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

Unified Diff: media/base/video_frame_unittest.cc

Issue 178133005: Audit/fix use of media::VideoFrame::coded_size() (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: e6f9affb danakj@ 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
Index: media/base/video_frame_unittest.cc
diff --git a/media/base/video_frame_unittest.cc b/media/base/video_frame_unittest.cc
index 05465d9b09dc1ec28751511bf97d205a71635378..656f5146191abf918fd2a21eca4f6186856dd7fb 100644
--- a/media/base/video_frame_unittest.cc
+++ b/media/base/video_frame_unittest.cc
@@ -88,8 +88,9 @@ void ExpectFrameColor(media::VideoFrame* yv12_frame, uint32 expect_rgb_color) {
// Fill each plane to its reported extents and verify accessors report non
// zero values. Additionally, for the first plane verify the rows and
// row_bytes values are correct.
-void ExpectFrameExtents(VideoFrame::Format format, int planes,
- int bytes_per_pixel, const char* expected_hash) {
+void ExpectFrameExtents(VideoFrame::Format format,
+ int planes,
+ const char* expected_hash) {
const unsigned char kFillByte = 0x80;
const int kWidth = 61;
const int kHeight = 31;
@@ -107,11 +108,6 @@ void ExpectFrameExtents(VideoFrame::Format format, int planes,
EXPECT_TRUE(frame->rows(plane));
EXPECT_TRUE(frame->row_bytes(plane));
- if (plane == 0) {
Ami GONE FROM CHROMIUM 2014/02/28 23:17:32 Why this change?
sheu 2014/03/01 01:56:57 VideoFrame::CreateFrame() can pad the coded_size o
- EXPECT_EQ(frame->rows(plane), kHeight);
- EXPECT_EQ(frame->row_bytes(plane), kWidth * bytes_per_pixel);
- }
-
memset(frame->data(plane), kFillByte,
frame->stride(plane) * frame->rows(plane));
}
@@ -206,10 +202,8 @@ TEST(VideoFrame, CheckFrameExtents) {
// Each call consists of a VideoFrame::Format, # of planes, bytes per pixel,
// and the expected hash of all planes if filled with kFillByte (defined in
// ExpectFrameExtents).
- ExpectFrameExtents(
- VideoFrame::YV12, 3, 1, "71113bdfd4c0de6cf62f48fb74f7a0b1");
- ExpectFrameExtents(
- VideoFrame::YV16, 3, 1, "9bb99ac3ff350644ebff4d28dc01b461");
+ ExpectFrameExtents(VideoFrame::YV12, 3, "8e5d54cb23cd0edca111dd35ffb6ff05");
+ ExpectFrameExtents(VideoFrame::YV16, 3, "cce408a044b212db42a10dfec304b3ef");
Ami GONE FROM CHROMIUM 2014/02/28 23:17:32 why these changes? (does this mean a bug was hidin
sheu 2014/03/01 01:56:57 Nope; we're padding out coded_size now so there's
}
static void TextureCallback(uint32* called_sync_point,

Powered by Google App Engine
This is Rietveld 408576698