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

Unified Diff: media/base/video_frame.cc

Issue 10024072: Cull unnecessary media::VideoFrame::Formats from the enum. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: shader_bench builds after having RGBA experimental code ripped out. Created 8 years, 8 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 | « media/base/video_frame.h ('k') | media/base/video_frame_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/base/video_frame.cc
diff --git a/media/base/video_frame.cc b/media/base/video_frame.cc
index 833d2a85b73c69f0afd876ddcdcefa1b1eb7e2e0..f8cdcf9cf05b5d13d0da9218d97c4901e4a2fe63 100644
--- a/media/base/video_frame.cc
+++ b/media/base/video_frame.cc
@@ -22,27 +22,15 @@ scoped_refptr<VideoFrame> VideoFrame::CreateFrame(
scoped_refptr<VideoFrame> frame(new VideoFrame(
format, width, height, timestamp, duration));
switch (format) {
- case VideoFrame::RGB555:
- case VideoFrame::RGB565:
- frame->AllocateRGB(2u);
- break;
- case VideoFrame::RGB24:
- frame->AllocateRGB(3u);
- break;
case VideoFrame::RGB32:
- case VideoFrame::RGBA:
frame->AllocateRGB(4u);
break;
case VideoFrame::YV12:
case VideoFrame::YV16:
frame->AllocateYUV();
break;
- case VideoFrame::ASCII:
- frame->AllocateRGB(1u);
- break;
default:
- NOTREACHED();
- return NULL;
+ LOG(FATAL) << "Unsupported frame format: " << format;
}
return frame;
}
@@ -175,11 +163,7 @@ VideoFrame::~VideoFrame() {
bool VideoFrame::IsValidPlane(size_t plane) const {
switch (format_) {
- case RGB555:
- case RGB565:
- case RGB24:
case RGB32:
- case RGBA:
return plane == kRGBPlane;
case YV12:
@@ -207,18 +191,8 @@ int VideoFrame::stride(size_t plane) const {
int VideoFrame::row_bytes(size_t plane) const {
DCHECK(IsValidPlane(plane));
switch (format_) {
- // 16bpp.
- case RGB555:
- case RGB565:
- return width_ * 2;
-
- // 24bpp.
- case RGB24:
- return width_ * 3;
-
// 32bpp.
case RGB32:
- case RGBA:
return width_ * 4;
// Planar, 8bpp.
@@ -240,11 +214,7 @@ int VideoFrame::row_bytes(size_t plane) const {
int VideoFrame::rows(size_t plane) const {
DCHECK(IsValidPlane(plane));
switch (format_) {
- case RGB555:
- case RGB565:
- case RGB24:
case RGB32:
- case RGBA:
case YV16:
return height_;
« no previous file with comments | « media/base/video_frame.h ('k') | media/base/video_frame_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698