Bug 1186257 - Add missing mediasource includes. r=jya

Add missing includes, forward declarations, and fix up
namespace references so dom/media/mediasource compiles
in a non-unified build.

The header side at least is important for writing unit tests.
This commit is contained in:
Ralph Giles 2015-07-21 18:09:21 -07:00
parent 5d28d0b4d1
commit b94f9cca69
12 changed files with 29 additions and 11 deletions

View File

@ -7,6 +7,7 @@
#include "mozilla/Logging.h"
#include "mozilla/dom/HTMLMediaElement.h"
#include "mozilla/Preferences.h"
#include "MediaDecoderStateMachine.h"
#include "MediaSource.h"
#include "MediaSourceReader.h"
@ -16,6 +17,7 @@
#include "VideoUtils.h"
#include "MediaFormatReader.h"
#include "MediaSourceDemuxer.h"
#include "SourceBufferList.h"
extern PRLogModuleInfo* GetMediaSourceLog();

View File

@ -9,6 +9,7 @@
#include <stdint.h>
#include "MediaSourceDemuxer.h"
#include "MediaSourceUtils.h"
#include "SourceBufferList.h"
#include "nsPrintfCString.h"

View File

@ -124,10 +124,10 @@ public:
private:
nsRefPtr<SeekPromise> DoSeek(media::TimeUnit aTime);
nsRefPtr<SamplesPromise> DoGetSamples(int32_t aNumSamples);
nsRefPtr<SkipAccessPointPromise> DoSkipToNextRandomAccessPoint(TimeUnit aTimeThreadshold);
nsRefPtr<SkipAccessPointPromise> DoSkipToNextRandomAccessPoint(media::TimeUnit aTimeThreadshold);
already_AddRefed<MediaRawData> GetSample(DemuxerFailureReason& aFailure);
// Return the timestamp of the next keyframe after mLastSampleIndex.
TimeUnit GetNextRandomAccessPoint();
media::TimeUnit GetNextRandomAccessPoint();
nsRefPtr<MediaSourceDemuxer> mParent;
nsRefPtr<TrackBuffersManager> mManager;

View File

@ -7,6 +7,7 @@
#include <cmath>
#include "mozilla/Logging.h"
#include "mozilla/Preferences.h"
#include "DecoderTraits.h"
#include "MediaDecoderOwner.h"
#include "MediaFormatReader.h"

View File

@ -4,8 +4,10 @@
* 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 "ResourceQueue.h"
#include "nsDeque.h"
#include "MediaData.h"
#include "mozilla/ErrorResult.h"
#include "mozilla/Logging.h"
extern PRLogModuleInfo* GetSourceBufferResourceLog();

View File

@ -8,6 +8,7 @@
#include "AsyncEventRunner.h"
#include "MediaData.h"
#include "MediaSourceDemuxer.h"
#include "MediaSourceUtils.h"
#include "TrackBuffer.h"
#include "mozilla/ErrorResult.h"
@ -35,6 +36,8 @@ extern PRLogModuleInfo* GetMediaSourceAPILog();
namespace mozilla {
using media::TimeUnit;
namespace dom {
class BufferAppendRunnable : public nsRunnable {
@ -140,7 +143,7 @@ SourceBuffer::GetBuffered(ErrorResult& aRv)
aRv.Throw(NS_ERROR_DOM_INVALID_STATE_ERR);
return nullptr;
}
TimeIntervals ranges = mContentManager->Buffered();
media::TimeIntervals ranges = mContentManager->Buffered();
MSE_DEBUGV("ranges=%s", DumpTimeRanges(ranges).get());
nsRefPtr<dom::TimeRanges> tr = new dom::TimeRanges();
ranges.ToTimeRanges(tr);

View File

@ -5,6 +5,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "SourceBufferContentManager.h"
#include "mozilla/Preferences.h"
#include "TrackBuffer.h"
#include "TrackBuffersManager.h"

View File

@ -11,7 +11,6 @@
#include "MediaData.h"
#include "MediaSourceDecoder.h"
#include "SourceBuffer.h"
#include "TimeUnits.h"
#include "nsString.h"
@ -20,6 +19,10 @@ namespace mozilla {
using media::TimeUnit;
using media::TimeIntervals;
namespace dom {
class SourceBuffer;
}
class SourceBufferContentManager {
public:
NS_INLINE_DECL_THREADSAFE_REFCOUNTING(SourceBufferContentManager);

View File

@ -36,11 +36,11 @@ extern PRLogModuleInfo* GetMediaSourceLog();
#define EOS_FUZZ_US 125000
namespace mozilla {
using media::TimeIntervals;
using media::Interval;
namespace mozilla {
TrackBuffer::TrackBuffer(MediaSourceDecoder* aParentDecoder, const nsACString& aType)
: mParentDecoder(aParentDecoder)
, mType(aType)

View File

@ -139,7 +139,7 @@ private:
void NotifyReaderDataRemoved(MediaDecoderReader* aReader);
typedef MozPromise<bool, nsresult, /* IsExclusive = */ true> BufferedRangesUpdatedPromise;
nsRefPtr<BufferedRangesUpdatedPromise> UpdateBufferedRanges(Interval<int64_t> aByteRange, bool aNotifyParent);
nsRefPtr<BufferedRangesUpdatedPromise> UpdateBufferedRanges(media::Interval<int64_t> aByteRange, bool aNotifyParent);
// Queue execution of InitializeDecoder on mTaskQueue.
bool QueueInitializeDecoder(SourceBufferDecoder* aDecoder);
@ -236,7 +236,7 @@ private:
MozPromiseHolder<RangeRemovalPromise> mRangeRemovalPromise;
Interval<int64_t> mLastAppendRange;
media::Interval<int64_t> mLastAppendRange;
// Protected by Parent's decoder Monitor.
media::TimeIntervals mBufferedRanges;

View File

@ -5,9 +5,13 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "TrackBuffersManager.h"
#include "ContainerParser.h"
#include "MediaSourceDemuxer.h"
#include "MediaSourceUtils.h"
#include "mozilla/Preferences.h"
#include "mozilla/StateMirroring.h"
#include "SourceBufferResource.h"
#include "SourceBuffer.h"
#include "MediaSourceDemuxer.h"
#ifdef MOZ_FMP4
#include "MP4Demuxer.h"
@ -32,6 +36,8 @@ PRLogModuleInfo* GetMediaSourceSamplesLog()
namespace mozilla {
using dom::SourceBufferAppendMode;
static const char*
AppendStateToStr(TrackBuffersManager::AppendState aState)
{

View File

@ -11,7 +11,7 @@
#include "mozilla/Maybe.h"
#include "mozilla/Monitor.h"
#include "mozilla/Pair.h"
#include "mozilla/StateMirroring.h"
#include "mozilla/dom/SourceBufferBinding.h"
#include "SourceBufferContentManager.h"
#include "MediaDataDemuxer.h"
@ -31,7 +31,6 @@ class SourceBufferResource;
using media::TimeUnit;
using media::TimeInterval;
using media::TimeIntervals;
using dom::SourceBufferAppendMode;
class TrackBuffersManager : public SourceBufferContentManager {
public: