dshowsrcwrapper: remove use of IGstDshowInterface
authorJulien Isorce <julien.isorce@gmail.com>
Mon, 27 Jul 2009 12:52:57 +0000 (14:52 +0200)
committerJulien Isorce <julien.isorce@gmail.com>
Mon, 27 Jul 2009 12:52:57 +0000 (14:52 +0200)
13 files changed:
sys/dshowsrcwrapper/Makefile.am
sys/dshowsrcwrapper/gstdshow.cpp
sys/dshowsrcwrapper/gstdshow.h
sys/dshowsrcwrapper/gstdshowaudiosrc.cpp
sys/dshowsrcwrapper/gstdshowaudiosrc.h
sys/dshowsrcwrapper/gstdshowfakesink.cpp
sys/dshowsrcwrapper/gstdshowfakesink.h
sys/dshowsrcwrapper/gstdshowinterface.h [deleted file]
sys/dshowsrcwrapper/gstdshowsrcwrapper.cpp
sys/dshowsrcwrapper/gstdshowvideosrc.cpp
sys/dshowsrcwrapper/gstdshowvideosrc.h
sys/dshowsrcwrapper/libgstdshow.def [deleted file]
win32/vs8/libdshowsrcwrapper.vcproj

index 74bf83e..de78c53 100755 (executable)
@@ -8,7 +8,6 @@ EXTRA_DIST = \
   gstdshowfakesink.cpp \
   gstdshowfakesink.h \
   gstdshow.h \
-  gstdshowinterface.h \
   gstdshowsrcwrapper.cpp \
   gstdshowvideosrc.cpp \
   gstdshowvideosrc.h
index ed27d63..4b09034 100755 (executable)
 #include "gstdshow.h"
 #include "gstdshowfakesink.h"
 
-CFactoryTemplate g_Templates[]=
-{
-  { 
-    L"DSHOW fake sink filter"
-    , &CLSID_DshowFakeSink
-    , CDshowFakeSink::CreateInstance
-    , NULL
-    , NULL
-  }
-};
-
-int g_cTemplates = sizeof(g_Templates)/sizeof(g_Templates[0]);
-static HINSTANCE g_hModule = NULL;
-
-extern "C" BOOL WINAPI DllEntryPoint(HINSTANCE, ULONG, LPVOID);
-BOOL APIENTRY DllMain(HANDLE hModule, DWORD dwReason, LPVOID lpReserved)
-{
-  if (!g_hModule)
-    g_hModule = (HINSTANCE)hModule;
-
-  return DllEntryPoint((HINSTANCE)(hModule), dwReason, lpReserved);
-}
-
-STDAPI DllRegisterServer()
-{
-  return AMovieDllRegisterServer2 (TRUE);
-}
-
-STDAPI DllUnregisterServer()
-{
-  return AMovieDllRegisterServer2 (FALSE);
-}
-
-HRESULT gst_dshow_register_fakefilters ()
-{
-  return DllRegisterServer();
-}
-
 void 
 gst_dshow_free_mediatype (AM_MEDIA_TYPE *pmt)
 {
index ec360b3..e71ca78 100755 (executable)
@@ -43,7 +43,7 @@ extern "C" {
 #endif
 
 /* register fake filters as COM object and as Direct Show filters in the registry */
-HRESULT gst_dshow_register_fakefilters ();
+//HRESULT gst_dshow_register_fakefilters ();
 
 /* free memory of the input pin mediatype */
 void gst_dshow_free_pin_mediatype (gpointer pt);
index c213aae..a0e2d78 100755 (executable)
@@ -95,7 +95,7 @@ static void gst_dshowaudiosrc_reset (GstAudioSrc * asrc);
 static GstCaps *gst_dshowaudiosrc_getcaps_from_streamcaps (GstDshowAudioSrc *
     src, IPin * pin, IAMStreamConfig * streamcaps);
 static gboolean gst_dshowaudiosrc_push_buffer (byte * buffer, long size,
-    byte * src_object, UINT64 start, UINT64 stop);
+    gpointer src_object, UINT64 start, UINT64 stop);
 
 static void
 gst_dshowaudiosrc_init_interfaces (GType type)
@@ -540,13 +540,8 @@ gst_dshowaudiosrc_open (GstAudioSrc * asrc)
     goto error;
   }
 
-  hres = CoCreateInstance (CLSID_DshowFakeSink, NULL, CLSCTX_INPROC,
-      IID_IBaseFilter, (LPVOID *) & src->dshow_fakesink);
-  if (hres != S_OK || !src->dshow_fakesink) {
-    GST_CAT_ERROR (dshowaudiosrc_debug,
-        "Can't create an instance of the directshow fakesink (error=%d)", hres);
-    goto error;
-  }
+  src->dshow_fakesink = new CDshowFakeSink;
+  src->dshow_fakesink->AddRef();
 
   hres = src->filter_graph->AddFilter(src->audio_cap_filter, L"capture");
   if (hres != S_OK) {
@@ -587,7 +582,6 @@ static gboolean
 gst_dshowaudiosrc_prepare (GstAudioSrc * asrc, GstRingBufferSpec * spec)
 {
   HRESULT hres;
-  IGstDshowInterface *srcinterface = NULL;
   IPin *input_pin = NULL;
   GstDshowAudioSrc *src = GST_DSHOWAUDIOSRC (asrc);
 
@@ -613,20 +607,9 @@ gst_dshowaudiosrc_prepare (GstAudioSrc * asrc, GstRingBufferSpec * spec)
       if (type) {
         pin_mediatype = (GstCapturePinMediaType *) type->data;
 
-        hres = src->dshow_fakesink->QueryInterface(IID_IGstDshowInterface, (LPVOID *) &srcinterface);
-        if (hres != S_OK || !srcinterface) {
-          GST_CAT_ERROR (dshowaudiosrc_debug,
-              "Can't get IGstDshowInterface interface from our dshow fakesink filter (error=%d)",
-              hres);
-          goto error;
-        }
-
-        srcinterface->gst_set_media_type(pin_mediatype->mediatype);
-        srcinterface->gst_set_buffer_callback(
-          (push_buffer_func) gst_dshowaudiosrc_push_buffer, (byte *) src);
-
-        if (srcinterface)
-          srcinterface->Release();
+        src->dshow_fakesink->gst_set_media_type (pin_mediatype->mediatype);
+        src->dshow_fakesink->gst_set_buffer_callback(
+          (push_buffer_func) gst_dshowaudiosrc_push_buffer, src);
 
         gst_dshow_get_pin_from_filter (src->dshow_fakesink, PINDIR_INPUT,
             &input_pin);
@@ -656,9 +639,6 @@ gst_dshowaudiosrc_prepare (GstAudioSrc * asrc, GstRingBufferSpec * spec)
   return TRUE;
 
 error:
-  if (srcinterface)
-    srcinterface->Release();
-
   return FALSE;
 }
 
@@ -844,7 +824,7 @@ gst_dshowaudiosrc_getcaps_from_streamcaps (GstDshowAudioSrc * src, IPin * pin,
 }
 
 static gboolean
-gst_dshowaudiosrc_push_buffer (byte * buffer, long size, byte * src_object,
+gst_dshowaudiosrc_push_buffer (byte * buffer, long size, gpointer src_object,
     UINT64 start, UINT64 stop)
 {
   GstDshowAudioSrc *src = GST_DSHOWAUDIOSRC (src_object);
index b814701..d5cfe6e 100755 (executable)
@@ -28,7 +28,7 @@
 #include <gst/interfaces/propertyprobe.h>
 
 #include "gstdshow.h"
-#include "gstdshowinterface.h"
+#include "gstdshowfakesink.h"
 
 G_BEGIN_DECLS
 #define GST_TYPE_DSHOWAUDIOSRC              (gst_dshowaudiosrc_get_type())
@@ -59,7 +59,7 @@ struct _GstDshowAudioSrc
   IBaseFilter *audio_cap_filter;
 
   /* dshow fakesink filter */
-  IBaseFilter *dshow_fakesink;
+  CDshowFakeSink *dshow_fakesink;
 
   /* graph manager interfaces */
   IMediaFilter *media_filter;
index afc0a5e..6c0c74d 100755 (executable)
 
 #include "gstdshowfakesink.h"
 
-
-CDshowFakeSink::CDshowFakeSink()
-  : m_hres(S_OK), CBaseRenderer(CLSID_DshowFakeSink, "DshowFakeSink", NULL, &m_hres)
-{
-  m_callback = NULL;
-}
-
-CDshowFakeSink::~CDshowFakeSink()
-{
-
-}
-
-//Object creation.
-CUnknown* WINAPI CDshowFakeSink::CreateInstance(LPUNKNOWN pUnk, HRESULT *pHr) 
-{
-       CDshowFakeSink *pNewObject = new CDshowFakeSink();
-  g_print ("CDshowFakeSink::CreateInstance\n");
-  if (pNewObject == NULL) {
-    *pHr = E_OUTOFMEMORY;
-  }
-  return pNewObject;
-} 
-
-STDMETHODIMP CDshowFakeSink::QueryInterface(REFIID riid, void **ppvObject)
-{
-  if (riid == IID_IGstDshowInterface) {
-      *ppvObject = (IGstDshowInterface*) this;
-      AddRef();
-      return S_OK;
-  }
-  else
-    return CBaseRenderer::QueryInterface (riid, ppvObject);
-}
-
-ULONG STDMETHODCALLTYPE CDshowFakeSink::AddRef()
-{
-  return CBaseRenderer::AddRef();
-}
-
-ULONG STDMETHODCALLTYPE CDshowFakeSink::Release()
+CDshowFakeSink::CDshowFakeSink() : 
+  m_hres(S_OK),
+  m_callback(NULL),
+  m_data(NULL),
+  CBaseRenderer(CLSID_DshowFakeSink, "DshowFakeSink", NULL, &m_hres)
 {
-  return CBaseRenderer::Release();
 }
 
-
 STDMETHODIMP CDshowFakeSink::gst_set_media_type (AM_MEDIA_TYPE *pmt)
 {
   m_MediaType.Set (*pmt);
   return S_OK;
 }
 
-STDMETHODIMP CDshowFakeSink::gst_set_buffer_callback (push_buffer_func push, byte *data)
+STDMETHODIMP CDshowFakeSink::gst_set_buffer_callback (push_buffer_func push, gpointer data)
 {
   m_callback = push;
   m_data = data;
   return S_OK;
 }
 
-STDMETHODIMP CDshowFakeSink::gst_push_buffer (byte *buffer, __int64 start, __int64 stop, unsigned int size, bool discount)
-{
-  return E_NOTIMPL;
-}
-
-STDMETHODIMP CDshowFakeSink::gst_flush ()
-{
-  return E_NOTIMPL;
-}
-
-STDMETHODIMP CDshowFakeSink::gst_set_sample_size(unsigned int size)
-{
-  return E_NOTIMPL;
-}
-
 HRESULT CDshowFakeSink::CheckMediaType(const CMediaType *pmt)
 {
-  VIDEOINFOHEADER *p1;
-  VIDEOINFOHEADER *p2;
-  if(pmt != NULL)
-  {
-    p1 = (VIDEOINFOHEADER *)pmt->Format();
-    p2 = (VIDEOINFOHEADER *)m_MediaType.Format();
+  if (pmt != NULL) {
     if (*pmt == m_MediaType)
       return S_OK;
   }
index 7f419b2..51291c6 100755 (executable)
  * Boston, MA 02111-1307, USA.
  */
 
-#include "gstdshowinterface.h"
+#ifndef __GST_DHOW_FAKESINK_H__
+#define __GST_DHOW_FAKESINK_H__
 
-class CDshowFakeSink :  public CBaseRenderer,
-                        public IGstDshowInterface
+#include "gstdshow.h"
+
+//{6A780808-9725-4d0b-8695-A4DD8D210773}
+static const GUID CLSID_DshowFakeSink =
+  { 0x6a780808, 0x9725, 0x4d0b, { 0x86, 0x95,  0xa4,  0xdd,  0x8d,  0x21,  0x7,  0x73 } };
+
+typedef bool (*push_buffer_func) (byte *buffer, long size, gpointer src_object, UINT64 start, UINT64 stop);
+
+class CDshowFakeSink :  public CBaseRenderer
 {
 public:
   CDshowFakeSink ();
-  virtual ~CDshowFakeSink ();
-
-  static CUnknown * WINAPI CreateInstance (LPUNKNOWN pUnk, HRESULT *pHr);
+  virtual ~CDshowFakeSink () {}
 
   virtual HRESULT CheckMediaType (const CMediaType *pmt);
   virtual HRESULT DoRenderSample (IMediaSample *pMediaSample);
   
-  STDMETHOD (QueryInterface)(REFIID riid, void **ppvObject);
-  ULONG STDMETHODCALLTYPE AddRef();
-  ULONG STDMETHODCALLTYPE Release();
   STDMETHOD (gst_set_media_type) (AM_MEDIA_TYPE *pmt);
-  STDMETHOD (gst_set_buffer_callback) (push_buffer_func push, byte *data);
-  STDMETHOD (gst_push_buffer) (byte *buffer, __int64 start, __int64 stop, unsigned int size, bool discount);
-  STDMETHOD (gst_flush) ();
-  STDMETHOD (gst_set_sample_size) (unsigned int size);
+  STDMETHOD (gst_set_buffer_callback) (push_buffer_func push, gpointer data);
 
 protected:
   HRESULT m_hres;
   CMediaType m_MediaType;
   push_buffer_func m_callback;
-  byte *m_data;
-};
\ No newline at end of file
+  gpointer m_data;
+};
+
+#endif /* __GST_DSHOW_FAKESINK_H__ */
diff --git a/sys/dshowsrcwrapper/gstdshowinterface.h b/sys/dshowsrcwrapper/gstdshowinterface.h
deleted file mode 100755 (executable)
index 68328b9..0000000
+++ /dev/null
@@ -1,163 +0,0 @@
-/* GStreamer
- * Copyright (C) 2007 Sebastien Moutte <sebastien@moutte.net>
- *
- * gstdshowinterface.h:
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-#ifndef __GST_DHOW_INTERFACE_H__
-#define __GST_DHOW_INTERFACE_H__
-
-#include "gstdshow.h"
-
-#ifdef  __cplusplus
-typedef bool (*push_buffer_func) (byte *buffer, long size, byte *src_object, UINT64 start, UINT64 stop);
-#endif
-
-/* verify that the <rpcndr.h> version is high enough to compile this file*/
-#ifndef __REQUIRED_RPCNDR_H_VERSION__
-#define __REQUIRED_RPCNDR_H_VERSION__ 440
-#endif
-
-#include "rpc.h"
-#include "rpcndr.h"
-
-#ifndef __RPCNDR_H_VERSION__
-#error this stub requires an updated version of <rpcndr.h>
-#endif // __RPCNDR_H_VERSION__
-
-#ifndef COM_NO_WINDOWS_H
-#include "windows.h"
-#include "ole2.h"
-#endif /*COM_NO_WINDOWS_H*/
-
-//{6A780808-9725-4d0b-8695-A4DD8D210773}
-static const GUID CLSID_DshowFakeSink
-  = { 0x6a780808, 0x9725, 0x4d0b, { 0x86, 0x95,  0xa4,  0xdd,  0x8d,  0x21,  0x7,  0x73 } };
-
-// {FC36764C-6CD4-4C73-900F-3F40BF3F191A}
-static const GUID IID_IGstDshowInterface = 
-  { 0xfc36764c, 0x6cd4, 0x4c73, { 0x90, 0xf, 0x3f, 0x40, 0xbf, 0x3f, 0x19, 0x1a } };
-
-#define CLSID_DSHOWFAKESINK_STRING "{6A780808-9725-4d0b-8695-A4DD8D210773}"
-
-typedef interface IGstDshowInterface IGstDshowInterface;
-
-/* header files for imported files */
-#include "oaidl.h"
-#include "ocidl.h"
-
-void __RPC_FAR * __RPC_USER MIDL_user_allocate(size_t);
-void __RPC_USER MIDL_user_free( void __RPC_FAR * ); 
-
-#ifndef __IGstDshowInterface_INTERFACE_DEFINED__
-#define __IGstDshowInterface_INTERFACE_DEFINED__
-
-#if defined(__cplusplus) && !defined(CINTERFACE)
-    
-    MIDL_INTERFACE("542C0A24-8BD1-46cb-AA57-3E46D006D2F3")
-    IGstDshowInterface : public IUnknown
-    {
-    public:
-        virtual HRESULT STDMETHODCALLTYPE gst_set_media_type( 
-            AM_MEDIA_TYPE __RPC_FAR *pmt) = 0;
-
-        virtual HRESULT STDMETHODCALLTYPE gst_set_buffer_callback( 
-            push_buffer_func push, byte *data) = 0;
-
-        virtual HRESULT STDMETHODCALLTYPE gst_push_buffer( 
-            byte *buffer, __int64 start, __int64 stop, unsigned int size, bool discount) = 0;
-        
-        virtual HRESULT STDMETHODCALLTYPE gst_flush() = 0;
-
-        virtual HRESULT STDMETHODCALLTYPE gst_set_sample_size(unsigned int size) = 0;
-    };
-    
-#else  /* C style interface */
-
-    typedef struct IGstDshowInterfaceVtbl
-    {
-        BEGIN_INTERFACE
-        
-        HRESULT ( STDMETHODCALLTYPE __RPC_FAR *QueryInterface )( 
-            IGstDshowInterface __RPC_FAR * This,
-            REFIID riid,
-            void __RPC_FAR *__RPC_FAR *ppvObject);
-        
-        ULONG ( STDMETHODCALLTYPE __RPC_FAR *AddRef )( 
-            IGstDshowInterface __RPC_FAR * This);
-        
-        ULONG ( STDMETHODCALLTYPE __RPC_FAR *Release )( 
-            IGstDshowInterface __RPC_FAR * This);
-        
-        HRESULT (STDMETHODCALLTYPE  *gst_set_media_type )( 
-            IGstDshowInterface __RPC_FAR * This,
-            AM_MEDIA_TYPE *pmt);
-
-        HRESULT (STDMETHODCALLTYPE *gst_set_buffer_callback) ( 
-            IGstDshowInterface __RPC_FAR * This,
-            byte * push, byte *data);
-
-        HRESULT (STDMETHODCALLTYPE *gst_push_buffer) ( 
-            IGstDshowInterface __RPC_FAR * This,
-            byte *buffer, __int64 start, __int64 stop,
-            unsigned int size, boolean discount);
-
-        HRESULT (STDMETHODCALLTYPE *gst_flush) ( 
-            IGstDshowInterface __RPC_FAR * This);
-        
-        HRESULT (STDMETHODCALLTYPE *gst_set_sample_size) ( 
-            IGstDshowInterface __RPC_FAR * This,
-            unsigned int size);
-
-        END_INTERFACE
-    } IGstDshowInterfaceVtbl;
-
-    interface IGstDshowInterface
-    {
-        CONST_VTBL struct IGstDshowInterfaceVtbl __RPC_FAR *lpVtbl;
-    };
-
-#define IGstDshowInterface_QueryInterface(This,riid,ppvObject) \
-    (This)->lpVtbl -> QueryInterface(This,riid,ppvObject)
-
-#define IGstDshowInterface_AddRef(This)        \
-    (This)->lpVtbl -> AddRef(This)
-
-#define IGstDshowInterface_Release(This)       \
-    (This)->lpVtbl -> Release(This)
-
-#define IGstDshowInterface_gst_set_media_type(This, mediatype) \
-    (This)->lpVtbl -> gst_set_media_type(This, mediatype)
-
-#define IGstDshowInterface_gst_set_buffer_callback(This, push, data)   \
-    (This)->lpVtbl -> gst_set_buffer_callback(This, push, data)
-
-#define IGstDshowInterface_gst_push_buffer(This, buffer, start, stop, size, discount)  \
-    (This)->lpVtbl -> gst_push_buffer(This, buffer, start, stop, size, discount)
-
-#define IGstDshowInterface_gst_flush(This)     \
-    (This)->lpVtbl -> gst_flush(This)
-
-#define IGstDshowInterface_gst_set_sample_size(This, size)     \
-    (This)->lpVtbl -> gst_set_sample_size(This, size)
-
-#endif         /* C style interface */
-
-#endif         /* __IGstDshowInterface_INTERFACE_DEFINED__ */
-
-#endif /* __GST_DSHOW_INTERFACE_H__ */
\ No newline at end of file
index 1e9a8aa..9acfc34 100755 (executable)
 #include "gstdshowaudiosrc.h"
 #include "gstdshowvideosrc.h"
 
-const GUID CLSID_GstreamerSrcFilter
-    =
-    { 0x6a780808, 0x9725, 0x4d0b, {0x86, 0x95, 0xa4, 0xdd, 0x8d, 0x21, 0x7,
-        0x73} };
-
-const GUID IID_IGstSrcInterface =
-    { 0x542c0a24, 0x8bd1, 0x46cb, {0xaa, 0x57, 0x3e, 0x46, 0xd0, 0x6, 0xd2,
-        0xf3} };
-
 static gboolean
 plugin_init (GstPlugin * plugin)
 {
-  /* register fake filters */
-  HRESULT hr = gst_dshow_register_fakefilters ();
-  if (FAILED (hr)) {
-    g_warning ("failed to register directshow fakesink filter: 0x%x\n", hr);
-    return FALSE;
-  }
-
   if (!gst_element_register (plugin, "dshowaudiosrc",
-          GST_RANK_NONE,
-          GST_TYPE_DSHOWAUDIOSRC) ||
+          GST_RANK_NONE, GST_TYPE_DSHOWAUDIOSRC) ||
       !gst_element_register (plugin, "dshowvideosrc",
           GST_RANK_NONE, GST_TYPE_DSHOWVIDEOSRC))
     return FALSE;
index 67e70d9..14654f6 100755 (executable)
@@ -111,7 +111,7 @@ static GstFlowReturn gst_dshowvideosrc_create (GstPushSrc * psrc,
 static GstCaps *gst_dshowvideosrc_getcaps_from_streamcaps (GstDshowVideoSrc *
     src, IPin * pin, IAMStreamConfig * streamcaps);
 static gboolean gst_dshowvideosrc_push_buffer (byte * buffer, long size,
-    byte * src_object, UINT64 start, UINT64 stop);
+    gpointer src_object, UINT64 start, UINT64 stop);
 
 static void
 gst_dshowvideosrc_init_interfaces (GType type)
@@ -614,14 +614,8 @@ gst_dshowvideosrc_start (GstBaseSrc * bsrc)
     goto error;
   }
 
-  hres = CoCreateInstance (CLSID_DshowFakeSink, NULL, CLSCTX_INPROC,
-      IID_IBaseFilter, (LPVOID *) & src->dshow_fakesink);
-  if (hres != S_OK || !src->dshow_fakesink) {
-    GST_CAT_ERROR (dshowvideosrc_debug,
-        "Can't create an instance of our dshow fakesink filter (error=0x%x)",
-        hres);
-    goto error;
-  }
+  src->dshow_fakesink = new CDshowFakeSink;
+  src->dshow_fakesink->AddRef();
 
   hres = src->filter_graph->AddFilter(src->video_cap_filter, L"capture");
   if (hres != S_OK) {
@@ -661,7 +655,6 @@ static gboolean
 gst_dshowvideosrc_set_caps (GstBaseSrc * bsrc, GstCaps * caps)
 {
   HRESULT hres;
-  IGstDshowInterface *srcinterface = NULL;
   IPin *input_pin = NULL;
   GstDshowVideoSrc *src = GST_DSHOWVIDEOSRC (bsrc);
   GstStructure *s = gst_caps_get_structure (caps, 0);
@@ -689,22 +682,9 @@ gst_dshowvideosrc_set_caps (GstBaseSrc * bsrc, GstCaps * caps)
       if (type) {
         pin_mediatype = (GstCapturePinMediaType *) type->data;
 
-        hres = src->dshow_fakesink->QueryInterface(
-            IID_IGstDshowInterface, (LPVOID *) &srcinterface);
-
-        if (hres != S_OK || !srcinterface) {
-          GST_CAT_ERROR (dshowvideosrc_debug,
-              "Can't get IGstDshowInterface interface from our dshow fakesink filter (error=%d)",
-              hres);
-          goto error;
-        }
-
-        srcinterface->gst_set_media_type(pin_mediatype->mediatype);
-        srcinterface->gst_set_buffer_callback(
-          (push_buffer_func) gst_dshowvideosrc_push_buffer, (byte *) src);
-
-        if (srcinterface)
-          srcinterface->Release();
+        src->dshow_fakesink->gst_set_media_type (pin_mediatype->mediatype);
+        src->dshow_fakesink->gst_set_buffer_callback(
+          (push_buffer_func) gst_dshowvideosrc_push_buffer, src);
 
         gst_dshow_get_pin_from_filter (src->dshow_fakesink, PINDIR_INPUT,
             &input_pin);
@@ -746,9 +726,6 @@ gst_dshowvideosrc_set_caps (GstBaseSrc * bsrc, GstCaps * caps)
   return TRUE;
 
 error:
-  if (srcinterface)
-    srcinterface->Release();
-
   return FALSE;
 }
 
@@ -992,7 +969,7 @@ gst_dshowvideosrc_getcaps_from_streamcaps (GstDshowVideoSrc * src, IPin * pin,
 }
 
 static gboolean
-gst_dshowvideosrc_push_buffer (byte * buffer, long size, byte * src_object,
+gst_dshowvideosrc_push_buffer (byte * buffer, long size, gpointer src_object,
     UINT64 start, UINT64 stop)
 {
   GstDshowVideoSrc *src = GST_DSHOWVIDEOSRC (src_object);
index b7bfbb1..bf94e61 100755 (executable)
@@ -28,7 +28,7 @@
 #include <gst/interfaces/propertyprobe.h>
 
 #include "gstdshow.h"
-#include "gstdshowinterface.h"
+#include "gstdshowfakesink.h"
 
 // 30323449-0000-0010-8000-00AA00389B71            MEDIASUBTYPE_I420
 DEFINE_GUID(MEDIASUBTYPE_I420, 0x30323449, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xAA, 0x00, 0x38, 0x9B, 0x71);
@@ -62,7 +62,7 @@ struct _GstDshowVideoSrc
   IBaseFilter *video_cap_filter;
 
   /* dshow sink filter */
-  IBaseFilter *dshow_fakesink;
+  CDshowFakeSink *dshow_fakesink;
 
   /* graph manager interfaces */
   IMediaFilter *media_filter;
diff --git a/sys/dshowsrcwrapper/libgstdshow.def b/sys/dshowsrcwrapper/libgstdshow.def
deleted file mode 100755 (executable)
index ee8586c..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-EXPORTS 
-       DllMain                         PRIVATE
-    DllGetClassObject   PRIVATE
-    DllCanUnloadNow     PRIVATE
-    DllRegisterServer   PRIVATE
-    DllUnregisterServer PRIVATE
-    
-       
index d18e66f..a87b860 100755 (executable)
@@ -49,7 +49,7 @@
                                Optimization="2"\r
                                InlineFunctionExpansion="1"\r
                                AdditionalIncludeDirectories="C:\msys\1.0\local\include;C:\msys\1.0\local\include\libxml2;&quot;C:\msys\1.0\local\include\glib-2.0&quot;;&quot;C:\msys\1.0\local\lib\glib-2.0\include&quot;;&quot;C:\msys\1.0\local\include\gstreamer-0.10&quot;;..\common;&quot;C:\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Samples\Multimedia\DirectShow\BaseClasses&quot;"\r
-                               PreprocessorDefinitions="NDEBUG;WIN32;_WINDOWS;_USRDLL;DSHOWSRCWRAPPER_EXPORTS;HAVE_CONFIG_H;COBJMACROS;_WIN32_DCOM;_CRT_SECURE_NO_DEPRECATE"\r
+                               PreprocessorDefinitions="NDEBUG;WIN32;_WINDOWS;_USRDLL;DSHOWSRCWRAPPER_EXPORTS;HAVE_CONFIG_H;_CRT_SECURE_NO_DEPRECATE"\r
                                StringPooling="true"\r
                                RuntimeLibrary="2"\r
                                EnableFunctionLevelLinking="true"\r
@@ -78,7 +78,7 @@
                                LinkIncremental="1"\r
                                SuppressStartupBanner="true"\r
                                AdditionalLibraryDirectories="C:\msys\1.0\local\lib;&quot;C:\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Lib&quot;;&quot;C:\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Samples\Multimedia\DirectShow\BaseClasses\XP32_RETAIL&quot;"\r
-                               ModuleDefinitionFile="..\..\sys\dshowsrcwrapper\libgstdshow.def"\r
+                               ModuleDefinitionFile=""\r
                                ProgramDatabaseFile=".\Release/libgstdshowsrcwrapper.pdb"\r
                                ImportLibrary=".\Release/libgstdshowsrcwrapper.lib"\r
                                TargetMachine="1"\r
                                Name="VCCLCompilerTool"\r
                                Optimization="0"\r
                                AdditionalIncludeDirectories="C:\msys\1.0\local\include;C:\msys\1.0\local\include\libxml2;&quot;C:\msys\1.0\local\include\glib-2.0&quot;;&quot;C:\msys\1.0\local\lib\glib-2.0\include&quot;;&quot;C:\msys\1.0\local\include\gstreamer-0.10&quot;;..\common;&quot;C:\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Samples\Multimedia\DirectShow\BaseClasses&quot;"\r
-                               PreprocessorDefinitions="_DEBUG;WIN32;_WINDOWS;_USRDLL;DSHOWSRCWRAPPER_EXPORTS;HAVE_CONFIG_H;COBJMACROS;_WIN32_DCOM;_CRT_SECURE_NO_DEPRECATE"\r
+                               PreprocessorDefinitions="_DEBUG;WIN32;_WINDOWS;_USRDLL;DSHOWSRCWRAPPER_EXPORTS;HAVE_CONFIG_H;_CRT_SECURE_NO_DEPRECATE"\r
                                MinimalRebuild="true"\r
                                BasicRuntimeChecks="3"\r
                                RuntimeLibrary="3"\r
                                LinkIncremental="2"\r
                                SuppressStartupBanner="true"\r
                                AdditionalLibraryDirectories="C:\msys\1.0\local\lib;&quot;C:\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Lib&quot;;&quot;C:\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Samples\Multimedia\DirectShow\BaseClasses\XP32_DEBUG&quot;"\r
-                               ModuleDefinitionFile="..\..\sys\dshowsrcwrapper\libgstdshow.def"\r
+                               ModuleDefinitionFile=""\r
                                GenerateDebugInformation="true"\r
                                ProgramDatabaseFile=".\Debug/libgstdshowsrcwrapper.pdb"\r
                                ImportLibrary=".\Debug/libgstdshowsrcwrapper.lib"\r
                                RelativePath="..\..\sys\dshowsrcwrapper\gstdshowvideosrc.cpp"\r
                                >\r
                        </File>\r
-                       <File\r
-                               RelativePath="..\..\sys\dshowsrcwrapper\libgstdshow.def"\r
-                               >\r
-                       </File>\r
                </Filter>\r
                <Filter\r
                        Name="Header Files"\r
                                >\r
                        </File>\r
                        <File\r
-                               RelativePath="..\..\sys\dshowsrcwrapper\gstdshowinterface.h"\r
-                               >\r
-                       </File>\r
-                       <File\r
                                RelativePath="..\..\sys\dshowsrcwrapper\gstdshowvideosrc.h"\r
                                >\r
                        </File>\r