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.

115 lines
4.5 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 Microsoft Corporation. All Rights Reserved.
  9. //
  10. //
  11. // History:
  12. // 22-Aug-97 TKB Created Initial Interface Version
  13. //
  14. //==========================================================================;
  15. #ifndef __CCDECODE_H
  16. #define __CCDECODE_H
  17. #include <stdio.h>
  18. #include <stdlib.h>
  19. #include <windows.h>
  20. #include <icodec.h>
  21. #pragma warning(disable:4355)
  22. //////////////////////////////////////////////////////////////
  23. // ICCOutputPin:: Closed Captioning Output Pin Interface
  24. //////////////////////////////////////////////////////////////
  25. class ICCOutputPin : public IVBIOutputPin
  26. {
  27. // Usable public interfaces
  28. public:
  29. ICCOutputPin(IKSDriver &driver, int nPin, PKSDATARANGE pKSDataRange ) :
  30. IVBIOutputPin( driver, nPin, pKSDataRange, sizeof(VBICODECFILTERING_CC_SUBSTREAMS) ),
  31. m_ScanlinesRequested(*this,KSPROPERTY_VBICODECFILTERING_SCANLINES_REQUESTED_BIT_ARRAY,
  32. sizeof(VBICODECFILTERING_SCANLINES)),
  33. m_ScanlinesDiscovered(*this,KSPROPERTY_VBICODECFILTERING_SCANLINES_DISCOVERED_BIT_ARRAY,
  34. sizeof(VBICODECFILTERING_SCANLINES)),
  35. m_SubstreamsRequested(*this,KSPROPERTY_VBICODECFILTERING_SUBSTREAMS_REQUESTED_BIT_ARRAY,
  36. sizeof(VBICODECFILTERING_CC_SUBSTREAMS) ),
  37. m_SubstreamsDiscovered(*this,KSPROPERTY_VBICODECFILTERING_SUBSTREAMS_DISCOVERED_BIT_ARRAY,
  38. sizeof(VBICODECFILTERING_CC_SUBSTREAMS) ),
  39. m_Statistics(*this,KSPROPERTY_VBICODECFILTERING_STATISTICS,
  40. sizeof(VBICODECFILTERING_STATISTICS_CC_PIN))
  41. {}
  42. ~ICCOutputPin();
  43. // Pin specific properties (does not affect other pins)
  44. IScanlinesProperty m_ScanlinesRequested;
  45. IScanlinesProperty m_ScanlinesDiscovered;
  46. ISubstreamsProperty m_SubstreamsRequested;
  47. ISubstreamsProperty m_SubstreamsDiscovered;
  48. IStatisticsProperty m_Statistics;
  49. // Helper functions and internal data
  50. protected:
  51. };
  52. //////////////////////////////////////////////////////////////
  53. // ICCDecode:: Closed Captioning Codec Interface
  54. //////////////////////////////////////////////////////////////
  55. class ICCDecode : public IVBICodec
  56. {
  57. // Usable public interfaces
  58. public:
  59. ICCDecode();
  60. ~ICCDecode();
  61. // Call to make sure construction was successful
  62. BOOL IsValid() { return IVBICodec::IsValid() && m_OutputPin.IsValid(); }
  63. // Typically line 21 for actual closed captioning data (default)
  64. int AddRequestedScanline(int nScanline); // Adds _another_ scanline to the request list.
  65. int ClearRequestedScanlines(); // Use this to reset requested scanlines to none.
  66. int GetDiscoveredScanlines(VBICODECFILTERING_SCANLINES &ScanlineBitArray);
  67. // One of KS_CC_SUBSTREAM_ODD(default), KS_CC_SUBSTREAM_EVEN
  68. // Readible closed captioning data is usually on the ODD field.
  69. int AddRequestedVideoField(int nField); // Adds _another_ field to the request list.
  70. int ClearRequestedVideoFields(); // Use this to reset requested fields to none.
  71. int GetDiscoveredVideoFields(VBICODECFILTERING_CC_SUBSTREAMS &bitArray);
  72. // Statistics Property Control
  73. int GetCodecStatistics(VBICODECFILTERING_STATISTICS_CC &CodecStatistics);
  74. int SetCodecStatistics(VBICODECFILTERING_STATISTICS_CC &CodecStatistics);
  75. int GetPinStatistics(VBICODECFILTERING_STATISTICS_CC_PIN &PinStatistics);
  76. int SetPinStatistics(VBICODECFILTERING_STATISTICS_CC_PIN &PinStatistics);
  77. // Read function (call "overlapped" at THREAD_PRIORITY_ABOVE_NORMAL to avoid data loss)
  78. int ReadData( LPBYTE lpBuffer, int nBytes, DWORD *lpcbReturned, LPOVERLAPPED lpOS )
  79. { return m_OutputPin.ReadData( lpBuffer, nBytes, lpcbReturned, lpOS ); }
  80. int GetOverlappedResult( LPOVERLAPPED lpOS, LPDWORD lpdwTransferred = NULL, BOOL bWait=TRUE )
  81. { return m_OutputPin.GetOverlappedResult(lpOS, lpdwTransferred, bWait ); }
  82. // Helper functions and internal data
  83. // Actual Pin instance [w/properties] (set by above to control filtering & to get discovered)
  84. ICCOutputPin m_OutputPin;
  85. // Additional driver global properties
  86. IStatisticsProperty m_Statistics;
  87. protected:
  88. };
  89. #pragma warning(default:4355)
  90. #endif