Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1744>
16 files changed:
};
/* MPEG 1/2: use the MPEG Audio Decoder filter */
};
/* MPEG 1/2: use the MPEG Audio Decoder filter */
-static const GUID CLSID_WINDOWS_MPEG_AUDIO_DECODER =
- {0x4A2286E0, 0x7BEF, 0x11CE,
+static const GUID CLSID_WINDOWS_MPEG_AUDIO_DECODER =
+ {0x4A2286E0, 0x7BEF, 0x11CE,
{0x9B, 0xD9, 0x00, 0x00, 0xE2, 0x02, 0x59, 0x9C}};
static PreferredFilter preferred_mpegaudio_filters[] = {
{&CLSID_WINDOWS_MPEG_AUDIO_DECODER},
{0x9B, 0xD9, 0x00, 0x00, 0xE2, 0x02, 0x59, 0x9C}};
static PreferredFilter preferred_mpegaudio_filters[] = {
{&CLSID_WINDOWS_MPEG_AUDIO_DECODER},
pMediaSample->GetPointer(&pBuffer);
pMediaSample->GetTime(&lStart, &lStop);
pMediaSample->GetPointer(&pBuffer);
pMediaSample->GetTime(&lStart, &lStop);
if (!GST_CLOCK_TIME_IS_VALID (mDec->timestamp)) {
// Convert REFERENCE_TIME to GST_CLOCK_TIME
mDec->timestamp = (GstClockTime)lStart * 100;
if (!GST_CLOCK_TIME_IS_VALID (mDec->timestamp)) {
// Convert REFERENCE_TIME to GST_CLOCK_TIME
mDec->timestamp = (GstClockTime)lStart * 100;
GST_WARNING_OBJECT (mDec, "cannot allocate a new GstBuffer");
goto done;
}
GST_WARNING_OBJECT (mDec, "cannot allocate a new GstBuffer");
goto done;
}
/* set buffer properties */
GST_BUFFER_TIMESTAMP (out_buf) = buf_start;
GST_BUFFER_DURATION (out_buf) = duration;
/* set buffer properties */
GST_BUFFER_TIMESTAMP (out_buf) = buf_start;
GST_BUFFER_DURATION (out_buf) = duration;
/* truncating */
if ((start_offset != 0) || (stop_offset != (size_t) size)) {
/* truncating */
if ((start_offset != 0) || (stop_offset != (size_t) size)) {
-
- GstBuffer *subbuf = gst_buffer_copy_region (out_buf, GST_BUFFER_COPY_ALL,
+
+ GstBuffer *subbuf = gst_buffer_copy_region (out_buf, GST_BUFFER_COPY_ALL,
start_offset, stop_offset - start_offset);
if (subbuf) {
start_offset, stop_offset - start_offset);
if (subbuf) {
- /* The Vista MP3 decoder (and possibly others?) outputs an
+ /* The Vista MP3 decoder (and possibly others?) outputs an
* AM_MEDIA_TYPE with the wrong cbFormat. So, rather than using
* CMediaType.operator==, we implement a sufficient check ourselves.
* I think this is a bug in the MP3 decoder.
* AM_MEDIA_TYPE with the wrong cbFormat. So, rather than using
* CMediaType.operator==, we implement a sufficient check ourselves.
* I think this is a bug in the MP3 decoder.
{
/* Types are the same at the top-level. Now, we need to compare
* the format blocks.
{
/* Types are the same at the top-level. Now, we need to compare
* the format blocks.
- * We special case WAVEFORMATEX to not check that
+ * We special case WAVEFORMATEX to not check that
* pmt->cbFormat == m_MediaType.cbFormat, though the actual format
* blocks must still be the same.
*/
* pmt->cbFormat == m_MediaType.cbFormat, though the actual format
* blocks must still be the same.
*/
description = g_strdup_printf ("DirectShow %s Decoder Wrapper",
tmp->element_longname);
description = g_strdup_printf ("DirectShow %s Decoder Wrapper",
tmp->element_longname);
- gst_element_class_set_metadata(element_class, longname, "Codec/Decoder/Audio", description,
+ gst_element_class_set_metadata(element_class, longname, "Codec/Decoder/Audio", description,
"Sebastien Moutte <sebastien@moutte.net>");
"Sebastien Moutte <sebastien@moutte.net>");
g_free (longname);
g_free (description);
g_free (longname);
g_free (description);
g_mutex_lock (&adec->com_init_lock);
/* create the COM initialization thread */
g_mutex_lock (&adec->com_init_lock);
/* create the COM initialization thread */
- g_thread_new ("COM init thread", (GThreadFunc)gst_dshowaudiodec_com_thread,
+ g_thread_new ("COM init thread", (GThreadFunc)gst_dshowaudiodec_com_thread,
adec);
/* wait until the COM thread signals that COM has been initialized */
adec);
/* wait until the COM thread signals that COM has been initialized */
mpeg1_format->fwHeadMode = ACM_MPEG_STEREO;
else
mpeg1_format->fwHeadMode = ACM_MPEG_SINGLECHANNEL;
mpeg1_format->fwHeadMode = ACM_MPEG_STEREO;
else
mpeg1_format->fwHeadMode = ACM_MPEG_SINGLECHANNEL;
mpeg1_format->fwHeadModeExt = 0;
mpeg1_format->wHeadEmphasis = 0;
mpeg1_format->fwHeadFlags = 0;
mpeg1_format->fwHeadModeExt = 0;
mpeg1_format->wHeadEmphasis = 0;
mpeg1_format->fwHeadFlags = 0;
mpeg1_format->wfx.nSamplesPerSec = adec->rate;
mpeg1_format->dwHeadBitrate = 128000; /* This doesn't seem to matter */
mpeg1_format->wfx.nAvgBytesPerSec = mpeg1_format->dwHeadBitrate / 8;
mpeg1_format->wfx.nSamplesPerSec = adec->rate;
mpeg1_format->dwHeadBitrate = 128000; /* This doesn't seem to matter */
mpeg1_format->wfx.nAvgBytesPerSec = mpeg1_format->dwHeadBitrate / 8;
{
size = sizeof (WAVEFORMATEX) +
(adec->codec_data ? gst_buffer_get_size(adec->codec_data) : 0);
{
size = sizeof (WAVEFORMATEX) +
(adec->codec_data ? gst_buffer_get_size(adec->codec_data) : 0);
if (adec->layer == 3) {
MPEGLAYER3WAVEFORMAT *mp3format;
if (adec->layer == 3) {
MPEGLAYER3WAVEFORMAT *mp3format;
- /* The WinXP mp3 decoder doesn't actually check the size of this structure,
+ /* The WinXP mp3 decoder doesn't actually check the size of this structure,
* but requires that this be allocated and filled out (or we get obscure
* random crashes)
*/
* but requires that this be allocated and filled out (or we get obscure
* random crashes)
*/
if (adec->codec_data) { /* Codec data is appended after our header */
gsize codec_size = gst_buffer_get_size(adec->codec_data);
if (adec->codec_data) { /* Codec data is appended after our header */
gsize codec_size = gst_buffer_get_size(adec->codec_data);
- gst_buffer_extract(adec->codec_data, 0, ((guchar *) format) + sizeof (WAVEFORMATEX),
+ gst_buffer_extract(adec->codec_data, 0, ((guchar *) format) + sizeof (WAVEFORMATEX),
codec_size);
format->cbSize = codec_size;
}
codec_size);
format->cbSize = codec_size;
}
mediatype->formattype = FORMAT_WaveFormatEx;
mediatype->cbFormat = sizeof (WAVEFORMATEX);
mediatype->pbFormat = (BYTE *)format;
mediatype->formattype = FORMAT_WaveFormatEx;
mediatype->cbFormat = sizeof (WAVEFORMATEX);
mediatype->pbFormat = (BYTE *)format;
adec->fakesink->SetMediaType(output_mediatype);
gst_audio_info_init(&audio_info);
adec->fakesink->SetMediaType(output_mediatype);
gst_audio_info_init(&audio_info);
- gst_audio_info_set_format(&audio_info,
+ gst_audio_info_set_format(&audio_info,
gst_audio_format_build_integer(TRUE, G_BYTE_ORDER, adec->depth, adec->depth),
adec->rate, adec->channels, NULL);
gst_audio_format_build_integer(TRUE, G_BYTE_ORDER, adec->depth, adec->depth),
adec->rate, adec->channels, NULL);
AM_MEDIA_TYPE *mediatype = NULL;
enum_mediatypes->Reset();
AM_MEDIA_TYPE *mediatype = NULL;
enum_mediatypes->Reset();
- while (!ret && enum_mediatypes->Next(1, &mediatype, &fetched) == S_OK)
+ while (!ret && enum_mediatypes->Next(1, &mediatype, &fetched) == S_OK)
{
if (IsEqualGUID (mediatype->subtype, MEDIASUBTYPE_PCM) &&
IsEqualGUID (mediatype->formattype, FORMAT_WaveFormatEx))
{
if (IsEqualGUID (mediatype->subtype, MEDIASUBTYPE_PCM) &&
IsEqualGUID (mediatype->formattype, FORMAT_WaveFormatEx))
outsubtype,
audio_dec_codecs[i].preferred_filters);
outsubtype,
audio_dec_codecs[i].preferred_filters);
{
GST_DEBUG ("Registering %s", audio_dec_codecs[i].element_name);
{
GST_DEBUG ("Registering %s", audio_dec_codecs[i].element_name);
/* element pads */
GstPad *sinkpad;
GstPad *srcpad;
/* element pads */
GstPad *sinkpad;
GstPad *srcpad;
GstFlowReturn last_ret;
/* filters interfaces*/
GstFlowReturn last_ret;
/* filters interfaces*/
AudioFakeSink *fakesink;
IBaseFilterPtr decfilter;
AudioFakeSink *fakesink;
IBaseFilterPtr decfilter;
-
- /* graph manager interfaces */
+
+ /* graph manager interfaces */
IMediaFilterPtr mediafilter;
IFilterGraphPtr filtergraph;
IMediaFilterPtr mediafilter;
IFilterGraphPtr filtergraph;
gint rate;
gint layer;
GstBuffer *codec_data;
gint rate;
gint layer;
GstBuffer *codec_data;
/* current segment */
GstSegment * segment;
/* current segment */
GstSegment * segment;
gboolean dshow_adec_register (GstPlugin * plugin);
gboolean dshow_adec_register (GstPlugin * plugin);
-const GUID CLSID_AudioFakeSink =
-{ 0x3867f537, 0x3e3d, 0x44da,
+const GUID CLSID_AudioFakeSink =
+{ 0x3867f537, 0x3e3d, 0x44da,
{ 0xbb, 0xf2, 0x02, 0x48, 0x7b, 0xb0, 0xbc, 0xc4} };
class AudioFakeSink : public CBaseRenderer
{
public:
{ 0xbb, 0xf2, 0x02, 0x48, 0x7b, 0xb0, 0xbc, 0xc4} };
class AudioFakeSink : public CBaseRenderer
{
public:
- AudioFakeSink(GstDshowAudioDec *dec) :
+ AudioFakeSink(GstDshowAudioDec *dec) :
m_hres(S_OK),
CBaseRenderer(CLSID_AudioFakeSink, _T("AudioFakeSink"), NULL, &m_hres),
m_hres(S_OK),
CBaseRenderer(CLSID_AudioFakeSink, _T("AudioFakeSink"), NULL, &m_hres),
{};
virtual ~AudioFakeSink() {};
HRESULT DoRenderSample(IMediaSample *pMediaSample);
HRESULT CheckMediaType(const CMediaType *pmt);
{};
virtual ~AudioFakeSink() {};
HRESULT DoRenderSample(IMediaSample *pMediaSample);
HRESULT CheckMediaType(const CMediaType *pmt);
- HRESULT SetMediaType (AM_MEDIA_TYPE *pmt)
+ HRESULT SetMediaType (AM_MEDIA_TYPE *pmt)
{
m_MediaType.Set (*pmt);
return S_OK;
{
m_MediaType.Set (*pmt);
return S_OK;
GST_DEBUG_CATEGORY_EXTERN (dshowdec_debug);
#define GST_CAT_DEFAULT dshowdec_debug
GST_DEBUG_CATEGORY_EXTERN (dshowdec_debug);
#define GST_CAT_DEFAULT dshowdec_debug
-const GUID CLSID_DecodeFakeSrc =
+const GUID CLSID_DecodeFakeSrc =
{ 0x039527db, 0x6b48, 0x45a7, { 0xab, 0xcf, 0x21, 0xab, 0xc5, 0x44, 0xbb, 0xb6} };
static CCritSec g_pCriticSec;
{ 0x039527db, 0x6b48, 0x45a7, { 0xab, 0xcf, 0x21, 0xab, 0xc5, 0x44, 0xbb, 0xb6} };
static CCritSec g_pCriticSec;
-HRESULT FakeOutputPin::GetMediaType(int iPosition,
+HRESULT FakeOutputPin::GetMediaType(int iPosition,
CMediaType *pMediaType)
{
if(iPosition == 0) {
*pMediaType = m_MediaType;
return S_OK;
}
CMediaType *pMediaType)
{
if(iPosition == 0) {
*pMediaType = m_MediaType;
return S_OK;
}
return VFW_S_NO_MORE_ITEMS;
}
#if 0
return VFW_S_NO_MORE_ITEMS;
}
#if 0
-HRESULT FakeOutputPin::DecideBufferSize (IMemAllocator *pAlloc,
+HRESULT FakeOutputPin::DecideBufferSize (IMemAllocator *pAlloc,
ALLOCATOR_PROPERTIES *ppropInputRequest)
{
ALLOCATOR_PROPERTIES properties;
ALLOCATOR_PROPERTIES *ppropInputRequest)
{
ALLOCATOR_PROPERTIES properties;
-STDMETHODIMP FakeOutputPin::PushBuffer(byte *buffer,
- __int64 start, __int64 stop,
+STDMETHODIMP FakeOutputPin::PushBuffer(byte *buffer,
+ __int64 start, __int64 stop,
unsigned int size, bool discont)
{
IMediaSample *pSample = NULL;
unsigned int size, bool discont)
{
IMediaSample *pSample = NULL;
if (start != -1) {
start /= 100;
stop /= 100;
if (start != -1) {
start /= 100;
stop /= 100;
pSample->SetActualDataLength(size);
}
pSample->SetDiscontinuity(discont);
pSample->SetActualDataLength(size);
}
pSample->SetDiscontinuity(discont);
pSample->SetSyncPoint(TRUE);
pSample->SetPreroll(FALSE);
pSample->SetSyncPoint(TRUE);
pSample->SetPreroll(FALSE);
if (start != -1)
pSample->SetTime(&start, &stop);
if (start != -1)
pSample->SetTime(&start, &stop);
FakeOutputPin *FakeSrc::GetOutputPin()
{
return m_pOutputPin;
FakeOutputPin *FakeSrc::GetOutputPin()
{
return m_pOutputPin;
-}
\ No newline at end of file
/* methods */
FakeOutputPin (CBaseFilter *pFilter, CCritSec *sec);
~FakeOutputPin ();
/* methods */
FakeOutputPin (CBaseFilter *pFilter, CCritSec *sec);
~FakeOutputPin ();
virtual HRESULT CheckMediaType(const CMediaType *pmt);
HRESULT GetMediaType(int iPosition, CMediaType *pMediaType);
virtual HRESULT DecideBufferSize (IMemAllocator *pAlloc, ALLOCATOR_PROPERTIES *ppropInputRequest);
virtual HRESULT CheckMediaType(const CMediaType *pmt);
HRESULT GetMediaType(int iPosition, CMediaType *pMediaType);
virtual HRESULT DecideBufferSize (IMemAllocator *pAlloc, ALLOCATOR_PROPERTIES *ppropInputRequest);
FakeOutputPin *GetOutputPin();
};
FakeOutputPin *GetOutputPin();
};
-#endif // _DSHOWDECWRAPPER_FAKESRC_H_
\ No newline at end of file
+#endif // _DSHOWDECWRAPPER_FAKESRC_H_
_COM_SMARTPTR_TYPEDEF(IDMOWrapperFilter, __uuidof(IDMOWrapperFilter));
_COM_SMARTPTR_TYPEDEF(IDMOWrapperFilter, __uuidof(IDMOWrapperFilter));
gst_dshow_get_pin_from_filter (IBaseFilter *filter, PIN_DIRECTION pindir)
{
IEnumPinsPtr enumpins;
IPinPtr pin;
gst_dshow_get_pin_from_filter (IBaseFilter *filter, PIN_DIRECTION pindir)
{
IEnumPinsPtr enumpins;
IPinPtr pin;
hres = filter->EnumPins (&enumpins);
if (FAILED(hres)) {
hres = filter->EnumPins (&enumpins);
if (FAILED(hres)) {
-IBaseFilter *
-gst_dshow_find_filter(CLSID input_majortype, CLSID input_subtype,
- CLSID output_majortype, CLSID output_subtype,
+IBaseFilter *
+gst_dshow_find_filter(CLSID input_majortype, CLSID input_subtype,
+ CLSID output_majortype, CLSID output_subtype,
PreferredFilter *preferred_filters)
{
HRESULT hres;
PreferredFilter *preferred_filters)
{
HRESULT hres;
/* First, see if any of our preferred filters is available.
* If not, we fall back to the highest-ranked installed filter */
if (preferred_filters) {
/* First, see if any of our preferred filters is available.
* If not, we fall back to the highest-ranked installed filter */
if (preferred_filters) {
- while (preferred_filters->filter_guid)
+ while (preferred_filters->filter_guid)
{
/* If the filter is a DMO, we need to do this a bit differently */
{
/* If the filter is a DMO, we need to do this a bit differently */
- if (preferred_filters->dmo_category)
+ if (preferred_filters->dmo_category)
{
IDMOWrapperFilterPtr wrapper;
{
IDMOWrapperFilterPtr wrapper;
- hres = CoCreateInstance (CLSID_DMOWrapperFilter, NULL,
+ hres = CoCreateInstance (CLSID_DMOWrapperFilter, NULL,
CLSCTX_INPROC,
IID_IBaseFilter, (void **)&filter);
if (SUCCEEDED(hres)) {
hres = filter->QueryInterface (&wrapper);
if (SUCCEEDED(hres)) {
CLSCTX_INPROC,
IID_IBaseFilter, (void **)&filter);
if (SUCCEEDED(hres)) {
hres = filter->QueryInterface (&wrapper);
if (SUCCEEDED(hres)) {
- hres = wrapper->Init (*preferred_filters->filter_guid,
+ hres = wrapper->Init (*preferred_filters->filter_guid,
*preferred_filters->dmo_category);
if (SUCCEEDED(hres))
return filter;
*preferred_filters->dmo_category);
if (SUCCEEDED(hres))
return filter;
- hres = CoCreateInstance (*preferred_filters->filter_guid,
+ hres = CoCreateInstance (*preferred_filters->filter_guid,
NULL, CLSCTX_INPROC,
IID_IBaseFilter, (void **)&filter);
if (SUCCEEDED(hres))
NULL, CLSCTX_INPROC,
IID_IBaseFilter, (void **)&filter);
if (SUCCEEDED(hres))
- hres = CoCreateInstance(CLSID_FilterMapper2, NULL, CLSCTX_INPROC,
+ hres = CoCreateInstance(CLSID_FilterMapper2, NULL, CLSCTX_INPROC,
IID_IFilterMapper2, (void **) &mapper);
if (FAILED(hres))
return NULL;
IID_IFilterMapper2, (void **) &mapper);
if (FAILED(hres))
return NULL;
inTypes[0] = input_majortype;
inTypes[1] = input_subtype;
outTypes[0] = output_majortype;
outTypes[1] = output_subtype;
inTypes[0] = input_majortype;
inTypes[1] = input_subtype;
outTypes[0] = output_majortype;
outTypes[1] = output_subtype;
- hres = mapper->EnumMatchingFilters (&enum_moniker, 0,
- FALSE, MERIT_DO_NOT_USE+1,
- TRUE, 1, inTypes, NULL, NULL, FALSE,
+ hres = mapper->EnumMatchingFilters (&enum_moniker, 0,
+ FALSE, MERIT_DO_NOT_USE+1,
+ TRUE, 1, inTypes, NULL, NULL, FALSE,
TRUE, 1, outTypes, NULL, NULL);
if (FAILED(hres))
return NULL;
TRUE, 1, outTypes, NULL, NULL);
if (FAILED(hres))
return NULL;
enum_moniker->Reset ();
while(enum_moniker->Next (1, &moniker, &fetched) == S_OK)
{
enum_moniker->Reset ();
while(enum_moniker->Next (1, &moniker, &fetched) == S_OK)
{
- hres = moniker->BindToObject(NULL, NULL,
+ hres = moniker->BindToObject(NULL, NULL,
IID_IBaseFilter, (void**)&filter);
if(SUCCEEDED(hres)) {
return filter;
IID_IBaseFilter, (void**)&filter);
if(SUCCEEDED(hres)) {
return filter;
IPin *gst_dshow_get_pin_from_filter (IBaseFilter *filter, PIN_DIRECTION pindir);
/* find and return a filter according to the input and output types */
IPin *gst_dshow_get_pin_from_filter (IBaseFilter *filter, PIN_DIRECTION pindir);
/* find and return a filter according to the input and output types */
-IBaseFilter *
-gst_dshow_find_filter(CLSID input_majortype, CLSID input_subtype,
- CLSID output_majortype, CLSID output_subtype,
+IBaseFilter *
+gst_dshow_find_filter(CLSID input_majortype, CLSID input_subtype,
+ CLSID output_majortype, CLSID output_subtype,
PreferredFilter *preferred_filters);
#define DSHOW_CODEC_QDATA g_quark_from_string ("dshow-codec")
PreferredFilter *preferred_filters);
#define DSHOW_CODEC_QDATA g_quark_from_string ("dshow-codec")
{&CLSID_CWMVDecMediaObject, &DMOCATEGORY_VIDEO_DECODER}, {0}
};
{&CLSID_CWMVDecMediaObject, &DMOCATEGORY_VIDEO_DECODER}, {0}
};
-static const GUID CLSID_AVI_DECOMPRESSOR =
- {0xCF49D4E0, 0x1115, 0x11CE,
+static const GUID CLSID_AVI_DECOMPRESSOR =
+ {0xCF49D4E0, 0x1115, 0x11CE,
{0xB0, 0x3A, 0x00, 0x20, 0xAF, 0x0B, 0xA7, 0x70}};
static PreferredFilter preferred_cinepack_filters[] = {
{&CLSID_AVI_DECOMPRESSOR}, {0}
{0xB0, 0x3A, 0x00, 0x20, 0xAF, 0x0B, 0xA7, 0x70}};
static PreferredFilter preferred_cinepack_filters[] = {
{&CLSID_AVI_DECOMPRESSOR}, {0}
static PreferredFilter preferred_mp43_filters[] = {
{&CLSID_CMpeg43DecMediaObject, &DMOCATEGORY_VIDEO_DECODER}, {0}};
static PreferredFilter preferred_mp43_filters[] = {
{&CLSID_CMpeg43DecMediaObject, &DMOCATEGORY_VIDEO_DECODER}, {0}};
-static const GUID CLSID_MPEG_VIDEO_DECODER =
- {0xFEB50740, 0x7BEF, 0x11CE,
+static const GUID CLSID_MPEG_VIDEO_DECODER =
+ {0xFEB50740, 0x7BEF, 0x11CE,
{0x9B, 0xD9, 0x00, 0x00, 0xE2, 0x02, 0x59, 0x9C}};
static PreferredFilter preferred_mpeg1_filters[] = {
{&CLSID_MPEG_VIDEO_DECODER}, {0}
{0x9B, 0xD9, 0x00, 0x00, 0xE2, 0x02, 0x59, 0x9C}};
static PreferredFilter preferred_mpeg1_filters[] = {
{&CLSID_MPEG_VIDEO_DECODER}, {0}
GUID_MEDIATYPE_VIDEO, GUID_MEDIASUBTYPE_YUY2,
GST_VIDEO_CAPS_MAKE("YUY2"),
preferred_mpeg1_filters},
GUID_MEDIATYPE_VIDEO, GUID_MEDIASUBTYPE_YUY2,
GST_VIDEO_CAPS_MAKE("YUY2"),
preferred_mpeg1_filters},
{"dshowvdec_mpeg4", "MPEG-4 Video",
GST_MAKE_FOURCC ('M', 'P', 'G', '4'),
GUID_MEDIATYPE_VIDEO, GUID_MEDIASUBTYPE_MPG4,
{"dshowvdec_mpeg4", "MPEG-4 Video",
GST_MAKE_FOURCC ('M', 'P', 'G', '4'),
GUID_MEDIATYPE_VIDEO, GUID_MEDIASUBTYPE_MPG4,
gst_buffer_map(buf, &map, GST_MAP_WRITE);
if (strstr (klass->entry->srccaps, "rgb")) {
gst_buffer_map(buf, &map, GST_MAP_WRITE);
if (strstr (klass->entry->srccaps, "rgb")) {
- /* FOR RGB directshow decoder will return bottom-up BITMAP
+ /* FOR RGB directshow decoder will return bottom-up BITMAP
* There is probably a way to get top-bottom video frames from
* the decoder...
*/
* There is probably a way to get top-bottom video frames from
* the decoder...
*/
description = g_strdup_printf ("DirectShow %s Decoder Wrapper",
tmp->element_longname);
description = g_strdup_printf ("DirectShow %s Decoder Wrapper",
tmp->element_longname);
- gst_element_class_set_metadata(element_class, longname, "Codec/Decoder/Video", description,
+ gst_element_class_set_metadata(element_class, longname, "Codec/Decoder/Video", description,
"Sebastien Moutte <sebastien@moutte.net>");
g_free (longname);
"Sebastien Moutte <sebastien@moutte.net>");
g_free (longname);
"framerate", GST_TYPE_FRACTION, vdec->fps_n, vdec->fps_d, NULL);
}
"framerate", GST_TYPE_FRACTION, vdec->fps_n, vdec->fps_d, NULL);
}
- gst_caps_set_simple (caps_out,
+ gst_caps_set_simple (caps_out,
"pixel-aspect-ratio", GST_TYPE_FRACTION, vdec->par_n, vdec->par_d, NULL);
if (!gst_pad_set_caps (vdec->srcpad, caps_out)) {
"pixel-aspect-ratio", GST_TYPE_FRACTION, vdec->par_n, vdec->par_d, NULL);
if (!gst_pad_set_caps (vdec->srcpad, caps_out)) {
enum_mediatypes->Reset();
while (hres =
enum_mediatypes->Next(1, &mediatype, &fetched),
enum_mediatypes->Reset();
while (hres =
enum_mediatypes->Next(1, &mediatype, &fetched),
{
VIDEOINFOHEADER *video_info;
GstCaps *mediacaps = NULL;
{
VIDEOINFOHEADER *video_info;
GstCaps *mediacaps = NULL;
enum_mediatypes->Reset();
while (hres =
enum_mediatypes->Next(1, &mediatype, &fetched),
enum_mediatypes->Reset();
while (hres =
enum_mediatypes->Next(1, &mediatype, &fetched),
{
if (IsEqualGUID (mediatype->subtype, subtype) &&
IsEqualGUID (mediatype->formattype, FORMAT_VideoInfo))
{
if (IsEqualGUID (mediatype->subtype, subtype) &&
IsEqualGUID (mediatype->formattype, FORMAT_VideoInfo))
/* caps of our src pad */
GstCaps *srccaps;
/* caps of our src pad */
GstCaps *srccaps;
GstFlowReturn last_ret;
/* list of dshow mediatypes corresponding to the caps list */
GstFlowReturn last_ret;
/* list of dshow mediatypes corresponding to the caps list */
gboolean dshow_vdec_register (GstPlugin * plugin);
gboolean dshow_vdec_register (GstPlugin * plugin);
-const GUID CLSID_VideoFakeSink =
+const GUID CLSID_VideoFakeSink =
{ 0xff8f0c8e, 0x64f9, 0x4471,
{ 0x96, 0x0e, 0xd2, 0xd3, 0x18, 0x87, 0x78, 0x9a} };
class VideoFakeSink : public CBaseRenderer
{
public:
{ 0xff8f0c8e, 0x64f9, 0x4471,
{ 0x96, 0x0e, 0xd2, 0xd3, 0x18, 0x87, 0x78, 0x9a} };
class VideoFakeSink : public CBaseRenderer
{
public:
- VideoFakeSink(GstDshowVideoDec *dec) :
+ VideoFakeSink(GstDshowVideoDec *dec) :
m_hres(S_OK),
CBaseRenderer(CLSID_VideoFakeSink, _T("VideoFakeSink"), NULL, &m_hres),
m_hres(S_OK),
CBaseRenderer(CLSID_VideoFakeSink, _T("VideoFakeSink"), NULL, &m_hres),
{};
virtual ~VideoFakeSink() {};
HRESULT DoRenderSample(IMediaSample *pMediaSample);
HRESULT CheckMediaType(const CMediaType *pmt);
{};
virtual ~VideoFakeSink() {};
HRESULT DoRenderSample(IMediaSample *pMediaSample);
HRESULT CheckMediaType(const CMediaType *pmt);
- HRESULT SetMediaType (AM_MEDIA_TYPE *pmt)
+ HRESULT SetMediaType (AM_MEDIA_TYPE *pmt)
{
m_MediaType.Set (*pmt);
return S_OK;
{
m_MediaType.Set (*pmt);
return S_OK;
#define GST_CAT_DEFAULT dshowvideosink_debug
// {A0A5CF33-BD0C-4158-9A56-3011DEE3AF6B}
#define GST_CAT_DEFAULT dshowvideosink_debug
// {A0A5CF33-BD0C-4158-9A56-3011DEE3AF6B}
-const GUID CLSID_VideoFakeSrc =
+const GUID CLSID_VideoFakeSrc =
{ 0xa0a5cf33, 0xbd0c, 0x4158, { 0x9a, 0x56, 0x30, 0x11, 0xde, 0xe3, 0xaf, 0x6b } };
/* output pin*/
{ 0xa0a5cf33, 0xbd0c, 0x4158, { 0x9a, 0x56, 0x30, 0x11, 0xde, 0xe3, 0xaf, 0x6b } };
/* output pin*/
*pMediaType = m_MediaType;
return S_OK;
}
*pMediaType = m_MediaType;
return S_OK;
}
return VFW_S_NO_MORE_ITEMS;
}
return VFW_S_NO_MORE_ITEMS;
}
(newvh->bmiHeader.biWidth >= curvh->bmiHeader.biWidth))
{
GST_DEBUG ("CheckMediaType has same media type, width %d (%d image)", newvh->bmiHeader.biWidth, curvh->bmiHeader.biWidth);
(newvh->bmiHeader.biWidth >= curvh->bmiHeader.biWidth))
{
GST_DEBUG ("CheckMediaType has same media type, width %d (%d image)", newvh->bmiHeader.biWidth, curvh->bmiHeader.biWidth);
/* OK, compatible! */
return S_OK;
}
/* OK, compatible! */
return S_OK;
}
GST_WARNING ("Looked similar, but aren't...");
}
}
GST_WARNING ("Looked similar, but aren't...");
}
}
}
GST_WARNING ("Different media types, FAILING!");
return S_FALSE;
}
GST_WARNING ("Different media types, FAILING!");
return S_FALSE;
HRESULT VideoFakeSrcPin::DecideBufferSize (IMemAllocator *pAlloc, ALLOCATOR_PROPERTIES *ppropInputRequest)
{
ALLOCATOR_PROPERTIES properties;
HRESULT VideoFakeSrcPin::DecideBufferSize (IMemAllocator *pAlloc, ALLOCATOR_PROPERTIES *ppropInputRequest)
{
ALLOCATOR_PROPERTIES properties;
- GST_DEBUG ("Required allocator properties: %d, %d, %d, %d",
- ppropInputRequest->cbAlign, ppropInputRequest->cbBuffer,
+ GST_DEBUG ("Required allocator properties: %d, %d, %d, %d",
+ ppropInputRequest->cbAlign, ppropInputRequest->cbBuffer,
ppropInputRequest->cbPrefix, ppropInputRequest->cBuffers);
ppropInputRequest->cbBuffer = m_SampleSize;
ppropInputRequest->cbPrefix, ppropInputRequest->cBuffers);
ppropInputRequest->cbBuffer = m_SampleSize;
/* First set the buffer descriptions we're interested in */
HRESULT hres = pAlloc->SetProperties(ppropInputRequest, &properties);
/* First set the buffer descriptions we're interested in */
HRESULT hres = pAlloc->SetProperties(ppropInputRequest, &properties);
- GST_DEBUG ("Actual Allocator properties: %d, %d, %d, %d",
- properties.cbAlign, properties.cbBuffer,
+ GST_DEBUG ("Actual Allocator properties: %d, %d, %d, %d",
+ properties.cbAlign, properties.cbBuffer,
properties.cbPrefix, properties.cBuffers);
return S_OK;
properties.cbPrefix, properties.cBuffers);
return S_OK;
* most of the time */
if ((fourcc == GST_MAKE_FOURCC ('Y', 'U', 'Y', '2')) ||
(fourcc == GST_MAKE_FOURCC ('Y', 'U', 'Y', 'V')) ||
* most of the time */
if ((fourcc == GST_MAKE_FOURCC ('Y', 'U', 'Y', '2')) ||
(fourcc == GST_MAKE_FOURCC ('Y', 'U', 'Y', 'V')) ||
- (fourcc == GST_MAKE_FOURCC ('U', 'Y', 'V', 'Y')))
+ (fourcc == GST_MAKE_FOURCC ('U', 'Y', 'V', 'Y')))
{
/* Nice and simple */
int srcstride = GST_ROUND_UP_4 (vh->rcSource.right * 2);
{
/* Nice and simple */
int srcstride = GST_ROUND_UP_4 (vh->rcSource.right * 2);
{
StopUsingOutputPin();
GST_WARNING ("Could not get sample for delivery to sink: %x", hres);
{
StopUsingOutputPin();
GST_WARNING ("Could not get sample for delivery to sink: %x", hres);
- /* Copy to the destination stride.
- * This is not just a simple memcpy because of the different strides.
- * TODO: optimise for the same-stride case and avoid the copy entirely.
+ /* Copy to the destination stride.
+ * This is not just a simple memcpy because of the different strides.
+ * TODO: optimise for the same-stride case and avoid the copy entirely.
*/
CopyToDestinationBuffer (data, sample_buffer);
}
*/
CopyToDestinationBuffer (data, sample_buffer);
}
pSample->SetDiscontinuity(FALSE); /* Decoded frame; unimportant */
pSample->SetSyncPoint(TRUE); /* Decoded frame; always a valid syncpoint */
pSample->SetDiscontinuity(FALSE); /* Decoded frame; unimportant */
pSample->SetSyncPoint(TRUE); /* Decoded frame; always a valid syncpoint */
- pSample->SetPreroll(FALSE); /* For non-displayed frames.
+ pSample->SetPreroll(FALSE); /* For non-displayed frames.
- /* Disable synchronising on this sample. We instead let GStreamer handle
+ /* Disable synchronising on this sample. We instead let GStreamer handle
* this at a higher level, inside BaseSink. */
pSample->SetTime(NULL, NULL);
* this at a higher level, inside BaseSink. */
pSample->SetTime(NULL, NULL);
"video/x-raw,"
"width = (int) [ 1, MAX ],"
"height = (int) [ 1, MAX ],"
"video/x-raw,"
"width = (int) [ 1, MAX ],"
"height = (int) [ 1, MAX ],"
- "framerate = (fraction) [ 0, MAX ],"
+ "framerate = (fraction) [ 0, MAX ],"
"format = {(string)YUY2, (string)UYVY, (string)YV12 }")
);
"format = {(string)YUY2, (string)UYVY, (string)YV12 }")
);
/* COM initialization/uninitialization thread */
static void gst_dshowvideosink_com_thread (GstDshowVideoSink * sink);
/* COM initialization/uninitialization thread */
static void gst_dshowvideosink_com_thread (GstDshowVideoSink * sink);
-/* TODO: event, preroll, buffer_alloc?
- * buffer_alloc won't generally be all that useful because the renderers require a
- * different stride to GStreamer's implicit values.
+/* TODO: event, preroll, buffer_alloc?
+ * buffer_alloc won't generally be all that useful because the renderers require a
+ * different stride to GStreamer's implicit values.
(GParamFlags)G_PARAM_READWRITE));
g_object_class_install_property (G_OBJECT_CLASS (klass),
(GParamFlags)G_PARAM_READWRITE));
g_object_class_install_property (G_OBJECT_CLASS (klass),
- PROP_RENDERER, g_param_spec_string ("renderer", "Renderer",
+ PROP_RENDERER, g_param_spec_string ("renderer", "Renderer",
"Force usage of specific DirectShow renderer (EVR, VMR9 or VMR7)",
NULL, (GParamFlags)G_PARAM_READWRITE));
}
"Force usage of specific DirectShow renderer (EVR, VMR9 or VMR7)",
NULL, (GParamFlags)G_PARAM_READWRITE));
}
{
IEnumPins *enumpins = NULL;
IPin *pin = NULL;
{
IEnumPins *enumpins = NULL;
IPin *pin = NULL;
hres = filter->EnumPins (&enumpins);
if (FAILED(hres)) {
hres = filter->EnumPins (&enumpins);
if (FAILED(hres)) {
gst_dshow_get_pin_from_filter (IBaseFilter *filter, PIN_DIRECTION pindir, IPin **pin)
{
gboolean ret = FALSE;
IEnumPins *enumpins = NULL;
IPin *pintmp = NULL;
gst_dshow_get_pin_from_filter (IBaseFilter *filter, PIN_DIRECTION pindir, IPin **pin)
{
gboolean ret = FALSE;
IEnumPins *enumpins = NULL;
IPin *pintmp = NULL;
*pin = NULL;
hres = filter->EnumPins (&enumpins);
*pin = NULL;
hres = filter->EnumPins (&enumpins);
gst_dshowvideosink_handle_event (GstDshowVideoSink *sink)
{
if (sink->filter_media_event) {
gst_dshowvideosink_handle_event (GstDshowVideoSink *sink)
{
if (sink->filter_media_event) {
}
/* WndProc for our default window, if the application didn't supply one */
}
/* WndProc for our default window, if the application didn't supply one */
WndProc (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
GstDshowVideoSink *sink = (GstDshowVideoSink *)GetWindowLongPtr (hWnd, GWLP_USERDATA);
WndProc (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
GstDshowVideoSink *sink = (GstDshowVideoSink *)GetWindowLongPtr (hWnd, GWLP_USERDATA);
- /* By default, create a normal top-level window, the size
+ /* By default, create a normal top-level window, the size
* of the video.
*/
RECT rect;
* of the video.
*/
RECT rect;
}
sink->is_new_window = FALSE;
}
sink->is_new_window = FALSE;
- /* This tells the renderer where the window is located, needed to
+ /* This tells the renderer where the window is located, needed to
* start drawing in the right place. */
sink->renderersupport->MoveWindow();
GST_INFO_OBJECT (sink, "Set renderer window to %x", sink->window_id);
* start drawing in the right place. */
sink->renderersupport->MoveWindow();
GST_INFO_OBJECT (sink, "Set renderer window to %x", sink->window_id);
srcpin = sink->fakesrc->GetOutputPin();
srcpin = sink->fakesrc->GetOutputPin();
- gst_dshow_get_pin_from_filter (sink->renderersupport->GetFilter(), PINDIR_INPUT,
+ gst_dshow_get_pin_from_filter (sink->renderersupport->GetFilter(), PINDIR_INPUT,
&sinkpin);
if (!sinkpin) {
GST_WARNING_OBJECT (sink, "Cannot get input pin from Renderer");
&sinkpin);
if (!sinkpin) {
GST_WARNING_OBJECT (sink, "Cannot get input pin from Renderer");
ret = GST_STATE_CHANGE_FAILURE;
goto done;
}
ret = GST_STATE_CHANGE_FAILURE;
goto done;
}
GST_DEBUG_OBJECT (sink, "DirectShow graph is now running");
ret = GST_STATE_CHANGE_SUCCESS;
GST_DEBUG_OBJECT (sink, "DirectShow graph is now running");
ret = GST_STATE_CHANGE_SUCCESS;
sink->filter_graph->Disconnect(sink->fakesrc->GetOutputPin());
sink->filter_graph->Disconnect(sink->fakesrc->GetOutputPin());
- gst_dshow_get_pin_from_filter (sink->renderersupport->GetFilter(), PINDIR_INPUT,
+ gst_dshow_get_pin_from_filter (sink->renderersupport->GetFilter(), PINDIR_INPUT,
&sinkpin);
sink->filter_graph->Disconnect(sinkpin);
sinkpin->Release();
&sinkpin);
sink->filter_graph->Disconnect(sinkpin);
sinkpin->Release();
HWND video_window;
public:
HWND video_window;
public:
- EVRSupport (GstDshowVideoSink *sink) :
+ EVRSupport (GstDshowVideoSink *sink) :
sink(sink),
filter(NULL),
service(NULL),
sink(sink),
filter(NULL),
service(NULL),
IID_IBaseFilter, (LPVOID *) &filter);
GST_DEBUG_OBJECT (sink, "cocreateinstance returned %d", hres);
if (FAILED (hres)) {
IID_IBaseFilter, (LPVOID *) &filter);
GST_DEBUG_OBJECT (sink, "cocreateinstance returned %d", hres);
if (FAILED (hres)) {
- GST_ERROR_OBJECT (sink,
+ GST_ERROR_OBJECT (sink,
"Can't create an instance of renderer (error=%x)",
hres);
return FALSE;
"Can't create an instance of renderer (error=%x)",
hres);
return FALSE;
- hres = service->GetService (MR_VIDEO_RENDER_SERVICE,
+ hres = service->GetService (MR_VIDEO_RENDER_SERVICE,
IID_IMFVideoDisplayControl, (void **) &control);
if (FAILED (hres)) {
GST_WARNING_OBJECT (sink, "EVR control service missing: %x", hres);
IID_IMFVideoDisplayControl, (void **) &control);
if (FAILED (hres)) {
GST_WARNING_OBJECT (sink, "EVR control service missing: %x", hres);
HWND video_window;
public:
HWND video_window;
public:
- VMR9Support (GstDshowVideoSink *sink) :
- sink(sink),
+ VMR9Support (GstDshowVideoSink *sink) :
+ sink(sink),
filter(NULL),
control(NULL),
config(NULL)
filter(NULL),
control(NULL),
config(NULL)
hres = CoCreateInstance (CLSID_VideoMixingRenderer9, NULL, CLSCTX_INPROC,
IID_IBaseFilter, (LPVOID *) &filter);
if (FAILED (hres)) {
hres = CoCreateInstance (CLSID_VideoMixingRenderer9, NULL, CLSCTX_INPROC,
IID_IBaseFilter, (LPVOID *) &filter);
if (FAILED (hres)) {
- GST_ERROR_OBJECT (sink,
+ GST_ERROR_OBJECT (sink,
"Can't create an instance of renderer (error=%x)",
hres);
return FALSE;
"Can't create an instance of renderer (error=%x)",
hres);
return FALSE;
GST_DEBUG_OBJECT (sink, "Set VMR9 (%p) to windowless mode!", filter);
}
GST_DEBUG_OBJECT (sink, "Set VMR9 (%p) to windowless mode!", filter);
}
- /* We can't QI to this until _after_ we've been set to windowless mode.
+ /* We can't QI to this until _after_ we've been set to windowless mode.
* Apparently this is against the rules in COM, but that's how it is... */
hres = filter->QueryInterface (
IID_IVMRWindowlessControl9, (void **) &control);
* Apparently this is against the rules in COM, but that's how it is... */
hres = filter->QueryInterface (
IID_IVMRWindowlessControl9, (void **) &control);
HWND video_window;
public:
HWND video_window;
public:
- VMR7Support (GstDshowVideoSink *sink) :
- sink(sink),
+ VMR7Support (GstDshowVideoSink *sink) :
+ sink(sink),
filter(NULL),
control(NULL),
config(NULL)
filter(NULL),
control(NULL),
config(NULL)
hres = CoCreateInstance (CLSID_VideoMixingRenderer, NULL, CLSCTX_INPROC,
IID_IBaseFilter, (LPVOID *) &filter);
if (FAILED (hres)) {
hres = CoCreateInstance (CLSID_VideoMixingRenderer, NULL, CLSCTX_INPROC,
IID_IBaseFilter, (LPVOID *) &filter);
if (FAILED (hres)) {
- GST_ERROR_OBJECT (sink,
+ GST_ERROR_OBJECT (sink,
"Can't create an instance of renderer (error=%x)",
hres);
return FALSE;
"Can't create an instance of renderer (error=%x)",
hres);
return FALSE;
-static gboolean
-gst_dshowvideosink_create_renderer (GstDshowVideoSink *sink)
+static gboolean
+gst_dshowvideosink_create_renderer (GstDshowVideoSink *sink)
{
GST_DEBUG_OBJECT (sink, "Trying to create renderer '%s'", "EVR");
{
GST_DEBUG_OBJECT (sink, "Trying to create renderer '%s'", "EVR");
- /* Build our DirectShow FilterGraph, looking like:
+ /* Build our DirectShow FilterGraph, looking like:
*
* [ fakesrc ] -> [ sink filter ]
*
*
* [ fakesrc ] -> [ sink filter ]
*
hres = CoCreateInstance (CLSID_FilterGraph, NULL, CLSCTX_INPROC,
IID_IFilterGraph, (LPVOID *) & sink->filter_graph);
if (FAILED (hres)) {
hres = CoCreateInstance (CLSID_FilterGraph, NULL, CLSCTX_INPROC,
IID_IFilterGraph, (LPVOID *) & sink->filter_graph);
if (FAILED (hres)) {
- GST_ERROR_OBJECT (sink,
+ GST_ERROR_OBJECT (sink,
"Can't create an instance of the dshow graph manager (error=%x)", hres);
goto error;
}
"Can't create an instance of the dshow graph manager (error=%x)", hres);
goto error;
}
sink->filter_graph->AddFilter (sink->renderersupport->GetFilter(),
L"renderer");
if (FAILED (hres)) {
sink->filter_graph->AddFilter (sink->renderersupport->GetFilter(),
L"renderer");
if (FAILED (hres)) {
- GST_ERROR_OBJECT (sink,
+ GST_ERROR_OBJECT (sink,
"Can't add renderer to the graph (error=%x)", hres);
goto error;
}
"Can't add renderer to the graph (error=%x)", hres);
goto error;
}
if (sink->connected) {
IPin *sinkpin;
sink->filter_graph->Disconnect(sink->fakesrc->GetOutputPin());
if (sink->connected) {
IPin *sinkpin;
sink->filter_graph->Disconnect(sink->fakesrc->GetOutputPin());
- gst_dshow_get_pin_from_filter (sink->renderersupport->GetFilter(), PINDIR_INPUT,
+ gst_dshow_get_pin_from_filter (sink->renderersupport->GetFilter(), PINDIR_INPUT,
&sinkpin);
sink->filter_graph->Disconnect(sinkpin);
sinkpin->Release();
&sinkpin);
sink->filter_graph->Disconnect(sinkpin);
sinkpin->Release();
GST_DEBUG_OBJECT (sink, "Configuring output pin media type");
/* Now we have an AM_MEDIA_TYPE describing what we're going to send.
GST_DEBUG_OBJECT (sink, "Configuring output pin media type");
/* Now we have an AM_MEDIA_TYPE describing what we're going to send.
- * We set this on our DirectShow fakesrc's output pin.
+ * We set this on our DirectShow fakesrc's output pin.
*/
sink->fakesrc->GetOutputPin()->SetMediaType (&sink->mediatype);
GST_DEBUG_OBJECT (sink, "Configured output pin media type");
*/
sink->fakesrc->GetOutputPin()->SetMediaType (&sink->mediatype);
GST_DEBUG_OBJECT (sink, "Configured output pin media type");
GST_WARNING_OBJECT (sink, "Cannot destroy filter graph; it doesn't exist");
return TRUE;
}
GST_WARNING_OBJECT (sink, "Cannot destroy filter graph; it doesn't exist");
return TRUE;
}
-
- /* If we created a new window, send the close message and wait until
+
+ /* If we created a new window, send the close message and wait until
* it's closed in the window thread */
if (sink->is_new_window) {
SendMessage (sink->window_id, WM_CLOSE, NULL, NULL);
* it's closed in the window thread */
if (sink->is_new_window) {
SendMessage (sink->window_id, WM_CLOSE, NULL, NULL);
{
VIDEOINFOHEADER *vh = (VIDEOINFOHEADER *)mediatype->pbFormat;
{
VIDEOINFOHEADER *vh = (VIDEOINFOHEADER *)mediatype->pbFormat;
- /* TODO: Set PAR here. Based on difference between source and target RECTs?
+ /* TODO: Set PAR here. Based on difference between source and target RECTs?
* Do we want framerate? Based on AvgTimePerFrame? */
* Do we want framerate? Based on AvgTimePerFrame? */
- gst_caps_set_simple (caps,
+ gst_caps_set_simple (caps,
"width", G_TYPE_INT, vh->bmiHeader.biWidth,
"height", G_TYPE_INT, vh->bmiHeader.biHeight,
NULL);
"width", G_TYPE_INT, vh->bmiHeader.biWidth,
"height", G_TYPE_INT, vh->bmiHeader.biHeight,
NULL);
if (sink->keep_aspect_ratio) {
par_n = GST_VIDEO_INFO_PAR_N (&info);
par_d = GST_VIDEO_INFO_PAR_D (&info);
if (sink->keep_aspect_ratio) {
par_n = GST_VIDEO_INFO_PAR_N (&info);
par_d = GST_VIDEO_INFO_PAR_D (&info);
- /* To handle non-square pixels, we set the target rectangle to a
+ /* To handle non-square pixels, we set the target rectangle to a
* different size than the source rectangle.
* There might be a better way, but this seems to work. */
vi->rcTarget.bottom = height;
* different size than the source rectangle.
* There might be a better way, but this seems to work. */
vi->rcTarget.bottom = height;
/* The video window set through GstXOverlay */
HWND window_id;
/* The video window set through GstXOverlay */
HWND window_id;
/* If we created the window, it needs to be closed in ::stop() */
gboolean is_new_window;
/* If we created the window, it needs to be closed in ::stop() */
gboolean is_new_window;
GstCapturePinMediaType *gst_dshow_new_pin_mediatype (IPin * pin);
/* create a new capture media type from enum mediatype */
GstCapturePinMediaType *gst_dshow_new_pin_mediatype (IPin * pin);
/* create a new capture media type from enum mediatype */
-GstCapturePinMediaType * gst_dshow_new_pin_mediatype_from_enum_mediatypes (IPin * pin,
+GstCapturePinMediaType * gst_dshow_new_pin_mediatype_from_enum_mediatypes (IPin * pin,
IEnumMediaTypes *enum_mediatypes);
/* create a new capture media type from streamcaps */
IEnumMediaTypes *enum_mediatypes);
/* create a new capture media type from streamcaps */
-GstCapturePinMediaType *gst_dshow_new_pin_mediatype_from_streamcaps (IPin * pin,
+GstCapturePinMediaType *gst_dshow_new_pin_mediatype_from_streamcaps (IPin * pin,
gint id, IAMStreamConfig * streamcaps);
/* free the memory of all mediatypes of the input list if pin mediatype */
gint id, IAMStreamConfig * streamcaps);
/* free the memory of all mediatypes of the input list if pin mediatype */
CLSID output_majortype, CLSID output_subtype,
gchar * prefered_filter_name, IBaseFilter ** filter);
CLSID output_majortype, CLSID output_subtype,
gchar * prefered_filter_name, IBaseFilter ** filter);
-/* get the dshow device path from device friendly name.
+/* get the dshow device path from device friendly name.
If friendly name is not set, it will return the first available device */
gchar *gst_dshow_getdevice_from_devicename (const GUID * device_category,
gchar ** device_name, gint * device_index);
If friendly name is not set, it will return the first available device */
gchar *gst_dshow_getdevice_from_devicename (const GUID * device_category,
gchar ** device_name, gint * device_index);
/* GStreamer
* Copyright (C) 2007 Sebastien Moutte <sebastien@moutte.net>
*
/* GStreamer
* Copyright (C) 2007 Sebastien Moutte <sebastien@moutte.net>
*
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
/* GStreamer
* Copyright (C) 2007 Sebastien Moutte <sebastien@moutte.net>
*
/* GStreamer
* Copyright (C) 2007 Sebastien Moutte <sebastien@moutte.net>
*
- * gstdshowsrcwrapper.c:
+ * gstdshowsrcwrapper.c:
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
- The filter graph now is created via the IGraphBuilder Interface
+ The filter graph now is created via the IGraphBuilder Interface
Code added to build upstream filters, needed for USB Analog TV Tuners / DVD Maker, based on AMCap code.
by Fabrice Costa <fabricio.costa@moldeointeractive.com.ar>
*/
Code added to build upstream filters, needed for USB Analog TV Tuners / DVD Maker, based on AMCap code.
by Fabrice Costa <fabricio.costa@moldeointeractive.com.ar>
*/
/*graph builder is derived from IFilterGraph so we can assign it to the old src->filter_graph*/
src->filter_graph = (IFilterGraph*) src->graph_builder;
}
/*graph builder is derived from IFilterGraph so we can assign it to the old src->filter_graph*/
src->filter_graph = (IFilterGraph*) src->graph_builder;
}
/*adding capture graph builder to correctly create upstream filters, Analog TV, TV Tuner */
hres = CoCreateInstance(CLSID_CaptureGraphBuilder2, NULL,
/*adding capture graph builder to correctly create upstream filters, Analog TV, TV Tuner */
hres = CoCreateInstance(CLSID_CaptureGraphBuilder2, NULL,
- CLSCTX_INPROC_SERVER, IID_ICaptureGraphBuilder2,
+ CLSCTX_INPROC_SERVER, IID_ICaptureGraphBuilder2,
(LPVOID *) & src->capture_builder);
(LPVOID *) & src->capture_builder);
- if ( hres != S_OK || !src->capture_builder ) {
+ if ( hres != S_OK || !src->capture_builder ) {
GST_ERROR
("Can't create an instance of the dshow capture graph builder manager (error=0x%x)",
hres);
goto error;
GST_ERROR
("Can't create an instance of the dshow capture graph builder manager (error=0x%x)",
hres);
goto error;
src->capture_builder->SetFiltergraph(src->graph_builder);
}
src->capture_builder->SetFiltergraph(src->graph_builder);
}
/* Finding interfaces really creates the upstream filters */
hres = src->capture_builder->FindInterface(&PIN_CATEGORY_CAPTURE,
/* Finding interfaces really creates the upstream filters */
hres = src->capture_builder->FindInterface(&PIN_CATEGORY_CAPTURE,
- &MEDIATYPE_Interleaved, src->video_cap_filter,
+ &MEDIATYPE_Interleaved, src->video_cap_filter,
IID_IAMVideoCompression, (LPVOID *)&src->pVC);
IID_IAMVideoCompression, (LPVOID *)&src->pVC);
if(hres != S_OK)
{
hres = src->capture_builder->FindInterface(&PIN_CATEGORY_CAPTURE,
if(hres != S_OK)
{
hres = src->capture_builder->FindInterface(&PIN_CATEGORY_CAPTURE,
- &MEDIATYPE_Video, src->video_cap_filter,
+ &MEDIATYPE_Video, src->video_cap_filter,
IID_IAMVideoCompression, (LPVOID *)&src->pVC);
}
IID_IAMVideoCompression, (LPVOID *)&src->pVC);
}
hres = src->capture_builder->FindInterface(&PIN_CATEGORY_CAPTURE,
&MEDIATYPE_Interleaved,
src->video_cap_filter, IID_IAMStreamConfig, (LPVOID *)&src->pVSC);
hres = src->capture_builder->FindInterface(&PIN_CATEGORY_CAPTURE,
&MEDIATYPE_Interleaved,
src->video_cap_filter, IID_IAMStreamConfig, (LPVOID *)&src->pVSC);
if (pin_mediatype) {
GstCaps *mediacaps = NULL;
if (pin_mediatype) {
GstCaps *mediacaps = NULL;
- GstVideoFormat video_format =
+ GstVideoFormat video_format =
gst_dshow_guid_to_gst_video_format (pin_mediatype->mediatype);
if (video_format != GST_VIDEO_FORMAT_UNKNOWN) {
gst_dshow_guid_to_gst_video_format (pin_mediatype->mediatype);
if (video_format != GST_VIDEO_FORMAT_UNKNOWN) {
/* GStreamer
* Copyright (C) 2007 Sebastien Moutte <sebastien@moutte.net>
*
/* GStreamer
* Copyright (C) 2007 Sebastien Moutte <sebastien@moutte.net>
*
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public