| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <algorithm> | 10 #include <algorithm> |
| (...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 161 0); | 161 0); |
| 162 return 0; | 162 return 0; |
| 163 } | 163 } |
| 164 | 164 |
| 165 std::string FFmpegVideoDecoder::GetDisplayName() const { | 165 std::string FFmpegVideoDecoder::GetDisplayName() const { |
| 166 return "FFmpegVideoDecoder"; | 166 return "FFmpegVideoDecoder"; |
| 167 } | 167 } |
| 168 | 168 |
| 169 void FFmpegVideoDecoder::Initialize(const VideoDecoderConfig& config, | 169 void FFmpegVideoDecoder::Initialize(const VideoDecoderConfig& config, |
| 170 bool low_delay, | 170 bool low_delay, |
| 171 const SetCdmReadyCB& /* set_cdm_ready_cb */, | 171 CdmContext* /* cdm_context */, |
| 172 const InitCB& init_cb, | 172 const InitCB& init_cb, |
| 173 const OutputCB& output_cb) { | 173 const OutputCB& output_cb) { |
| 174 DCHECK(thread_checker_.CalledOnValidThread()); | 174 DCHECK(thread_checker_.CalledOnValidThread()); |
| 175 DCHECK(config.IsValidConfig()); | 175 DCHECK(config.IsValidConfig()); |
| 176 DCHECK(!output_cb.is_null()); | 176 DCHECK(!output_cb.is_null()); |
| 177 | 177 |
| 178 InitCB bound_init_cb = BindToCurrentLoop(init_cb); | 178 InitCB bound_init_cb = BindToCurrentLoop(init_cb); |
| 179 | 179 |
| 180 if (config.is_encrypted()) { | 180 if (config.is_encrypted()) { |
| 181 bound_init_cb.Run(false); | 181 bound_init_cb.Run(false); |
| (...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 372 if (!codec || avcodec_open2(codec_context_.get(), codec, NULL) < 0) { | 372 if (!codec || avcodec_open2(codec_context_.get(), codec, NULL) < 0) { |
| 373 ReleaseFFmpegResources(); | 373 ReleaseFFmpegResources(); |
| 374 return false; | 374 return false; |
| 375 } | 375 } |
| 376 | 376 |
| 377 av_frame_.reset(av_frame_alloc()); | 377 av_frame_.reset(av_frame_alloc()); |
| 378 return true; | 378 return true; |
| 379 } | 379 } |
| 380 | 380 |
| 381 } // namespace media | 381 } // namespace media |
| OLD | NEW |