| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/cdm/ppapi/ffmpeg_cdm_video_decoder.h" | 5 #include "media/cdm/ppapi/ffmpeg_cdm_video_decoder.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "media/base/buffers.h" | 9 #include "media/base/buffers.h" |
| 10 #include "media/base/limits.h" | 10 #include "media/base/limits.h" |
| (...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 167 LOG(ERROR) << "Initialize(): avcodec_find_decoder failed."; | 167 LOG(ERROR) << "Initialize(): avcodec_find_decoder failed."; |
| 168 return false; | 168 return false; |
| 169 } | 169 } |
| 170 | 170 |
| 171 int status; | 171 int status; |
| 172 if ((status = avcodec_open2(codec_context_.get(), codec, NULL)) < 0) { | 172 if ((status = avcodec_open2(codec_context_.get(), codec, NULL)) < 0) { |
| 173 LOG(ERROR) << "Initialize(): avcodec_open2 failed: " << status; | 173 LOG(ERROR) << "Initialize(): avcodec_open2 failed: " << status; |
| 174 return false; | 174 return false; |
| 175 } | 175 } |
| 176 | 176 |
| 177 av_frame_.reset(avcodec_alloc_frame()); | 177 av_frame_.reset(av_frame_alloc()); |
| 178 is_initialized_ = true; | 178 is_initialized_ = true; |
| 179 | 179 |
| 180 return true; | 180 return true; |
| 181 } | 181 } |
| 182 | 182 |
| 183 void FFmpegCdmVideoDecoder::Deinitialize() { | 183 void FFmpegCdmVideoDecoder::Deinitialize() { |
| 184 DVLOG(1) << "Deinitialize()"; | 184 DVLOG(1) << "Deinitialize()"; |
| 185 ReleaseFFmpegResources(); | 185 ReleaseFFmpegResources(); |
| 186 is_initialized_ = false; | 186 is_initialized_ = false; |
| 187 } | 187 } |
| (...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 326 } | 326 } |
| 327 | 327 |
| 328 void FFmpegCdmVideoDecoder::ReleaseFFmpegResources() { | 328 void FFmpegCdmVideoDecoder::ReleaseFFmpegResources() { |
| 329 DVLOG(1) << "ReleaseFFmpegResources()"; | 329 DVLOG(1) << "ReleaseFFmpegResources()"; |
| 330 | 330 |
| 331 codec_context_.reset(); | 331 codec_context_.reset(); |
| 332 av_frame_.reset(); | 332 av_frame_.reset(); |
| 333 } | 333 } |
| 334 | 334 |
| 335 } // namespace media | 335 } // namespace media |
| OLD | NEW |