| 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/filters/ffmpeg_video_decoder.h" | 5 #include "media/filters/ffmpeg_video_decoder.h" |
| 6 | 6 |
| 7 #include <deque> | 7 #include <deque> |
| 8 | 8 |
| 9 #include "base/task.h" | 9 #include "base/task.h" |
| 10 #include "media/base/callback.h" | 10 #include "media/base/callback.h" |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 82 case CODEC_ID_VC1: | 82 case CODEC_ID_VC1: |
| 83 config.codec_ = kCodecVC1; break; | 83 config.codec_ = kCodecVC1; break; |
| 84 case CODEC_ID_H264: | 84 case CODEC_ID_H264: |
| 85 config.codec_ = kCodecH264; break; | 85 config.codec_ = kCodecH264; break; |
| 86 case CODEC_ID_THEORA: | 86 case CODEC_ID_THEORA: |
| 87 config.codec_ = kCodecTheora; break; | 87 config.codec_ = kCodecTheora; break; |
| 88 case CODEC_ID_MPEG2VIDEO: | 88 case CODEC_ID_MPEG2VIDEO: |
| 89 config.codec_ = kCodecMPEG2; break; | 89 config.codec_ = kCodecMPEG2; break; |
| 90 case CODEC_ID_MPEG4: | 90 case CODEC_ID_MPEG4: |
| 91 config.codec_ = kCodecMPEG4; break; | 91 config.codec_ = kCodecMPEG4; break; |
| 92 case CODEC_ID_VP8: |
| 93 config.codec_ = kCodecVP8; break; |
| 92 default: | 94 default: |
| 93 NOTREACHED(); | 95 NOTREACHED(); |
| 94 } | 96 } |
| 95 config.opaque_context_ = av_stream; | 97 config.opaque_context_ = av_stream; |
| 96 config.width_ = width_; | 98 config.width_ = width_; |
| 97 config.height_ = height_; | 99 config.height_ = height_; |
| 98 decode_engine_->Initialize(message_loop(), this, config); | 100 decode_engine_->Initialize(message_loop(), this, config); |
| 99 } | 101 } |
| 100 | 102 |
| 101 void FFmpegVideoDecoder::OnInitializeComplete(const VideoCodecInfo& info) { | 103 void FFmpegVideoDecoder::OnInitializeComplete(const VideoCodecInfo& info) { |
| (...skipping 320 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 422 } | 424 } |
| 423 | 425 |
| 424 // static | 426 // static |
| 425 bool FFmpegVideoDecoder::IsMediaFormatSupported(const MediaFormat& format) { | 427 bool FFmpegVideoDecoder::IsMediaFormatSupported(const MediaFormat& format) { |
| 426 std::string mime_type; | 428 std::string mime_type; |
| 427 return format.GetAsString(MediaFormat::kMimeType, &mime_type) && | 429 return format.GetAsString(MediaFormat::kMimeType, &mime_type) && |
| 428 mime_type::kFFmpegVideo == mime_type; | 430 mime_type::kFFmpegVideo == mime_type; |
| 429 } | 431 } |
| 430 | 432 |
| 431 } // namespace media | 433 } // namespace media |
| OLD | NEW |