| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 <algorithm> | 7 #include <algorithm> |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 158 0); | 158 0); |
| 159 return 0; | 159 return 0; |
| 160 } | 160 } |
| 161 | 161 |
| 162 std::string FFmpegVideoDecoder::GetDisplayName() const { | 162 std::string FFmpegVideoDecoder::GetDisplayName() const { |
| 163 return "FFmpegVideoDecoder"; | 163 return "FFmpegVideoDecoder"; |
| 164 } | 164 } |
| 165 | 165 |
| 166 void FFmpegVideoDecoder::Initialize(const VideoDecoderConfig& config, | 166 void FFmpegVideoDecoder::Initialize(const VideoDecoderConfig& config, |
| 167 bool low_delay, | 167 bool low_delay, |
| 168 const SetCdmReadyCB& /* set_cdm_ready_cb */, |
| 168 const InitCB& init_cb, | 169 const InitCB& init_cb, |
| 169 const OutputCB& output_cb) { | 170 const OutputCB& output_cb) { |
| 170 DCHECK(task_runner_->BelongsToCurrentThread()); | 171 DCHECK(task_runner_->BelongsToCurrentThread()); |
| 171 DCHECK(config.IsValidConfig()); | 172 DCHECK(config.IsValidConfig()); |
| 172 DCHECK(!output_cb.is_null()); | 173 DCHECK(!output_cb.is_null()); |
| 173 | 174 |
| 174 InitCB bound_init_cb = BindToCurrentLoop(init_cb); | 175 InitCB bound_init_cb = BindToCurrentLoop(init_cb); |
| 175 | 176 |
| 176 if (config.is_encrypted()) { | 177 if (config.is_encrypted()) { |
| 177 bound_init_cb.Run(false); | 178 bound_init_cb.Run(false); |
| (...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 367 if (!codec || avcodec_open2(codec_context_.get(), codec, NULL) < 0) { | 368 if (!codec || avcodec_open2(codec_context_.get(), codec, NULL) < 0) { |
| 368 ReleaseFFmpegResources(); | 369 ReleaseFFmpegResources(); |
| 369 return false; | 370 return false; |
| 370 } | 371 } |
| 371 | 372 |
| 372 av_frame_.reset(av_frame_alloc()); | 373 av_frame_.reset(av_frame_alloc()); |
| 373 return true; | 374 return true; |
| 374 } | 375 } |
| 375 | 376 |
| 376 } // namespace media | 377 } // namespace media |
| OLD | NEW |