michael@0: /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-*/ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this file, michael@0: * You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #ifndef MP4ESDS_h_ michael@0: #define MP4ESDS_h_ michael@0: michael@0: #include "nsTArray.h" michael@0: #include "MuxerOperation.h" michael@0: michael@0: namespace mozilla { michael@0: michael@0: class ISOControl; michael@0: michael@0: /** michael@0: * ESDS tag michael@0: */ michael@0: #define ESDescrTag 0x03 michael@0: michael@0: /** michael@0: * 14496-1 '8.3.3 ES_Descriptor'. michael@0: * It will get DecoderConfigDescriptor and SLConfigDescriptor from michael@0: * AAC CSD data. michael@0: */ michael@0: class ES_Descriptor : public MuxerOperation { michael@0: public: michael@0: // ISO BMFF members michael@0: uint8_t tag; // ESDescrTag michael@0: uint8_t length; michael@0: uint16_t ES_ID; michael@0: std::bitset<1> streamDependenceFlag; michael@0: std::bitset<1> URL_Flag; michael@0: std::bitset<1> reserved; michael@0: std::bitset<5> streamPriority; michael@0: michael@0: nsTArray DecodeSpecificInfo; michael@0: michael@0: // MuxerOperation methods michael@0: nsresult Generate(uint32_t* aBoxSize) MOZ_OVERRIDE; michael@0: nsresult Write() MOZ_OVERRIDE; michael@0: nsresult Find(const nsACString& aType, michael@0: nsTArray>& aOperations) MOZ_OVERRIDE; michael@0: michael@0: // ES_Descriptor methods michael@0: ES_Descriptor(ISOControl* aControl); michael@0: ~ES_Descriptor(); michael@0: michael@0: protected: michael@0: ISOControl* mControl; michael@0: }; michael@0: michael@0: // 14496-14 5.6 'Sample Description Boxes' michael@0: // Box type: 'esds' michael@0: class ESDBox : public FullBox { michael@0: public: michael@0: // ISO BMFF members michael@0: nsRefPtr es_descriptor; michael@0: michael@0: // MuxerOperation methods michael@0: nsresult Generate(uint32_t* aBoxSize) MOZ_OVERRIDE; michael@0: nsresult Write() MOZ_OVERRIDE; michael@0: michael@0: // ESDBox methods michael@0: ESDBox(ISOControl* aControl); michael@0: ~ESDBox(); michael@0: }; michael@0: michael@0: // 14496-14 5.6 'Sample Description Boxes' michael@0: // Box type: 'mp4a' michael@0: class MP4AudioSampleEntry : public AudioSampleEntry { michael@0: public: michael@0: // ISO BMFF members michael@0: nsRefPtr es; michael@0: michael@0: // MuxerOperation methods michael@0: nsresult Generate(uint32_t* aBoxSize) MOZ_OVERRIDE; michael@0: nsresult Write() MOZ_OVERRIDE; michael@0: michael@0: // MP4AudioSampleEntry methods michael@0: MP4AudioSampleEntry(ISOControl* aControl); michael@0: ~MP4AudioSampleEntry(); michael@0: }; michael@0: michael@0: } michael@0: michael@0: #endif // MP4ESDS_h_