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

Unified Diff: content/common/gpu/media/gpu_video_encode_accelerator.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 5 years, 1 month 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: content/common/gpu/media/gpu_video_encode_accelerator.cc
diff --git a/content/common/gpu/media/gpu_video_encode_accelerator.cc b/content/common/gpu/media/gpu_video_encode_accelerator.cc
index ef1406003a11a6f8ca103fe0b2d489ff38a0fdbd..0d9dd614cda8c8b2c9b8b4f6e20574dc9c2df103 100644
--- a/content/common/gpu/media/gpu_video_encode_accelerator.cc
+++ b/content/common/gpu/media/gpu_video_encode_accelerator.cc
@@ -276,19 +276,18 @@ void GpuVideoEncodeAccelerator::OnEncode(
params.buffer_handle,
params.buffer_offset,
base::TimeDelta());
- frame->AddDestructionObserver(
- media::BindToCurrentLoop(
- base::Bind(&GpuVideoEncodeAccelerator::EncodeFrameFinished,
- weak_this_factory_.GetWeakPtr(),
- params.frame_id,
- base::Passed(&shm))));
-
if (!frame.get()) {
Pawel Osciak 2015/11/26 01:19:03 if (!frame) ?
emircan 2015/12/04 04:20:09 Done.
DLOG(ERROR) << "GpuVideoEncodeAccelerator::OnEncode(): could not create "
"VideoFrame for frame_id=" << params.frame_id;
Pawel Osciak 2015/11/26 01:19:03 s/"Video/<< "Video/
emircan 2015/12/04 04:20:09 Done.
NotifyError(media::VideoEncodeAccelerator::kPlatformFailureError);
return;
}
+ frame->AddDestructionObserver(
+ media::BindToCurrentLoop(
+ base::Bind(&GpuVideoEncodeAccelerator::EncodeFrameFinished,
+ weak_this_factory_.GetWeakPtr(),
+ params.frame_id,
+ base::Passed(&shm))));
encoder_->Encode(frame, params.force_keyframe);
}

Powered by Google App Engine
This is Rietveld 408576698