/VideoRendererElement/VideoRendererElement/Types.cs

# · C# · 84 lines · 66 code · 5 blank · 13 comment · 0 complexity · db7107cc814109849b4909504bb05a07 MD5 · raw file

  1. using System;
  2. using System.Runtime.InteropServices;
  3. using DirectShowLib;
  4. namespace MediaBridge
  5. {
  6. /// <summary>
  7. /// The MediaBridge source filter COM interface
  8. /// </summary>
  9. [ComImport, Guid("FDDEB397-2169-4441-B924-E6991F4A0431"),
  10. InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
  11. internal interface IMediaBridgeSourceFilter
  12. {
  13. int InitializeVideo(int VideoPixelWidth,
  14. int VideoPixelHeight,
  15. int BitCount,
  16. int FourCC,
  17. [Out, MarshalAs(UnmanagedType.Struct)]Guid MediaSubType);
  18. int SetCallback(IMediaBridgeCallback Callback);
  19. }
  20. /// <summary>
  21. /// The callback interface for the source filter
  22. /// </summary>
  23. [ComImport, Guid("FDDEB397-2269-4441-B924-E6991F4A0431"),
  24. InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
  25. internal interface IMediaBridgeCallback
  26. {
  27. [PreserveSig]
  28. int FillBuffer(IMediaSample pSample);
  29. }
  30. /// <summary>
  31. /// Standard bitmap compression options
  32. /// </summary>
  33. public enum BitmapCompression
  34. {
  35. UncompressedRGB = 0,
  36. RLE8 = 1,
  37. RLE4 = 2,
  38. BitFields = 3,
  39. JPEG = 4,
  40. PNG = 5
  41. }
  42. /// <summary>
  43. /// Supported media types for samples. These values can be passed for the MediaType
  44. /// parameter of the InitializeVideo method in the VideoRendererElement
  45. /// </summary>
  46. public static class RendererMediaType
  47. {
  48. public static readonly Guid A2B10G10R10 = new Guid(0x576f7893, 0xbdf6, 0x48c4, 0x87, 0x5f, 0xae, 0x7b, 0x81, 0x83, 0x45, 0x67);
  49. public static readonly Guid A2R10G10B10 = new Guid(0x2f8bb76d, 0xb644, 0x4550, 0xac, 0xf3, 0xd3, 12, 170, 0x65, 0xd5, 0xc5);
  50. public static readonly Guid ARGB1555 = new Guid(0x297c55af, 0xe209, 0x4cb3, 0xb7, 0x57, 0xc7, 0x6d, 0x6b, 0x9c, 0x88, 0xa8);
  51. public static readonly Guid ARGB1555_D3D_DX7_RT = new Guid(0x35314137, 0, 0x10, 0x80, 0, 0, 170, 0, 0x38, 0x9b, 0x71);
  52. public static readonly Guid ARGB1555_D3D_DX9_RT = new Guid(0x35314139, 0, 0x10, 0x80, 0, 0, 170, 0, 0x38, 0x9b, 0x71);
  53. public static readonly Guid ARGB32 = new Guid(0x773c9ac0, 0x3274, 0x11d0, 0xb7, 0x24, 0, 170, 0, 0x6c, 0x1a, 1);
  54. public static readonly Guid ARGB32_D3D_DX7_RT = new Guid(0x38384137, 0, 0x10, 0x80, 0, 0, 170, 0, 0x38, 0x9b, 0x71);
  55. public static readonly Guid ARGB32_D3D_DX9_RT = new Guid(0x38384139, 0, 0x10, 0x80, 0, 0, 170, 0, 0x38, 0x9b, 0x71);
  56. public static readonly Guid ARGB4444 = new Guid(0x6e6415e6, 0x5c24, 0x425f, 0x93, 0xcd, 0x80, 0x10, 0x2b, 0x3d, 0x1c, 0xca);
  57. public static readonly Guid ARGB4444_D3D_DX7_RT = new Guid(0x34344137, 0, 0x10, 0x80, 0, 0, 170, 0, 0x38, 0x9b, 0x71);
  58. public static readonly Guid ARGB4444_D3D_DX9_RT = new Guid(0x34344139, 0, 0x10, 0x80, 0, 0, 170, 0, 0x38, 0x9b, 0x71);
  59. public static readonly Guid RGB1 = new Guid(0xe436eb78, 0x524f, 0x11ce, 0x9f, 0x53, 0, 0x20, 0xaf, 11, 0xa7, 0x70);
  60. public static readonly Guid RGB16_D3D_DX7_RT = new Guid(0x36315237, 0, 0x10, 0x80, 0, 0, 170, 0, 0x38, 0x9b, 0x71);
  61. public static readonly Guid RGB16_D3D_DX9_RT = new Guid(0x36315239, 0, 0x10, 0x80, 0, 0, 170, 0, 0x38, 0x9b, 0x71);
  62. public static readonly Guid RGB24 = new Guid(0xe436eb7d, 0x524f, 0x11ce, 0x9f, 0x53, 0, 0x20, 0xaf, 11, 0xa7, 0x70);
  63. public static readonly Guid RGB32 = new Guid(0xe436eb7e, 0x524f, 0x11ce, 0x9f, 0x53, 0, 0x20, 0xaf, 11, 0xa7, 0x70);
  64. public static readonly Guid RGB32_D3D_DX7_RT = new Guid(0x32335237, 0, 0x10, 0x80, 0, 0, 170, 0, 0x38, 0x9b, 0x71);
  65. public static readonly Guid RGB32_D3D_DX9_RT = new Guid(0x32335239, 0, 0x10, 0x80, 0, 0, 170, 0, 0x38, 0x9b, 0x71);
  66. public static readonly Guid RGB4 = new Guid(0xe436eb79, 0x524f, 0x11ce, 0x9f, 0x53, 0, 0x20, 0xaf, 11, 0xa7, 0x70);
  67. public static readonly Guid RGB555 = new Guid(0xe436eb7c, 0x524f, 0x11ce, 0x9f, 0x53, 0, 0x20, 0xaf, 11, 0xa7, 0x70);
  68. public static readonly Guid RGB565 = new Guid(0xe436eb7b, 0x524f, 0x11ce, 0x9f, 0x53, 0, 0x20, 0xaf, 11, 0xa7, 0x70);
  69. public static readonly Guid RGB8 = new Guid(0xe436eb7a, 0x524f, 0x11ce, 0x9f, 0x53, 0, 0x20, 0xaf, 11, 0xa7, 0x70);
  70. public static readonly Guid Y211 = new Guid(0x31313259, 0, 0x10, 0x80, 0, 0, 170, 0, 0x38, 0x9b, 0x71);
  71. public static readonly Guid Y411 = new Guid(0x31313459, 0, 0x10, 0x80, 0, 0, 170, 0, 0x38, 0x9b, 0x71);
  72. public static readonly Guid Y41P = new Guid(0x50313459, 0, 0x10, 0x80, 0, 0, 170, 0, 0x38, 0x9b, 0x71);
  73. public static readonly Guid YUY2 = new Guid(0x32595559, 0, 0x10, 0x80, 0, 0, 170, 0, 0x38, 0x9b, 0x71);
  74. public static readonly Guid YUYV = new Guid(0x56595559, 0, 0x10, 0x80, 0, 0, 170, 0, 0x38, 0x9b, 0x71);
  75. public static readonly Guid YV12 = new Guid(0x32315659, 0, 0x10, 0x80, 0, 0, 170, 0, 0x38, 0x9b, 0x71);
  76. public static readonly Guid YVU9 = new Guid(0x39555659, 0, 0x10, 0x80, 0, 0, 170, 0, 0x38, 0x9b, 0x71);
  77. public static readonly Guid YVYU = new Guid(0x55595659, 0, 0x10, 0x80, 0, 0, 170, 0, 0x38, 0x9b, 0x71);
  78. }
  79. }