content/media/encoder/fmp4_muxer/AVCBox.h

branch
TOR_BUG_9701
changeset 13
44a2da4a2ab2
equal deleted inserted replaced
-1:000000000000 0:25fbddfde527
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-*/
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
4 * You can obtain one at http://mozilla.org/MPL/2.0/. */
5
6 #ifndef AVCBox_h_
7 #define AVCBox_h_
8
9 #include "nsTArray.h"
10 #include "nsAutoPtr.h"
11 #include "ISOMediaBoxes.h"
12
13 namespace mozilla {
14
15 class ISOControl;
16
17 // 14496-12 8.5.2.2
18 #define resolution_72_dpi 0x00480000
19 #define video_depth 0x0018
20
21 // 14496-15 5.3.4.1 'Sample description name and format'
22 // Box type: 'avcC'
23 class AVCConfigurationBox : public Box {
24 public:
25 // ISO BMFF members
26
27 // avcConfig is CodecSpecificData from 14496-15 '5.3.4.1 Sample description
28 // name and format.
29 // These data are generated by encoder and we encapsulated the generated
30 // bitstream into box directly.
31 nsTArray<uint8_t> avcConfig;
32
33 // MuxerOperation methods
34 nsresult Generate(uint32_t* aBoxSize) MOZ_OVERRIDE;
35 nsresult Write() MOZ_OVERRIDE;
36
37 // AVCConfigurationBox methods
38 AVCConfigurationBox(ISOControl* aControl);
39 ~AVCConfigurationBox();
40 };
41
42 // 14496-15 5.3.4.1 'Sample description name and format'
43 // Box type: 'avc1'
44 class AVCSampleEntry : public VisualSampleEntry {
45 public:
46 // ISO BMFF members
47 nsRefPtr<AVCConfigurationBox> avcConfigBox;
48
49 // MuxerOperation methods
50 nsresult Generate(uint32_t* aBoxSize) MOZ_OVERRIDE;
51 nsresult Write() MOZ_OVERRIDE;
52
53 // VisualSampleEntry methods
54 AVCSampleEntry(ISOControl* aControl);
55 ~AVCSampleEntry();
56 };
57
58 }
59
60 #endif // AVCBox_h_

mercurial