1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 #ifndef MEDIA_FORMATS_MP2T_TS_SECTION_CAT_H_
6 #define MEDIA_FORMATS_MP2T_TS_SECTION_CAT_H_
7 
8 #include "base/callback.h"
9 #include "base/macros.h"
10 #include "media/base/encryption_scheme.h"
11 #include "media/formats/mp2t/ts_section_psi.h"
12 
13 namespace media {
14 namespace mp2t {
15 
16 class TsSectionCat : public TsSectionPsi {
17  public:
18   // RegisterCencPidsCB::Run(int ca_pid, int pssh_pid);
19   using RegisterCencPidsCB = base::RepeatingCallback<void(int, int)>;
20   // RegisterEncryptionScheme::Run(EncryptionScheme scheme);
21   using RegisterEncryptionSchemeCB =
22       base::RepeatingCallback<void(EncryptionScheme)>;
23   TsSectionCat(const RegisterCencPidsCB& register_cenc_ids_cb,
24                const RegisterEncryptionSchemeCB& register_encryption_scheme_cb);
25   ~TsSectionCat() override;
26 
27   // TsSectionPsi implementation.
28   bool ParsePsiSection(BitReader* bit_reader) override;
29   void ResetPsiSection() override;
30 
31  private:
32   RegisterCencPidsCB register_cenc_ids_cb_;
33   RegisterEncryptionSchemeCB register_encryption_scheme_cb_;
34 
35   // Parameters from the CAT.
36   int version_number_;
37 
38   DISALLOW_COPY_AND_ASSIGN(TsSectionCat);
39 };
40 
41 }  // namespace mp2t
42 }  // namespace media
43 
44 #endif
45