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
33f270af
Commit
33f270af
authored
Apr 08, 2008
by
Dan Hipschman
Committed by
Alexandre Julliard
Apr 09, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
qedit: Implement IMediaDet_(put|get)_CurrentStream.
parent
d3061d48
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
101 additions
and
9 deletions
+101
-9
mediadet.c
dlls/qedit/mediadet.c
+37
-4
mediadet.c
dlls/qedit/tests/mediadet.c
+64
-5
No files found.
dlls/qedit/mediadet.c
View file @
33f270af
...
...
@@ -37,6 +37,8 @@ typedef struct MediaDetImpl {
IGraphBuilder
*
graph
;
IBaseFilter
*
source
;
IBaseFilter
*
splitter
;
long
num_streams
;
long
cur_stream
;
}
MediaDetImpl
;
static
void
MD_cleanup
(
MediaDetImpl
*
This
)
...
...
@@ -47,6 +49,8 @@ static void MD_cleanup(MediaDetImpl *This)
This
->
splitter
=
NULL
;
if
(
This
->
graph
)
IGraphBuilder_Release
(
This
->
graph
);
This
->
graph
=
NULL
;
This
->
num_streams
=
-
1
;
This
->
cur_stream
=
0
;
}
static
ULONG
WINAPI
MediaDet_AddRef
(
IMediaDet
*
iface
)
...
...
@@ -116,6 +120,12 @@ static HRESULT WINAPI MediaDet_get_OutputStreams(IMediaDet* iface, long *pVal)
if
(
!
This
->
splitter
)
return
E_INVALIDARG
;
if
(
This
->
num_streams
!=
-
1
)
{
*
pVal
=
This
->
num_streams
;
return
S_OK
;
}
*
pVal
=
0
;
hr
=
IBaseFilter_EnumPins
(
This
->
splitter
,
&
pins
);
...
...
@@ -138,21 +148,42 @@ static HRESULT WINAPI MediaDet_get_OutputStreams(IMediaDet* iface, long *pVal)
}
IEnumPins_Release
(
pins
);
This
->
num_streams
=
*
pVal
;
return
S_OK
;
}
static
HRESULT
WINAPI
MediaDet_get_CurrentStream
(
IMediaDet
*
iface
,
long
*
pVal
)
{
MediaDetImpl
*
This
=
(
MediaDetImpl
*
)
iface
;
FIXME
(
"(%p)->(%p): not implemented!
\n
"
,
This
,
pVal
);
return
E_NOTIMPL
;
TRACE
(
"(%p)
\n
"
,
This
);
if
(
!
pVal
)
return
E_POINTER
;
*
pVal
=
This
->
cur_stream
;
return
S_OK
;
}
static
HRESULT
WINAPI
MediaDet_put_CurrentStream
(
IMediaDet
*
iface
,
long
newVal
)
{
MediaDetImpl
*
This
=
(
MediaDetImpl
*
)
iface
;
FIXME
(
"(%p)->(%ld): not implemented!
\n
"
,
This
,
newVal
);
return
E_NOTIMPL
;
HRESULT
hr
;
TRACE
(
"(%p)->(%ld)
\n
"
,
This
,
newVal
);
if
(
This
->
num_streams
==
-
1
)
{
long
n
;
hr
=
MediaDet_get_OutputStreams
(
iface
,
&
n
);
if
(
FAILED
(
hr
))
return
hr
;
}
if
(
newVal
<
0
||
This
->
num_streams
<=
newVal
)
return
E_INVALIDARG
;
This
->
cur_stream
=
newVal
;
return
S_OK
;
}
static
HRESULT
WINAPI
MediaDet_get_StreamType
(
IMediaDet
*
iface
,
GUID
*
pVal
)
...
...
@@ -469,6 +500,8 @@ HRESULT MediaDet_create(IUnknown * pUnkOuter, LPVOID * ppv) {
obj
->
graph
=
NULL
;
obj
->
source
=
NULL
;
obj
->
splitter
=
NULL
;
obj
->
num_streams
=
-
1
;
obj
->
cur_stream
=
0
;
*
ppv
=
obj
;
return
S_OK
;
...
...
dlls/qedit/tests/mediadet.c
View file @
33f270af
...
...
@@ -120,11 +120,37 @@ static void test_mediadet(void)
ok
(
hr
==
E_INVALIDARG
,
"IMediaDet_get_OutputStreams
\n
"
);
ok
(
nstrms
==
-
1
,
"IMediaDet_get_OutputStreams
\n
"
);
strm
=
-
1
;
/* The stream defaults to 0, even without a file! */
hr
=
IMediaDet_get_CurrentStream
(
pM
,
&
strm
);
ok
(
hr
==
S_OK
,
"IMediaDet_get_CurrentStream
\n
"
);
ok
(
strm
==
0
,
"IMediaDet_get_CurrentStream
\n
"
);
hr
=
IMediaDet_get_CurrentStream
(
pM
,
NULL
);
ok
(
hr
==
E_POINTER
,
"IMediaDet_get_CurrentStream
\n
"
);
/* But put_CurrentStream doesn't. */
hr
=
IMediaDet_put_CurrentStream
(
pM
,
0
);
ok
(
hr
==
E_INVALIDARG
,
"IMediaDet_put_CurrentStream
\n
"
);
hr
=
IMediaDet_put_CurrentStream
(
pM
,
-
1
);
ok
(
hr
==
E_INVALIDARG
,
"IMediaDet_put_CurrentStream
\n
"
);
filename
=
SysAllocString
(
test_avi_filename
);
hr
=
IMediaDet_put_Filename
(
pM
,
filename
);
ok
(
hr
==
S_OK
,
"IMediaDet_put_Filename -> %x
\n
"
,
hr
);
SysFreeString
(
filename
);
strm
=
-
1
;
/* The stream defaults to 0. */
hr
=
IMediaDet_get_CurrentStream
(
pM
,
&
strm
);
ok
(
hr
==
S_OK
,
"IMediaDet_get_CurrentStream
\n
"
);
ok
(
strm
==
0
,
"IMediaDet_get_CurrentStream
\n
"
);
/* Even before get_OutputStreams. */
hr
=
IMediaDet_put_CurrentStream
(
pM
,
1
);
ok
(
hr
==
E_INVALIDARG
,
"IMediaDet_put_CurrentStream
\n
"
);
hr
=
IMediaDet_get_OutputStreams
(
pM
,
&
nstrms
);
ok
(
hr
==
S_OK
,
"IMediaDet_get_OutputStreams
\n
"
);
ok
(
nstrms
==
1
,
"IMediaDet_get_OutputStreams
\n
"
);
...
...
@@ -139,13 +165,33 @@ static void test_mediadet(void)
hr
=
IMediaDet_get_Filename
(
pM
,
NULL
);
ok
(
hr
==
E_POINTER
,
"IMediaDet_get_Filename
\n
"
);
strm
=
-
1
;
hr
=
IMediaDet_get_CurrentStream
(
pM
,
&
strm
);
ok
(
hr
==
S_OK
,
"IMediaDet_get_CurrentStream
\n
"
);
ok
(
strm
==
0
,
"IMediaDet_get_CurrentStream
\n
"
);
hr
=
IMediaDet_get_CurrentStream
(
pM
,
NULL
);
ok
(
hr
==
E_POINTER
,
"IMediaDet_get_CurrentStream
\n
"
);
hr
=
IMediaDet_put_CurrentStream
(
pM
,
-
1
);
ok
(
hr
==
E_INVALIDARG
,
"IMediaDet_put_CurrentStream
\n
"
);
hr
=
IMediaDet_put_CurrentStream
(
pM
,
1
);
ok
(
hr
==
E_INVALIDARG
,
"IMediaDet_put_CurrentStream
\n
"
);
/* Try again. */
strm
=
-
1
;
hr
=
IMediaDet_get_CurrentStream
(
pM
,
&
strm
);
ok
(
hr
==
S_OK
,
"IMediaDet_get_CurrentStream
\n
"
);
ok
(
strm
==
0
,
"IMediaDet_get_CurrentStream
\n
"
);
hr
=
IMediaDet_put_CurrentStream
(
pM
,
0
);
todo_wine
ok
(
hr
==
S_OK
,
"IMediaDet_put_CurrentStream
\n
"
);
ok
(
hr
==
S_OK
,
"IMediaDet_put_CurrentStream
\n
"
);
strm
=
-
1
;
hr
=
IMediaDet_get_CurrentStream
(
pM
,
&
strm
);
todo_wine
ok
(
hr
==
S_OK
,
"IMediaDet_get_CurrentStream
\n
"
);
todo_wine
ok
(
strm
==
0
,
"IMediaDet_get_CurrentStream
\n
"
);
ok
(
hr
==
S_OK
,
"IMediaDet_get_CurrentStream
\n
"
);
ok
(
strm
==
0
,
"IMediaDet_get_CurrentStream
\n
"
);
ZeroMemory
(
&
mt
,
sizeof
mt
);
hr
=
IMediaDet_get_StreamMediaType
(
pM
,
&
mt
);
...
...
@@ -185,7 +231,7 @@ static void test_mediadet(void)
flags
=
0
;
hr
=
IMediaDet_put_CurrentStream
(
pM
,
0
);
todo_wine
ok
(
hr
==
S_OK
,
"IMediaDet_put_CurrentStream
\n
"
);
ok
(
hr
==
S_OK
,
"IMediaDet_put_CurrentStream
\n
"
);
ZeroMemory
(
&
mt
,
sizeof
mt
);
hr
=
IMediaDet_get_StreamMediaType
(
pM
,
&
mt
);
...
...
@@ -197,7 +243,12 @@ static void test_mediadet(void)
:
0
));
hr
=
IMediaDet_put_CurrentStream
(
pM
,
1
);
todo_wine
ok
(
hr
==
S_OK
,
"IMediaDet_put_CurrentStream
\n
"
);
ok
(
hr
==
S_OK
,
"IMediaDet_put_CurrentStream
\n
"
);
strm
=
-
1
;
hr
=
IMediaDet_get_CurrentStream
(
pM
,
&
strm
);
ok
(
hr
==
S_OK
,
"IMediaDet_get_CurrentStream
\n
"
);
ok
(
strm
==
1
,
"IMediaDet_get_CurrentStream
\n
"
);
ZeroMemory
(
&
mt
,
sizeof
mt
);
hr
=
IMediaDet_get_StreamMediaType
(
pM
,
&
mt
);
...
...
@@ -210,6 +261,14 @@ static void test_mediadet(void)
todo_wine
ok
(
flags
==
3
,
"IMediaDet_get_StreamMediaType
\n
"
);
hr
=
IMediaDet_put_CurrentStream
(
pM
,
2
);
ok
(
hr
==
E_INVALIDARG
,
"IMediaDet_put_CurrentStream
\n
"
);
strm
=
-
1
;
hr
=
IMediaDet_get_CurrentStream
(
pM
,
&
strm
);
ok
(
hr
==
S_OK
,
"IMediaDet_get_CurrentStream
\n
"
);
ok
(
strm
==
1
,
"IMediaDet_get_CurrentStream
\n
"
);
hr
=
IMediaDet_Release
(
pM
);
ok
(
hr
==
0
,
"IMediaDet_Release returned: %x
\n
"
,
hr
);
...
...
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