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
e89ab440
Commit
e89ab440
authored
Feb 24, 2020
by
Zebediah Figura
Committed by
Alexandre Julliard
Feb 25, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mp3dmod: Implement IMediaObject::GetInputSizeInfo().
Signed-off-by:
Zebediah Figura
<
zfigura@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
b9b5560a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
63 additions
and
5 deletions
+63
-5
mp3dmod.c
dlls/mp3dmod/mp3dmod.c
+14
-4
mp3dmod.c
dlls/mp3dmod/tests/mp3dmod.c
+49
-1
No files found.
dlls/mp3dmod/mp3dmod.c
View file @
e89ab440
...
...
@@ -52,7 +52,7 @@ struct mp3_decoder
mpg123_handle
*
mh
;
DMO_MEDIA_TYPE
intype
,
outtype
;
BOOL
intype_set
;
BOOL
intype_set
,
outtype_set
;
IMediaBuffer
*
buffer
;
REFERENCE_TIME
timestamp
;
...
...
@@ -262,6 +262,7 @@ static HRESULT WINAPI MediaObject_SetOutputType(IMediaObject *iface, DWORD index
if
(
flags
&
DMO_SET_TYPEF_CLEAR
)
{
MoFreeMediaType
(
&
This
->
outtype
);
This
->
outtype_set
=
FALSE
;
return
S_OK
;
}
...
...
@@ -287,6 +288,7 @@ static HRESULT WINAPI MediaObject_SetOutputType(IMediaObject *iface, DWORD index
return
DMO_E_TYPE_NOT_ACCEPTED
;
}
MoCopyMediaType
(
&
This
->
outtype
,
type
);
This
->
outtype_set
=
TRUE
;
}
return
S_OK
;
...
...
@@ -306,11 +308,19 @@ static HRESULT WINAPI MediaObject_GetOutputCurrentType(IMediaObject *iface, DWOR
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
MediaObject_GetInputSizeInfo
(
IMediaObject
*
iface
,
DWORD
index
,
DWORD
*
size
,
DWORD
*
max_lookahead
,
DWORD
*
alignment
)
static
HRESULT
WINAPI
MediaObject_GetInputSizeInfo
(
IMediaObject
*
iface
,
DWORD
index
,
DWORD
*
size
,
DWORD
*
lookahead
,
DWORD
*
alignment
)
{
FIXME
(
"(%p)->(%d, %p, %p, %p) stub!
\n
"
,
iface
,
index
,
size
,
max_lookahead
,
alignment
);
struct
mp3_decoder
*
dmo
=
impl_from_IMediaObject
(
iface
);
return
E_NOTIMPL
;
TRACE
(
"iface %p, index %u, size %p, lookahead %p, alignment %p.
\n
"
,
iface
,
index
,
size
,
lookahead
,
alignment
);
if
(
!
dmo
->
intype_set
||
!
dmo
->
outtype_set
)
return
DMO_E_TYPE_NOT_SET
;
*
size
=
0
;
*
alignment
=
1
;
return
S_OK
;
}
static
HRESULT
WINAPI
MediaObject_GetOutputSizeInfo
(
IMediaObject
*
iface
,
DWORD
index
,
DWORD
*
size
,
DWORD
*
alignment
)
...
...
dlls/mp3dmod/tests/mp3dmod.c
View file @
e89ab440
...
...
@@ -288,7 +288,36 @@ static void test_aggregation(void)
static
void
test_stream_info
(
void
)
{
DWORD
input_count
,
output_count
,
flags
;
static
const
MPEGLAYER3WAVEFORMAT
input_format
=
{
.
wfx
.
nChannels
=
2
,
.
wfx
.
nSamplesPerSec
=
48000
,
};
DMO_MEDIA_TYPE
input_mt
=
{
.
majortype
=
MEDIATYPE_Audio
,
.
subtype
=
WMMEDIASUBTYPE_MP3
,
.
formattype
=
FORMAT_WaveFormatEx
,
.
cbFormat
=
sizeof
(
input_format
),
.
pbFormat
=
(
BYTE
*
)
&
input_format
,
};
static
const
WAVEFORMATEX
output_format
=
{
.
nChannels
=
1
,
.
nSamplesPerSec
=
48000
,
.
nAvgBytesPerSec
=
2
*
48000
,
.
nBlockAlign
=
2
,
.
wBitsPerSample
=
16
,
};
DMO_MEDIA_TYPE
output_mt
=
{
.
formattype
=
FORMAT_WaveFormatEx
,
.
cbFormat
=
sizeof
(
output_format
),
.
pbFormat
=
(
BYTE
*
)
&
output_format
,
};
DWORD
input_count
,
output_count
,
flags
,
size
,
lookahead
,
alignment
;
IMediaObject
*
dmo
;
HRESULT
hr
;
...
...
@@ -311,6 +340,25 @@ static void test_stream_info(void)
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
ok
(
!
flags
,
"Got flags %#x.
\n
"
,
flags
);
hr
=
IMediaObject_GetInputSizeInfo
(
dmo
,
0
,
&
size
,
&
lookahead
,
&
alignment
);
ok
(
hr
==
DMO_E_TYPE_NOT_SET
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IMediaObject_SetInputType
(
dmo
,
0
,
&
input_mt
,
0
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IMediaObject_GetInputSizeInfo
(
dmo
,
0
,
&
size
,
&
lookahead
,
&
alignment
);
ok
(
hr
==
DMO_E_TYPE_NOT_SET
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IMediaObject_SetOutputType
(
dmo
,
0
,
&
output_mt
,
0
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
size
=
lookahead
=
alignment
=
0xdeadbeef
;
hr
=
IMediaObject_GetInputSizeInfo
(
dmo
,
0
,
&
size
,
&
lookahead
,
&
alignment
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
ok
(
!
size
,
"Got size %u.
\n
"
,
size
);
ok
(
lookahead
==
0xdeadbeef
,
"Got lookahead %u.
\n
"
,
lookahead
);
ok
(
alignment
==
1
,
"Got alignment %u.
\n
"
,
alignment
);
IMediaObject_Release
(
dmo
);
}
...
...
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