content/media/encoder/fmp4_muxer/AVCBox.h

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

     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/. */
     6 #ifndef AVCBox_h_
     7 #define AVCBox_h_
     9 #include "nsTArray.h"
    10 #include "nsAutoPtr.h"
    11 #include "ISOMediaBoxes.h"
    13 namespace mozilla {
    15 class ISOControl;
    17 // 14496-12 8.5.2.2
    18 #define resolution_72_dpi 0x00480000
    19 #define video_depth 0x0018
    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
    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;
    33   // MuxerOperation methods
    34   nsresult Generate(uint32_t* aBoxSize) MOZ_OVERRIDE;
    35   nsresult Write() MOZ_OVERRIDE;
    37   // AVCConfigurationBox methods
    38   AVCConfigurationBox(ISOControl* aControl);
    39   ~AVCConfigurationBox();
    40 };
    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;
    49   // MuxerOperation methods
    50   nsresult Generate(uint32_t* aBoxSize) MOZ_OVERRIDE;
    51   nsresult Write() MOZ_OVERRIDE;
    53   // VisualSampleEntry methods
    54   AVCSampleEntry(ISOControl* aControl);
    55   ~AVCSampleEntry();
    56 };
    58 }
    60 #endif // AVCBox_h_

mercurial