diff --git a/content/media/MediaDecoderStateMachine.cpp b/content/media/MediaDecoderStateMachine.cpp index 6c045ebb737..275fd27401c 100644 --- a/content/media/MediaDecoderStateMachine.cpp +++ b/content/media/MediaDecoderStateMachine.cpp @@ -620,7 +620,7 @@ static void WriteVideoToMediaStream(layers::Image* aImage, VideoSegment* aOutput) { nsRefPtr image = aImage; - aOutput->AppendFrame(image.forget(), aDuration, ThebesIntSize(aIntrinsicSize)); + aOutput->AppendFrame(image.forget(), aDuration, aIntrinsicSize); } static const TrackID TRACK_AUDIO = 1; diff --git a/content/media/VideoSegment.cpp b/content/media/VideoSegment.cpp index 5e0df4063c8..d61d1d8a459 100644 --- a/content/media/VideoSegment.cpp +++ b/content/media/VideoSegment.cpp @@ -4,6 +4,8 @@ * You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "VideoSegment.h" + +#include "gfx2DGlue.h" #include "ImageContainer.h" namespace mozilla { @@ -43,10 +45,10 @@ VideoChunk::~VideoChunk() void VideoSegment::AppendFrame(already_AddRefed aImage, TrackTicks aDuration, - const gfxIntSize& aIntrinsicSize) + const IntSize& aIntrinsicSize) { VideoChunk* chunk = AppendChunk(aDuration); - VideoFrame frame(aImage, aIntrinsicSize); + VideoFrame frame(aImage, ThebesIntSize(aIntrinsicSize)); chunk->mFrame.TakeFrom(&frame); } diff --git a/content/media/VideoSegment.h b/content/media/VideoSegment.h index 10d7e1f7d85..0f97af3d3bf 100644 --- a/content/media/VideoSegment.h +++ b/content/media/VideoSegment.h @@ -84,12 +84,13 @@ struct VideoChunk { class VideoSegment : public MediaSegmentBase { public: typedef mozilla::layers::Image Image; + typedef mozilla::gfx::IntSize IntSize; VideoSegment(); ~VideoSegment(); void AppendFrame(already_AddRefed aImage, TrackTicks aDuration, - const gfxIntSize& aIntrinsicSize); + const IntSize& aIntrinsicSize); const VideoFrame* GetFrameAt(TrackTicks aOffset, TrackTicks* aStart = nullptr) { VideoChunk* c = FindChunkContaining(aOffset, aStart); diff --git a/content/media/encoder/TrackEncoder.cpp b/content/media/encoder/TrackEncoder.cpp index cfc4a1532cb..5a193e9caee 100644 --- a/content/media/encoder/TrackEncoder.cpp +++ b/content/media/encoder/TrackEncoder.cpp @@ -197,7 +197,7 @@ VideoTrackEncoder::AppendVideoSegment(const VideoSegment& aSegment) VideoChunk chunk = *iter; nsRefPtr image = chunk.mFrame.GetImage(); mRawSegment.AppendFrame(image.forget(), chunk.GetDuration(), - chunk.mFrame.GetIntrinsicSize()); + chunk.mFrame.GetIntrinsicSize().ToIntSize()); iter.Next(); } diff --git a/content/media/webrtc/MediaEngineDefault.cpp b/content/media/webrtc/MediaEngineDefault.cpp index 8ff4241fa76..3dbb0851590 100644 --- a/content/media/webrtc/MediaEngineDefault.cpp +++ b/content/media/webrtc/MediaEngineDefault.cpp @@ -247,9 +247,9 @@ MediaEngineDefaultVideoSource::NotifyPull(MediaStreamGraph* aGraph, // nullptr images are allowed if (image) { segment.AppendFrame(image.forget(), delta, - gfxIntSize(mOpts.mWidth, mOpts.mHeight)); + IntSize(mOpts.mWidth, mOpts.mHeight)); } else { - segment.AppendFrame(nullptr, delta, gfxIntSize(0,0)); + segment.AppendFrame(nullptr, delta, IntSize(0, 0)); } // This can fail if either a) we haven't added the track yet, or b) // we've removed or finished the track. diff --git a/content/media/webrtc/MediaEngineTabVideoSource.cpp b/content/media/webrtc/MediaEngineTabVideoSource.cpp index 36f9bdd5a22..225019021c4 100644 --- a/content/media/webrtc/MediaEngineTabVideoSource.cpp +++ b/content/media/webrtc/MediaEngineTabVideoSource.cpp @@ -158,9 +158,9 @@ NotifyPull(MediaStreamGraph*, SourceMediaStream* aSource, mozilla::TrackID aID, // nullptr images are allowed if (image) { gfx::IntSize size = image->GetSize(); - segment.AppendFrame(image.forget(), delta, gfx::ThebesIntSize(size)); + segment.AppendFrame(image.forget(), delta, size); } else { - segment.AppendFrame(nullptr, delta, gfxIntSize(0,0)); + segment.AppendFrame(nullptr, delta, IntSize(0, 0)); } // This can fail if either a) we haven't added the track yet, or b) // we've removed or finished the track. diff --git a/content/media/webrtc/MediaEngineWebRTCVideo.cpp b/content/media/webrtc/MediaEngineWebRTCVideo.cpp index 92812f72ebb..d4b39d86ab8 100644 --- a/content/media/webrtc/MediaEngineWebRTCVideo.cpp +++ b/content/media/webrtc/MediaEngineWebRTCVideo.cpp @@ -143,9 +143,9 @@ MediaEngineWebRTCVideoSource::NotifyPull(MediaStreamGraph* aGraph, if (delta > 0) { // nullptr images are allowed if (image) { - segment.AppendFrame(image.forget(), delta, gfxIntSize(mWidth, mHeight)); + segment.AppendFrame(image.forget(), delta, IntSize(mWidth, mHeight)); } else { - segment.AppendFrame(nullptr, delta, gfxIntSize(0,0)); + segment.AppendFrame(nullptr, delta, IntSize(0, 0)); } // This can fail if either a) we haven't added the track yet, or b) // we've removed or finished the track. diff --git a/media/webrtc/signaling/src/mediapipeline/MediaPipeline.cpp b/media/webrtc/signaling/src/mediapipeline/MediaPipeline.cpp index 777a94da45d..bffb9a0f860 100644 --- a/media/webrtc/signaling/src/mediapipeline/MediaPipeline.cpp +++ b/media/webrtc/signaling/src/mediapipeline/MediaPipeline.cpp @@ -1243,8 +1243,7 @@ NotifyPull(MediaStreamGraph* graph, StreamTime desired_time) { // delta and thus messes up handling of the graph if (delta > 0) { VideoSegment segment; - segment.AppendFrame(image ? image.forget() : nullptr, delta, - gfxIntSize(width_, height_)); + segment.AppendFrame(image.forget(), delta, IntSize(width_, height_)); // Handle track not actually added yet or removed/finished if (source_->AppendToTrack(track_id_, &segment)) { played_ticks_ = target; diff --git a/media/webrtc/signaling/src/peerconnection/PeerConnectionMedia.h b/media/webrtc/signaling/src/peerconnection/PeerConnectionMedia.h index f58d9ceef01..b5e25017f3d 100644 --- a/media/webrtc/signaling/src/peerconnection/PeerConnectionMedia.h +++ b/media/webrtc/signaling/src/peerconnection/PeerConnectionMedia.h @@ -154,7 +154,8 @@ class Fake_VideoGenerator { // AddTrack takes ownership of segment mozilla::VideoSegment *segment = new mozilla::VideoSegment(); // 10 fps. - segment->AppendFrame(image.forget(), mozilla::USECS_PER_S / 10, gfxIntSize(WIDTH, HEIGHT)); + segment->AppendFrame(image.forget(), mozilla::USECS_PER_S / 10, + IntSize(WIDTH, HEIGHT)); gen->mStream->GetStream()->AsSourceStream()->AppendToTrack(1, segment); }