Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
2c88b69f
Commit
2c88b69f
authored
Apr 02, 2024
by
Ziqing Hui
Committed by
Alexandre Julliard
Apr 16, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winegstreamer: Merge audio_wma into audio field.
parent
256e9afc
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
84 additions
and
89 deletions
+84
-89
mfplat.c
dlls/winegstreamer/mfplat.c
+8
-8
quartz_parser.c
dlls/winegstreamer/quartz_parser.c
+32
-32
unixlib.h
dlls/winegstreamer/unixlib.h
+7
-12
wg_format.c
dlls/winegstreamer/wg_format.c
+27
-27
wg_transform.c
dlls/winegstreamer/wg_transform.c
+1
-1
wma_decoder.c
dlls/winegstreamer/wma_decoder.c
+9
-9
No files found.
dlls/winegstreamer/mfplat.c
View file @
2c88b69f
...
...
@@ -779,14 +779,14 @@ static void mf_media_type_to_wg_format_audio_wma(IMFMediaType *type, const GUID
}
format
->
major_type
=
WG_MAJOR_TYPE_AUDIO_WMA
;
format
->
u
.
audio
_wma
.
version
=
version
;
format
->
u
.
audio
_wma
.
bitrate
=
bytes_per_second
*
8
;
format
->
u
.
audio
_wma
.
rate
=
rate
;
format
->
u
.
audio
_wma
.
depth
=
depth
;
format
->
u
.
audio
_wma
.
channels
=
channels
;
format
->
u
.
audio
_wma
.
block_align
=
block_align
;
format
->
u
.
audio
_wma
.
codec_data_len
=
codec_data_len
;
memcpy
(
format
->
u
.
audio
_wma
.
codec_data
,
codec_data
,
codec_data_len
);
format
->
u
.
audio
.
version
=
version
;
format
->
u
.
audio
.
bitrate
=
bytes_per_second
*
8
;
format
->
u
.
audio
.
rate
=
rate
;
format
->
u
.
audio
.
depth
=
depth
;
format
->
u
.
audio
.
channels
=
channels
;
format
->
u
.
audio
.
block_align
=
block_align
;
format
->
u
.
audio
.
codec_data_len
=
codec_data_len
;
memcpy
(
format
->
u
.
audio
.
codec_data
,
codec_data
,
codec_data_len
);
}
static
void
mf_media_type_to_wg_format_video_h264
(
IMFMediaType
*
type
,
struct
wg_format
*
format
)
...
...
dlls/winegstreamer/quartz_parser.c
View file @
2c88b69f
...
...
@@ -288,7 +288,7 @@ static bool amt_from_wg_format_audio_wma(AM_MEDIA_TYPE *mt, const struct wg_form
mt
->
majortype
=
MEDIATYPE_Audio
;
mt
->
formattype
=
FORMAT_WaveFormatEx
;
switch
(
format
->
u
.
audio
_wma
.
version
)
switch
(
format
->
u
.
audio
.
version
)
{
case
1
:
subtype
=
&
MEDIASUBTYPE_MSAUDIO1
;
...
...
@@ -322,21 +322,21 @@ static bool amt_from_wg_format_audio_wma(AM_MEDIA_TYPE *mt, const struct wg_form
mt
->
subtype
=
*
subtype
;
mt
->
bFixedSizeSamples
=
TRUE
;
mt
->
lSampleSize
=
format
->
u
.
audio
_wma
.
block_align
;
mt
->
lSampleSize
=
format
->
u
.
audio
.
block_align
;
mt
->
cbFormat
=
size
;
mt
->
pbFormat
=
(
BYTE
*
)
wave_format
;
wave_format
->
wFormatTag
=
fmt_tag
;
wave_format
->
nChannels
=
format
->
u
.
audio
_wma
.
channels
;
wave_format
->
nSamplesPerSec
=
format
->
u
.
audio
_wma
.
rate
;
wave_format
->
nAvgBytesPerSec
=
format
->
u
.
audio
_wma
.
bitrate
/
8
;
wave_format
->
nBlockAlign
=
format
->
u
.
audio
_wma
.
block_align
;
wave_format
->
wBitsPerSample
=
format
->
u
.
audio
_wma
.
depth
;
wave_format
->
nChannels
=
format
->
u
.
audio
.
channels
;
wave_format
->
nSamplesPerSec
=
format
->
u
.
audio
.
rate
;
wave_format
->
nAvgBytesPerSec
=
format
->
u
.
audio
.
bitrate
/
8
;
wave_format
->
nBlockAlign
=
format
->
u
.
audio
.
block_align
;
wave_format
->
wBitsPerSample
=
format
->
u
.
audio
.
depth
;
wave_format
->
cbSize
=
codec_data_len
;
if
(
format
->
u
.
audio
_wma
.
codec_data_len
==
codec_data_len
)
memcpy
(
wave_format
+
1
,
format
->
u
.
audio
_wma
.
codec_data
,
format
->
u
.
audio_wma
.
codec_data_len
);
if
(
format
->
u
.
audio
.
codec_data_len
==
codec_data_len
)
memcpy
(
wave_format
+
1
,
format
->
u
.
audio
.
codec_data
,
format
->
u
.
audio
.
codec_data_len
);
else
FIXME
(
"Unexpected codec_data length; got %u, expected %lu
\n
"
,
format
->
u
.
audio
_wma
.
codec_data_len
,
codec_data_len
);
FIXME
(
"Unexpected codec_data length; got %u, expected %lu
\n
"
,
format
->
u
.
audio
.
codec_data_len
,
codec_data_len
);
return
true
;
}
...
...
@@ -454,7 +454,7 @@ unsigned int wg_format_get_max_size(const struct wg_format *format)
/* Estimated max size of a compressed audio frame.
* There's no way to no way to know the real upper bound,
* so let's just use one second of decompressed size and hope it works. */
return
format
->
u
.
audio
_wma
.
rate
*
format
->
u
.
audio_wma
.
channels
*
format
->
u
.
audio_wma
.
depth
/
8
;
return
format
->
u
.
audio
.
rate
*
format
->
u
.
audio
.
channels
*
format
->
u
.
audio
.
depth
/
8
;
case
WG_MAJOR_TYPE_AUDIO_MPEG4
:
case
WG_MAJOR_TYPE_VIDEO_H264
:
...
...
@@ -878,33 +878,33 @@ static bool amt_to_wg_format_audio_wma(const AM_MEDIA_TYPE *mt, struct wg_format
}
if
(
IsEqualGUID
(
&
mt
->
subtype
,
&
MEDIASUBTYPE_MSAUDIO1
))
format
->
u
.
audio
_wma
.
version
=
1
;
format
->
u
.
audio
.
version
=
1
;
else
if
(
IsEqualGUID
(
&
mt
->
subtype
,
&
MEDIASUBTYPE_WMAUDIO2
))
format
->
u
.
audio
_wma
.
version
=
2
;
format
->
u
.
audio
.
version
=
2
;
else
if
(
IsEqualGUID
(
&
mt
->
subtype
,
&
MEDIASUBTYPE_WMAUDIO3
))
format
->
u
.
audio
_wma
.
version
=
3
;
format
->
u
.
audio
.
version
=
3
;
else
if
(
IsEqualGUID
(
&
mt
->
subtype
,
&
MEDIASUBTYPE_WMAUDIO_LOSSLESS
))
format
->
u
.
audio
_wma
.
version
=
4
;
format
->
u
.
audio
.
version
=
4
;
else
assert
(
false
);
format
->
major_type
=
WG_MAJOR_TYPE_AUDIO_WMA
;
format
->
u
.
audio
_wma
.
bitrate
=
audio_format
->
nAvgBytesPerSec
*
8
;
format
->
u
.
audio
_wma
.
rate
=
audio_format
->
nSamplesPerSec
;
format
->
u
.
audio
_wma
.
depth
=
audio_format
->
wBitsPerSample
;
format
->
u
.
audio
_wma
.
channels
=
audio_format
->
nChannels
;
format
->
u
.
audio
_wma
.
block_align
=
audio_format
->
nBlockAlign
;
format
->
u
.
audio
_wma
.
codec_data_len
=
0
;
if
(
format
->
u
.
audio
_wma
.
version
==
1
)
format
->
u
.
audio
_wma
.
codec_data_len
=
4
;
if
(
format
->
u
.
audio
_wma
.
version
==
2
)
format
->
u
.
audio
_wma
.
codec_data_len
=
10
;
if
(
format
->
u
.
audio
_wma
.
version
==
3
)
format
->
u
.
audio
_wma
.
codec_data_len
=
18
;
if
(
format
->
u
.
audio
_wma
.
version
==
4
)
format
->
u
.
audio
_wma
.
codec_data_len
=
18
;
if
(
mt
->
cbFormat
>=
sizeof
(
WAVEFORMATEX
)
+
format
->
u
.
audio
_wma
.
codec_data_len
)
memcpy
(
format
->
u
.
audio
_wma
.
codec_data
,
audio_format
+
1
,
format
->
u
.
audio_wma
.
codec_data_len
);
format
->
u
.
audio
.
bitrate
=
audio_format
->
nAvgBytesPerSec
*
8
;
format
->
u
.
audio
.
rate
=
audio_format
->
nSamplesPerSec
;
format
->
u
.
audio
.
depth
=
audio_format
->
wBitsPerSample
;
format
->
u
.
audio
.
channels
=
audio_format
->
nChannels
;
format
->
u
.
audio
.
block_align
=
audio_format
->
nBlockAlign
;
format
->
u
.
audio
.
codec_data_len
=
0
;
if
(
format
->
u
.
audio
.
version
==
1
)
format
->
u
.
audio
.
codec_data_len
=
4
;
if
(
format
->
u
.
audio
.
version
==
2
)
format
->
u
.
audio
.
codec_data_len
=
10
;
if
(
format
->
u
.
audio
.
version
==
3
)
format
->
u
.
audio
.
codec_data_len
=
18
;
if
(
format
->
u
.
audio
.
version
==
4
)
format
->
u
.
audio
.
codec_data_len
=
18
;
if
(
mt
->
cbFormat
>=
sizeof
(
WAVEFORMATEX
)
+
format
->
u
.
audio
.
codec_data_len
)
memcpy
(
format
->
u
.
audio
.
codec_data
,
audio_format
+
1
,
format
->
u
.
audio
.
codec_data_len
);
else
FIXME
(
"Too small format block, can't copy codec data
\n
"
);
...
...
dlls/winegstreamer/unixlib.h
View file @
2c88b69f
...
...
@@ -99,7 +99,9 @@ struct wg_format
*
* Uncompressed(PCM): channels, channel_mask, rate.
* MPEG1: channels, rate, layer.
* MPEG4: payload_type, codec_data_len, codec_data. */
* MPEG4: payload_type, codec_data_len, codec_data.
* WMA: channels, rate, bitrate, depth, block_align, version, layer,
* payload_type, codec_data_len, codec_data */
struct
{
wg_audio_format
format
;
...
...
@@ -107,22 +109,15 @@ struct wg_format
uint32_t
channels
;
uint32_t
channel_mask
;
/* In WinMM format. */
uint32_t
rate
;
uint32_t
layer
;
uint32_t
payload_type
;
uint32_t
codec_data_len
;
unsigned
char
codec_data
[
64
];
}
audio
;
struct
{
uint32_t
version
;
uint32_t
bitrate
;
uint32_t
rate
;
uint32_t
depth
;
uint32_t
channels
;
uint32_t
block_align
;
uint32_t
version
;
uint32_t
layer
;
uint32_t
payload_type
;
uint32_t
codec_data_len
;
unsigned
char
codec_data
[
64
];
}
audio
_wma
;
}
audio
;
struct
{
...
...
dlls/winegstreamer/wg_format.c
View file @
2c88b69f
...
...
@@ -247,18 +247,18 @@ static void wg_format_from_caps_audio_wma(struct wg_format *format, const GstCap
}
format
->
major_type
=
WG_MAJOR_TYPE_AUDIO_WMA
;
format
->
u
.
audio
_wma
.
version
=
version
;
format
->
u
.
audio
_wma
.
bitrate
=
bitrate
;
format
->
u
.
audio
_wma
.
rate
=
rate
;
format
->
u
.
audio
_wma
.
depth
=
depth
;
format
->
u
.
audio
_wma
.
channels
=
channels
;
format
->
u
.
audio
_wma
.
block_align
=
block_align
;
format
->
u
.
audio
.
version
=
version
;
format
->
u
.
audio
.
bitrate
=
bitrate
;
format
->
u
.
audio
.
rate
=
rate
;
format
->
u
.
audio
.
depth
=
depth
;
format
->
u
.
audio
.
channels
=
channels
;
format
->
u
.
audio
.
block_align
=
block_align
;
gst_buffer_map
(
codec_data
,
&
map
,
GST_MAP_READ
);
if
(
map
.
size
<=
sizeof
(
format
->
u
.
audio
_wma
.
codec_data
))
if
(
map
.
size
<=
sizeof
(
format
->
u
.
audio
.
codec_data
))
{
format
->
u
.
audio
_wma
.
codec_data_len
=
map
.
size
;
memcpy
(
format
->
u
.
audio
_wma
.
codec_data
,
map
.
data
,
map
.
size
);
format
->
u
.
audio
.
codec_data_len
=
map
.
size
;
memcpy
(
format
->
u
.
audio
.
codec_data
,
map
.
data
,
map
.
size
);
}
else
GST_WARNING
(
"Too big codec_data value (%u) in %"
GST_PTR_FORMAT
"."
,
(
UINT
)
map
.
size
,
caps
);
...
...
@@ -639,29 +639,29 @@ static GstCaps *wg_format_to_caps_audio_wma(const struct wg_format *format)
if
(
!
(
caps
=
gst_caps_new_empty_simple
(
"audio/x-wma"
)))
return
NULL
;
if
(
format
->
u
.
audio
_wma
.
version
)
gst_caps_set_simple
(
caps
,
"wmaversion"
,
G_TYPE_INT
,
format
->
u
.
audio
_wma
.
version
,
NULL
);
if
(
format
->
u
.
audio
_wma
.
bitrate
)
gst_caps_set_simple
(
caps
,
"bitrate"
,
G_TYPE_INT
,
format
->
u
.
audio
_wma
.
bitrate
,
NULL
);
if
(
format
->
u
.
audio
_wma
.
rate
)
gst_caps_set_simple
(
caps
,
"rate"
,
G_TYPE_INT
,
format
->
u
.
audio
_wma
.
rate
,
NULL
);
if
(
format
->
u
.
audio
_wma
.
depth
)
gst_caps_set_simple
(
caps
,
"depth"
,
G_TYPE_INT
,
format
->
u
.
audio
_wma
.
depth
,
NULL
);
if
(
format
->
u
.
audio
_wma
.
channels
)
gst_caps_set_simple
(
caps
,
"channels"
,
G_TYPE_INT
,
format
->
u
.
audio
_wma
.
channels
,
NULL
);
if
(
format
->
u
.
audio
_wma
.
block_align
)
gst_caps_set_simple
(
caps
,
"block_align"
,
G_TYPE_INT
,
format
->
u
.
audio
_wma
.
block_align
,
NULL
);
if
(
format
->
u
.
audio
_wma
.
codec_data_len
)
{
if
(
!
(
buffer
=
gst_buffer_new_and_alloc
(
format
->
u
.
audio
_wma
.
codec_data_len
)))
if
(
format
->
u
.
audio
.
version
)
gst_caps_set_simple
(
caps
,
"wmaversion"
,
G_TYPE_INT
,
format
->
u
.
audio
.
version
,
NULL
);
if
(
format
->
u
.
audio
.
bitrate
)
gst_caps_set_simple
(
caps
,
"bitrate"
,
G_TYPE_INT
,
format
->
u
.
audio
.
bitrate
,
NULL
);
if
(
format
->
u
.
audio
.
rate
)
gst_caps_set_simple
(
caps
,
"rate"
,
G_TYPE_INT
,
format
->
u
.
audio
.
rate
,
NULL
);
if
(
format
->
u
.
audio
.
depth
)
gst_caps_set_simple
(
caps
,
"depth"
,
G_TYPE_INT
,
format
->
u
.
audio
.
depth
,
NULL
);
if
(
format
->
u
.
audio
.
channels
)
gst_caps_set_simple
(
caps
,
"channels"
,
G_TYPE_INT
,
format
->
u
.
audio
.
channels
,
NULL
);
if
(
format
->
u
.
audio
.
block_align
)
gst_caps_set_simple
(
caps
,
"block_align"
,
G_TYPE_INT
,
format
->
u
.
audio
.
block_align
,
NULL
);
if
(
format
->
u
.
audio
.
codec_data_len
)
{
if
(
!
(
buffer
=
gst_buffer_new_and_alloc
(
format
->
u
.
audio
.
codec_data_len
)))
{
gst_caps_unref
(
caps
);
return
NULL
;
}
gst_buffer_fill
(
buffer
,
0
,
format
->
u
.
audio
_wma
.
codec_data
,
format
->
u
.
audio_wma
.
codec_data_len
);
gst_buffer_fill
(
buffer
,
0
,
format
->
u
.
audio
.
codec_data
,
format
->
u
.
audio
.
codec_data_len
);
gst_caps_set_simple
(
caps
,
"codec_data"
,
GST_TYPE_BUFFER
,
buffer
,
NULL
);
gst_buffer_unref
(
buffer
);
}
...
...
dlls/winegstreamer/wg_transform.c
View file @
2c88b69f
...
...
@@ -349,7 +349,7 @@ static GstCaps *transform_get_parsed_caps(struct wg_format *format, const char *
gst_caps_set_simple
(
parsed_caps
,
"framed"
,
G_TYPE_BOOLEAN
,
true
,
"mpegversion"
,
G_TYPE_INT
,
4
,
NULL
);
break
;
case
WG_MAJOR_TYPE_AUDIO_WMA
:
gst_caps_set_simple
(
parsed_caps
,
"wmaversion"
,
G_TYPE_INT
,
format
->
u
.
audio
_wma
.
version
,
NULL
);
gst_caps_set_simple
(
parsed_caps
,
"wmaversion"
,
G_TYPE_INT
,
format
->
u
.
audio
.
version
,
NULL
);
break
;
case
WG_MAJOR_TYPE_VIDEO_H264
:
gst_caps_set_simple
(
parsed_caps
,
"parsed"
,
G_TYPE_BOOLEAN
,
true
,
NULL
);
...
...
dlls/winegstreamer/wma_decoder.c
View file @
2c88b69f
...
...
@@ -317,19 +317,19 @@ static HRESULT WINAPI transform_GetOutputAvailableType(IMFTransform *iface, DWOR
goto
done
;
if
(
FAILED
(
hr
=
IMFMediaType_SetUINT32
(
media_type
,
&
MF_MT_AUDIO_NUM_CHANNELS
,
decoder
->
input_format
.
u
.
audio
_wma
.
channels
)))
decoder
->
input_format
.
u
.
audio
.
channels
)))
goto
done
;
if
(
FAILED
(
hr
=
IMFMediaType_SetUINT32
(
media_type
,
&
MF_MT_AUDIO_SAMPLES_PER_SECOND
,
decoder
->
input_format
.
u
.
audio
_wma
.
rate
)))
decoder
->
input_format
.
u
.
audio
.
rate
)))
goto
done
;
block_alignment
=
sample_size
*
decoder
->
input_format
.
u
.
audio
_wma
.
channels
/
8
;
block_alignment
=
sample_size
*
decoder
->
input_format
.
u
.
audio
.
channels
/
8
;
if
(
FAILED
(
hr
=
IMFMediaType_SetUINT32
(
media_type
,
&
MF_MT_AUDIO_BLOCK_ALIGNMENT
,
block_alignment
)))
goto
done
;
if
(
FAILED
(
hr
=
IMFMediaType_SetUINT32
(
media_type
,
&
MF_MT_AUDIO_AVG_BYTES_PER_SECOND
,
decoder
->
input_format
.
u
.
audio
_wma
.
rate
*
block_alignment
)))
decoder
->
input_format
.
u
.
audio
.
rate
*
block_alignment
)))
goto
done
;
if
(
FAILED
(
hr
=
IMFMediaType_SetUINT32
(
media_type
,
&
MF_MT_ALL_SAMPLES_INDEPENDENT
,
1
)))
...
...
@@ -446,7 +446,7 @@ static HRESULT WINAPI transform_SetOutputType(IMFTransform *iface, DWORD id, IMF
if
(
flags
&
MFT_SET_TYPE_TEST_ONLY
)
return
S_OK
;
decoder
->
input_format
.
u
.
audio
_wma
.
depth
=
sample_size
;
decoder
->
input_format
.
u
.
audio
.
depth
=
sample_size
;
mf_media_type_to_wg_format
(
type
,
&
decoder
->
output_format
);
decoder
->
output_buf_size
=
1024
*
block_alignment
*
channel_count
;
...
...
@@ -682,13 +682,13 @@ static HRESULT WINAPI media_object_GetOutputType(IMediaObject *iface, DWORD inde
memset
(
type
->
pbFormat
,
0
,
type
->
cbFormat
);
wfx
=
(
WAVEFORMATEX
*
)
type
->
pbFormat
;
if
(
decoder
->
input_format
.
u
.
audio
_wma
.
depth
==
32
)
if
(
decoder
->
input_format
.
u
.
audio
.
depth
==
32
)
wfx
->
wFormatTag
=
WAVE_FORMAT_IEEE_FLOAT
;
else
wfx
->
wFormatTag
=
WAVE_FORMAT_PCM
;
wfx
->
nChannels
=
decoder
->
input_format
.
u
.
audio
_wma
.
channels
;
wfx
->
nSamplesPerSec
=
decoder
->
input_format
.
u
.
audio
_wma
.
rate
;
wfx
->
wBitsPerSample
=
decoder
->
input_format
.
u
.
audio
_wma
.
depth
;
wfx
->
nChannels
=
decoder
->
input_format
.
u
.
audio
.
channels
;
wfx
->
nSamplesPerSec
=
decoder
->
input_format
.
u
.
audio
.
rate
;
wfx
->
wBitsPerSample
=
decoder
->
input_format
.
u
.
audio
.
depth
;
wfx
->
nAvgBytesPerSec
=
wfx
->
nChannels
*
wfx
->
nSamplesPerSec
*
wfx
->
wBitsPerSample
/
8
;
wfx
->
nBlockAlign
=
wfx
->
nChannels
*
wfx
->
wBitsPerSample
/
8
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment