/src/mozilla-central/dom/media/mp4/SinfParser.h
Line | Count | Source (jump to first uncovered line) |
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 "mozilla/ResultExtensions.h" |
10 | | #include "Atom.h" |
11 | | #include "AtomType.h" |
12 | | |
13 | | namespace mozilla { |
14 | | |
15 | | class Box; |
16 | | |
17 | | class Sinf : public Atom |
18 | | { |
19 | | public: |
20 | | Sinf() |
21 | | : mDefaultIVSize(0) |
22 | | , mDefaultEncryptionType() |
23 | | {} |
24 | | explicit Sinf(Box& aBox); |
25 | | |
26 | | virtual bool IsValid() override |
27 | | { |
28 | | return !!mDefaultIVSize && !!mDefaultEncryptionType; |
29 | | } |
30 | | |
31 | | uint8_t mDefaultIVSize; |
32 | | AtomType mDefaultEncryptionType; |
33 | | uint8_t mDefaultKeyID[16]; |
34 | | }; |
35 | | |
36 | | class SinfParser |
37 | | { |
38 | | public: |
39 | | explicit SinfParser(Box& aBox); |
40 | | |
41 | 0 | Sinf& GetSinf() { return mSinf; } |
42 | | private: |
43 | | Result<Ok, nsresult> ParseSchm(Box& aBox); |
44 | | Result<Ok, nsresult> ParseSchi(Box& aBox); |
45 | | Result<Ok, nsresult> ParseTenc(Box& aBox); |
46 | | |
47 | | Sinf mSinf; |
48 | | }; |
49 | | |
50 | | } |
51 | | |
52 | | #endif // SINF_PARSER_H_ |