| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef MEDIA_FORMATS_MP2T_TS_SECTION_PSI_H_ | 5 #ifndef MEDIA_FORMATS_MP2T_TS_SECTION_PSI_H_ |
| 6 #define MEDIA_FORMATS_MP2T_TS_SECTION_PSI_H_ | 6 #define MEDIA_FORMATS_MP2T_TS_SECTION_PSI_H_ |
| 7 | 7 |
| 8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
| 9 #include "media/base/byte_queue.h" | 9 #include "media/base/byte_queue.h" |
| 10 #include "media/formats/mp2t/ts_section.h" | 10 #include "media/formats/mp2t/ts_section.h" |
| 11 | 11 |
| 12 namespace media { | 12 namespace media { |
| 13 | 13 |
| 14 class BitReader; | 14 class BitReader; |
| 15 | 15 |
| 16 namespace mp2t { | 16 namespace mp2t { |
| 17 | 17 |
| 18 class TsSectionPsi : public TsSection { | 18 class TsSectionPsi : public TsSection { |
| 19 public: | 19 public: |
| 20 TsSectionPsi(); | 20 TsSectionPsi(); |
| 21 virtual ~TsSectionPsi(); | 21 virtual ~TsSectionPsi(); |
| 22 | 22 |
| 23 // TsSection implementation. | 23 // TsSection implementation. |
| 24 virtual bool Parse(bool payload_unit_start_indicator, | 24 virtual bool Parse(bool payload_unit_start_indicator, |
| 25 const uint8* buf, int size) OVERRIDE; | 25 const uint8* buf, int size) override; |
| 26 virtual void Flush() OVERRIDE; | 26 virtual void Flush() override; |
| 27 virtual void Reset() OVERRIDE; | 27 virtual void Reset() override; |
| 28 | 28 |
| 29 // Parse the content of the PSI section. | 29 // Parse the content of the PSI section. |
| 30 virtual bool ParsePsiSection(BitReader* bit_reader) = 0; | 30 virtual bool ParsePsiSection(BitReader* bit_reader) = 0; |
| 31 | 31 |
| 32 // Reset the state of the PSI section. | 32 // Reset the state of the PSI section. |
| 33 virtual void ResetPsiSection() = 0; | 33 virtual void ResetPsiSection() = 0; |
| 34 | 34 |
| 35 private: | 35 private: |
| 36 void ResetPsiState(); | 36 void ResetPsiState(); |
| 37 | 37 |
| 38 // Bytes of the current PSI. | 38 // Bytes of the current PSI. |
| 39 ByteQueue psi_byte_queue_; | 39 ByteQueue psi_byte_queue_; |
| 40 | 40 |
| 41 // Do not start parsing before getting a unit start indicator. | 41 // Do not start parsing before getting a unit start indicator. |
| 42 bool wait_for_pusi_; | 42 bool wait_for_pusi_; |
| 43 | 43 |
| 44 // Number of leading bytes to discard (pointer field). | 44 // Number of leading bytes to discard (pointer field). |
| 45 int leading_bytes_to_discard_; | 45 int leading_bytes_to_discard_; |
| 46 | 46 |
| 47 DISALLOW_COPY_AND_ASSIGN(TsSectionPsi); | 47 DISALLOW_COPY_AND_ASSIGN(TsSectionPsi); |
| 48 }; | 48 }; |
| 49 | 49 |
| 50 } // namespace mp2t | 50 } // namespace mp2t |
| 51 } // namespace media | 51 } // namespace media |
| 52 | 52 |
| 53 #endif | 53 #endif |
| 54 | 54 |
| OLD | NEW |