From 1ea92621d7d48c9cf11f386d52fcdfe46226257d Mon Sep 17 00:00:00 2001
From: basos g <noxelia 4t gmail d0t c0m>
Date: Thu, 2 Apr 2009 15:46:23 +0000
Subject: [PATCH 19/19] ADD Dshow Analog Video Device Standart Selection

Added a new string list configuration option to adjust the
analog video standart (PALX, NTSCX, ... ) on analog devices.
It is a dynamic list that is populated after reading the
capabilites of the corresponding device

We include the strmiids library that defines most of the symbols
used as mingw has progressed. Only 3 symbols are declared in the plugin
---
 configure.ac                    |    2 +-
 modules/access/dshow/dshow.cpp  |  219 +++++++++++++++++++++++++++++++++++++--
 modules/access/dshow/filter.cpp |  129 +----------------------
 3 files changed, 215 insertions(+), 135 deletions(-)

diff --git a/configure.ac b/configure.ac
index 82c0186..3e3382c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2223,7 +2223,7 @@ then
       AC_CHECK_HEADERS(dshow.h,
       [ VLC_ADD_PLUGIN([dshow])
         VLC_ADD_CXXFLAGS([dshow],[])
-        VLC_ADD_LIBS([dshow],[-lole32 -loleaut32 -luuid]) ])
+        VLC_ADD_LIBS([dshow],[-lstrmiids -lole32 -loleaut32 -luuid]) ])
     AC_LANG_POP(C++)
   fi
 fi
diff --git a/modules/access/dshow/dshow.cpp b/modules/access/dshow/dshow.cpp
index 68086f1..3d216b4 100644
--- a/modules/access/dshow/dshow.cpp
+++ b/modules/access/dshow/dshow.cpp
@@ -66,6 +66,8 @@ static int FindDevicesCallback( vlc_object_t *, char const *,
                                 vlc_value_t, vlc_value_t, void * );
 static int ConfigDevicesCallback( vlc_object_t *, char const *,
                                   vlc_value_t, vlc_value_t, void * );
+static int UpdateVideoStdsCallback( vlc_object_t *, char const *,
+                                  vlc_value_t, vlc_value_t, void * );
 
 static void ShowPropertyPage( IUnknown * );
 static void ShowDeviceProperties( vlc_object_t *, ICaptureGraphBuilder2 *,
@@ -95,6 +97,8 @@ static const char *const ppsz_amtuner_mode_text[] = { N_("Default"),
                                           N_("FM radio"),
                                           N_("AM radio"),
                                           N_("DSS") };
+static const char *const ppsz_vstd[] = { "None" };
+static const char *const ppsz_vdev_slaves[] = { "dshow-vstd" };
 
 #define CACHING_TEXT N_("Caching value in ms")
 #define CACHING_LONGTEXT N_( \
@@ -123,6 +127,9 @@ static const char *const ppsz_amtuner_mode_text[] = { N_("Default"),
 #define FPS_LONGTEXT N_( \
     "Force the DirectShow video input to use a specific frame rate" \
     "(eg. 0 means default, 25, 29.97, 50, 59.94, etc.)")
+#define VSTD_TEXT N_("Analog Video Standart")
+#define VSTD_LONGTEXT N_( \
+    "Define the video standart used to interpret analog signal (on supported devices)")
 #define CONFIG_TEXT N_("Device properties")
 #define CONFIG_LONGTEXT N_( \
     "Show the properties dialog of the selected device before starting the " \
@@ -183,6 +190,7 @@ static void AccessClose( vlc_object_t * );
 static int  DemuxOpen  ( vlc_object_t * );
 static void DemuxClose ( vlc_object_t * );
 
+
 vlc_module_begin ()
     set_shortname( N_("DirectShow") )
     set_description( N_("DirectShow input") )
@@ -195,6 +203,7 @@ vlc_module_begin ()
         change_string_list( ppsz_vdev, ppsz_vdev_text, FindDevicesCallback )
         change_action_add( FindDevicesCallback, N_("Refresh list") )
         change_action_add( ConfigDevicesCallback, N_("Configure") )
+        change_slave_list( ppsz_vdev_slaves )
 
     add_string( "dshow-adev", NULL, NULL, ADEV_TEXT, ADEV_LONGTEXT, false)
         change_string_list( ppsz_adev, ppsz_adev_text, FindDevicesCallback )
@@ -205,6 +214,9 @@ vlc_module_begin ()
 
     add_string( "dshow-chroma", NULL, NULL, CHROMA_TEXT, CHROMA_LONGTEXT, true )
 
+    add_string( "dshow-vstd", NULL, NULL, VSTD_TEXT, VSTD_LONGTEXT, true )
+        change_string_list( ppsz_vstd, NULL, UpdateVideoStdsCallback )
+
     add_float( "dshow-fps", 0.0f, NULL, FPS_TEXT, FPS_LONGTEXT, true )
 
     add_bool( "dshow-config", false, NULL, CONFIG_TEXT, CONFIG_LONGTEXT, true )
@@ -280,6 +292,56 @@ typedef struct dshow_stream_t
     deque<VLCMediaSample> samples_queue;
 } dshow_stream_t;
 
+struct analog_video_std_mapping_t
+{
+    const char*   psz_string ;
+    LONG    lCode ;
+} analog_video_std_mappings[] =
+{
+    { "None",        0x00000000 },
+    { "NTSC_M",      0x00000001 },
+    { "NTSC_M_J",    0x00000002 },
+    { "NTSC_433",    0x00000004 },
+    { "PAL_B",       0x00000010 },
+    { "PAL_D",       0x00000020 },
+    { "PAL_H",       0x00000080 },
+    { "PAL_I",       0x00000100 },
+    { "PAL_M",       0x00000200 },
+    { "PAL_N",       0x00000400 },
+    { "PAL_60",      0x00000800 },
+    { "SECAM_B",     0x00001000 },
+    { "SECAM_D",     0x00002000 },
+    { "SECAM_G",     0x00004000 },
+    { "SECAM_H",     0x00008000 },
+    { "SECAM_K",     0x00010000 },
+    { "SECAM_K1",    0x00020000 },
+    { "SECAM_L",     0x00040000 },
+    { "SECAM_L1",    0x00080000 },
+    { "PAL_N_COMBO", 0x00100000 }
+} ;
+
+static const char* AnalogVideoStd_GetNextString( LONG *plCodeMask )
+{
+    for ( int i = 1; i < sizeof( analog_video_std_mappings ) / sizeof( struct analog_video_std_mapping_t ) ; i++ )
+        if ( *plCodeMask & analog_video_std_mappings[i].lCode ==  analog_video_std_mappings[i].lCode )
+        {
+            /* mask out found code */
+            *plCodeMask = *plCodeMask & ~analog_video_std_mappings[i].lCode ;
+            return analog_video_std_mappings[i].psz_string ;
+        }
+    return NULL ;
+}
+
+static LONG AnalogVideoStd_GetCode( const char* psz_string )
+{
+    for ( int i = 0; i < sizeof( analog_video_std_mappings ) / sizeof( struct analog_video_std_mapping_t ) ; i++ )
+        if ( !strcasecmp( psz_string, analog_video_std_mappings[i].psz_string ) )
+        {
+            return analog_video_std_mappings[i].lCode ;
+        }
+    return -1L ;
+}
+
 /*****************************************************************************
  * DirectShow utility functions
  *****************************************************************************/
@@ -427,6 +489,7 @@ static int CommonOpen( vlc_object_t *p_this, access_sys_t *p_sys,
     free( val.psz_string );
 
     var_Create( p_this, "dshow-fps", VLC_VAR_FLOAT | VLC_VAR_DOINHERIT );
+    var_Create( p_this, "dshow-vstd", VLC_VAR_STRING | VLC_VAR_DOINHERIT ) ;
     var_Create( p_this, "dshow-tuner-channel",
                 VLC_VAR_INTEGER | VLC_VAR_DOINHERIT );
     var_Create( p_this, "dshow-tuner-country",
@@ -993,6 +1056,40 @@ static int OpenDevice( vlc_object_t *p_this, access_sys_t *p_sys,
 
     AM_MEDIA_TYPE *mt = NULL;
 
+    if ( !b_audio )
+    {
+        /* Set the AnalogVideo Standard ( if present and if applicable ) */
+        char* psz_vstd =
+            var_GetString( p_this, "dshow-vstd" ) ;
+        LONG lVideoStd = 0L ;
+        if ( psz_vstd )
+            lVideoStd = AnalogVideoStd_GetCode( psz_vstd ) ;
+        if ( lVideoStd < 0 )
+        {
+            msg_Warn( p_this, "Invalid analog video standart: %s. Skipping it.", psz_vstd ) ;
+            lVideoStd = 0L ;
+        }
+        if ( lVideoStd )
+        {
+            /*Get the AnalogVideoDecoder Interface */
+            IAMAnalogVideoDecoder *pAVD;
+            if( SUCCEEDED( p_device_filter->QueryInterface( IID_IAMAnalogVideoDecoder,
+                                                (void **)&pAVD )) )
+            {
+                if (FAILED( pAVD->put_TVFormat( lVideoStd ) ) )
+                {
+                    msg_Err( p_this, "Could not set analog video standart %s for device %s (is it supported?)", psz_vstd, devicename.c_str() ) ;
+                    /* force abort of device open */
+                    media_count = 0 ;
+                }
+                pAVD->Release() ;
+            }
+            else
+                msg_Warn( p_this, "Trying to set an analog video standart on a digital or unsupported device (%s)", devicename.c_str() );
+        }
+        free( psz_vstd ) ;
+    } //end if b_audio
+
     if( media_count > 0 )
     {
         mt = (AM_MEDIA_TYPE *)CoTaskMemAlloc(sizeof(AM_MEDIA_TYPE) * media_count);
@@ -1291,7 +1388,7 @@ static size_t EnumDeviceCaps( vlc_object_t *p_this, IBaseFilter *p_filter,
 
         if( S_OK == p_output_pin->QueryPinInfo( &info ) )
         {
-            msg_Dbg( p_this, "EnumDeviceCaps: %s pin: %S",
+            msg_Dbg( p_this, "EnumDeviceCaps: %s pin: %s",
                      info.dir == PINDIR_INPUT ? "input" : "output",
                      info.achName );
             if( info.pFilter ) info.pFilter->Release();
@@ -1314,7 +1411,7 @@ static size_t EnumDeviceCaps( vlc_object_t *p_this, IBaseFilter *p_filter,
                 p_output_pin->Release();
                 continue;
             }
-            msg_Dbg( p_this, "EnumDeviceCaps: trying pin %S", info.achName );
+            msg_Dbg( p_this, "EnumDeviceCaps: trying pin %s", info.achName );
         }
 
         AM_MEDIA_TYPE *p_mt;
@@ -2008,14 +2105,13 @@ static int ConfigDevicesCallback( vlc_object_t *p_this, char const *psz_name,
     module_config_t *p_item;
     bool b_audio = false;
 
-    /* Initialize OLE/COM */
-    CoInitialize( 0 );
-
     p_item = config_FindConfig( p_this, psz_name );
     if( !p_item ) return VLC_SUCCESS;
-
     if( !strcmp( psz_name, "dshow-adev" ) ) b_audio = true;
 
+    /* Initialize OLE/COM */
+    CoInitialize( 0 );
+
     string devicename;
 
     if( newval.psz_string && *newval.psz_string )
@@ -2029,7 +2125,12 @@ static int ConfigDevicesCallback( vlc_object_t *p_this, char const *psz_name,
 
         /* Enumerate devices */
         FindCaptureDevice( p_this, NULL, &list_devices, b_audio );
-        if( !list_devices.size() ) return VLC_EGENERIC;
+        if( !list_devices.size() )
+        {
+            /* Uninitialize OLE/COM */
+            CoUninitialize();
+            return VLC_EGENERIC;
+        }
         devicename = *list_devices.begin();
     }
 
@@ -2044,6 +2145,81 @@ static int ConfigDevicesCallback( vlc_object_t *p_this, char const *psz_name,
     {
         /* Uninitialize OLE/COM */
         CoUninitialize();
+        msg_Err( p_this, "didn't find device: %s", devicename.c_str() );
+        return VLC_EGENERIC;
+    }
+
+    /* Uninitialize OLE/COM */
+    CoUninitialize();
+
+    return VLC_SUCCESS;
+}
+
+static int UpdateVideoStdsCallback( vlc_object_t *p_this, char const *psz_name,
+                               vlc_value_t newval, vlc_value_t oldval, void * )
+{
+    module_config_t *p_item;
+
+    msg_Dbg( p_this, "Updating Analog video standarts list" );
+
+    p_item = config_FindConfig( p_this, psz_name );
+    if( !p_item ) return VLC_ENOOBJ;
+
+    /* Initialize OLE/COM */
+    CoInitialize( 0 );
+
+    string devicename;
+
+    char* psz_vdev =
+        config_GetPsz( p_this, "dshow-vdev" );
+
+    if( psz_vdev && *psz_vdev )
+    {
+        devicename = psz_vdev;
+        free( psz_vdev );
+    }
+    else
+    {
+        /* If no device name was specified, pick the 1st one */
+        list<string> list_devices;
+
+        /* Enumerate devices */
+        FindCaptureDevice( p_this, NULL, &list_devices, false /*video devices*/ );
+        if( !list_devices.size() )
+        {
+            /* Uninitialize OLE/COM */
+            CoUninitialize();
+            return VLC_EGENERIC;
+        }
+        devicename = *list_devices.begin();
+    }
+
+    /* Get selected (or default) device filter */
+    IBaseFilter *p_device_filter =
+        FindCaptureDevice( p_this, &devicename, NULL, false /*video devices*/ );
+    LONG lVideoStd = 0L;
+    if( p_device_filter )
+    {
+        /*Get the AnalogVideoDecoder Interface */
+        IAMAnalogVideoDecoder *pAVD;
+        if( SUCCEEDED( p_device_filter->QueryInterface( IID_IAMAnalogVideoDecoder,
+                                            (void **)&pAVD )) )
+        {
+            if (FAILED( pAVD->get_TVFormat( &lVideoStd ) ) )
+            {
+                lVideoStd = 0L;
+                msg_Warn( p_this, "could not get analog standarts for device %s", devicename.c_str() ) ;
+            }
+            else
+                msg_Dbg( p_this, "Got analog standarts for device %s", devicename.c_str() ) ;
+            pAVD->Release() ;
+        }
+        p_device_filter->Release();
+    }
+    else
+    {
+        /* Uninitialize OLE/COM */
+        CoUninitialize();
 
         msg_Err( p_this, "didn't find device: %s", devicename.c_str() );
         return VLC_EGENERIC;
@@ -2052,9 +2228,38 @@ static int ConfigDevicesCallback( vlc_object_t *p_this, char const *psz_name,
     /* Uninitialize OLE/COM */
     CoUninitialize();
 
+    int i ;
+    /* Clean-up the current list */
+    for( i = 1; i < p_item->i_list; i++ )
+    {
+        free( const_cast<char *>(p_item->ppsz_list[i]) );
+    }
+
+    const char* psz_vstd ;
+    i = 1;
+    /* Iterate thru all the video standarts in the mask */
+    while ( psz_vstd = AnalogVideoStd_GetNextString( &lVideoStd ) )
+    {
+        if ( i >= p_item->i_list )
+            p_item->ppsz_list =
+            (char **)realloc( p_item->ppsz_list,
+                            ( i+1 ) * sizeof(char *) );
+
+        p_item->ppsz_list[ i++ ] = strdup( psz_vstd ) ;
+    }
+    p_item->i_list = i ;
+    p_item->ppsz_list =
+       (char **)realloc( p_item->ppsz_list,
+                     ( p_item->i_list + 1 ) * sizeof(char *) );
+    p_item->ppsz_list[ p_item->i_list ] = NULL ;
+
+    /* Signal change to the interface */
+    p_item->b_dirty = true;
+
     return VLC_SUCCESS;
 }
 
+
 /*****************************************************************************
  * Properties
  *****************************************************************************/
diff --git a/modules/access/dshow/filter.cpp b/modules/access/dshow/filter.cpp
index 456aa87..cefcaf7 100644
--- a/modules/access/dshow/filter.cpp
+++ b/modules/access/dshow/filter.cpp
@@ -40,146 +40,21 @@
 #include "common.h"
 #include "filter.h"
 
-#define DEBUG_DSHOW 1
+#define DEBUG_DSHOW 0
 
 #define FILTER_NAME  L"VideoLAN Capture Filter"
 #define PIN_NAME     L"Capture"
 
 /*****************************************************************************
  * DirectShow GUIDs.
- * Easier to define them here as mingw doesn't provide them all.
+ * Missing GUIDS from mingw libraries
  *****************************************************************************/
-const GUID CLSID_SystemDeviceEnum = {0x62be5d10, 0x60eb, 0x11d0, {0xbd, 0x3b, 0x00, 0xa0, 0xc9, 0x11, 0xce, 0x86}};
-const GUID CLSID_VideoInputDeviceCategory = {0x860BB310,0x5D01,0x11d0,{0xBD,0x3B,0x00,0xA0,0xC9,0x11,0xCE,0x86}};
-const GUID CLSID_AudioInputDeviceCategory = {0x33d9a762, 0x90c8, 0x11d0, {0xbd, 0x43, 0x00, 0xa0, 0xc9, 0x11, 0xce, 0x86}};
-//const GUID IID_IPropertyBag = {0x55272A00, 0x42CB, 0x11CE, {0x81, 0x35, 0x00, 0xAA, 0x00, 0x4B, 0xB8, 0x51}};
-extern const GUID IID_IPropertyBag;
-const GUID IID_ICreateDevEnum = {0x29840822, 0x5b84, 0x11d0, {0xbd, 0x3b, 0x00, 0xa0, 0xc9, 0x11, 0xce, 0x86}};
-const GUID IID_IFilterGraph = {0x56a8689f, 0x0ad4, 0x11ce, {0xb0, 0x3a, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70}};
-const GUID IID_IMediaControl = {0x56a868b1, 0x0ad4, 0x11ce, {0xb0, 0x3a, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70}};
-const GUID CLSID_FilterGraph = {0xe436ebb3, 0x524f, 0x11ce, {0x9f, 0x53, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70}};
-
-//const GUID IID_IUnknown = {0x00000000, 0x0000, 0x0000, {0xc0,0x00, 0x00,0x00,0x00,0x00,0x00,0x46}};
-extern const GUID IID_IUnknown;
-//const GUID IID_IPersist = {0x0000010c, 0x0000, 0x0000, {0xc0,0x00, 0x00,0x00,0x00,0x00,0x00,0x46}};
-extern const GUID IID_IPersist;
-const GUID IID_IMediaFilter = {0x56a86899, 0x0ad4, 0x11ce, {0xb0,0x3a, 0x00,0x20,0xaf,0x0b,0xa7,0x70}};
-const GUID IID_IBaseFilter = {0x56a86895, 0x0ad4, 0x11ce, {0xb0, 0x3a, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70}};
-const GUID IID_IPin = {0x56a86891, 0x0ad4, 0x11ce, {0xb0,0x3a, 0x00,0x20,0xaf,0x0b,0xa7,0x70}};
-const GUID IID_IMemInputPin = {0x56a8689d, 0x0ad4, 0x11ce, {0xb0,0x3a, 0x00,0x20,0xaf,0x0b,0xa7,0x70}};
-extern const GUID IID_IMemInputPin;
-
-const GUID IID_IEnumPins = {0x56a86892, 0x0ad4, 0x11ce, {0xb0,0x3a, 0x00,0x20,0xaf,0x0b,0xa7,0x70}};
-const GUID IID_IEnumMediaTypes = {0x89c31040, 0x846b, 0x11ce, {0x97,0xd3, 0x00,0xaa,0x00,0x55,0x59,0x5a}};
-
-const GUID IID_IAMBufferNegotiation = {0x56ed71a0, 0xaf5f, 0x11d0, {0xb3, 0xf0, 0x00, 0xaa, 0x00, 0x37, 0x61, 0xc5}};
-
-//const GUID IID_ISpecifyPropertyPages = {0xb196b28b, 0xbab4, 0x101a, {0xb6, 0x9c, 0x00, 0xaa, 0x00, 0x34, 0x1d, 0x07}};
-extern const GUID IID_ISpecifyPropertyPages;
-
-const GUID IID_IQualityControl = {0x56a868a5, 0x0ad4, 0x11ce, {0xb, 0x3a, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70}};
-
-const GUID CLSID_CaptureGraphBuilder2 = {0xBF87B6E1, 0x8C27, 0x11d0, {0xB3, 0xF0, 0x0, 0xAA, 0x00, 0x37, 0x61, 0xC5}};
-
-const GUID IID_IGraphBuilder = {0x56a868a9, 0x0ad4, 0x11ce, {0xb0, 0x3a, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70}};
-
-const GUID IID_ICaptureGraphBuilder2 = {0x93E5A4E0, 0x2D50, 0x11d2, {0xAB, 0xFA, 0x00, 0xA0, 0xC9, 0xC6, 0xE3, 0x8D}};
-
-const GUID IID_IAMTVAudio = {0x83EC1C30, 0x23D1, 0x11d1, {0x99, 0xE6, 0x00, 0xA0, 0xC9, 0x56, 0x02, 0x66}};
-const GUID IID_IAMStreamConfig = {0xC6E13340, 0x30AC, 0x11d0, {0xA1, 0x8C, 0x00, 0xA0, 0xC9, 0x11, 0x89, 0x56}};
-const GUID IID_IAMCrossbar = {0xC6E13380, 0x30AC, 0x11d0, {0xA1, 0x8C, 0x00, 0xA0, 0xC9, 0x11, 0x89, 0x56}};
-const GUID IID_IAMTVTuner = {0x211A8766, 0x03AC, 0x11d1, {0x8D, 0x13, 0x00, 0xAA, 0x00, 0xBD, 0x83, 0x39}};
-
-const GUID IID_IKsPropertySet = {0x31EFAC30, 0x515C, 0x11d0, {0xA9, 0xAA, 0x00, 0xAA, 0x00, 0x61, 0xBE, 0x93}};
-
-/* Video Format */
-
-const GUID FORMAT_VideoInfo  = {0x05589f80, 0xc356, 0x11ce, {0xbf, 0x01, 0x00, 0xaa, 0x00, 0x55, 0x59, 0x5a}};
-/*
- * MEDIATYPEs and MEDIASUBTYPEs
- */
-const GUID MEDIATYPE_Video = {0x73646976, 0x0000, 0x0010, {0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}};
-const GUID MEDIATYPE_Interleaved = {0x73766169, 0x0000, 0x0010, {0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}};
-const GUID MEDIATYPE_Stream = {0xe436eb83, 0x524f, 0x11ce, {0x9f, 0x53, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70}};
-const GUID MEDIASUBTYPE_PREVIEW_VIDEO = {0x2859e1da, 0xb81f, 0x4fbd, {0x94, 0x3b, 0xe2, 0x37, 0x24, 0xa1, 0xab, 0xb3}};
-
-/* Packed RGB formats */
-const GUID MEDIASUBTYPE_RGB1 = {0xe436eb78, 0x524f, 0x11ce, {0x9f, 0x53, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70}};
-const GUID MEDIASUBTYPE_RGB4 = {0xe436eb79, 0x524f, 0x11ce, {0x9f, 0x53, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70}};
-const GUID MEDIASUBTYPE_RGB8 = {0xe436eb7a, 0x524f, 0x11ce, {0x9f, 0x53, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70}};
-const GUID MEDIASUBTYPE_RGB565 = {0xe436eb7b, 0x524f, 0x11ce, {0x9f, 0x53, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70}};
-const GUID MEDIASUBTYPE_RGB555 = {0xe436eb7c, 0x524f, 0x11ce, {0x9f, 0x53, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70}};
-const GUID MEDIASUBTYPE_RGB24 = {0xe436eb7d, 0x524f, 0x11ce, {0x9f, 0x53, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70}};
-const GUID MEDIASUBTYPE_RGB32 = {0xe436eb7e, 0x524f, 0x11ce, {0x9f, 0x53, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70}};
-const GUID MEDIASUBTYPE_ARGB32 = {0x773c9ac0, 0x3274, 0x11d0, {0xb7, 0x24, 0x0, 0xaa, 0x0, 0x6c, 0x1a, 0x1}};
-
 /* Packed YUV formats */
-const GUID MEDIASUBTYPE_YUYV = {0x56595559, 0x0000, 0x0010, {0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}};
-const GUID MEDIASUBTYPE_Y411 = {0x31313459, 0x0000, 0x0010, {0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}};
-const GUID MEDIASUBTYPE_Y211 = {0x31313259, 0x0000, 0x0010, {0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}};
-const GUID MEDIASUBTYPE_YUY2 = {0x32595559, 0x0000, 0x0010, {0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}};
-const GUID MEDIASUBTYPE_YVYU = {0x55595659, 0x0000, 0x0010, {0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}};
-const GUID MEDIASUBTYPE_UYVY = {0x59565955, 0x0000, 0x0010, {0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}};
 const GUID MEDIASUBTYPE_HDYC = {0x43594448, 0x0000, 0x0010, {0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}};
-
-/* Planar YUV formats */
-const GUID MEDIASUBTYPE_YVU9 = {0x39555659, 0x0000, 0x0010, {0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}};
-const GUID MEDIASUBTYPE_YV12 = {0x32315659, 0x0000, 0x0010, {0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}};
-const GUID MEDIASUBTYPE_IYUV = {0x56555949, 0x0000, 0x0010, {0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}}; /* identical to YV12 */
-const GUID MEDIASUBTYPE_Y41P = {0x50313459, 0x0000, 0x0010, {0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}};
 const GUID MEDIASUBTYPE_I420 = {0x30323449, 0x0000, 0x0010, {0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}};
-
-const GUID MEDIATYPE_Audio = {0x73647561, 0x0000, 0x0010, {0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}};
-const GUID FORMAT_WaveFormatEx = {0x05589f81, 0xc356, 0x11ce, {0xbf, 0x01, 0x00, 0xaa, 0x00, 0x55, 0x59, 0x5a}};
-const GUID MEDIASUBTYPE_PCM = {0x00000001, 0x0000, 0x0010, {0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}};
-const GUID MEDIASUBTYPE_IEEE_FLOAT = {0x00000003, 0x0000, 0x0010, {0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}};
-
-/* DV formats */
-const GUID MEDIASUBTYPE_dvsd = {0x64737664, 0x0000, 0x0010, {0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}};
-const GUID MEDIASUBTYPE_dvhd = {0x64687664, 0x0000, 0x0010, {0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}};
-const GUID MEDIASUBTYPE_dvsl = {0x6c737664, 0x0000, 0x0010, {0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}};
-
-/* MPEG2 formats */
-const GUID MEDIASUBTYPE_MPEG2_VIDEO = {0xe06d8026, 0xdb46, 0x11cf, {0xb4, 0xd1, 0x00, 0x80, 0x5f, 0x6c, 0xbb, 0xea}};
-const GUID MEDIASUBTYPE_MPEG2_PROGRAM = {0xe06d8022, 0xdb46, 0x11cf, {0xb4, 0xd1, 0x00, 0x80, 0x5f, 0x6c, 0xbb, 0xea}};
-const GUID MEDIASUBTYPE_MPEG2_TRANSPORT = {0xe06d8023, 0xdb46, 0x11cf, {0xb4, 0xd1, 0x00, 0x80, 0x5f, 0x6c, 0xbb, 0xea}};
-const GUID FORMAT_MPEG2Video = {0xe06d80e3, 0xdb46, 0x11cf, {0xb4, 0xd1, 0x00, 0x80, 0x5f, 0x6c, 0xbb, 0xea}};
-
-/* MJPG format */
-const GUID MEDIASUBTYPE_MJPG = {0x47504A4D, 0x0000, 0x0010, {0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}};
-
 /* DivX formats */
 const GUID MEDIASUBTYPE_DIVX = {0x58564944, 0x0000, 0x0010, {0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}};
 
-/* Analog Video */
-const GUID FORMAT_AnalogVideo = {0x482dde0, 0x7817, 0x11cf, {0x8a, 0x3, 0x0, 0xaa, 0x0, 0x6e, 0xcb, 0x65}};
-
-const GUID MEDIATYPE_AnalogVideo = {0x482dde1, 0x7817, 0x11cf, {0x8a, 0x3, 0x0, 0xab, 0x0, 0x6e, 0xcb, 0x65}};
-
-const GUID MEDIASUBTYPE_AnalogVideo_NTSC_M = {0x482dde2, 0x7817, 0x11cf, {0x8a, 0x3, 0x0, 0xaa, 0x0, 0x6e, 0xcb, 0x65}};
-const GUID MEDIASUBTYPE_AnalogVideo_PAL_B = {0x482dde5, 0x7817, 0x11cf, {0x8a, 0x3, 0x0, 0xaa, 0x0, 0x6e, 0xcb, 0x65}};
-const GUID MEDIASUBTYPE_AnalogVideo_PAL_D = {0x482dde6, 0x7817, 0x11cf, {0x8a, 0x3, 0x0, 0xaa, 0x0, 0x6e, 0xcb, 0x65}};
-const GUID MEDIASUBTYPE_AnalogVideo_PAL_G = {0x482dde7, 0x7817, 0x11cf, {0x8a, 0x3, 0x0, 0xaa, 0x0, 0x6e, 0xcb, 0x65}};
-const GUID MEDIASUBTYPE_AnalogVideo_PAL_H = {0x482dde8, 0x7817, 0x11cf, {0x8a, 0x3, 0x0, 0xaa, 0x0, 0x6e, 0xcb, 0x65}};
-const GUID MEDIASUBTYPE_AnalogVideo_PAL_I = {0x482dde9, 0x7817, 0x11cf, {0x8a, 0x3, 0x0, 0xaa, 0x0, 0x6e, 0xcb, 0x65}};
-const GUID MEDIASUBTYPE_AnalogVideo_PAL_M = {0x482ddea, 0x7817, 0x11cf, {0x8a, 0x3, 0x0, 0xaa, 0x0, 0x6e, 0xcb, 0x65}};
-const GUID MEDIASUBTYPE_AnalogVideo_PAL_N = {0x482ddeb, 0x7817, 0x11cf, {0x8a, 0x3, 0x0, 0xaa, 0x0, 0x6e, 0xcb, 0x65}};
-const GUID MEDIASUBTYPE_AnalogVideo_PAL_N_COMBO = {0x482ddec, 0x7817, 0x11cf, {0x8a, 0x3, 0x0, 0xaa, 0x0, 0x6e, 0xcb, 0x65}};
-const GUID MEDIASUBTYPE_AnalogVideo_SECAM_B = {0x482ddf0, 0x7817, 0x11cf, {0x8a, 0x3, 0x0, 0xaa, 0x0, 0x6e, 0xcb, 0x65}};
-const GUID MEDIASUBTYPE_AnalogVideo_SECAM_D = {0x482ddf1, 0x7817, 0x11cf, {0x8a, 0x3, 0x0, 0xaa, 0x0, 0x6e, 0xcb, 0x65}};
-const GUID MEDIASUBTYPE_AnalogVideo_SECAM_G = {0x482ddf2, 0x7817, 0x11cf, {0x8a, 0x3, 0x0, 0xaa, 0x0, 0x6e, 0xcb, 0x65}};
-const GUID MEDIASUBTYPE_AnalogVideo_SECAM_H = {0x482ddf3, 0x7817, 0x11cf, {0x8a, 0x3, 0x0, 0xaa, 0x0, 0x6e, 0xcb, 0x65}};
-const GUID MEDIASUBTYPE_AnalogVideo_SECAM_K = {0x482ddf4, 0x7817, 0x11cf, {0x8a, 0x3, 0x0, 0xaa, 0x0, 0x6e, 0xcb, 0x65}};
-const GUID MEDIASUBTYPE_AnalogVideo_SECAM_K1 = {0x482ddf5, 0x7817, 0x11cf, {0x8a, 0x3, 0x0, 0xaa, 0x0, 0x6e, 0xcb, 0x65}};
-const GUID MEDIASUBTYPE_AnalogVideo_SECAM_L = {0x482ddf6, 0x7817, 0x11cf, {0x8a, 0x3, 0x0, 0xaa, 0x0, 0x6e, 0xcb, 0x65}};
-
-const GUID AMPROPSETID_Pin= {0x9b00f101, 0x1567, 0x11d1, {0xb3, 0xf1, 0x0, 0xaa, 0x0, 0x37, 0x61, 0xc5}};
-const GUID PIN_CATEGORY_ANALOGVIDEOIN= {0xfb6c4283, 0x0353, 0x11d1, {0x90, 0x5f, 0x00, 0x00, 0xc0, 0xcc, 0x16, 0xba}};
-const GUID PIN_CATEGORY_CAPTURE= {0xfb6c4281, 0x0353, 0x11d1, {0x90, 0x5f, 0x0, 0x0, 0xc0, 0xcc, 0x16, 0xba}};
-const GUID LOOK_UPSTREAM_ONLY= {0xac798be0, 0x98e3, 0x11d1, {0xb3, 0xf1, 0x0, 0xaa, 0x0, 0x37, 0x61, 0xc}};
-
-//const GUID GUID_NULL = {0x0000, 0x0000, 0x0000, {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}};
-extern const GUID GUID_NULL;
 
 void WINAPI FreeMediaType( AM_MEDIA_TYPE& mt )
 {
-- 
1.6.1.3

