summaryrefslogtreecommitdiffstats
path: root/sys/dshowdecwrapper/gstdshowaudiodec.h
diff options
context:
space:
mode:
authorMichael Smith <msmith@xiph.org>2008-09-10 23:15:11 +0000
committerMichael Smith <msmith@xiph.org>2008-09-10 23:15:11 +0000
commit007478f09c8c10a24b473d6ac8eef1929ce25ca0 (patch)
tree7cd3ed7569f937c69df398d48e72eefe7a7753a2 /sys/dshowdecwrapper/gstdshowaudiodec.h
parent61dee512910cd2c9e407cc0679a492cc57333194 (diff)
downloadgst-plugins-bad-007478f09c8c10a24b473d6ac8eef1929ce25ca0.tar.gz
gst-plugins-bad-007478f09c8c10a24b473d6ac8eef1929ce25ca0.tar.bz2
gst-plugins-bad-007478f09c8c10a24b473d6ac8eef1929ce25ca0.zip
sys/dshowdecwrapper/: Major rewrite of dshowdecwrapper. Converts code to
Original commit message from CVS: * sys/dshowdecwrapper/Makefile.am: * sys/dshowdecwrapper/gstdshowaudiodec.c: * sys/dshowdecwrapper/gstdshowaudiodec.cpp: * sys/dshowdecwrapper/gstdshowaudiodec.h: * sys/dshowdecwrapper/gstdshowdecwrapper.c: * sys/dshowdecwrapper/gstdshowdecwrapper.cpp: * sys/dshowdecwrapper/gstdshowdecwrapper.h: * sys/dshowdecwrapper/gstdshowfakesrc.cpp: * sys/dshowdecwrapper/gstdshowfakesrc.h: * sys/dshowdecwrapper/gstdshowutil.cpp: * sys/dshowdecwrapper/gstdshowutil.h: * sys/dshowdecwrapper/gstdshowvideodec.c: * sys/dshowdecwrapper/gstdshowvideodec.cpp: * sys/dshowdecwrapper/gstdshowvideodec.h: Major rewrite of dshowdecwrapper. Converts code to C++, moves to direct use of DirectShow base classes, make a lot of code clearer, simplify, etc. Fix decode of MP3 on Vista by working around an apparent bug in the decoder.
Diffstat (limited to 'sys/dshowdecwrapper/gstdshowaudiodec.h')
-rw-r--r--sys/dshowdecwrapper/gstdshowaudiodec.h56
1 files changed, 48 insertions, 8 deletions
diff --git a/sys/dshowdecwrapper/gstdshowaudiodec.h b/sys/dshowdecwrapper/gstdshowaudiodec.h
index 732e636d..6301b31f 100644
--- a/sys/dshowdecwrapper/gstdshowaudiodec.h
+++ b/sys/dshowdecwrapper/gstdshowaudiodec.h
@@ -47,11 +47,21 @@
#ifndef __GST_DSHOWAUDIODEC_H__
#define __GST_DSHOWAUDIODEC_H__
+#include <atlbase.h>
+
#include <gst/gst.h>
-#include "gstdshowdecwrapper.h"
+#include "gstdshowutil.h"
+#include "gstdshowfakesrc.h"
G_BEGIN_DECLS
+typedef struct {
+ gchar *element_name; /* The gst element factory name */
+ gchar *element_longname; /* Description string for element */
+ gint32 format; /* WAVEFORMATEX format */
+ gchar *sinkcaps; /* GStreamer caps of input format */
+} AudioCodecEntry;
+
#define GST_TYPE_DSHOWAUDIODEC (gst_dshowaudiodec_get_type())
#define GST_DSHOWAUDIODEC(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_DSHOWAUDIODEC,GstDshowAudioDec))
#define GST_DSHOWAUDIODEC_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_DSHOWAUDIODEC,GstDshowAudioDecClass))
@@ -61,6 +71,8 @@ G_BEGIN_DECLS
typedef struct _GstDshowAudioDec GstDshowAudioDec;
typedef struct _GstDshowAudioDecClass GstDshowAudioDecClass;
+class AudioFakeSink;
+
struct _GstDshowAudioDec
{
GstElement element;
@@ -72,14 +84,14 @@ struct _GstDshowAudioDec
GstFlowReturn last_ret;
/* filters interfaces*/
- IBaseFilter *srcfilter;
- IGstDshowInterface *gstdshowsrcfilter;
- IBaseFilter *decfilter;
- IBaseFilter *sinkfilter;
+ FakeSrc *fakesrc;
+ AudioFakeSink *fakesink;
+
+ CComPtr<IBaseFilter> decfilter;
/* graph manager interfaces */
- IMediaFilter *mediafilter;
- IFilterGraph *filtergraph;
+ CComPtr<IMediaFilter> mediafilter;
+ CComPtr<IFilterGraph> filtergraph;
/* true when dshow graph is setup */
gboolean setup;
@@ -105,11 +117,39 @@ struct _GstDshowAudioDec
struct _GstDshowAudioDecClass
{
GstElementClass parent_class;
- const CodecEntry *entry;
+ const AudioCodecEntry *entry;
};
gboolean dshow_adec_register (GstPlugin * plugin);
+const GUID CLSID_AudioFakeSink =
+{ 0x3867f537, 0x3e3d, 0x44da,
+ { 0xbb, 0xf2, 0x02, 0x48, 0x7b, 0xb0, 0xbc, 0xc4} };
+
+class AudioFakeSink : public CBaseRenderer
+{
+public:
+ AudioFakeSink(GstDshowAudioDec *dec) :
+ m_hres(S_OK),
+ CBaseRenderer(CLSID_AudioFakeSink, L"AudioFakeSink", NULL, &m_hres),
+ mDec(dec)
+ {};
+ virtual ~AudioFakeSink() {};
+
+ HRESULT DoRenderSample(IMediaSample *pMediaSample);
+ HRESULT CheckMediaType(const CMediaType *pmt);
+ HRESULT SetMediaType (AM_MEDIA_TYPE *pmt)
+ {
+ m_MediaType.Set (*pmt);
+ return S_OK;
+ }
+
+protected:
+ HRESULT m_hres;
+ CMediaType m_MediaType;
+ GstDshowAudioDec *mDec;
+};
+
G_END_DECLS
#endif /* __GST_DSHOWAUDIODEC_H__ */