| 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 341 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 352 } | 352 } |
| 353 | 353 |
| 354 VideoFrame::Format FFmpegVideoDecodeEngine::GetSurfaceFormat() const { | 354 VideoFrame::Format FFmpegVideoDecodeEngine::GetSurfaceFormat() const { |
| 355 // J (Motion JPEG) versions of YUV are full range 0..255. | 355 // J (Motion JPEG) versions of YUV are full range 0..255. |
| 356 // Regular (MPEG) YUV is 16..240. | 356 // Regular (MPEG) YUV is 16..240. |
| 357 // For now we will ignore the distinction and treat them the same. | 357 // For now we will ignore the distinction and treat them the same. |
| 358 switch (codec_context_->pix_fmt) { | 358 switch (codec_context_->pix_fmt) { |
| 359 case PIX_FMT_YUV420P: | 359 case PIX_FMT_YUV420P: |
| 360 case PIX_FMT_YUVJ420P: | 360 case PIX_FMT_YUVJ420P: |
| 361 return VideoFrame::YV12; | 361 return VideoFrame::YV12; |
| 362 break; | |
| 363 case PIX_FMT_YUV422P: | 362 case PIX_FMT_YUV422P: |
| 364 case PIX_FMT_YUVJ422P: | 363 case PIX_FMT_YUVJ422P: |
| 365 return VideoFrame::YV16; | 364 return VideoFrame::YV16; |
| 366 break; | |
| 367 default: | 365 default: |
| 368 // TODO(scherkus): More formats here? | 366 // TODO(scherkus): More formats here? |
| 369 return VideoFrame::INVALID; | 367 break; |
| 370 } | 368 } |
| 369 return VideoFrame::INVALID; |
| 371 } | 370 } |
| 372 | 371 |
| 373 } // namespace media | 372 } // namespace media |
| 374 | 373 |
| 375 // Disable refcounting for this object because this object only lives | 374 // Disable refcounting for this object because this object only lives |
| 376 // on the video decoder thread and there's no need to refcount it. | 375 // on the video decoder thread and there's no need to refcount it. |
| 377 DISABLE_RUNNABLE_METHOD_REFCOUNT(media::FFmpegVideoDecodeEngine); | 376 DISABLE_RUNNABLE_METHOD_REFCOUNT(media::FFmpegVideoDecodeEngine); |
| OLD | NEW |