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
0c14a85d
Commit
0c14a85d
authored
May 11, 2018
by
Zebediah Figura
Committed by
Alexandre Julliard
May 11, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mp3dmod: Implement SetOutputType().
Signed-off-by:
Zebediah Figura
<
z.figura12@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
4f868310
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
48 additions
and
3 deletions
+48
-3
Makefile.in
dlls/mp3dmod/Makefile.in
+1
-1
mp3dmod.c
dlls/mp3dmod/mp3dmod.c
+42
-2
mediaobj.idl
include/mediaobj.idl
+5
-0
No files found.
dlls/mp3dmod/Makefile.in
View file @
0c14a85d
MODULE
=
mp3dmod.dll
IMPORTS
=
dmoguids uuid wmcodecdspuuid
IMPORTS
=
dmoguids
msdmo
uuid wmcodecdspuuid
EXTRAINCL
=
$(MPG123_CFLAGS)
EXTRALIBS
=
$(MPG123_LIBS)
...
...
dlls/mp3dmod/mp3dmod.c
View file @
0c14a85d
...
...
@@ -22,8 +22,11 @@
#include <mpg123.h>
#include "windef.h"
#include "winbase.h"
#include "wingdi.h"
#include "mmreg.h"
#define COBJMACROS
#include "objbase.h"
#include "dmo.h"
#include "rpcproxy.h"
#include "wmcodecdsp.h"
#include "wine/debug.h"
...
...
@@ -37,6 +40,7 @@ struct mp3_decoder {
IMediaObject
IMediaObject_iface
;
LONG
ref
;
mpg123_handle
*
mh
;
DMO_MEDIA_TYPE
outtype
;
};
static
inline
struct
mp3_decoder
*
impl_from_IMediaObject
(
IMediaObject
*
iface
)
...
...
@@ -132,9 +136,44 @@ static HRESULT WINAPI MediaObject_SetInputType(IMediaObject *iface, DWORD index,
static
HRESULT
WINAPI
MediaObject_SetOutputType
(
IMediaObject
*
iface
,
DWORD
index
,
const
DMO_MEDIA_TYPE
*
type
,
DWORD
flags
)
{
FIXME
(
"(%p)->(%d, %p, %#x) stub!
\n
"
,
iface
,
index
,
type
,
flags
);
struct
mp3_decoder
*
This
=
impl_from_IMediaObject
(
iface
);
WAVEFORMATEX
*
format
;
long
enc
;
int
err
;
return
E_NOTIMPL
;
TRACE
(
"(%p)->(%d, %p, %#x)
\n
"
,
iface
,
index
,
type
,
flags
);
if
(
flags
&
DMO_SET_TYPEF_CLEAR
)
{
MoFreeMediaType
(
&
This
->
outtype
);
return
S_OK
;
}
format
=
(
WAVEFORMATEX
*
)
type
->
pbFormat
;
if
(
format
->
wBitsPerSample
==
8
)
enc
=
MPG123_ENC_UNSIGNED_8
;
else
if
(
format
->
wBitsPerSample
==
16
)
enc
=
MPG123_ENC_SIGNED_16
;
else
{
ERR
(
"Cannot decode to bit depth %u.
\n
"
,
format
->
wBitsPerSample
);
return
DMO_E_TYPE_NOT_ACCEPTED
;
}
if
(
!
(
flags
&
DMO_SET_TYPEF_TEST_ONLY
))
{
err
=
mpg123_format
(
This
->
mh
,
format
->
nSamplesPerSec
,
format
->
nChannels
,
enc
);
if
(
err
!=
MPG123_OK
)
{
ERR
(
"Failed to set format: %u channels, %u samples/sec, %u bits/sample.
\n
"
,
format
->
nChannels
,
format
->
nSamplesPerSec
,
format
->
wBitsPerSample
);
return
DMO_E_TYPE_NOT_ACCEPTED
;
}
MoCopyMediaType
(
&
This
->
outtype
,
type
);
}
return
S_OK
;
}
static
HRESULT
WINAPI
MediaObject_GetInputCurrentType
(
IMediaObject
*
iface
,
DWORD
index
,
DMO_MEDIA_TYPE
*
type
)
...
...
@@ -277,6 +316,7 @@ static HRESULT create_mp3_decoder(REFIID iid, void **obj)
mpg123_init
();
This
->
mh
=
mpg123_new
(
NULL
,
&
err
);
mpg123_format_none
(
This
->
mh
);
return
IMediaObject_QueryInterface
(
&
This
->
IMediaObject_iface
,
iid
,
obj
);
}
...
...
include/mediaobj.idl
View file @
0c14a85d
...
...
@@ -102,6 +102,11 @@ enum _DMO_INPLACE_PROCESS_FLAGS {
DMO_INPLACE_ZERO
=
0
x00000001
}
;
enum
_DMO_SET_TYPE_FLAGS
{
DMO_SET_TYPEF_TEST_ONLY
=
0
x00000001
,
DMO_SET_TYPEF_CLEAR
=
0
x00000002
,
}
;
/*****************************************************************************
*
IMediaObject
interface
*/
...
...
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