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.

181 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. // 17-Nov-97 TKB Created Initial Interface Version
  13. //
  14. //==========================================================================;
  15. #include <nabts.h>
  16. #pragma warning(disable:4355)
  17. //////////////////////////////////////////////////////////////
  18. // Stream Format Raw NABTS bundles
  19. //////////////////////////////////////////////////////////////
  20. #define NABTS_OUTPUT_PIN 1
  21. KSDATARANGE StreamFormatNabts =
  22. {
  23. // Definition of the stream (MUST match the output pin of the decoder)
  24. {
  25. sizeof (KSDATARANGE), // FormatSize
  26. 0, // Flags
  27. sizeof (NABTS_BUFFER), // SampleSize
  28. 0, // Reserved
  29. { STATIC_KSDATAFORMAT_TYPE_NABTS },
  30. { STATIC_KSDATAFORMAT_SUBTYPE_NABTS },
  31. { STATIC_KSDATAFORMAT_SPECIFIER_NONE }
  32. }
  33. };
  34. //////////////////////////////////////////////////////////////
  35. // INabtsOutputPin
  36. // INabtsOutputPin
  37. //////////////////////////////////////////////////////////////
  38. INabtsOutputPin::~INabtsOutputPin()
  39. {
  40. }
  41. //////////////////////////////////////////////////////////////
  42. // INabts:: ctors & dtors
  43. //////////////////////////////////////////////////////////////
  44. INabts::INabts() :
  45. IVBICodec("NABTS/FEC VBI Codec", sizeof(VBICODECFILTERING_NABTS_SUBSTREAMS) ),
  46. m_Statistics(*this, KSPROPERTY_VBICODECFILTERING_STATISTICS, sizeof(VBICODECFILTERING_STATISTICS_NABTS)),
  47. m_OutputPin(*this, NABTS_OUTPUT_PIN, &StreamFormatNabts)
  48. {
  49. }
  50. INabts::~INabts()
  51. {
  52. }
  53. //////////////////////////////////////////////////////////////
  54. // INabts Scanline routines
  55. //////////////////////////////////////////////////////////////
  56. int
  57. INabts::AddRequestedScanline(int nScanline)
  58. {
  59. int nStatus = -1;
  60. VBICODECFILTERING_SCANLINES ScanlineBitArray;
  61. if ( m_OutputPin.m_ScanlinesRequested.GetValue(&ScanlineBitArray) )
  62. {
  63. DWORD nBitsPerElement = sizeof(*ScanlineBitArray.DwordBitArray)*8;
  64. ScanlineBitArray.DwordBitArray[ nScanline / nBitsPerElement ]
  65. |= 1L << (nScanline % nBitsPerElement);
  66. if ( m_OutputPin.m_ScanlinesRequested.SetValue(&ScanlineBitArray) )
  67. nStatus = 0;
  68. }
  69. return nStatus;
  70. }
  71. int
  72. INabts::ClearRequestedScanlines()
  73. {
  74. int nStatus = -1;
  75. VBICODECFILTERING_SCANLINES ScanlineBitArray;
  76. ZeroMemory(&ScanlineBitArray,sizeof(ScanlineBitArray));
  77. if ( m_OutputPin.m_ScanlinesRequested.SetValue(&ScanlineBitArray) )
  78. nStatus = 0;
  79. return nStatus;
  80. }
  81. int
  82. INabts::GetDiscoveredScanlines(VBICODECFILTERING_SCANLINES &ScanlineBitArray)
  83. {
  84. int nStatus = -1;
  85. if ( m_OutputPin.m_ScanlinesDiscovered.GetValue(&ScanlineBitArray) )
  86. {
  87. nStatus = 0;
  88. }
  89. return nStatus;
  90. }
  91. //////////////////////////////////////////////////////////////
  92. // Global Statistics Property Control
  93. //////////////////////////////////////////////////////////////
  94. int
  95. INabts::GetCodecStatistics(VBICODECFILTERING_STATISTICS_NABTS &CodecStatistics)
  96. {
  97. int nStatus = -1;
  98. if ( m_Statistics.GetValue( &CodecStatistics ) )
  99. {
  100. nStatus = 0;
  101. }
  102. return nStatus;
  103. }
  104. int
  105. INabts::SetCodecStatistics(VBICODECFILTERING_STATISTICS_NABTS &CodecStatistics)
  106. {
  107. int nStatus = -1;
  108. if ( m_Statistics.SetValue( &CodecStatistics ) )
  109. {
  110. nStatus = 0;
  111. }
  112. return nStatus;
  113. }
  114. int
  115. INabts::GetPinStatistics(VBICODECFILTERING_STATISTICS_COMMON_PIN &PinStatistics)
  116. {
  117. int nStatus = -1;
  118. if ( m_OutputPin.m_Statistics.GetValue( &PinStatistics ) )
  119. {
  120. nStatus = 0;
  121. }
  122. return nStatus;
  123. }
  124. int
  125. INabts::SetPinStatistics(VBICODECFILTERING_STATISTICS_COMMON_PIN &PinStatistics)
  126. {
  127. int nStatus = -1;
  128. if ( m_OutputPin.m_Statistics.SetValue( &PinStatistics ) )
  129. {
  130. nStatus = 0;
  131. }
  132. return nStatus;
  133. }
  134. //////////////////////////////////////////////////////////////
  135. // Embedded class tests
  136. //////////////////////////////////////////////////////////////
  137. #if defined(_CLASSTESTS)
  138. INabts Nabts();
  139. #endif
  140. #pragma warning(default:4355)
  141. /*EOF*/