XiphExtradata.h (1159B)
1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 2 /* vim: set ts=8 sts=2 et sw=2 tw=80: */ 3 /* This Source Code Form is subject to the terms of the Mozilla Public 4 * License, v. 2.0. If a copy of the MPL was not distributed with this 5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 6 #ifndef XiphExtradata_h 7 #define XiphExtradata_h 8 9 #include "MediaData.h" 10 11 namespace mozilla { 12 13 /* This converts a list of headers to the canonical form of extradata for Xiph 14 codecs in non-Ogg containers. We use it to pass those headers from demuxer 15 to decoder even when demuxing from an Ogg cotainer. */ 16 bool XiphHeadersToExtradata(MediaByteBuffer* aCodecSpecificConfig, 17 const nsTArray<const unsigned char*>& aHeaders, 18 const nsTArray<size_t>& aHeaderLens); 19 20 /* This converts a set of extradata back into a list of headers. */ 21 bool XiphExtradataToHeaders(nsTArray<unsigned char*>& aHeaders, 22 nsTArray<size_t>& aHeaderLens, unsigned char* aData, 23 size_t aAvailable); 24 25 } // namespace mozilla 26 27 #endif // XiphExtradata_h