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

Unified Diff: content/common/gpu/media/android_video_encode_accelerator.cc

Issue 178133005: Audit/fix use of media::VideoFrame::coded_size() (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 6f577dde Comments. Created 6 years, 10 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
« no previous file with comments | « cc/resources/video_resource_updater.cc ('k') | media/base/video_frame.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/common/gpu/media/android_video_encode_accelerator.cc
diff --git a/content/common/gpu/media/android_video_encode_accelerator.cc b/content/common/gpu/media/android_video_encode_accelerator.cc
index 05f18b6b12513c318a1753885b416710447f41ca..e474137871631b064b67a10700fbff688d54c1c2 100644
--- a/content/common/gpu/media/android_video_encode_accelerator.cc
+++ b/content/common/gpu/media/android_video_encode_accelerator.cc
@@ -202,15 +202,16 @@ void AndroidVideoEncodeAccelerator::Encode(
// MediaCodec doesn't have a way to specify stride for non-Packed formats, so
// we insist on being called with packed frames and no cropping :(
- RETURN_ON_FAILURE(frame->row_bytes(VideoFrame::kYPlane) ==
- frame->stride(VideoFrame::kYPlane) &&
- frame->row_bytes(VideoFrame::kUPlane) ==
- frame->stride(VideoFrame::kUPlane) &&
- frame->row_bytes(VideoFrame::kVPlane) ==
- frame->stride(VideoFrame::kVPlane) &&
- gfx::Rect(frame->coded_size()) == frame->visible_rect(),
- "Non-packed frame, or visible rect != coded size",
- kInvalidArgumentError);
+ RETURN_ON_FAILURE(
+ frame->row_bytes(VideoFrame::kYPlane) ==
+ frame->stride(VideoFrame::kYPlane) &&
+ frame->row_bytes(VideoFrame::kUPlane) ==
+ frame->stride(VideoFrame::kUPlane) &&
+ frame->row_bytes(VideoFrame::kVPlane) ==
+ frame->stride(VideoFrame::kVPlane) &&
+ frame->coded_size().width() == frame->visible_rect().width(),
Ami GONE FROM CHROMIUM 2014/02/28 00:48:13 I still think this is wrong because there's no way
+ "Non-packed frame, or visible_rect/coded_size mismatch",
+ kInvalidArgumentError);
pending_frames_.push(MakeTuple(frame, force_keyframe, base::Time::Now()));
DoIOTask();
« no previous file with comments | « cc/resources/video_resource_updater.cc ('k') | media/base/video_frame.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698