summaryrefslogtreecommitdiffstats
path: root/media/cast
diff options
context:
space:
mode:
authorMatt Mueller <mattm@chromium.org>2015-05-29 11:18:05 -0700
committerMatt Mueller <mattm@chromium.org>2015-05-29 18:19:36 +0000
commit4e5779460e0fd5d9d7a227984b60ca85c4d93b9a (patch)
treea63f958fdd76c3d051cc89f8893aee7665cc3166 /media/cast
parent70fcdc97f0f389e70bfcfcec4786b13d6a06bdba (diff)
downloadchromium_src-4e5779460e0fd5d9d7a227984b60ca85c4d93b9a.zip
chromium_src-4e5779460e0fd5d9d7a227984b60ca85c4d93b9a.tar.gz
chromium_src-4e5779460e0fd5d9d7a227984b60ca85c4d93b9a.tar.bz2
Revert "VideoFrame: Segregate Pixel Format and Storage Type."
This reverts commit 80f289fe303323361d07c5b58b23f8499903a154. Appears to have broken chromium OS compile: ../../content/common/gpu/media/v4l2_device.cc: In static member function 'static media::VideoFrame::Format content::V4L2Device::V4L2PixFmtToVideoFrameFormat(uint32)': ../../content/common/gpu/media/v4l2_device.cc:46:14: error: 'NV12' is not a member of 'media::VideoFrame' return media::VideoFrame::NV12; ^ ../../content/common/gpu/media/v4l2_device.cc: In static member function 'static uint32 content::V4L2Device::VideoFrameFormatToV4L2PixFmt(media::VideoFrame::Format)': ../../content/common/gpu/media/v4l2_device.cc:65:10: error: 'NV12' is not a member of 'media::VideoFrame' case media::VideoFrame::NV12: ^ [..snip..] In file included from ../../base/memory/weak_ptr.h:69:0, from ../../base/bind_helpers.h:148, from ../../base/bind_internal.h:8, from ../../base/bind.h:8, from ../../content/common/gpu/media/v4l2_image_processor.cc:12: ../../content/common/gpu/media/v4l2_image_processor.cc: In member function 'bool content::V4L2ImageProcessor::Initialize(media::VideoFrame::Format, media::VideoFrame::Format, gfx::Size, gfx::Size, gfx::Size, const Closure&)': ../../content/common/gpu/media/v4l2_image_processor.cc:112:28: error: 'NV12' is not a member of 'media::VideoFrame' DCHECK_EQ(output_format, media::VideoFrame::NV12); ^ ../../base/logging.h:671:22: note: in definition of macro 'DCHECK_OP' (val1), (val2), #val1 " " #op " " #val2)) \ ^ ../../content/common/gpu/media/v4l2_image_processor.cc:112:3: note: in expansion of macro 'DCHECK_EQ' DCHECK_EQ(output_format, media::VideoFrame::NV12); ^ ninja: build stopped: subcommand failed. BUG=489744 CQ_INCLUDE_TRYBOTS=tryserver.blink:linux_blink_rel TBR=mcasas@chromium.org Review URL: https://codereview.chromium.org/1161803003 Cr-Commit-Position: refs/heads/master@{#332012}
Diffstat (limited to 'media/cast')
-rw-r--r--media/cast/test/end2end_unittest.cc5
-rw-r--r--media/cast/test/utility/video_utility.cc45
2 files changed, 22 insertions, 28 deletions
diff --git a/media/cast/test/end2end_unittest.cc b/media/cast/test/end2end_unittest.cc
index 4b3bbba..15fdf74 100644
--- a/media/cast/test/end2end_unittest.cc
+++ b/media/cast/test/end2end_unittest.cc
@@ -656,9 +656,8 @@ class End2EndTest : public ::testing::Test {
// since the video clock may not be the same as the reference clock.
const base::TimeDelta time_diff = reference_time - start_time_;
const gfx::Size size(kVideoHdWidth, kVideoHdHeight);
- EXPECT_TRUE(VideoFrame::IsValidConfig(VideoFrame::I420,
- VideoFrame::STORAGE_UNKNOWN, size,
- gfx::Rect(size), size));
+ EXPECT_TRUE(VideoFrame::IsValidConfig(
+ VideoFrame::I420, size, gfx::Rect(size), size));
scoped_refptr<media::VideoFrame> video_frame =
media::VideoFrame::CreateFrame(
VideoFrame::I420, size, gfx::Rect(size), size,
diff --git a/media/cast/test/utility/video_utility.cc b/media/cast/test/utility/video_utility.cc
index 8c4b0cb..46469563 100644
--- a/media/cast/test/utility/video_utility.cc
+++ b/media/cast/test/utility/video_utility.cc
@@ -77,7 +77,6 @@ void PopulateVideoFrame(VideoFrame* frame, int start_value) {
}
const int half_height = (height + 1) / 2;
-#if defined(OS_MACOSX)
if (frame->format() == VideoFrame::NV12) {
const int stride_uv = frame->stride(VideoFrame::kUVPlane);
uint8* uv_plane = frame->data(VideoFrame::kUVPlane);
@@ -92,11 +91,7 @@ void PopulateVideoFrame(VideoFrame* frame, int start_value) {
uv_plane += 2;
}
}
- } else
-#endif
- {
- DCHECK(frame->format() == VideoFrame::I420 ||
- frame->format() == VideoFrame::YV12);
+ } else { // I420, YV12, etc.
const int stride_u = frame->stride(VideoFrame::kUPlane);
const int stride_v = frame->stride(VideoFrame::kVPlane);
uint8* u_plane = frame->data(VideoFrame::kUPlane);
@@ -117,7 +112,7 @@ void PopulateVideoFrame(VideoFrame* frame, int start_value) {
const int stripe_j = (j / stripe_size) * stripe_size;
for (int i = 0; i < stride_v; ++i) {
const int stripe_i = (i / stripe_size) * stripe_size;
- *v_plane = static_cast<uint8>(start_value + stripe_i + stripe_j);
+ *u_plane = static_cast<uint8>(start_value + stripe_i + stripe_j);
++v_plane;
}
}
@@ -125,14 +120,14 @@ void PopulateVideoFrame(VideoFrame* frame, int start_value) {
}
void PopulateVideoFrameWithNoise(VideoFrame* frame) {
- const int height = frame->coded_size().height();
- const int stride_y = frame->stride(VideoFrame::kYPlane);
- const int stride_u = frame->stride(VideoFrame::kUPlane);
- const int stride_v = frame->stride(VideoFrame::kVPlane);
- const int half_height = (height + 1) / 2;
- uint8* const y_plane = frame->data(VideoFrame::kYPlane);
- uint8* const u_plane = frame->data(VideoFrame::kUPlane);
- uint8* const v_plane = frame->data(VideoFrame::kVPlane);
+ int height = frame->coded_size().height();
+ int stride_y = frame->stride(VideoFrame::kYPlane);
+ int stride_u = frame->stride(VideoFrame::kUPlane);
+ int stride_v = frame->stride(VideoFrame::kVPlane);
+ int half_height = (height + 1) / 2;
+ uint8* y_plane = frame->data(VideoFrame::kYPlane);
+ uint8* u_plane = frame->data(VideoFrame::kUPlane);
+ uint8* v_plane = frame->data(VideoFrame::kVPlane);
base::RandBytes(y_plane, height * stride_y);
base::RandBytes(u_plane, half_height * stride_u);
@@ -140,17 +135,17 @@ void PopulateVideoFrameWithNoise(VideoFrame* frame) {
}
bool PopulateVideoFrameFromFile(VideoFrame* frame, FILE* video_file) {
- const int width = frame->coded_size().width();
- const int height = frame->coded_size().height();
- const int half_width = (width + 1) / 2;
- const int half_height = (height + 1) / 2;
- const size_t frame_size = width * height + 2 * half_width * half_height;
- uint8* const y_plane = frame->data(VideoFrame::kYPlane);
- uint8* const u_plane = frame->data(VideoFrame::kUPlane);
- uint8* const v_plane = frame->data(VideoFrame::kVPlane);
+ int width = frame->coded_size().width();
+ int height = frame->coded_size().height();
+ int half_width = (width + 1) / 2;
+ int half_height = (height + 1) / 2;
+ size_t frame_size = width * height + 2 * half_width * half_height;
+ uint8* y_plane = frame->data(VideoFrame::kYPlane);
+ uint8* u_plane = frame->data(VideoFrame::kUPlane);
+ uint8* v_plane = frame->data(VideoFrame::kVPlane);
- uint8* const raw_data = new uint8[frame_size];
- const size_t count = fread(raw_data, 1, frame_size, video_file);
+ uint8* raw_data = new uint8[frame_size];
+ size_t count = fread(raw_data, 1, frame_size, video_file);
if (count != frame_size)
return false;