| 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 "base/memory/scoped_ptr.h" | |
| 6 #include "media/cdm/ppapi/external_clear_key/cdm_video_decoder.h" | 5 #include "media/cdm/ppapi/external_clear_key/cdm_video_decoder.h" |
| 7 | 6 |
| 8 #if defined(CLEAR_KEY_CDM_USE_FAKE_VIDEO_DECODER) | 7 #if defined(CLEAR_KEY_CDM_USE_FAKE_VIDEO_DECODER) |
| 9 #include "media/cdm/ppapi/external_clear_key/fake_cdm_video_decoder.h" | 8 #include "media/cdm/ppapi/external_clear_key/fake_cdm_video_decoder.h" |
| 10 #endif | 9 #endif |
| 11 | 10 |
| 12 #if defined(CLEAR_KEY_CDM_USE_FFMPEG_DECODER) | 11 #if defined(CLEAR_KEY_CDM_USE_FFMPEG_DECODER) |
| 13 #include "media/cdm/ppapi/external_clear_key/ffmpeg_cdm_video_decoder.h" | 12 #include "media/cdm/ppapi/external_clear_key/ffmpeg_cdm_video_decoder.h" |
| 14 #endif | 13 #endif |
| 15 | 14 |
| 16 #if defined(CLEAR_KEY_CDM_USE_LIBVPX_DECODER) | 15 #if defined(CLEAR_KEY_CDM_USE_LIBVPX_DECODER) |
| 17 #include "media/cdm/ppapi/external_clear_key/libvpx_cdm_video_decoder.h" | 16 #include "media/cdm/ppapi/external_clear_key/libvpx_cdm_video_decoder.h" |
| 18 #endif | 17 #endif |
| 19 | 18 |
| 20 namespace media { | 19 namespace media { |
| 21 | 20 |
| 22 scoped_ptr<CdmVideoDecoder> CreateVideoDecoder( | 21 std::unique_ptr<CdmVideoDecoder> CreateVideoDecoder( |
| 23 ClearKeyCdmHost* host, const cdm::VideoDecoderConfig& config) { | 22 ClearKeyCdmHost* host, |
| 24 scoped_ptr<CdmVideoDecoder> video_decoder; | 23 const cdm::VideoDecoderConfig& config) { |
| 24 std::unique_ptr<CdmVideoDecoder> video_decoder; |
| 25 #if defined(CLEAR_KEY_CDM_USE_FAKE_VIDEO_DECODER) | 25 #if defined(CLEAR_KEY_CDM_USE_FAKE_VIDEO_DECODER) |
| 26 video_decoder.reset(new FakeCdmVideoDecoder(host)); | 26 video_decoder.reset(new FakeCdmVideoDecoder(host)); |
| 27 | 27 |
| 28 if (!video_decoder->Initialize(config)) | 28 if (!video_decoder->Initialize(config)) |
| 29 video_decoder.reset(); | 29 video_decoder.reset(); |
| 30 #else | 30 #else |
| 31 | 31 |
| 32 #if defined(CLEAR_KEY_CDM_USE_LIBVPX_DECODER) | 32 #if defined(CLEAR_KEY_CDM_USE_LIBVPX_DECODER) |
| 33 if (config.codec == cdm::VideoDecoderConfig::kCodecVp8 || | 33 if (config.codec == cdm::VideoDecoderConfig::kCodecVp8 || |
| 34 config.codec == cdm::VideoDecoderConfig::kCodecVp9) { | 34 config.codec == cdm::VideoDecoderConfig::kCodecVp9) { |
| (...skipping 12 matching lines...) Expand all Loading... |
| 47 if (!video_decoder->Initialize(config)) | 47 if (!video_decoder->Initialize(config)) |
| 48 video_decoder.reset(); | 48 video_decoder.reset(); |
| 49 #endif | 49 #endif |
| 50 | 50 |
| 51 #endif // CLEAR_KEY_CDM_USE_FAKE_VIDEO_DECODER | 51 #endif // CLEAR_KEY_CDM_USE_FAKE_VIDEO_DECODER |
| 52 | 52 |
| 53 return video_decoder; | 53 return video_decoder; |
| 54 } | 54 } |
| 55 | 55 |
| 56 } // namespace media | 56 } // namespace media |
| OLD | NEW |