Advertisement
Guest User

TVCAS_B1.tvcas STAR digio patch

a guest
Jan 10th, 2019
1,048
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.46 KB | None | 0 0
  1. diff -U 10 -rw TVCAS_B1-rev5/TVCAS/TsTable.cpp TVCAS_B1-rev6/TVCAS/TsTable.cpp
  2.  
  3. --- TVCAS_B1-rev5/TVCAS/TsTable.cpp 2012-09-15 19:00:00.000000000 +0900
  4.  
  5. +++ TVCAS_B1-rev6/TVCAS/TsTable.cpp 2018-07-20 01:30:16.006900500 +0900
  6.  
  7. @@ -851,33 +851,35 @@
  8.  
  9. CPmtTable::CPmtTable(const CPmtTable &Operand)
  10. {
  11. *this = Operand;
  12. }
  13.  
  14. CPmtTable & CPmtTable::operator = (const CPmtTable &Operand)
  15. {
  16. if (this != &Operand) {
  17. CPsiSingleTable::operator=(Operand);
  18. m_wPcrPID = Operand.m_wPcrPID;
  19. + m_wSdEcmPID = Operand.m_wSdEcmPID; // for SPSD ECM
  20. m_TableDescBlock = Operand.m_TableDescBlock;
  21. m_EsInfoArray = Operand.m_EsInfoArray;
  22. }
  23.  
  24. return *this;
  25. }
  26.  
  27. void CPmtTable::Reset(void)
  28. {
  29. // 状態をクリアする
  30. CPsiSingleTable::Reset();
  31.  
  32. m_wPcrPID = 0xFFFFU;
  33. + m_wSdEcmPID = 0xFFFFU; // for SPSD ECM
  34. m_TableDescBlock.Reset();
  35. m_EsInfoArray.clear();
  36. }
  37.  
  38. const WORD CPmtTable::GetProgramNumberID(void) const
  39. {
  40. return m_CurSection.GetTableIdExtension();
  41. }
  42.  
  43. const WORD CPmtTable::GetPcrPID(void) const
  44. @@ -890,38 +892,38 @@
  45.  
  46. {
  47. // テーブルの記述子ブロックを返す
  48. return &m_TableDescBlock;
  49. }
  50.  
  51. const WORD CPmtTable::GetEcmPID(void) const
  52. {
  53. // ECMのPIDを返す
  54. const CCaMethodDesc *pCaMethodDesc = dynamic_cast<const CCaMethodDesc *>(m_TableDescBlock.GetDescByTag(CCaMethodDesc::DESC_TAG));
  55.  
  56. - return (pCaMethodDesc)? pCaMethodDesc->GetCaPID() : 0xFFFFU;
  57. + return (pCaMethodDesc)? pCaMethodDesc->GetCaPID() : m_wSdEcmPID; // 0xFFFFU; // for SPSD ECM
  58. }
  59.  
  60. const WORD CPmtTable::GetEcmPID(const WORD CASystemID) const
  61. {
  62. // 指定されたCA_system_idに対応するECMのPIDを返す
  63. for (WORD i = 0 ; i < m_TableDescBlock.GetDescNum() ; i++) {
  64. const CBaseDesc *pDesc = m_TableDescBlock.GetDescByIndex(i);
  65.  
  66. if (pDesc != NULL && pDesc->GetTag() == CCaMethodDesc::DESC_TAG) {
  67. const CCaMethodDesc *pCaDesc = dynamic_cast<const CCaMethodDesc*>(pDesc);
  68.  
  69. if (pCaDesc != NULL && pCaDesc->GetCaMethodID() == CASystemID)
  70. return pCaDesc->GetCaPID();
  71. }
  72. }
  73.  
  74. - return 0xFFFF;
  75. + return (m_wSdEcmPID); // 0xFFFF; // for SPSD ECM
  76. }
  77.  
  78. const WORD CPmtTable::GetEsInfoNum(void) const
  79. {
  80. // ES情報の数を返す
  81. return (WORD)m_EsInfoArray.size();
  82. }
  83.  
  84. const BYTE CPmtTable::GetStreamTypeID(const WORD wIndex) const
  85. {
  86. @@ -946,20 +948,21 @@
  87.  
  88. const WORD wDataSize = pCurSection->GetPayloadSize();
  89. const BYTE *pHexData = pCurSection->GetPayloadData();
  90.  
  91. if (wDataSize < 4)
  92. return false;
  93.  
  94. if(pCurSection->GetTableID() != 0x02U)return false; // テーブルIDが不正
  95.  
  96. // 状態をクリアする
  97. m_wPcrPID = 0xFFFFU;
  98. + m_wSdEcmPID = 0xFFFFU; // for SPSD ECM
  99. m_EsInfoArray.clear();
  100.  
  101. // テーブルを解析する
  102. m_wPcrPID = ((WORD)(pHexData[0] & 0x1FU) << 8) | (WORD)pHexData[1]; // +0,1
  103. WORD wDescLen = ((WORD)(pHexData[2] & 0x0FU) << 8) | (WORD)pHexData[3];
  104. if (4 + wDescLen > wDataSize)
  105. return false;
  106.  
  107. // 記述子ブロック
  108. m_TableDescBlock.ParseBlock(&pHexData[4], wDescLen);
  109. @@ -984,20 +987,31 @@
  110.  
  111. PmtItem.DescBlock.ParseBlock(&pHexData[wPos + 5], wDescLen);
  112.  
  113. #ifdef _DEBUG
  114. if (m_bDebugTrace)
  115. TRACE(TEXT("[%u] Stream Type ID = %02X PID = %04X\n"),
  116. m_EsInfoArray.size(), PmtItem.byStreamTypeID, PmtItem.wEsPID);
  117. #endif
  118.  
  119. // テーブルに追加する
  120. m_EsInfoArray.push_back(PmtItem);
  121. +
  122. + // for SPSD ECM
  123. + if ( (m_wSdEcmPID > 0x1FFFU) && (pCurSection->GetTableIdExtension() < 32768) ) {
  124. + const CBaseDesc *pDesc = PmtItem.DescBlock.GetDescByTag(CCaMethodDesc::DESC_TAG);
  125. + if ( pDesc != NULL ) {
  126. + const CCaMethodDesc *pCaDesc = dynamic_cast<const CCaMethodDesc*>(pDesc);
  127. + if ( (pCaDesc != NULL) && (pCaDesc->GetCaMethodID() == 0x01U) ) {
  128. + m_wSdEcmPID = pCaDesc->GetCaPID();
  129. + }
  130. + }
  131. + }
  132. }
  133.  
  134. return true;
  135. }
  136.  
  137.  
  138. /////////////////////////////////////////////////////////////////////////////
  139. // SDTテーブル抽象化クラス
  140. /////////////////////////////////////////////////////////////////////////////
  141.  
  142. diff -U 10 -rw TVCAS_B1-rev5/TVCAS/TsTable.h TVCAS_B1-rev6/TVCAS/TsTable.h
  143.  
  144. --- TVCAS_B1-rev5/TVCAS/TsTable.h 2012-09-15 19:00:00.000000000 +0900
  145.  
  146. +++ TVCAS_B1-rev6/TVCAS/TsTable.h 2018-07-20 01:36:21.072554100 +0900
  147.  
  148. @@ -342,35 +342,40 @@
  149.  
  150. const WORD GetPcrPID(void) const;
  151. const CDescBlock * GetTableDesc(void) const;
  152. const WORD GetEcmPID(void) const;
  153. const WORD GetEcmPID(const WORD CASystemID) const;
  154.  
  155. const WORD GetEsInfoNum(void) const;
  156. const BYTE GetStreamTypeID(const WORD wIndex) const;
  157. const WORD GetEsPID(const WORD wIndex) const;
  158. const CDescBlock * GetItemDesc(const WORD wIndex) const;
  159.  
  160. +// for SPSD ECM
  161. + WORD GetSdEcmPID() const { return(m_wSdEcmPID); };
  162. +
  163. protected:
  164. virtual const bool OnTableUpdate(const CPsiSection *pCurSection, const CPsiSection *pOldSection);
  165.  
  166. struct TAG_PMTITEM
  167. {
  168. BYTE byStreamTypeID; // Stream Type ID
  169. WORD wEsPID; // Elementary Stream PID
  170. CDescBlock DescBlock; // Stream ID Descriptor 他
  171. };
  172.  
  173. vector<TAG_PMTITEM> m_EsInfoArray;
  174.  
  175. WORD m_wPcrPID; // PCR_PID
  176. CDescBlock m_TableDescBlock; // Conditional Access Method Descriptor 他
  177.  
  178. + WORD m_wSdEcmPID; // for SPSD ECM
  179. +
  180. #ifdef _DEBUG
  181. bool m_bDebugTrace;
  182. #endif
  183. };
  184.  
  185.  
  186. /////////////////////////////////////////////////////////////////////////////
  187. // SDTテーブル抽象化クラス
  188. /////////////////////////////////////////////////////////////////////////////
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement