]> git.sesse.net Git - vlc/blobdiff - modules/access/dshow/filter.h
DShow: update Copyright years
[vlc] / modules / access / dshow / filter.h
index 1ea95f5f8c9794e56da549292c245fe3cdb0abbc..4a6c3ab2c9389b3cb429195bbb1041e423142469 100644 (file)
@@ -1,10 +1,10 @@
 /*****************************************************************************
  * filter.h : DirectShow access module for vlc
  *****************************************************************************
- * Copyright (C) 2002 VideoLAN
- * $Id: filter.h,v 1.1 2003/08/24 11:17:39 gbazin Exp $
+ * Copyright (C) 2002-2004, 2008 the VideoLAN team
+ * $Id$
  *
- * Author: Gildas Bazin <gbazin@netcourrier.com>
+ * Author: Gildas Bazin <gbazin@videolan.org>
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -18,7 +18,7 @@
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
  *****************************************************************************/
 
 /*****************************************************************************
 #include <deque>
 using namespace std;
 
+#ifndef _MSC_VER
+#   include <wtypes.h>
+#   include <unknwn.h>
+#   include <ole2.h>
+#   include <limits.h>
+#   ifdef _WINGDI_
+#      undef _WINGDI_
+#   endif
+#   define _WINGDI_ 1
+#   define AM_NOVTABLE
+#   define _OBJBASE_H_
+#   undef _X86_
+#   ifndef _I64_MAX
+#     define _I64_MAX LONG_LONG_MAX
+#   endif
+#   define LONGLONG long long
+#endif
+
+#include <dshow.h>
+
+extern const GUID MEDIASUBTYPE_I420;
+extern const GUID MEDIASUBTYPE_PREVIEW_VIDEO;
+
 typedef struct VLCMediaSample
 {
     IMediaSample *p_sample;
@@ -42,24 +65,34 @@ void WINAPI FreeMediaType( AM_MEDIA_TYPE& mt );
 HRESULT WINAPI CopyMediaType( AM_MEDIA_TYPE *pmtTarget,
                               const AM_MEDIA_TYPE *pmtSource );
 
+int GetFourCCFromMediaType(const AM_MEDIA_TYPE &media_type);
+
 /****************************************************************************
  * Declaration of our dummy directshow filter pin class
  ****************************************************************************/
 class CapturePin: public IPin, public IMemInputPin
 {
-    input_thread_t * p_input;
+    friend class CaptureEnumMediaTypes;
 
-    CaptureFilter *p_filter;
+    vlc_object_t *p_input;
+    access_sys_t *p_sys;
+    CaptureFilter  *p_filter;
 
     IPin *p_connected_pin;
-    AM_MEDIA_TYPE media_type;
+
+    AM_MEDIA_TYPE *media_types;
+    size_t media_type_count;
+
+    AM_MEDIA_TYPE cx_media_type;
 
     deque<VLCMediaSample> samples_queue;
 
-    int i_ref;
+    long i_ref;
 
   public:
-    CapturePin( input_thread_t * _p_input, CaptureFilter *_p_filter );
+    CapturePin( vlc_object_t *_p_input, access_sys_t *p_sys,
+                CaptureFilter *_p_filter,
+                AM_MEDIA_TYPE *mt, size_t mt_count );
     virtual ~CapturePin();
 
     /* IUnknown methods */
@@ -98,7 +131,9 @@ class CapturePin: public IPin, public IMemInputPin
 
     /* Custom methods */
     HRESULT CustomGetSample( VLCMediaSample * );
-    AM_MEDIA_TYPE CustomGetMediaType();
+    HRESULT CustomGetSamples( deque<VLCMediaSample> &external_queue );
+
+    AM_MEDIA_TYPE &CustomGetMediaType();
 };
 
 /****************************************************************************
@@ -106,14 +141,19 @@ class CapturePin: public IPin, public IMemInputPin
  ****************************************************************************/
 class CaptureFilter : public IBaseFilter
 {
-    input_thread_t * p_input;
-    CapturePin *p_pin;
-    IFilterGraph * p_graph;
+    friend class CapturePin;
 
-    int i_ref;
+    vlc_object_t   *p_input;
+    CapturePin     *p_pin;
+    IFilterGraph   *p_graph;
+    //AM_MEDIA_TYPE  media_type;
+    FILTER_STATE   state;
+
+    long i_ref;
 
   public:
-    CaptureFilter( input_thread_t * _p_input );
+    CaptureFilter( vlc_object_t *_p_input, access_sys_t *p_sys,
+                   AM_MEDIA_TYPE *mt, size_t mt_count );
     virtual ~CaptureFilter();
 
     /* IUnknown methods */
@@ -148,14 +188,14 @@ class CaptureFilter : public IBaseFilter
  ****************************************************************************/
 class CaptureEnumPins : public IEnumPins
 {
-    input_thread_t * p_input;
-    int i_position;
-    CaptureFilter *p_filter;
+    vlc_object_t *p_input;
+    CaptureFilter  *p_filter;
 
-    int i_ref;
+    int i_position;
+    long i_ref;
 
 public:
-    CaptureEnumPins( input_thread_t * _p_input, CaptureFilter *_p_filter,
+    CaptureEnumPins( vlc_object_t *_p_input, CaptureFilter *_p_filter,
                      CaptureEnumPins *pEnumPins );
     virtual ~CaptureEnumPins();
 
@@ -176,14 +216,15 @@ public:
  ****************************************************************************/
 class CaptureEnumMediaTypes : public IEnumMediaTypes
 {
-    input_thread_t * p_input;
-    int i_position;
-    CapturePin *p_pin;
+    vlc_object_t *p_input;
+    CapturePin     *p_pin;
+    AM_MEDIA_TYPE cx_media_type;
 
-    int i_ref;
+    size_t i_position;
+    long i_ref;
 
 public:
-    CaptureEnumMediaTypes( input_thread_t * _p_input, CapturePin *_p_pin,
+    CaptureEnumMediaTypes( vlc_object_t *_p_input, CapturePin *_p_pin,
                            CaptureEnumMediaTypes *pEnumMediaTypes );
 
     virtual ~CaptureEnumMediaTypes();