Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(755)

Unified Diff: media/cast/test/fake_media_source.cc

Issue 1476523005: Verify returned frames from media::VideoFrame::Wrap*() methods (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: media/cast/test/fake_media_source.cc
diff --git a/media/cast/test/fake_media_source.cc b/media/cast/test/fake_media_source.cc
index 8e411bb0dd2155b86ee5cca53df97a9eef97493b..7d58a4c391c093a604860f45c6fe780cf274c35f 100644
--- a/media/cast/test/fake_media_source.cc
+++ b/media/cast/test/fake_media_source.cc
@@ -557,10 +557,14 @@ void FakeMediaSource::DecodeVideo(ScopedAVPacket packet) {
video_first_pts_ = avframe->pkt_pts - adjustment_pts;
}
- video_frame_queue_.push(VideoFrame::WrapExternalYuvData(
- media::PIXEL_FORMAT_YV12, size, gfx::Rect(size), size,
- avframe->linesize[0], avframe->linesize[1], avframe->linesize[2],
- avframe->data[0], avframe->data[1], avframe->data[2], timestamp));
+ scoped_refptr<media::VideoFrame> video_frame =
+ VideoFrame::WrapExternalYuvData(
+ media::PIXEL_FORMAT_YV12, size, gfx::Rect(size), size,
+ avframe->linesize[0], avframe->linesize[1], avframe->linesize[2],
+ avframe->data[0], avframe->data[1], avframe->data[2], timestamp);
+ if (!video_frame)
+ return;
+ video_frame_queue_.push(video_frame);
video_frame_queue_.back()->AddDestructionObserver(
base::Bind(&AVFreeFrame, avframe));
last_video_frame_timestamp_ = timestamp;

Powered by Google App Engine
This is Rietveld 408576698