Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

117 lines
4.6 KiB

  1. //==========================================================================;
  2. //
  3. // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
  4. // KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
  5. // IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
  6. // PURPOSE.
  7. //
  8. // Copyright (c) 1997-1998 Microsoft Corporation. All Rights Reserved.
  9. //
  10. //
  11. // History:
  12. // 20-Feb-98 TKB Initial Interface Version
  13. //
  14. //==========================================================================;
  15. #ifndef __IGEMSTAR_H
  16. #define __IGEMSTAR_H
  17. #include <stdio.h>
  18. #include <stdlib.h>
  19. #include <windows.h>
  20. #include <icodec.h>
  21. #include <gemstar.h>
  22. #pragma warning(disable:4355)
  23. //////////////////////////////////////////////////////////////
  24. // IGemstarOutputPin:: Closed Captioning Output Pin Interface
  25. //////////////////////////////////////////////////////////////
  26. class IGemstarOutputPin : public IVBIOutputPin
  27. {
  28. // Usable public interfaces
  29. public:
  30. IGemstarOutputPin(IKSDriver &driver, int nPin, PKSDATARANGE pKSDataRange ) :
  31. IVBIOutputPin( driver, nPin, pKSDataRange, sizeof(VBICODECFILTERING_GEMSTAR_SUBSTREAMS) ),
  32. m_ScanlinesRequested(*this,KSPROPERTY_VBICODECFILTERING_SCANLINES_REQUESTED_BIT_ARRAY,
  33. sizeof(VBICODECFILTERING_SCANLINES)),
  34. m_ScanlinesDiscovered(*this,KSPROPERTY_VBICODECFILTERING_SCANLINES_DISCOVERED_BIT_ARRAY,
  35. sizeof(VBICODECFILTERING_SCANLINES)),
  36. m_SubstreamsRequested(*this,KSPROPERTY_VBICODECFILTERING_SUBSTREAMS_REQUESTED_BIT_ARRAY,
  37. sizeof(VBICODECFILTERING_GEMSTAR_SUBSTREAMS) ),
  38. m_SubstreamsDiscovered(*this,KSPROPERTY_VBICODECFILTERING_SUBSTREAMS_DISCOVERED_BIT_ARRAY,
  39. sizeof(VBICODECFILTERING_GEMSTAR_SUBSTREAMS) ),
  40. m_Statistics(*this,KSPROPERTY_VBICODECFILTERING_STATISTICS,
  41. sizeof(VBICODECFILTERING_STATISTICS_GEMSTAR_PIN))
  42. {}
  43. ~IGemstarOutputPin();
  44. // Pin specific properties (does not affect other pins)
  45. IScanlinesProperty m_ScanlinesRequested;
  46. IScanlinesProperty m_ScanlinesDiscovered;
  47. ISubstreamsProperty m_SubstreamsRequested;
  48. ISubstreamsProperty m_SubstreamsDiscovered;
  49. IStatisticsProperty m_Statistics;
  50. // Helper functions and internal data
  51. protected:
  52. };
  53. //////////////////////////////////////////////////////////////
  54. // IGemstarDecode:: Closed Captioning Codec Interface
  55. //////////////////////////////////////////////////////////////
  56. class IGemstarDecode : public IVBICodec
  57. {
  58. // Usable public interfaces
  59. public:
  60. IGemstarDecode();
  61. ~IGemstarDecode();
  62. // Call to make sure construction was successful
  63. BOOL IsValid() { return IVBICodec::IsValid() && m_OutputPin.IsValid(); }
  64. // Typically line 21 for actual closed captioning data (default)
  65. int AddRequestedScanline(int nScanline); // Adds _another_ scanline to the request list.
  66. int ClearRequestedScanlines(); // Use this to reset requested scanlines to none.
  67. int GetDiscoveredScanlines(VBICODECFILTERING_SCANLINES &ScanlineBitArray);
  68. // One of KS_GEMSTAR_SUBSTREAM_ODD(default), KS_GEMSTAR_SUBSTREAM_EVEN
  69. // Readible closed captioning data is usually on the ODD field.
  70. int AddRequestedVideoField(int nField); // Adds _another_ field to the request list.
  71. int ClearRequestedVideoFields(); // Use this to reset requested fields to none.
  72. int GetDiscoveredVideoFields(VBICODECFILTERING_GEMSTAR_SUBSTREAMS &bitArray);
  73. // Statistics Property Control
  74. int GetCodecStatistics(VBICODECFILTERING_STATISTICS_GEMSTAR &CodecStatistics);
  75. int SetCodecStatistics(VBICODECFILTERING_STATISTICS_GEMSTAR &CodecStatistics);
  76. int GetPinStatistics(VBICODECFILTERING_STATISTICS_GEMSTAR_PIN &PinStatistics);
  77. int SetPinStatistics(VBICODECFILTERING_STATISTICS_GEMSTAR_PIN &PinStatistics);
  78. // Read function (call "overlapped" at THREAD_PRIORITY_ABOVE_NORMAL to avoid data loss)
  79. int ReadData( PGEMSTAR_BUFFER lpBuffer, int nBytes, DWORD *lpcbReturned, LPOVERLAPPED lpOS )
  80. { return m_OutputPin.ReadData( (LPBYTE)lpBuffer, nBytes, lpcbReturned, lpOS ); }
  81. int GetOverlappedResult( LPOVERLAPPED lpOS, LPDWORD lpdwTransferred = NULL, BOOL bWait=TRUE )
  82. { return m_OutputPin.GetOverlappedResult(lpOS, lpdwTransferred, bWait ); }
  83. // Helper functions and internal data
  84. // Actual Pin instance [w/properties] (set by above to control filtering & to get discovered)
  85. IGemstarOutputPin m_OutputPin;
  86. // Additional driver global properties
  87. IStatisticsProperty m_Statistics;
  88. protected:
  89. };
  90. #pragma warning(default:4355)
  91. #endif