Line data Source code
1 : /* This Source Code Form is subject to the terms of the Mozilla Public
2 : * License, v. 2.0. If a copy of the MPL was not distributed with this
3 : * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
4 :
5 :
6 : #ifndef SINF_PARSER_H_
7 : #define SINF_PARSER_H_
8 :
9 : #include "mp4_demuxer/Atom.h"
10 : #include "mp4_demuxer/AtomType.h"
11 :
12 : namespace mp4_demuxer {
13 :
14 : class Box;
15 :
16 0 : class Sinf : public Atom
17 : {
18 : public:
19 0 : Sinf()
20 0 : : mDefaultIVSize(0)
21 0 : , mDefaultEncryptionType()
22 0 : {}
23 : explicit Sinf(Box& aBox);
24 :
25 0 : virtual bool IsValid() override
26 : {
27 0 : return !!mDefaultIVSize && !!mDefaultEncryptionType;
28 : }
29 :
30 : uint8_t mDefaultIVSize;
31 : AtomType mDefaultEncryptionType;
32 : uint8_t mDefaultKeyID[16];
33 : };
34 :
35 : class SinfParser
36 : {
37 : public:
38 : explicit SinfParser(Box& aBox);
39 :
40 0 : Sinf& GetSinf() { return mSinf; }
41 : private:
42 : void ParseSchm(Box& aBox);
43 : void ParseSchi(Box& aBox);
44 : void ParseTenc(Box& aBox);
45 :
46 : Sinf mSinf;
47 : };
48 :
49 : }
50 :
51 : #endif // SINF_PARSER_H_
|