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

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: 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
Index: media/base/video_frame.cc
diff --git a/media/base/video_frame.cc b/media/base/video_frame.cc
index 833d2a85b73c69f0afd876ddcdcefa1b1eb7e2e0..bbe45e6b1a3815a0c568481bd47c43137efc1e28 100644
--- a/media/base/video_frame.cc
+++ b/media/base/video_frame.cc
@@ -22,26 +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();
+ NOTREACHED() << format;
return NULL;
scherkus (not reviewing) 2012/04/10 21:32:31 do we expect clients to handle NULL from CreateFra
Ami GONE FROM CHROMIUM 2012/04/10 22:01:07 Done.
}
return frame;
@@ -175,11 +164,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 +192,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 +215,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_;

Powered by Google App Engine
This is Rietveld 408576698