Commit 642c090d authored by Anton Baskanov's avatar Anton Baskanov Committed by Alexandre Julliard

winegstreamer: Add a skeleton MPEG layer-3 decoder filter.

parent a490e819
......@@ -20,4 +20,5 @@
*/
DEFINE_GUID(CLSID_decodebin_parser, 0xf9d8d64e, 0xa144, 0x47dc, 0x8e, 0xe0, 0xf5, 0x34, 0x98, 0x37, 0x2c, 0x29);
DEFINE_GUID(CLSID_mpeg_layer3_decoder, 0x38be3000, 0xdbf4, 0x11d0, 0x86, 0x0e, 0x00, 0xa0, 0x24, 0xcf, 0xef, 0x6d);
DEFINE_GUID(WINESUBTYPE_Gstreamer, 0xffffffff, 0x128f, 0x4dd1, 0xad, 0x22, 0xbe, 0xcf, 0xa6, 0x6c, 0xe7, 0xaa);
......@@ -109,6 +109,7 @@ unsigned int wg_format_get_max_size(const struct wg_format *format);
HRESULT avi_splitter_create(IUnknown *outer, IUnknown **out);
HRESULT decodebin_parser_create(IUnknown *outer, IUnknown **out);
HRESULT mpeg_audio_codec_create(IUnknown *outer, IUnknown **out);
HRESULT mpeg_layer3_decoder_create(IUnknown *outer, IUnknown **out);
HRESULT mpeg_splitter_create(IUnknown *outer, IUnknown **out);
HRESULT wave_parser_create(IUnknown *outer, IUnknown **out);
HRESULT wma_decoder_create(IUnknown *outer, IUnknown **out);
......
......@@ -450,6 +450,7 @@ static const IClassFactoryVtbl class_factory_vtbl =
static struct class_factory avi_splitter_cf = {{&class_factory_vtbl}, avi_splitter_create};
static struct class_factory decodebin_parser_cf = {{&class_factory_vtbl}, decodebin_parser_create};
static struct class_factory mpeg_audio_codec_cf = {{&class_factory_vtbl}, mpeg_audio_codec_create};
static struct class_factory mpeg_layer3_decoder_cf = {{&class_factory_vtbl}, mpeg_layer3_decoder_create};
static struct class_factory mpeg_splitter_cf = {{&class_factory_vtbl}, mpeg_splitter_create};
static struct class_factory wave_parser_cf = {{&class_factory_vtbl}, wave_parser_create};
static struct class_factory wma_decoder_cf = {{&class_factory_vtbl}, wma_decoder_create};
......@@ -476,6 +477,8 @@ HRESULT WINAPI DllGetClassObject(REFCLSID clsid, REFIID iid, void **out)
factory = &decodebin_parser_cf;
else if (IsEqualGUID(clsid, &CLSID_CMpegAudioCodec))
factory = &mpeg_audio_codec_cf;
else if (IsEqualGUID(clsid, &CLSID_mpeg_layer3_decoder))
factory = &mpeg_layer3_decoder_cf;
else if (IsEqualGUID(clsid, &CLSID_MPEG1Splitter))
factory = &mpeg_splitter_cf;
else if (IsEqualGUID(clsid, &CLSID_WAVEParser))
......
......@@ -19,6 +19,7 @@
*/
#include "gst_private.h"
#include "gst_guids.h"
#include "mferror.h"
#include "mpegtype.h"
......@@ -733,3 +734,48 @@ HRESULT mpeg_audio_codec_create(IUnknown *outer, IUnknown **out)
*out = &object->filter.IUnknown_inner;
return hr;
}
static HRESULT mpeg_layer3_decoder_sink_query_accept(struct transform *filter, const AM_MEDIA_TYPE *mt)
{
return S_OK;
}
static HRESULT mpeg_layer3_decoder_source_query_accept(struct transform *filter, const AM_MEDIA_TYPE *mt)
{
return S_OK;
}
static HRESULT mpeg_layer3_decoder_source_get_media_type(struct transform *filter, unsigned int index, AM_MEDIA_TYPE *mt)
{
return VFW_S_NO_MORE_ITEMS;
}
static HRESULT mpeg_layer3_decoder_source_decide_buffer_size(struct transform *filter, IMemAllocator *allocator, ALLOCATOR_PROPERTIES *props)
{
return S_OK;
}
static const struct transform_ops mpeg_layer3_decoder_transform_ops =
{
mpeg_layer3_decoder_sink_query_accept,
mpeg_layer3_decoder_source_query_accept,
mpeg_layer3_decoder_source_get_media_type,
mpeg_layer3_decoder_source_decide_buffer_size,
};
HRESULT mpeg_layer3_decoder_create(IUnknown *outer, IUnknown **out)
{
struct transform *object;
HRESULT hr;
hr = transform_create(outer, &CLSID_mpeg_layer3_decoder, &mpeg_layer3_decoder_transform_ops, &object);
if (FAILED(hr))
return hr;
wcscpy(object->sink.pin.name, L"XForm In");
wcscpy(object->source.pin.name, L"XForm Out");
TRACE("Created MPEG layer-3 decoder %p.\n", object);
*out = &object->filter.IUnknown_inner;
return hr;
}
......@@ -36,6 +36,13 @@ coclass AviSplitter {}
coclass CMpegAudioCodec {}
[
helpstring("MPEG Layer-3 Decoder"),
threading(both),
uuid(38be3000-dbf4-11d0-860e-00a024cfef6d)
]
coclass mpeg_layer3_decoder {}
[
helpstring("MPEG-I Stream Splitter"),
threading(both),
uuid(336475d0-942a-11ce-a870-00aa002feab5)
......
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