context: #region license
  
  /*
  DirectShowLib - Provide access to DirectShow interfaces via .NET
  Copyright (C) 2007
  http://sourceforge.net/projects/directshownet/
  
  This library is free software; you can redistribute it and/or
  modify it under the terms of the GNU Lesser General Public
  License as published by the Free Software Foundation; either
  version 2.1 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
  Lesser General Public License for more details.
  
  You should have received a copy of the GNU Lesser General Public
  License along with this library; if not, write to the Free Software
  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
  
  #endregion
  
  using System;
  using System.Runtime.InteropServices;
  
  namespace DirectShowLib.BDA
  {
      #region Declarations
  
  #if ALLOW_UNTESTED_INTERFACES
  
      /// <summary>
      /// From KSPROPERTY_IPSINK
      /// </summary>
      public enum KSPropertyIPSink
      {
          MulticastList,
          AdapterDescription,
          AdapterAddress
      }
  
      /// <summary>
      /// From PID_MAP
      /// </summary>
      [StructLayout(LayoutKind.Sequential)]
      public struct PIDMap
      {
          public int ulPID;
          public MediaSampleContent MediaSampleContent;
      }
  
      /// <summary>
      /// From SmartCardStatusType
      /// </summary>
      public enum SmartCardStatusType
      {
          CardInserted = 0,
          CardRemoved,
          CardError,
          CardDataChanged,
          CardFirmwareUpgrade
      }
  
      /// <summary>
      /// From SmartCardAssociationType
      /// </summary>
      public enum SmartCardAssociationType
      {
          NotAssociated = 0,
          Associated,
          AssociationUnknown
      }
  
      /// <summary>
      /// From LocationCodeSchemeType
      /// </summary>
      public enum LocationCodeSchemeType
      {
          SCTE_18 = 0
      }
  
      /// <summary>
      /// From EALocationCodeType
      /// </summary>
      [StructLayout(LayoutKind.Sequential, Pack = 1)]
      public struct EALocationCodeType
      {
          public LocationCodeSchemeType LocationCodeScheme;
          public byte StateCode;
          public byte CountySubdivision;
          public short CountyCode;
      }
  
      /// <summary>
      /// From EntitlementType
      /// </summary>
      public enum EntitlementType
      {
          Entitled = 0,
          NotEntitled,
          TechnicalFailure
      }
  
      /// <summary>
      /// From UICloseReasonType
      /// </summary>
      public enum UICloseReasonType
      {
          NotReady = 0,
          UserClosed,
          SystemClosed,
          DeviceClosed,
          ErrorClosed
      }
  
      /// <summary>
      /// From SmartCardApplication
      /// </summary>
      [StructLayout(LayoutKind.Sequential)]
      public struct SmartCardApplication
      {
          public ApplicationTypeType ApplicationType;
          public short ApplicationVersion;
          [MarshalAs(UnmanagedType.BStr)]
          public string pbstrApplicationName;
          [MarshalAs(UnmanagedType.BStr)]
          public string pbstrApplicationURL;
      }
  
      /// <summary>
      /// From BDA_DrmPairingError
      /// </summary>
      public enum BDA_DrmPairingError
      {
          Succeeded = 0,
          HardwareFailure,
          NeedRevocationData,
          NeedIndiv,
          Other,
          DrmInitFailed,
          DrmNotPaired,
          DrmRePairSoon,
          Aborted,
          NeedSDKUpdate
      }
  
      /// <summary>
      /// BDA_CONDITIONALACCESS_REQUESTTYPE
      /// </summary>
      public enum BDA_CONDITIONALACCESS_REQUESTTYPE
      {
          Unspecified = 0,
          NotPossible,
          Possible,
          PossibleNoStreamingDisruption
      }
  
      /// <summary>
      /// From BDA_CONDITIONALACCESS_MMICLOSEREASON
      /// </summary>
      public enum BDA_CONDITIONALACCESS_MMICLOSEREASON
      {
          Unspecified = 0,
          ClosedItself,
          TunerRequestedClose,
          DialogTimeout,
          DialogFocusChange,
          DialogUserDismissed,
          DialogUserNotAvailable
      }
  
      /// <summary>
      /// From MUX_PID_TYPE
      /// </summary>
      public enum MUX_PID_TYPE
      {
          Other = -1,
          ElementaryStream,
          MPEG2SectionPSISI
      }
  
      /// <summary>
      /// From BDA_MUX_PIDLISTITEM
      /// </summary>
      public class BDA_MUX_PIDLISTITEM
      {
          public short usPIDNumber;
          public short usProgramNumber;
          public MUX_PID_TYPE ePIDType;
      }
  
      /// <summary>
      /// From BDA_SIGNAL_TIMEOUTS
      /// </summary>
      public class BDA_SIGNAL_TIMEOUTS
      {
          public int ulCarrierTimeoutMs;
          public int ulScanningTimeoutMs;
          public int ulTuningTimeoutMs;
      }
  
  #endif
  
      /// <summary>
      /// From BDA_CHANGE_STATE
      /// </summary>
      public enum BDAChangeState
      {
          ChangesComplete = 0,
          ChangesPending
      }
  
      /// <summary>
      /// From BDA_MULTICAST_MODE
      /// </summary>
      public enum MulticastMode
      {
          PromiscuousMulticast = 0,
          FilteredMulticast,
          NoMulticast
      }
  
      /// <summary>
      /// From MEDIA_SAMPLE_CONTENT
      /// </summary>
      public enum MediaSampleContent
      {
          TransportPacket,
          ElementaryStream,
          Mpeg2PSI,
          TransportPayload
      }
  
      /// <summary>
      /// From BDANODE_DESCRIPTOR
      /// </summary>
      [StructLayout(LayoutKind.Sequential)]
      public struct BDANodeDescriptor
      {
          public int ulBdaNodeType;
          public Guid guidFunction;
          public Guid guidName;
      }
  
      /// <summary>
      /// From KS_CC_SUBSTREAM_SERVICE_* defines
      /// </summary>
      [Flags]
      public enum CCSubstreamService
      {
          None = 0,
          CC1 = 0x0001, //CC1 (caption channel) 
          CC2 = 0x0002, //CC2 (caption channel) 
          T1 = 0x0004, // T1 (text channel) 
          T2 = 0x0008, // T2 (text channel) 
          CC3 = 0x0100, // CC3 (caption channel) 
          CC4 = 0x0200, // CC4 (caption channel) 
          T3 = 0x0400, // T3 (text channel) 
          T4 = 0x0800, // T4 (text channel) 
          XDS = 0x1000, // Extended Data Services (XDS) 
          Field1 = 0x000F, // Bitmask to filter field 1 substreams. 
          Field2 = 0x1F00 //Bitmask to filter field 2 substreams 
      }
  
      #endregion
  
      #region Interfaces
  
  #if ALLOW_UNTESTED_INTERFACES
  
      [ComImport, System.Security.SuppressUnmanagedCodeSecurity,
      Guid("fd501041-8ebe-11ce-8183-00aa00577da2"),
      InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
      public interface IBDA_NetworkProvider
      {
          [PreserveSig]
          int PutSignalSource([In] int ulSignalSource);
  
          [PreserveSig]
          int GetSignalSource([Out] out int pulSignalSource);
  
          [PreserveSig]
          int GetNetworkType([Out] out Guid pguidNetworkType);
  
          [PreserveSig]
          int PutTuningSpace([In, MarshalAs(UnmanagedType.LPStruct)] Guid guidTuningSpace);
  
          [PreserveSig]
          int GetTuningSpace([Out] out Guid pguidTuingSpace);
  
          [PreserveSig]
          int RegisterDeviceFilter(
              [In, MarshalAs(UnmanagedType.Interface)] object pUnkFilterControl,
              [Out] out int ppvRegisitrationContext
              );
  
          [PreserveSig]
          int UnRegisterDeviceFilter([In] int pvRegistrationContext);
      }
  
      [ComImport, System.Security.SuppressUnmanagedCodeSecurity,
      Guid("71985F46-1CA1-11d3-9CC8-00C04F7971E0"),
      InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
      public interface IBDA_VoidTransform
      {
          [PreserveSig]
          int Start();
  
          [PreserveSig]
          int Stop();
      }
  
      [ComImport, System.Security.SuppressUnmanagedCodeSecurity,
      Guid("DDF15B0D-BD25-11d2-9CA0-00C04F7971E0"),
      InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
      public interface IBDA_NullTransform
      {
          [PreserveSig]
          int Start();
  
          [PreserveSig]
          int Stop();
      }
  
      [ComImport, System.Security.SuppressUnmanagedCodeSecurity,
      Guid("afb6c2a2-2c41-11d3-8a60-0000f81e0e4a"),
      InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
      public interface IEnumPIDMap
      {
          [PreserveSig]
          int Next(
              [In] int cRequest,
              [Out, MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 0, ArraySubType = UnmanagedType.Struct)] PIDMap[] pPIDMap,
              [In] IntPtr pcReceived
              );
  
          [PreserveSig]
          int Skip([In] int cRecords);
  
          [PreserveSig]
          int Reset();
  
          [PreserveSig]
          int Clone([Out] out IEnumPIDMap ppIEnumPIDMap);
      }
  
      [ComImport, System.Security.SuppressUnmanagedCodeSecurity,
      Guid("0DED49D5-A8B7-4d5d-97A1-12B0C195874D"),
      InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
      public interface IBDA_PinControl
      {
          [PreserveSig]
          int GetPinID([Out] out int pulPinID);
  
          [PreserveSig]
          int GetPinType([Out] out int pulPinType);
  
          [PreserveSig]
          int RegistrationContext([Out] out int pulRegistrationCtx);
      }
  
      [ComImport, System.Security.SuppressUnmanagedCodeSecurity,
      Guid("34518D13-1182-48e6-B28F-B24987787326"),
      InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
      public interface IBDA_AutoDemodulateEx : IBDA_AutoDemodulate
      {
          #region IBDA_AutoDemodulate Methods
  
          [PreserveSig]
          new int put_AutoDemodulate();
  
          #endregion
  
          [PreserveSig]
          int get_SupportedDeviceNodeTypes(
              [In] int ulcDeviceNodeTypesMax,
              [Out] out int pulcDeviceNodeTypes,
              [In, Out, MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.Struct)] Guid[] pguidDeviceNodeTypes
              );
  
          [PreserveSig]
          int get_SupportedVideoFormats(
            [Out] out AMTunerModeType pulAMTunerModeType,
            [Out] out AnalogVideoStandard pulAnalogVideoStandard
            );
  
          [PreserveSig]
          int get_AuxInputCount(
            [Out] out int pulCompositeCount,
            [Out] out int pulSvideoCount
            );
      }
  
      [ComImport, System.Security.SuppressUnmanagedCodeSecurity,
      Guid("D806973D-3EBE-46de-8FBB-6358FE784208"),
      InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
      public interface IBDA_EasMessage
      {
          [PreserveSig]
          int get_EasMessage(
            [In] int ulEventID,
            [Out, MarshalAs(UnmanagedType.IUnknown)] out object ppEASObject
            );
      }
  
      [ComImport, System.Security.SuppressUnmanagedCodeSecurity,
      Guid("8E882535-5F86-47AB-86CF-C281A72A0549"),
      InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
      public interface IBDA_TransportStreamInfo
      {
          [PreserveSig]
  
gt:         int get_PatTableTickCount([Out] out int pPatTickCount);