Fri, 16 Jan 2015 04:50:19 +0100
Replace accessor implementation with direct member state manipulation, by
request https://trac.torproject.org/projects/tor/ticket/9701#comment:32
michael@0 | 1 | /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-*/ |
michael@0 | 2 | /* This Source Code Form is subject to the terms of the Mozilla Public |
michael@0 | 3 | * License, v. 2.0. If a copy of the MPL was not distributed with this file, |
michael@0 | 4 | * You can obtain one at http://mozilla.org/MPL/2.0/. */ |
michael@0 | 5 | |
michael@0 | 6 | #ifndef MP4ESDS_h_ |
michael@0 | 7 | #define MP4ESDS_h_ |
michael@0 | 8 | |
michael@0 | 9 | #include "nsTArray.h" |
michael@0 | 10 | #include "MuxerOperation.h" |
michael@0 | 11 | |
michael@0 | 12 | namespace mozilla { |
michael@0 | 13 | |
michael@0 | 14 | class ISOControl; |
michael@0 | 15 | |
michael@0 | 16 | /** |
michael@0 | 17 | * ESDS tag |
michael@0 | 18 | */ |
michael@0 | 19 | #define ESDescrTag 0x03 |
michael@0 | 20 | |
michael@0 | 21 | /** |
michael@0 | 22 | * 14496-1 '8.3.3 ES_Descriptor'. |
michael@0 | 23 | * It will get DecoderConfigDescriptor and SLConfigDescriptor from |
michael@0 | 24 | * AAC CSD data. |
michael@0 | 25 | */ |
michael@0 | 26 | class ES_Descriptor : public MuxerOperation { |
michael@0 | 27 | public: |
michael@0 | 28 | // ISO BMFF members |
michael@0 | 29 | uint8_t tag; // ESDescrTag |
michael@0 | 30 | uint8_t length; |
michael@0 | 31 | uint16_t ES_ID; |
michael@0 | 32 | std::bitset<1> streamDependenceFlag; |
michael@0 | 33 | std::bitset<1> URL_Flag; |
michael@0 | 34 | std::bitset<1> reserved; |
michael@0 | 35 | std::bitset<5> streamPriority; |
michael@0 | 36 | |
michael@0 | 37 | nsTArray<uint8_t> DecodeSpecificInfo; |
michael@0 | 38 | |
michael@0 | 39 | // MuxerOperation methods |
michael@0 | 40 | nsresult Generate(uint32_t* aBoxSize) MOZ_OVERRIDE; |
michael@0 | 41 | nsresult Write() MOZ_OVERRIDE; |
michael@0 | 42 | nsresult Find(const nsACString& aType, |
michael@0 | 43 | nsTArray<nsRefPtr<MuxerOperation>>& aOperations) MOZ_OVERRIDE; |
michael@0 | 44 | |
michael@0 | 45 | // ES_Descriptor methods |
michael@0 | 46 | ES_Descriptor(ISOControl* aControl); |
michael@0 | 47 | ~ES_Descriptor(); |
michael@0 | 48 | |
michael@0 | 49 | protected: |
michael@0 | 50 | ISOControl* mControl; |
michael@0 | 51 | }; |
michael@0 | 52 | |
michael@0 | 53 | // 14496-14 5.6 'Sample Description Boxes' |
michael@0 | 54 | // Box type: 'esds' |
michael@0 | 55 | class ESDBox : public FullBox { |
michael@0 | 56 | public: |
michael@0 | 57 | // ISO BMFF members |
michael@0 | 58 | nsRefPtr<ES_Descriptor> es_descriptor; |
michael@0 | 59 | |
michael@0 | 60 | // MuxerOperation methods |
michael@0 | 61 | nsresult Generate(uint32_t* aBoxSize) MOZ_OVERRIDE; |
michael@0 | 62 | nsresult Write() MOZ_OVERRIDE; |
michael@0 | 63 | |
michael@0 | 64 | // ESDBox methods |
michael@0 | 65 | ESDBox(ISOControl* aControl); |
michael@0 | 66 | ~ESDBox(); |
michael@0 | 67 | }; |
michael@0 | 68 | |
michael@0 | 69 | // 14496-14 5.6 'Sample Description Boxes' |
michael@0 | 70 | // Box type: 'mp4a' |
michael@0 | 71 | class MP4AudioSampleEntry : public AudioSampleEntry { |
michael@0 | 72 | public: |
michael@0 | 73 | // ISO BMFF members |
michael@0 | 74 | nsRefPtr<ESDBox> es; |
michael@0 | 75 | |
michael@0 | 76 | // MuxerOperation methods |
michael@0 | 77 | nsresult Generate(uint32_t* aBoxSize) MOZ_OVERRIDE; |
michael@0 | 78 | nsresult Write() MOZ_OVERRIDE; |
michael@0 | 79 | |
michael@0 | 80 | // MP4AudioSampleEntry methods |
michael@0 | 81 | MP4AudioSampleEntry(ISOControl* aControl); |
michael@0 | 82 | ~MP4AudioSampleEntry(); |
michael@0 | 83 | }; |
michael@0 | 84 | |
michael@0 | 85 | } |
michael@0 | 86 | |
michael@0 | 87 | #endif // MP4ESDS_h_ |