Commit 943b6564 authored by Zebediah Figura's avatar Zebediah Figura Committed by Alexandre Julliard

winegstreamer: Get rid of the AudioConvert filter.

parent 1052d5cf
......@@ -19,7 +19,6 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
DEFINE_GUID(CLSID_Gstreamer_AudioConvert, 0x334b2ec9, 0xf2b5, 0x40b9, 0x84, 0x32, 0x4a, 0x00, 0xe0, 0x03, 0x86, 0xa8);
DEFINE_GUID(CLSID_Gstreamer_Mp3, 0x728dcf55, 0x128f, 0x4dd1, 0xad, 0x22, 0xbe, 0xcf, 0xa6, 0x6c, 0xe7, 0xaa);
DEFINE_GUID(CLSID_Gstreamer_Splitter, 0xf9d8d64e, 0xa144, 0x47dc, 0x8e, 0xe0, 0xf5, 0x34, 0x98, 0x37, 0x2c, 0x29);
DEFINE_GUID(WINESUBTYPE_Gstreamer, 0xffffffff, 0x128f, 0x4dd1, 0xad, 0x22, 0xbe, 0xcf, 0xa6, 0x6c, 0xe7, 0xaa);
......@@ -37,7 +37,6 @@
IUnknown * CALLBACK avi_splitter_create(IUnknown *outer, HRESULT *phr) DECLSPEC_HIDDEN;
IUnknown * CALLBACK mpeg_splitter_create(IUnknown *outer, HRESULT *phr) DECLSPEC_HIDDEN;
IUnknown * CALLBACK Gstreamer_AudioConvert_create(IUnknown *pUnkOuter, HRESULT *phr);
IUnknown * CALLBACK Gstreamer_Mp3_create(IUnknown *pUnkOuter, HRESULT *phr);
IUnknown * CALLBACK Gstreamer_Splitter_create(IUnknown *pUnkOuter, HRESULT *phr);
IUnknown * CALLBACK wave_parser_create(IUnknown *outer, HRESULT *phr) DECLSPEC_HIDDEN;
......
......@@ -626,123 +626,3 @@ IUnknown * CALLBACK Gstreamer_Mp3_create(IUnknown *punkouter, HRESULT *phr)
return obj;
}
static HRESULT WINAPI Gstreamer_AudioConvert_QueryConnect(TransformFilter *iface, const AM_MEDIA_TYPE *amt)
{
GstTfImpl *This = (GstTfImpl*)iface;
TRACE("%p %p\n", This, amt);
if (!IsEqualGUID(&amt->majortype, &MEDIATYPE_Audio) ||
!IsEqualGUID(&amt->subtype, &MEDIASUBTYPE_PCM) ||
!IsEqualGUID(&amt->formattype, &FORMAT_WaveFormatEx))
return S_FALSE;
return S_OK;
}
static HRESULT audio_converter_connect_sink(TransformFilter *tf, const AM_MEDIA_TYPE *amt)
{
GstTfImpl *This = (GstTfImpl*)tf;
GstCaps *capsin, *capsout;
AM_MEDIA_TYPE *outpmt = &This->tf.pmt;
WAVEFORMATEX *inwfe;
WAVEFORMATEX *outwfe;
WAVEFORMATEXTENSIBLE *outwfx;
GstAudioFormat format;
HRESULT hr;
BOOL inisfloat = FALSE;
int indepth;
mark_wine_thread();
if (Gstreamer_AudioConvert_QueryConnect(&This->tf, amt) == S_FALSE || !amt->pbFormat)
return E_FAIL;
FreeMediaType(outpmt);
*outpmt = *amt;
outpmt->pUnk = NULL;
outpmt->cbFormat = sizeof(WAVEFORMATEXTENSIBLE);
outpmt->pbFormat = CoTaskMemAlloc(outpmt->cbFormat);
inwfe = (WAVEFORMATEX*)amt->pbFormat;
indepth = inwfe->wBitsPerSample;
if (inwfe->wFormatTag == WAVE_FORMAT_EXTENSIBLE) {
WAVEFORMATEXTENSIBLE *inwfx = (WAVEFORMATEXTENSIBLE*)inwfe;
inisfloat = IsEqualGUID(&inwfx->SubFormat, &KSDATAFORMAT_SUBTYPE_IEEE_FLOAT);
if (inwfx->Samples.wValidBitsPerSample)
indepth = inwfx->Samples.wValidBitsPerSample;
} else if (inwfe->wFormatTag == WAVE_FORMAT_IEEE_FLOAT)
inisfloat = TRUE;
if (inisfloat)
format = inwfe->wBitsPerSample == 64 ? GST_AUDIO_FORMAT_F64LE : GST_AUDIO_FORMAT_F32LE;
else
format = gst_audio_format_build_integer(inwfe->wBitsPerSample != 8, G_LITTLE_ENDIAN,
inwfe->wBitsPerSample, indepth);
capsin = gst_caps_new_simple("audio/x-raw",
"format", G_TYPE_STRING, gst_audio_format_to_string(format),
"channels", G_TYPE_INT, inwfe->nChannels,
"rate", G_TYPE_INT, inwfe->nSamplesPerSec,
NULL);
outwfe = (WAVEFORMATEX*)outpmt->pbFormat;
outwfx = (WAVEFORMATEXTENSIBLE*)outwfe;
outwfe->wFormatTag = WAVE_FORMAT_EXTENSIBLE;
outwfe->nChannels = 2;
outwfe->nSamplesPerSec = inwfe->nSamplesPerSec;
outwfe->wBitsPerSample = 16;
outwfe->nBlockAlign = outwfe->nChannels * outwfe->wBitsPerSample / 8;
outwfe->nAvgBytesPerSec = outwfe->nBlockAlign * outwfe->nSamplesPerSec;
outwfe->cbSize = sizeof(*outwfx) - sizeof(*outwfe);
outwfx->Samples.wValidBitsPerSample = outwfe->wBitsPerSample;
outwfx->dwChannelMask = SPEAKER_FRONT_LEFT|SPEAKER_FRONT_RIGHT;
outwfx->SubFormat = KSDATAFORMAT_SUBTYPE_PCM;
capsout = gst_caps_new_simple("audio/x-raw",
"format", G_TYPE_STRING, "S16LE",
"channels", G_TYPE_INT, outwfe->nChannels,
"rate", G_TYPE_INT, outwfe->nSamplesPerSec,
NULL);
hr = Gstreamer_transform_ConnectInput(This, amt, capsin, capsout);
gst_caps_unref(capsin);
gst_caps_unref(capsout);
This->cbBuffer = inwfe->nAvgBytesPerSec;
return hr;
}
static const TransformFilterFuncTable Gstreamer_AudioConvert_vtbl = {
.pfnDecideBufferSize = Gstreamer_transform_DecideBufferSize,
.pfnStartStreaming = Gstreamer_transform_ProcessBegin,
.pfnReceive = Gstreamer_transform_ProcessData,
.pfnStopStreaming = Gstreamer_transform_ProcessEnd,
.pfnCheckInputType = Gstreamer_AudioConvert_QueryConnect,
.transform_connect_sink = audio_converter_connect_sink,
.pfnBreakConnect = Gstreamer_transform_Cleanup,
.pfnEndOfStream = Gstreamer_transform_EndOfStream,
.pfnBeginFlush = Gstreamer_transform_BeginFlush,
.pfnEndFlush = Gstreamer_transform_EndFlush,
.pfnNewSegment = Gstreamer_transform_NewSegment,
.pfnNotify = Gstreamer_transform_QOS,
};
IUnknown * CALLBACK Gstreamer_AudioConvert_create(IUnknown *punkouter, HRESULT *phr)
{
IUnknown *obj = NULL;
TRACE("%p %p\n", punkouter, phr);
if (!init_gstreamer())
{
*phr = E_FAIL;
return NULL;
}
*phr = Gstreamer_transform_create(punkouter, &CLSID_Gstreamer_AudioConvert, "audioconvert", &Gstreamer_AudioConvert_vtbl, (LPVOID*)&obj);
TRACE("returning %p\n", obj);
return obj;
}
......@@ -40,8 +40,6 @@ static const WCHAR wGstreamer_Splitter[] =
{'G','S','t','r','e','a','m','e','r',' ','s','p','l','i','t','t','e','r',' ','f','i','l','t','e','r',0};
static const WCHAR wGstreamer_Mp3[] =
{'G','S','t','r','e','a','m','e','r',' ','M','p','3',' ','f','i','l','t','e','r',0};
static const WCHAR wGstreamer_AudioConvert[] =
{'G','S','t','r','e','a','m','e','r',' ','A','u','d','i','o','C','o','n','v','e','r','t',' ','f','i','l','t','e','r',0};
static const WCHAR wave_parserW[] =
{'W','a','v','e',' ','P','a','r','s','e','r',0};
static const WCHAR avi_splitterW[] =
......@@ -122,32 +120,6 @@ AMOVIESETUP_FILTER const amfMp3 =
amfMp3Pin
};
AMOVIESETUP_PIN amfAudioConvertPin[] =
{ { wNull,
FALSE, FALSE, FALSE, FALSE,
&GUID_NULL,
NULL,
1,
amfMTaudio
},
{
wNull,
FALSE, TRUE, FALSE, FALSE,
&GUID_NULL,
NULL,
1,
amfMTaudio
},
};
AMOVIESETUP_FILTER const amfAudioConvert =
{ &CLSID_Gstreamer_AudioConvert,
wGstreamer_AudioConvert,
MERIT_UNLIKELY,
2,
amfAudioConvertPin
};
static const AMOVIESETUP_MEDIATYPE wave_parser_sink_type_data[] =
{
{&MEDIATYPE_Stream, &MEDIASUBTYPE_WAVE},
......@@ -296,13 +268,6 @@ FactoryTemplate const g_Templates[] = {
&amfMp3,
},
{
wGstreamer_AudioConvert,
&CLSID_Gstreamer_AudioConvert,
Gstreamer_AudioConvert_create,
NULL,
&amfAudioConvert,
},
{
wave_parserW,
&CLSID_WAVEParser,
wave_parser_create,
......
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