content/media/encoder/fmp4_muxer/MP4ESDS.h

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

     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 MP4ESDS_h_
     7 #define MP4ESDS_h_
     9 #include "nsTArray.h"
    10 #include "MuxerOperation.h"
    12 namespace mozilla {
    14 class ISOControl;
    16 /**
    17  * ESDS tag
    18  */
    19 #define ESDescrTag        0x03
    21 /**
    22  * 14496-1 '8.3.3 ES_Descriptor'.
    23  * It will get DecoderConfigDescriptor and SLConfigDescriptor from
    24  * AAC CSD data.
    25  */
    26 class ES_Descriptor : public MuxerOperation {
    27 public:
    28   // ISO BMFF members
    29   uint8_t tag;      // ESDescrTag
    30   uint8_t length;
    31   uint16_t ES_ID;
    32   std::bitset<1> streamDependenceFlag;
    33   std::bitset<1> URL_Flag;
    34   std::bitset<1> reserved;
    35   std::bitset<5> streamPriority;
    37   nsTArray<uint8_t> DecodeSpecificInfo;
    39   // MuxerOperation methods
    40   nsresult Generate(uint32_t* aBoxSize) MOZ_OVERRIDE;
    41   nsresult Write() MOZ_OVERRIDE;
    42   nsresult Find(const nsACString& aType,
    43                 nsTArray<nsRefPtr<MuxerOperation>>& aOperations) MOZ_OVERRIDE;
    45   // ES_Descriptor methods
    46   ES_Descriptor(ISOControl* aControl);
    47   ~ES_Descriptor();
    49 protected:
    50   ISOControl* mControl;
    51 };
    53 // 14496-14 5.6 'Sample Description Boxes'
    54 // Box type: 'esds'
    55 class ESDBox : public FullBox {
    56 public:
    57   // ISO BMFF members
    58   nsRefPtr<ES_Descriptor> es_descriptor;
    60   // MuxerOperation methods
    61   nsresult Generate(uint32_t* aBoxSize) MOZ_OVERRIDE;
    62   nsresult Write() MOZ_OVERRIDE;
    64   // ESDBox methods
    65   ESDBox(ISOControl* aControl);
    66   ~ESDBox();
    67 };
    69 // 14496-14 5.6 'Sample Description Boxes'
    70 // Box type: 'mp4a'
    71 class MP4AudioSampleEntry : public AudioSampleEntry {
    72 public:
    73   // ISO BMFF members
    74   nsRefPtr<ESDBox> es;
    76   // MuxerOperation methods
    77   nsresult Generate(uint32_t* aBoxSize) MOZ_OVERRIDE;
    78   nsresult Write() MOZ_OVERRIDE;
    80   // MP4AudioSampleEntry methods
    81   MP4AudioSampleEntry(ISOControl* aControl);
    82   ~MP4AudioSampleEntry();
    83 };
    85 }
    87 #endif // MP4ESDS_h_

mercurial