OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "media/video/ffmpeg_video_decode_engine.h" | 5 #include "media/video/ffmpeg_video_decode_engine.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/string_number_conversions.h" | 8 #include "base/string_number_conversions.h" |
9 #include "base/task.h" | 9 #include "base/task.h" |
10 #include "media/base/buffers.h" | 10 #include "media/base/buffers.h" |
(...skipping 335 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
346 } | 346 } |
347 | 347 |
348 VideoFrame::Format FFmpegVideoDecodeEngine::GetSurfaceFormat() const { | 348 VideoFrame::Format FFmpegVideoDecodeEngine::GetSurfaceFormat() const { |
349 // J (Motion JPEG) versions of YUV are full range 0..255. | 349 // J (Motion JPEG) versions of YUV are full range 0..255. |
350 // Regular (MPEG) YUV is 16..240. | 350 // Regular (MPEG) YUV is 16..240. |
351 // For now we will ignore the distinction and treat them the same. | 351 // For now we will ignore the distinction and treat them the same. |
352 switch (codec_context_->pix_fmt) { | 352 switch (codec_context_->pix_fmt) { |
353 case PIX_FMT_YUV420P: | 353 case PIX_FMT_YUV420P: |
354 case PIX_FMT_YUVJ420P: | 354 case PIX_FMT_YUVJ420P: |
355 return VideoFrame::YV12; | 355 return VideoFrame::YV12; |
356 break; | |
357 case PIX_FMT_YUV422P: | 356 case PIX_FMT_YUV422P: |
358 case PIX_FMT_YUVJ422P: | 357 case PIX_FMT_YUVJ422P: |
359 return VideoFrame::YV16; | 358 return VideoFrame::YV16; |
360 break; | |
361 default: | 359 default: |
362 // TODO(scherkus): More formats here? | 360 // TODO(scherkus): More formats here? |
363 return VideoFrame::INVALID; | 361 break; |
364 } | 362 } |
| 363 return VideoFrame::INVALID; |
365 } | 364 } |
366 | 365 |
367 } // namespace media | 366 } // namespace media |
368 | 367 |
369 // Disable refcounting for this object because this object only lives | 368 // Disable refcounting for this object because this object only lives |
370 // on the video decoder thread and there's no need to refcount it. | 369 // on the video decoder thread and there's no need to refcount it. |
371 DISABLE_RUNNABLE_METHOD_REFCOUNT(media::FFmpegVideoDecodeEngine); | 370 DISABLE_RUNNABLE_METHOD_REFCOUNT(media::FFmpegVideoDecodeEngine); |
OLD | NEW |