mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-26 19:51:11 +00:00
dshowdecwrapper: Remove dependency on ATL
This fixes compiling with Visual C++ Express that doesn't include ATL. https://bugzilla.gnome.org/show_bug.cgi?id=677223
This commit is contained in:
parent
0fc55436b3
commit
96ea75d75a
5 changed files with 42 additions and 32 deletions
|
@ -869,11 +869,11 @@ gst_dshowaudiodec_setup_graph (GstDshowAudioDec * adec, GstCaps *caps)
|
|||
GstCaps *outcaps = NULL;
|
||||
AM_MEDIA_TYPE *output_mediatype = NULL;
|
||||
AM_MEDIA_TYPE *input_mediatype = NULL;
|
||||
CComPtr<IPin> output_pin = NULL;
|
||||
CComPtr<IPin> input_pin = NULL;
|
||||
IPinPtr output_pin = NULL;
|
||||
IPinPtr input_pin = NULL;
|
||||
const AudioCodecEntry *codec_entry = klass->entry;
|
||||
CComQIPtr<IBaseFilter> srcfilter;
|
||||
CComQIPtr<IBaseFilter> sinkfilter;
|
||||
IBaseFilterPtr srcfilter;
|
||||
IBaseFilterPtr sinkfilter;
|
||||
GstAudioInfo audio_info;
|
||||
|
||||
input_mediatype = dshowaudiodec_set_input_format (adec, caps);
|
||||
|
@ -972,8 +972,8 @@ end:
|
|||
static gboolean
|
||||
gst_dshowaudiodec_get_filter_settings (GstDshowAudioDec * adec)
|
||||
{
|
||||
CComPtr<IPin> output_pin;
|
||||
CComPtr<IEnumMediaTypes> enum_mediatypes;
|
||||
IPinPtr output_pin;
|
||||
IEnumMediaTypesPtr enum_mediatypes;
|
||||
HRESULT hres;
|
||||
ULONG fetched;
|
||||
BOOL ret = FALSE;
|
||||
|
@ -1018,13 +1018,13 @@ gst_dshowaudiodec_create_graph_and_filters (GstDshowAudioDec * adec)
|
|||
HRESULT hres;
|
||||
GstDshowAudioDecClass *klass =
|
||||
(GstDshowAudioDecClass *) G_OBJECT_GET_CLASS (adec);
|
||||
CComQIPtr<IBaseFilter> srcfilter;
|
||||
CComQIPtr<IBaseFilter> sinkfilter;
|
||||
IBaseFilterPtr srcfilter;
|
||||
IBaseFilterPtr sinkfilter;
|
||||
GUID insubtype = GUID_MEDIASUBTYPE_FROM_FOURCC (klass->entry->format);
|
||||
GUID outsubtype = GUID_MEDIASUBTYPE_FROM_FOURCC (WAVE_FORMAT_PCM);
|
||||
|
||||
/* create the filter graph manager object */
|
||||
hres = adec->filtergraph.CoCreateInstance (
|
||||
hres = adec->filtergraph.CreateInstance (
|
||||
CLSID_FilterGraph, NULL, CLSCTX_INPROC);
|
||||
if (FAILED (hres)) {
|
||||
GST_ELEMENT_ERROR (adec, STREAM, FAILED,
|
||||
|
@ -1112,7 +1112,7 @@ gst_dshowaudiodec_destroy_graph_and_filters (GstDshowAudioDec * adec)
|
|||
|
||||
if (adec->fakesrc) {
|
||||
if (adec->filtergraph) {
|
||||
CComQIPtr<IBaseFilter> filter = adec->fakesrc;
|
||||
IBaseFilterPtr filter = adec->fakesrc;
|
||||
adec->filtergraph->RemoveFilter(filter);
|
||||
}
|
||||
adec->fakesrc->Release();
|
||||
|
@ -1125,7 +1125,7 @@ gst_dshowaudiodec_destroy_graph_and_filters (GstDshowAudioDec * adec)
|
|||
}
|
||||
if (adec->fakesink) {
|
||||
if (adec->filtergraph) {
|
||||
CComQIPtr<IBaseFilter> filter = adec->fakesink;
|
||||
IBaseFilterPtr filter = adec->fakesink;
|
||||
adec->filtergraph->RemoveFilter(filter);
|
||||
}
|
||||
|
||||
|
@ -1163,7 +1163,7 @@ dshow_adec_register (GstPlugin * plugin)
|
|||
hr = CoInitialize(0);
|
||||
for (i = 0; i < sizeof (audio_dec_codecs) / sizeof (AudioCodecEntry); i++) {
|
||||
GType type;
|
||||
CComPtr<IBaseFilter> filter;
|
||||
IBaseFilterPtr filter;
|
||||
GUID insubtype = GUID_MEDIASUBTYPE_FROM_FOURCC (audio_dec_codecs[i].format);
|
||||
GUID outsubtype = GUID_MEDIASUBTYPE_FROM_FOURCC (WAVE_FORMAT_PCM);
|
||||
|
||||
|
|
|
@ -47,8 +47,6 @@
|
|||
#ifndef __GST_DSHOWAUDIODEC_H__
|
||||
#define __GST_DSHOWAUDIODEC_H__
|
||||
|
||||
#include <atlbase.h>
|
||||
|
||||
#include <gst/gst.h>
|
||||
#include "gstdshowutil.h"
|
||||
#include "gstdshowfakesrc.h"
|
||||
|
@ -88,11 +86,11 @@ struct _GstDshowAudioDec
|
|||
FakeSrc *fakesrc;
|
||||
AudioFakeSink *fakesink;
|
||||
|
||||
CComPtr<IBaseFilter> decfilter;
|
||||
IBaseFilterPtr decfilter;
|
||||
|
||||
/* graph manager interfaces */
|
||||
CComPtr<IMediaFilter> mediafilter;
|
||||
CComPtr<IFilterGraph> filtergraph;
|
||||
IMediaFilterPtr mediafilter;
|
||||
IFilterGraphPtr filtergraph;
|
||||
|
||||
/* true when dshow graph is setup */
|
||||
gboolean setup;
|
||||
|
|
|
@ -19,18 +19,19 @@
|
|||
* Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#include <atlbase.h>
|
||||
#include <dmodshow.h>
|
||||
#include <dmoreg.h>
|
||||
|
||||
#include "gstdshowutil.h"
|
||||
#include "gstdshowfakesrc.h"
|
||||
|
||||
_COM_SMARTPTR_TYPEDEF(IDMOWrapperFilter, __uuidof(IDMOWrapperFilter));
|
||||
|
||||
IPin *
|
||||
gst_dshow_get_pin_from_filter (IBaseFilter *filter, PIN_DIRECTION pindir)
|
||||
{
|
||||
CComPtr<IEnumPins> enumpins;
|
||||
CComPtr<IPin> pin;
|
||||
IEnumPinsPtr enumpins;
|
||||
IPinPtr pin;
|
||||
HRESULT hres;
|
||||
|
||||
hres = filter->EnumPins (&enumpins);
|
||||
|
@ -59,9 +60,9 @@ gst_dshow_find_filter(CLSID input_majortype, CLSID input_subtype,
|
|||
HRESULT hres;
|
||||
GUID inTypes[2];
|
||||
GUID outTypes[2];
|
||||
CComPtr<IFilterMapper2> mapper;
|
||||
CComPtr<IEnumMoniker> enum_moniker;
|
||||
CComPtr<IMoniker> moniker;
|
||||
IFilterMapper2Ptr mapper;
|
||||
IEnumMonikerPtr enum_moniker;
|
||||
IMonikerPtr moniker;
|
||||
ULONG fetched;
|
||||
IBaseFilter *filter;
|
||||
|
||||
|
@ -73,7 +74,7 @@ gst_dshow_find_filter(CLSID input_majortype, CLSID input_subtype,
|
|||
/* If the filter is a DMO, we need to do this a bit differently */
|
||||
if (preferred_filters->dmo_category)
|
||||
{
|
||||
CComPtr<IDMOWrapperFilter> wrapper;
|
||||
IDMOWrapperFilterPtr wrapper;
|
||||
|
||||
hres = CoCreateInstance (CLSID_DMOWrapperFilter, NULL,
|
||||
CLSCTX_INPROC,
|
||||
|
|
|
@ -24,6 +24,8 @@
|
|||
#define _GST_DSHOW_UTIL_H_
|
||||
|
||||
#include <windows.h>
|
||||
#include <tchar.h>
|
||||
#include <comdef.h>
|
||||
#include <objbase.h>
|
||||
#include <dshow.h>
|
||||
#include <Rpc.h>
|
||||
|
@ -32,6 +34,16 @@
|
|||
|
||||
#include <glib.h>
|
||||
|
||||
_COM_SMARTPTR_TYPEDEF(IBaseFilter, __uuidof(IBaseFilter));
|
||||
_COM_SMARTPTR_TYPEDEF(IFilterGraph, __uuidof(IFilterGraph));
|
||||
_COM_SMARTPTR_TYPEDEF(IFilterMapper2, __uuidof(IFilterMapper2));
|
||||
_COM_SMARTPTR_TYPEDEF(IEnumMediaTypes, __uuidof(IEnumMediaTypes));
|
||||
_COM_SMARTPTR_TYPEDEF(IEnumMoniker, __uuidof(IEnumMoniker));
|
||||
_COM_SMARTPTR_TYPEDEF(IEnumPins, __uuidof(IEnumPins));
|
||||
_COM_SMARTPTR_TYPEDEF(IMediaFilter, __uuidof(IMediaFilter));
|
||||
_COM_SMARTPTR_TYPEDEF(IMoniker, __uuidof(IMoniker));
|
||||
_COM_SMARTPTR_TYPEDEF(IPin, __uuidof(IPin));
|
||||
|
||||
typedef struct {
|
||||
const GUID *filter_guid; /* The filter GUID, or DMO GUID */
|
||||
const GUID *dmo_category; /* If non-NULL, the filter is a DMO of this
|
||||
|
|
|
@ -47,7 +47,6 @@
|
|||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#include <atlbase.h>
|
||||
#include <dmoreg.h>
|
||||
#include <wmcodecdsp.h>
|
||||
|
||||
|
@ -593,8 +592,8 @@ gst_dshowvideodec_sink_setcaps (GstPad * pad, GstCaps * caps)
|
|||
GstCaps *caps_out = NULL;
|
||||
AM_MEDIA_TYPE output_mediatype, input_mediatype;
|
||||
VIDEOINFOHEADER *input_vheader = NULL, *output_vheader = NULL;
|
||||
CComPtr<IPin> output_pin;
|
||||
CComPtr<IPin> input_pin;
|
||||
IPinPtr output_pin;
|
||||
IPinPtr input_pin;
|
||||
IBaseFilter *srcfilter = NULL;
|
||||
IBaseFilter *sinkfilter = NULL;
|
||||
const GValue *fps, *par;
|
||||
|
@ -968,8 +967,8 @@ gst_dshowvideodec_src_getcaps (GstPad * pad)
|
|||
vdec->srccaps = gst_caps_new_empty ();
|
||||
|
||||
if (vdec->decfilter) {
|
||||
CComPtr<IPin> output_pin;
|
||||
CComPtr<IEnumMediaTypes> enum_mediatypes;
|
||||
IPinPtr output_pin;
|
||||
IEnumMediaTypesPtr enum_mediatypes;
|
||||
HRESULT hres;
|
||||
ULONG fetched;
|
||||
|
||||
|
@ -1058,8 +1057,8 @@ static gboolean
|
|||
gst_dshowvideodec_get_filter_output_format (GstDshowVideoDec * vdec,
|
||||
const GUID subtype, VIDEOINFOHEADER ** format, guint * size)
|
||||
{
|
||||
CComPtr<IPin> output_pin;
|
||||
CComPtr<IEnumMediaTypes> enum_mediatypes;
|
||||
IPinPtr output_pin;
|
||||
IEnumMediaTypesPtr enum_mediatypes;
|
||||
HRESULT hres;
|
||||
ULONG fetched;
|
||||
BOOL ret = FALSE;
|
||||
|
@ -1304,7 +1303,7 @@ dshow_vdec_register (GstPlugin * plugin)
|
|||
|
||||
for (i = 0; i < sizeof (video_dec_codecs) / sizeof (VideoCodecEntry); i++) {
|
||||
GType type;
|
||||
CComPtr<IBaseFilter> filter;
|
||||
IBaseFilterPtr filter;
|
||||
guint rank = GST_RANK_MARGINAL;
|
||||
|
||||
filter = gst_dshow_find_filter (
|
||||
|
|
Loading…
Reference in a new issue