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
95360025
Commit
95360025
authored
Apr 09, 2008
by
Dan Hipschman
Committed by
Alexandre Julliard
Apr 10, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
qedit: Implement IMediaDet_get_FrameRate.
parent
3b0d68e4
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
61 additions
and
33 deletions
+61
-33
mediadet.c
dlls/qedit/mediadet.c
+24
-2
mediadet.c
dlls/qedit/tests/mediadet.c
+37
-31
No files found.
dlls/qedit/mediadet.c
View file @
95360025
...
...
@@ -524,8 +524,30 @@ static HRESULT WINAPI MediaDet_GetSampleGrabber(IMediaDet* iface,
static
HRESULT
WINAPI
MediaDet_get_FrameRate
(
IMediaDet
*
iface
,
double
*
pVal
)
{
MediaDetImpl
*
This
=
(
MediaDetImpl
*
)
iface
;
FIXME
(
"(%p)->(%p): not implemented!
\n
"
,
This
,
pVal
);
return
E_NOTIMPL
;
AM_MEDIA_TYPE
mt
;
VIDEOINFOHEADER
*
vh
;
HRESULT
hr
;
TRACE
(
"(%p)
\n
"
,
This
);
if
(
!
pVal
)
return
E_POINTER
;
hr
=
MediaDet_get_StreamMediaType
(
iface
,
&
mt
);
if
(
FAILED
(
hr
))
return
hr
;
if
(
!
IsEqualGUID
(
&
mt
.
majortype
,
&
MEDIATYPE_Video
))
{
CoTaskMemFree
(
mt
.
pbFormat
);
return
VFW_E_INVALIDMEDIATYPE
;
}
vh
=
(
VIDEOINFOHEADER
*
)
mt
.
pbFormat
;
*
pVal
=
1.0e7
/
(
double
)
vh
->
AvgTimePerFrame
;
CoTaskMemFree
(
mt
.
pbFormat
);
return
S_OK
;
}
static
HRESULT
WINAPI
MediaDet_EnterBitmapGrabMode
(
IMediaDet
*
iface
,
...
...
dlls/qedit/tests/mediadet.c
View file @
95360025
...
...
@@ -23,6 +23,7 @@
#define COBJMACROS
#include "ole2.h"
#include "vfwmsgs.h"
#include "uuids.h"
#include "wine/test.h"
#include "qedit.h"
...
...
@@ -95,7 +96,9 @@ static void test_mediadet(void)
long
nstrms
=
0
;
long
strm
;
AM_MEDIA_TYPE
mt
;
double
fps
;
int
flags
;
int
i
;
/* test.avi has one video stream. */
hr
=
CoCreateInstance
(
&
CLSID_MediaDet
,
NULL
,
CLSCTX_INPROC_SERVER
,
...
...
@@ -211,6 +214,13 @@ static void test_mediadet(void)
"IMediaDet_get_StreamMediaType
\n
"
);
CoTaskMemFree
(
mt
.
pbFormat
);
hr
=
IMediaDet_get_FrameRate
(
pM
,
NULL
);
ok
(
hr
==
E_POINTER
,
"IMediaDet_get_FrameRate
\n
"
);
hr
=
IMediaDet_get_FrameRate
(
pM
,
&
fps
);
ok
(
hr
==
S_OK
,
"IMediaDet_get_FrameRate
\n
"
);
ok
(
fps
==
10
.
0
,
"IMediaDet_get_FrameRate
\n
"
);
hr
=
IMediaDet_Release
(
pM
);
ok
(
hr
==
0
,
"IMediaDet_Release returned: %x
\n
"
,
hr
);
...
...
@@ -242,37 +252,33 @@ static void test_mediadet(void)
for both an audio and video stream. */
flags
=
0
;
hr
=
IMediaDet_put_CurrentStream
(
pM
,
0
);
ok
(
hr
==
S_OK
,
"IMediaDet_put_CurrentStream
\n
"
);
ZeroMemory
(
&
mt
,
sizeof
mt
);
hr
=
IMediaDet_get_StreamMediaType
(
pM
,
&
mt
);
ok
(
hr
==
S_OK
,
"IMediaDet_get_StreamMediaType
\n
"
);
flags
+=
(
IsEqualGUID
(
&
mt
.
majortype
,
&
MEDIATYPE_Video
)
?
1
:
(
IsEqualGUID
(
&
mt
.
majortype
,
&
MEDIATYPE_Audio
)
?
2
:
0
));
CoTaskMemFree
(
mt
.
pbFormat
);
hr
=
IMediaDet_put_CurrentStream
(
pM
,
1
);
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
);
ok
(
hr
==
S_OK
,
"IMediaDet_get_StreamMediaType
\n
"
);
flags
+=
(
IsEqualGUID
(
&
mt
.
majortype
,
&
MEDIATYPE_Video
)
?
1
:
(
IsEqualGUID
(
&
mt
.
majortype
,
&
MEDIATYPE_Audio
)
?
2
:
0
));
CoTaskMemFree
(
mt
.
pbFormat
);
for
(
i
=
0
;
i
<
2
;
++
i
)
{
hr
=
IMediaDet_put_CurrentStream
(
pM
,
i
);
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
==
i
,
"IMediaDet_get_CurrentStream
\n
"
);
ZeroMemory
(
&
mt
,
sizeof
mt
);
hr
=
IMediaDet_get_StreamMediaType
(
pM
,
&
mt
);
ok
(
hr
==
S_OK
,
"IMediaDet_get_StreamMediaType
\n
"
);
flags
+=
(
IsEqualGUID
(
&
mt
.
majortype
,
&
MEDIATYPE_Video
)
?
1
:
(
IsEqualGUID
(
&
mt
.
majortype
,
&
MEDIATYPE_Audio
)
?
2
:
0
));
if
(
IsEqualGUID
(
&
mt
.
majortype
,
&
MEDIATYPE_Audio
))
{
hr
=
IMediaDet_get_FrameRate
(
pM
,
&
fps
);
ok
(
hr
==
VFW_E_INVALIDMEDIATYPE
,
"IMediaDet_get_FrameRate
\n
"
);
}
CoTaskMemFree
(
mt
.
pbFormat
);
}
ok
(
flags
==
3
,
"IMediaDet_get_StreamMediaType
\n
"
);
hr
=
IMediaDet_put_CurrentStream
(
pM
,
2
);
...
...
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