Commit 9650f5a7 authored by Gabriel Ivăncescu's avatar Gabriel Ivăncescu Committed by Alexandre Julliard

qedit: Implement IMediaDet::get_StreamType().

parent 59987bc9
...@@ -28,6 +28,7 @@ ...@@ -28,6 +28,7 @@
#include "ole2.h" #include "ole2.h"
#include "qedit_private.h" #include "qedit_private.h"
#include "wine/strmbase.h"
#include "wine/debug.h" #include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(qedit); WINE_DEFAULT_DEBUG_CHANNEL(qedit);
...@@ -280,11 +281,24 @@ static HRESULT WINAPI MediaDet_put_CurrentStream(IMediaDet* iface, LONG newVal) ...@@ -280,11 +281,24 @@ static HRESULT WINAPI MediaDet_put_CurrentStream(IMediaDet* iface, LONG newVal)
return S_OK; return S_OK;
} }
static HRESULT WINAPI MediaDet_get_StreamType(IMediaDet* iface, GUID *pVal) static HRESULT WINAPI MediaDet_get_StreamType(IMediaDet *iface, GUID *majortype)
{ {
MediaDetImpl *This = impl_from_IMediaDet(iface); MediaDetImpl *detector = impl_from_IMediaDet(iface);
FIXME("(%p)->(%s): not implemented!\n", This, debugstr_guid(pVal)); AM_MEDIA_TYPE mt;
return E_NOTIMPL; HRESULT hr;
TRACE("detector %p, majortype %p.\n", detector, majortype);
if (!majortype)
return E_POINTER;
if (SUCCEEDED(hr = IMediaDet_get_StreamMediaType(iface, &mt)))
{
*majortype = mt.majortype;
FreeMediaType(&mt);
}
return hr;
} }
static HRESULT WINAPI MediaDet_get_StreamTypeB(IMediaDet* iface, BSTR *pVal) static HRESULT WINAPI MediaDet_get_StreamTypeB(IMediaDet* iface, BSTR *pVal)
......
...@@ -192,6 +192,7 @@ static void test_mediadet(void) ...@@ -192,6 +192,7 @@ static void test_mediadet(void)
BSTR filename = NULL; BSTR filename = NULL;
LONG nstrms = 0; LONG nstrms = 0;
LONG strm; LONG strm;
GUID guid;
AM_MEDIA_TYPE mt; AM_MEDIA_TYPE mt;
double fps; double fps;
int flags; int flags;
...@@ -242,6 +243,12 @@ static void test_mediadet(void) ...@@ -242,6 +243,12 @@ static void test_mediadet(void)
hr = IMediaDet_get_StreamMediaType(pM, NULL); hr = IMediaDet_get_StreamMediaType(pM, NULL);
ok(hr == E_POINTER, "IMediaDet_get_StreamMediaType failed: %08x\n", hr); ok(hr == E_POINTER, "IMediaDet_get_StreamMediaType failed: %08x\n", hr);
hr = IMediaDet_get_StreamType(pM, &guid);
ok(hr == E_INVALIDARG, "Got hr %#x.\n", hr);
hr = IMediaDet_get_StreamType(pM, NULL);
ok(hr == E_POINTER, "Got hr %#x.\n", hr);
filename = SysAllocString(test_avi_filename); filename = SysAllocString(test_avi_filename);
hr = IMediaDet_put_Filename(pM, filename); hr = IMediaDet_put_Filename(pM, filename);
ok(hr == S_OK, "IMediaDet_put_Filename failed: %08x\n", hr); ok(hr == S_OK, "IMediaDet_put_Filename failed: %08x\n", hr);
...@@ -258,6 +265,10 @@ static void test_mediadet(void) ...@@ -258,6 +265,10 @@ static void test_mediadet(void)
ok(hr == S_OK, "IMediaDet_get_StreamMediaType failed: %08x\n", hr); ok(hr == S_OK, "IMediaDet_get_StreamMediaType failed: %08x\n", hr);
CoTaskMemFree(mt.pbFormat); CoTaskMemFree(mt.pbFormat);
hr = IMediaDet_get_StreamType(pM, &guid);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(IsEqualGUID(&guid, &MEDIATYPE_Video), "Got major type %s.\n", debugstr_guid(&guid));
/* Even before get_OutputStreams. */ /* Even before get_OutputStreams. */
hr = IMediaDet_put_CurrentStream(pM, 1); hr = IMediaDet_put_CurrentStream(pM, 1);
ok(hr == E_INVALIDARG, "IMediaDet_put_CurrentStream failed: %08x\n", hr); ok(hr == E_INVALIDARG, "IMediaDet_put_CurrentStream failed: %08x\n", hr);
...@@ -311,6 +322,10 @@ static void test_mediadet(void) ...@@ -311,6 +322,10 @@ static void test_mediadet(void)
"IMediaDet_get_StreamMediaType\n"); "IMediaDet_get_StreamMediaType\n");
CoTaskMemFree(mt.pbFormat); CoTaskMemFree(mt.pbFormat);
hr = IMediaDet_get_StreamType(pM, &guid);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(IsEqualGUID(&guid, &MEDIATYPE_Video), "Got major type %s.\n", debugstr_guid(&guid));
hr = IMediaDet_get_FrameRate(pM, NULL); hr = IMediaDet_get_FrameRate(pM, NULL);
ok(hr == E_POINTER, "IMediaDet_get_FrameRate failed: %08x\n", hr); ok(hr == E_POINTER, "IMediaDet_get_FrameRate failed: %08x\n", hr);
...@@ -370,6 +385,10 @@ static void test_mediadet(void) ...@@ -370,6 +385,10 @@ static void test_mediadet(void)
if (IsEqualGUID(&mt.majortype, &MEDIATYPE_Audio)) if (IsEqualGUID(&mt.majortype, &MEDIATYPE_Audio))
{ {
hr = IMediaDet_get_StreamType(pM, &guid);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(IsEqualGUID(&guid, &MEDIATYPE_Audio), "Got major type %s.\n", debugstr_guid(&guid));
hr = IMediaDet_get_FrameRate(pM, &fps); hr = IMediaDet_get_FrameRate(pM, &fps);
ok(hr == VFW_E_INVALIDMEDIATYPE, "IMediaDet_get_FrameRate failed: %08x\n", hr); ok(hr == VFW_E_INVALIDMEDIATYPE, "IMediaDet_get_FrameRate failed: %08x\n", hr);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment