Index: cc/resources/video_resource_updater.cc |
diff --git a/cc/resources/video_resource_updater.cc b/cc/resources/video_resource_updater.cc |
index 295e2811d3717238276ffba37e63b84c2a8f62c2..d0b1c88389b25da812ebfa02115a589d6e2c9aa9 100644 |
--- a/cc/resources/video_resource_updater.cc |
+++ b/cc/resources/video_resource_updater.cc |
@@ -385,50 +385,7 @@ VideoFrameExternalResources VideoResourceUpdater::CreateForSoftwarePlanes( |
TRACE_EVENT0("cc", "VideoResourceUpdater::CreateForSoftwarePlanes"); |
const media::VideoPixelFormat input_frame_format = video_frame->format(); |
- // TODO(hubbe): Make this a video frame method. |
- int bits_per_channel = 0; |
- switch (input_frame_format) { |
- case media::PIXEL_FORMAT_UNKNOWN: |
- NOTREACHED(); |
- // Fall through! |
- case media::PIXEL_FORMAT_I420: |
- case media::PIXEL_FORMAT_YV12: |
- case media::PIXEL_FORMAT_YV16: |
- case media::PIXEL_FORMAT_YV12A: |
- case media::PIXEL_FORMAT_YV24: |
- case media::PIXEL_FORMAT_NV12: |
- case media::PIXEL_FORMAT_NV21: |
- case media::PIXEL_FORMAT_UYVY: |
- case media::PIXEL_FORMAT_YUY2: |
- case media::PIXEL_FORMAT_ARGB: |
- case media::PIXEL_FORMAT_XRGB: |
- case media::PIXEL_FORMAT_RGB24: |
- case media::PIXEL_FORMAT_RGB32: |
- case media::PIXEL_FORMAT_MJPEG: |
- case media::PIXEL_FORMAT_MT21: |
- case media::PIXEL_FORMAT_Y8: |
- case media::PIXEL_FORMAT_I422: |
- bits_per_channel = 8; |
- break; |
- case media::PIXEL_FORMAT_YUV420P9: |
- case media::PIXEL_FORMAT_YUV422P9: |
- case media::PIXEL_FORMAT_YUV444P9: |
- bits_per_channel = 9; |
- break; |
- case media::PIXEL_FORMAT_YUV420P10: |
- case media::PIXEL_FORMAT_YUV422P10: |
- case media::PIXEL_FORMAT_YUV444P10: |
- bits_per_channel = 10; |
- break; |
- case media::PIXEL_FORMAT_YUV420P12: |
- case media::PIXEL_FORMAT_YUV422P12: |
- case media::PIXEL_FORMAT_YUV444P12: |
- bits_per_channel = 12; |
- break; |
- case media::PIXEL_FORMAT_Y16: |
- bits_per_channel = 16; |
- break; |
- } |
+ int bits_per_channel = video_frame->BitsPerChannel(input_frame_format); |
// Only YUV and Y16 software video frames are supported. |
DCHECK(media::IsYuvPlanar(input_frame_format) || |