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

Unified Diff: media/base/video_frame.cc

Issue 2571163002: Add PIXEL_FORMAT_I422. (Closed)
Patch Set: move switch cases to align with the enum value order Created 4 years 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_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 f2d11bd2e131acd7bb0b85b003f3d9703ef50ecd..d2808356111d86c56b19644a2f6a51d602c4ca2b 100644
--- a/media/base/video_frame.cc
+++ b/media/base/video_frame.cc
@@ -123,6 +123,7 @@ bool RequiresEvenSizeAllocation(VideoPixelFormat format) {
case PIXEL_FORMAT_YUV444P12:
case PIXEL_FORMAT_YV12A:
case PIXEL_FORMAT_UYVY:
+ case PIXEL_FORMAT_I422:
return true;
case PIXEL_FORMAT_UNKNOWN:
break;
@@ -157,7 +158,7 @@ bool VideoFrame::IsValidConfig(VideoPixelFormat format,
return true;
// Make sure new formats are properly accounted for in the method.
- static_assert(PIXEL_FORMAT_MAX == 26,
+ static_assert(PIXEL_FORMAT_MAX == 27,
"Added pixel format, please review IsValidConfig()");
if (format == PIXEL_FORMAT_UNKNOWN) {
@@ -527,6 +528,7 @@ size_t VideoFrame::NumPlanes(VideoPixelFormat format) {
case PIXEL_FORMAT_YUV420P12:
case PIXEL_FORMAT_YUV422P12:
case PIXEL_FORMAT_YUV444P12:
+ case PIXEL_FORMAT_I422:
return 3;
case PIXEL_FORMAT_YV12A:
return 4;
@@ -1029,6 +1031,7 @@ gfx::Size VideoFrame::SampleSize(VideoPixelFormat format, size_t plane) {
return gfx::Size(1, 1);
case PIXEL_FORMAT_YV16:
+ case PIXEL_FORMAT_I422:
case PIXEL_FORMAT_YUV422P9:
case PIXEL_FORMAT_YUV422P10:
case PIXEL_FORMAT_YUV422P12:
@@ -1097,6 +1100,7 @@ int VideoFrame::BytesPerElement(VideoPixelFormat format, size_t plane) {
case PIXEL_FORMAT_YV12A:
case PIXEL_FORMAT_YV24:
case PIXEL_FORMAT_Y8:
+ case PIXEL_FORMAT_I422:
return 1;
case PIXEL_FORMAT_MJPEG:
return 0;
« no previous file with comments | « cc/resources/video_resource_updater.cc ('k') | media/base/video_frame_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698