Back out 4fd2bf2ec8db (bug 939662) for Windows build bustage

CLOSED TREE
This commit is contained in:
Phil Ringnalda 2013-11-18 21:34:48 -08:00
parent 50639dcbe8
commit 102ba52e3d
12 changed files with 47 additions and 41 deletions

View File

@ -570,7 +570,7 @@ nsresult MediaDecoder::Play()
* (and can be -1 if aValue is before aRanges.Start(0)).
*/
static bool
IsInRanges(dom::TimeRanges& aRanges, double aValue, int32_t& aIntervalIndex)
IsInRanges(TimeRanges& aRanges, double aValue, int32_t& aIntervalIndex)
{
uint32_t length;
aRanges.GetLength(&length);
@ -598,7 +598,7 @@ nsresult MediaDecoder::Seek(double aTime)
NS_ABORT_IF_FALSE(aTime >= 0.0, "Cannot seek to a negative value.");
dom::TimeRanges seekable;
TimeRanges seekable;
nsresult res;
uint32_t length = 0;
res = GetSeekable(&seekable);
@ -1326,7 +1326,7 @@ bool MediaDecoder::IsMediaSeekable()
return mMediaSeekable;
}
nsresult MediaDecoder::GetSeekable(dom::TimeRanges* aSeekable)
nsresult MediaDecoder::GetSeekable(TimeRanges* aSeekable)
{
double initialTime = 0.0;
@ -1492,7 +1492,7 @@ void MediaDecoder::Invalidate()
// Constructs the time ranges representing what segments of the media
// are buffered and playable.
nsresult MediaDecoder::GetBuffered(dom::TimeRanges* aBuffered) {
nsresult MediaDecoder::GetBuffered(TimeRanges* aBuffered) {
if (mDecoderStateMachine) {
return mDecoderStateMachine->GetBuffered(aBuffered);
}

View File

@ -201,6 +201,8 @@ class TimeRanges;
}
}
using namespace mozilla::dom;
namespace mozilla {
namespace layers {
class Image;
@ -230,6 +232,8 @@ class MediaDecoder : public nsIObserver,
public AbstractMediaDecoder
{
public:
typedef mozilla::layers::Image Image;
NS_DECL_THREADSAFE_ISUPPORTS
NS_DECL_NSIOBSERVER
@ -367,7 +371,7 @@ public:
MediaDecoder* mDecoder;
// The last video image sent to the stream. Useful if we need to replicate
// the image.
nsRefPtr<layers::Image> mLastVideoImage;
nsRefPtr<Image> mLastVideoImage;
gfxIntSize mLastVideoImageDisplaySize;
// This is set to true when the stream is initialized (audio and
// video tracks added).
@ -519,7 +523,7 @@ public:
virtual bool IsTransportSeekable();
// Return the time ranges that can be seeked into.
virtual nsresult GetSeekable(dom::TimeRanges* aSeekable);
virtual nsresult GetSeekable(TimeRanges* aSeekable);
// Set the end time of the media resource. When playback reaches
// this point the media pauses. aTime is in seconds.
@ -555,7 +559,7 @@ public:
virtual void MoveLoadsToBackground();
// Returns a weak reference to the media decoder owner.
MediaDecoderOwner* GetMediaOwner() const;
mozilla::MediaDecoderOwner* GetMediaOwner() const;
// Returns the current size of the framebuffer used in
// MozAudioAvailable events.
@ -580,7 +584,7 @@ public:
// Constructs the time ranges representing what segments of the media
// are buffered and playable.
virtual nsresult GetBuffered(dom::TimeRanges* aBuffered);
virtual nsresult GetBuffered(TimeRanges* aBuffered);
// Returns the size, in bytes, of the heap memory used by the currently
// queued decoded video and audio data.
@ -591,7 +595,7 @@ public:
{
return mVideoFrameContainer;
}
layers::ImageContainer* GetImageContainer() MOZ_OVERRIDE;
mozilla::layers::ImageContainer* GetImageContainer() MOZ_OVERRIDE;
// Sets the length of the framebuffer used in MozAudioAvailable events.
// The new size must be between 512 and 16384.
@ -657,8 +661,8 @@ public:
// held.
void UpdatePlaybackPosition(int64_t aTime) MOZ_FINAL MOZ_OVERRIDE;
void SetAudioChannelType(dom::AudioChannelType aType) { mAudioChannelType = aType; }
dom::AudioChannelType GetAudioChannelType() { return mAudioChannelType; }
void SetAudioChannelType(AudioChannelType aType) { mAudioChannelType = aType; }
AudioChannelType GetAudioChannelType() { return mAudioChannelType; }
// Send a new set of metadata to the state machine, to be dispatched to the
// main thread to be presented when the |currentTime| of the media is greater
@ -923,7 +927,6 @@ public:
GetFrameStatistics().NotifyDecodedFrames(aParsed, aDecoded);
}
protected:
/******
* The following members should be accessed with the decoder lock held.
******/
@ -1022,7 +1025,7 @@ private:
// The |RestrictedAccessMonitor| member object.
RestrictedAccessMonitor mReentrantMonitor;
protected:
public:
// Data about MediaStreams that are being fed by this decoder.
nsTArray<OutputStreamData> mOutputStreams;
// The SourceMediaStream we are using to feed the mOutputStreams. This stream
@ -1084,6 +1087,8 @@ protected:
// PlaybackEnded when mDecodedStream->mStream finishes.
bool mTriggerPlaybackEndedWhenSourceStreamFinishes;
protected:
// Start timer to update download progress information.
nsresult StartProgress();
@ -1143,7 +1148,7 @@ protected:
// Be assigned from media element during the initialization and pass to
// AudioStream Class.
dom::AudioChannelType mAudioChannelType;
AudioChannelType mAudioChannelType;
};
} // namespace mozilla

View File

@ -1605,7 +1605,7 @@ void MediaDecoderStateMachine::NotifyDataArrived(const char* aBuffer,
// faster than played, mEndTime won't reflect the end of playable data
// since we haven't played the frame at the end of buffered data. So update
// mEndTime here as new data is downloaded to prevent such a lag.
dom::TimeRanges buffered;
TimeRanges buffered;
if (mDecoder->IsInfinite() &&
NS_SUCCEEDED(mDecoder->GetBuffered(&buffered)))
{
@ -1851,7 +1851,7 @@ int64_t MediaDecoderStateMachine::GetUndecodedData() const
AssertCurrentThreadInMonitor();
NS_ASSERTION(mState > DECODER_STATE_DECODING_METADATA,
"Must have loaded metadata for GetBuffered() to work");
dom::TimeRanges buffered;
TimeRanges buffered;
nsresult res = mDecoder->GetBuffered(&buffered);
NS_ENSURE_SUCCESS(res, 0);
@ -2713,7 +2713,7 @@ void MediaDecoderStateMachine::StartBuffering()
stats.mDownloadRate/1024, stats.mDownloadRateReliable ? "" : " (unreliable)"));
}
nsresult MediaDecoderStateMachine::GetBuffered(dom::TimeRanges* aBuffered) {
nsresult MediaDecoderStateMachine::GetBuffered(TimeRanges* aBuffered) {
MediaResource* resource = mDecoder->GetResource();
NS_ENSURE_TRUE(resource, NS_ERROR_FAILURE);
resource->Pin();

View File

@ -255,7 +255,7 @@ public:
return mState == DECODER_STATE_SEEKING;
}
nsresult GetBuffered(dom::TimeRanges* aBuffered);
nsresult GetBuffered(TimeRanges* aBuffered);
void SetPlaybackRate(double aPlaybackRate);
void SetPreservesPitch(bool aPreservesPitch);

View File

@ -147,7 +147,7 @@ ChannelMediaResource::OnStartRequest(nsIRequest* aRequest)
MediaDecoderOwner* owner = mDecoder->GetMediaOwner();
NS_ENSURE_TRUE(owner, NS_ERROR_FAILURE);
dom::HTMLMediaElement* element = owner->GetMediaElement();
HTMLMediaElement* element = owner->GetMediaElement();
NS_ENSURE_TRUE(element, NS_ERROR_FAILURE);
nsresult status;
nsresult rv = aRequest->GetStatus(&status);
@ -583,7 +583,7 @@ nsresult ChannelMediaResource::OpenChannel(nsIStreamListener** aStreamListener)
// an authorizing Access-Control header.
MediaDecoderOwner* owner = mDecoder->GetMediaOwner();
NS_ENSURE_TRUE(owner, NS_ERROR_FAILURE);
dom::HTMLMediaElement* element = owner->GetMediaElement();
HTMLMediaElement* element = owner->GetMediaElement();
NS_ENSURE_TRUE(element, NS_ERROR_FAILURE);
if (element->ShouldCheckAllowOrigin()) {
nsRefPtr<nsCORSListenerProxy> crossSiteListener =
@ -642,7 +642,7 @@ void ChannelMediaResource::SetupChannelHeaders()
if (!owner) {
return;
}
dom::HTMLMediaElement* element = owner->GetMediaElement();
HTMLMediaElement* element = owner->GetMediaElement();
if (!element) {
return;
}
@ -805,7 +805,7 @@ void ChannelMediaResource::Suspend(bool aCloseImmediately)
// Shutting down; do nothing.
return;
}
dom::HTMLMediaElement* element = owner->GetMediaElement();
HTMLMediaElement* element = owner->GetMediaElement();
if (!element) {
// Shutting down; do nothing.
return;
@ -840,7 +840,7 @@ void ChannelMediaResource::Resume()
// Shutting down; do nothing.
return;
}
dom::HTMLMediaElement* element = owner->GetMediaElement();
HTMLMediaElement* element = owner->GetMediaElement();
if (!element) {
// Shutting down; do nothing.
return;
@ -889,7 +889,7 @@ ChannelMediaResource::RecreateChannel()
// The decoder is being shut down, so don't bother opening a new channel
return NS_OK;
}
dom::HTMLMediaElement* element = owner->GetMediaElement();
HTMLMediaElement* element = owner->GetMediaElement();
if (!element) {
// The decoder is being shut down, so don't bother opening a new channel
return NS_OK;
@ -1309,7 +1309,7 @@ nsresult FileMediaResource::Open(nsIStreamListener** aStreamListener)
// web server.
MediaDecoderOwner* owner = mDecoder->GetMediaOwner();
NS_ENSURE_TRUE(owner, NS_ERROR_FAILURE);
dom::HTMLMediaElement* element = owner->GetMediaElement();
HTMLMediaElement* element = owner->GetMediaElement();
NS_ENSURE_TRUE(element, NS_ERROR_FAILURE);
rv = nsContentUtils::GetSecurityManager()->
@ -1374,7 +1374,7 @@ already_AddRefed<MediaResource> FileMediaResource::CloneData(MediaDecoder* aDeco
// The decoder is being shut down, so we can't clone
return nullptr;
}
dom::HTMLMediaElement* element = owner->GetMediaElement();
HTMLMediaElement* element = owner->GetMediaElement();
if (!element) {
// The decoder is being shut down, so we can't clone
return nullptr;
@ -1533,7 +1533,7 @@ void BaseMediaResource::MoveLoadsToBackground() {
NS_WARNING("Null owner in MediaResource::MoveLoadsToBackground()");
return;
}
dom::HTMLMediaElement* element = owner->GetMediaElement();
HTMLMediaElement* element = owner->GetMediaElement();
if (!element) {
NS_WARNING("Null element in MediaResource::MoveLoadsToBackground()");
return;

View File

@ -504,7 +504,7 @@ RtspMediaResource::OnConnected(uint8_t aTrackIdx,
MediaDecoderOwner* owner = mDecoder->GetMediaOwner();
NS_ENSURE_TRUE(owner, NS_ERROR_FAILURE);
dom::HTMLMediaElement* element = owner->GetMediaElement();
HTMLMediaElement* element = owner->GetMediaElement();
NS_ENSURE_TRUE(element, NS_ERROR_FAILURE);
element->FinishDecoderSetup(mDecoder, this);
@ -535,7 +535,7 @@ void RtspMediaResource::Suspend(bool aCloseImmediately)
MediaDecoderOwner* owner = mDecoder->GetMediaOwner();
NS_ENSURE_TRUE_VOID(owner);
dom::HTMLMediaElement* element = owner->GetMediaElement();
HTMLMediaElement* element = owner->GetMediaElement();
NS_ENSURE_TRUE_VOID(element);
mMediaStreamController->Suspend();
@ -548,7 +548,7 @@ void RtspMediaResource::Resume()
MediaDecoderOwner* owner = mDecoder->GetMediaOwner();
NS_ENSURE_TRUE_VOID(owner);
dom::HTMLMediaElement* element = owner->GetMediaElement();
HTMLMediaElement* element = owner->GetMediaElement();
NS_ENSURE_TRUE_VOID(element);
if (mChannel) {

View File

@ -654,7 +654,7 @@ nsresult GStreamerReader::Seek(int64_t aTarget,
return DecodeToTarget(aTarget);
}
nsresult GStreamerReader::GetBuffered(dom::TimeRanges* aBuffered,
nsresult GStreamerReader::GetBuffered(TimeRanges* aBuffered,
int64_t aStartTime)
{
if (!mInfo.HasValidMedia()) {

View File

@ -35,6 +35,7 @@ namespace dom {
class GlobalObject;
class SourceBuffer;
class SourceBufferList;
class TimeRanges;
template <typename T> class Optional;
#define MOZILLA_DOM_MEDIASOURCE_IMPLEMENTATION_IID \

View File

@ -120,7 +120,7 @@ private:
}
};
MediaSourceDecoder::MediaSourceDecoder(dom::HTMLMediaElement* aElement)
MediaSourceDecoder::MediaSourceDecoder(HTMLMediaElement* aElement)
: mMediaSource(nullptr)
, mVideoReader(nullptr),
mAudioReader(nullptr)
@ -148,13 +148,13 @@ MediaSourceDecoder::Load(nsIStreamListener**, MediaDecoder*)
}
nsresult
MediaSourceDecoder::GetSeekable(dom::TimeRanges* aSeekable)
MediaSourceDecoder::GetSeekable(TimeRanges* aSeekable)
{
double duration = mMediaSource->Duration();
if (IsNaN(duration)) {
// Return empty range.
} else if (duration > 0 && mozilla::IsInfinite(duration)) {
nsRefPtr<dom::TimeRanges> bufferedRanges = new dom::TimeRanges();
nsRefPtr<TimeRanges> bufferedRanges = new TimeRanges();
GetBuffered(bufferedRanges);
aSeekable->Add(0, bufferedRanges->GetFinalEndTime());
} else {
@ -164,7 +164,7 @@ MediaSourceDecoder::GetSeekable(dom::TimeRanges* aSeekable)
}
void
MediaSourceDecoder::AttachMediaSource(dom::MediaSource* aMediaSource)
MediaSourceDecoder::AttachMediaSource(MediaSource* aMediaSource)
{
MOZ_ASSERT(!mMediaSource && !mDecoderStateMachine);
mMediaSource = aMediaSource;

View File

@ -36,14 +36,14 @@ class MediaSource;
class MediaSourceDecoder : public MediaDecoder
{
public:
MediaSourceDecoder(dom::HTMLMediaElement* aElement);
MediaSourceDecoder(HTMLMediaElement* aElement);
virtual MediaDecoder* Clone() MOZ_OVERRIDE;
virtual MediaDecoderStateMachine* CreateStateMachine() MOZ_OVERRIDE;
virtual nsresult Load(nsIStreamListener**, MediaDecoder*) MOZ_OVERRIDE;
virtual nsresult GetSeekable(dom::TimeRanges* aSeekable) MOZ_OVERRIDE;
virtual nsresult GetSeekable(TimeRanges* aSeekable) MOZ_OVERRIDE;
void AttachMediaSource(dom::MediaSource* aMediaSource);
void AttachMediaSource(MediaSource* aMediaSource);
void DetachMediaSource();
SubBufferDecoder* CreateSubDecoder(const nsACString& aType);
@ -80,7 +80,7 @@ public:
}
private:
dom::MediaSource* mMediaSource;
MediaSource* mMediaSource;
nsTArray<nsRefPtr<SubBufferDecoder> > mDecoders;
nsTArray<MediaDecoderReader*> mReaders; // Readers owned by Decoders.

View File

@ -48,7 +48,7 @@ public:
mParentDecoder->NotifyDataArrived(aBuffer, aLength, aOffset);
}
nsresult GetBuffered(dom::TimeRanges* aBuffered)
nsresult GetBuffered(TimeRanges* aBuffered)
{
// XXX: Need mStartTime (from StateMachine) instead of passing 0.
return mReader->GetBuffered(aBuffered, 0);

View File

@ -1772,7 +1772,7 @@ nsresult OggReader::SeekBisection(int64_t aTarget,
return NS_OK;
}
nsresult OggReader::GetBuffered(dom::TimeRanges* aBuffered, int64_t aStartTime)
nsresult OggReader::GetBuffered(TimeRanges* aBuffered, int64_t aStartTime)
{
{
mozilla::ReentrantMonitorAutoEnter mon(mMonitor);