Bug 1313632: P2. Cleaner Ogg related headers. r=kaku

MozReview-Commit-ID: DpnezpZw27H

--HG--
extra : rebase_source : 3700dbccbc98ae2aadd29fcf3fbef3e38fdec13c
This commit is contained in:
Jean-Yves Avenard 2016-11-09 12:19:06 +11:00
Родитель d3a0f99985
Коммит 87a107c468
8 изменённых файлов: 36 добавлений и 40 удалений

Просмотреть файл

@ -8,6 +8,7 @@
#include "mp4_demuxer/ByteReader.h"
#include "nsTArray.h"
#include "OggCodecState.h"
#include "OpusParser.h"
#include "VideoUtils.h"
using mp4_demuxer::ByteReader;
@ -43,6 +44,10 @@ FlacFrameParser::FlacFrameParser()
{
}
FlacFrameParser::~FlacFrameParser()
{
}
uint32_t
FlacFrameParser::HeaderBlockLength(const uint8_t* aPacket) const
{

Просмотреть файл

@ -26,6 +26,7 @@ class FlacFrameParser
{
public:
FlacFrameParser();
~FlacFrameParser();
bool IsHeaderBlock(const uint8_t* aPacket, size_t aLength) const;
// Return the length of the block header (METADATA_BLOCK_HEADER+
@ -56,7 +57,6 @@ private:
// Used to decode the vorbis comment metadata.
nsAutoPtr<OpusParser> mParser;
};
}

Просмотреть файл

@ -6,18 +6,18 @@
#include <string.h>
#include "mozilla/DebugOnly.h"
#include "mozilla/EndianUtils.h"
#include <stdint.h>
#include "nsDebug.h"
#include "MediaDecoderReader.h"
#include "OggCodecState.h"
#include "OggDecoder.h"
#include "nsISupportsImpl.h"
#include "OpusParser.h"
#include "VideoUtils.h"
#include <algorithm>
#include <opus/opus.h>
#include "opus/opus_multistream.h"
// On Android JellyBean, the hardware.h header redefines version_major and
// version_minor, which breaks our build. See:
// https://bugzilla.mozilla.org/show_bug.cgi?id=912702#c6

Просмотреть файл

@ -7,18 +7,7 @@
#define OggCodecState_h_
#include <ogg/ogg.h>
#include <theora/theoradec.h>
#ifdef MOZ_TREMOR
#include <tremor/ivorbiscodec.h>
#else
#include <vorbis/codec.h>
#endif
#include <opus/opus.h>
#include "opus/opus_multistream.h"
// For MOZ_SAMPLE_TYPE_*
#include "mozilla/dom/HTMLMediaElement.h"
#include "MediaDecoderStateMachine.h"
#include "MediaDecoderReader.h"
#include <nsAutoPtr.h>
#include <nsAutoRef.h>
#include <nsDeque.h>
@ -27,7 +16,12 @@
#include "VideoUtils.h"
#include "FlacFrameParser.h"
#include <stdint.h>
#include <theora/theoradec.h>
#ifdef MOZ_TREMOR
#include <tremor/ivorbiscodec.h>
#else
#include <vorbis/codec.h>
#endif
// Uncomment the following to validate that we're predicting the number
// of Vorbis samples in each packet correctly.
@ -36,10 +30,12 @@
#include <map>
#endif
#include "OpusParser.h"
struct OpusMSDecoder;
namespace mozilla {
class OpusParser;
// Deallocates a packet, used in OggPacketQueue below.
class OggPacketDeallocator : public nsDequeFunctor
{
@ -94,11 +90,11 @@ public:
};
virtual ~OggCodecState();
// Factory for creating nsCodecStates. Use instead of constructor.
// aPage should be a beginning-of-stream page.
static OggCodecState* Create(ogg_page* aPage);
virtual CodecType GetType() { return TYPE_UNKNOWN; }
// Reads a header packet. Returns false if an error was encountered
@ -209,7 +205,7 @@ public:
// captured.
virtual nsresult PageIn(ogg_page* aPage);
// Number of packets read.
// Number of packets read.
uint64_t mPacketCount;
// Serial number of the bitstream.
@ -224,7 +220,7 @@ public:
// Is the bitstream active; whether we're decoding and playing this bitstream.
bool mActive;
// True when all headers packets have been read.
bool mDoneReadingHeaders;
@ -360,7 +356,7 @@ public:
int64_t MaxKeyframeOffset();
// Returns the end time that a granulepos represents.
static int64_t Time(th_info* aInfo, int64_t aGranulePos);
static int64_t Time(th_info* aInfo, int64_t aGranulePos);
th_info mInfo;
th_comment mComment;
@ -566,7 +562,7 @@ private:
{
public:
nsKeyFrameIndex(int64_t aStartTime, int64_t aEndTime)
nsKeyFrameIndex(int64_t aStartTime, int64_t aEndTime)
: mStartTime(aStartTime)
, mEndTime(aEndTime)
{

Просмотреть файл

@ -4,18 +4,11 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include <string.h>
#include "mozilla/DebugOnly.h"
#include <algorithm>
#include "mozilla/EndianUtils.h"
#include <stdint.h>
#include "OpusParser.h"
#include "nsDebug.h"
#include "MediaDecoderReader.h"
#include "VideoUtils.h"
#include <algorithm>
#include "opus/opus.h"
extern "C" {

Просмотреть файл

@ -6,11 +6,6 @@
#if !defined(OpusParser_h_)
#define OpusParser_h_
#include <stdint.h>
#include <opus/opus.h>
#include "opus/opus_multistream.h"
#include "nsTArray.h"
#include "nsString.h"
@ -46,7 +41,6 @@ public:
nsTArray<nsCString> mTags; // Unparsed comment strings from the header.
nsCString mVendorString; // Encoder vendor string from the header.
};
} // namespace mozilla

Просмотреть файл

@ -5,6 +5,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "OpusDecoder.h"
#include "OpusParser.h"
#include "TimeUnits.h"
#include "VorbisUtils.h"
#include "VorbisDecoder.h" // For VorbisLayout
@ -12,9 +13,13 @@
#include "mozilla/PodOperations.h"
#include "mozilla/SyncRunnable.h"
#include <stdint.h>
#include <inttypes.h> // For PRId64
#include "opus/opus.h"
extern "C" {
#include "opus/opus_multistream.h"
}
#define OPUS_DEBUG(arg, ...) MOZ_LOG(sPDMLog, mozilla::LogLevel::Debug, \
("OpusDataDecoder(%p)::%s: " arg, this, __func__, ##__VA_ARGS__))

Просмотреть файл

@ -6,14 +6,17 @@
#if !defined(OpusDecoder_h_)
#define OpusDecoder_h_
#include "OpusParser.h"
#include "PlatformDecoderModule.h"
#include "mozilla/Maybe.h"
#include "nsAutoPtr.h"
struct OpusMSDecoder;
namespace mozilla {
class OpusParser;
class OpusDataDecoder : public MediaDataDecoder
{
public: