| 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" | 5 #include "base/memory/scoped_ptr.h" |
| 6 #include "media/cdm/ppapi/external_clear_key/cdm_video_decoder.h" | 6 #include "media/cdm/ppapi/external_clear_key/cdm_video_decoder.h" |
| 7 | 7 |
| 8 #if defined(CLEAR_KEY_CDM_USE_FAKE_VIDEO_DECODER) | 8 #if defined(CLEAR_KEY_CDM_USE_FAKE_VIDEO_DECODER) |
| 9 #include "media/cdm/ppapi/external_clear_key/fake_cdm_video_decoder.h" | 9 #include "media/cdm/ppapi/external_clear_key/fake_cdm_video_decoder.h" |
| 10 #endif | 10 #endif |
| (...skipping 19 matching lines...) Expand all Loading... |
| 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) { |
| 35 video_decoder.reset(new LibvpxCdmVideoDecoder(host)); | 35 video_decoder.reset(new LibvpxCdmVideoDecoder(host)); |
| 36 | 36 |
| 37 if (!video_decoder->Initialize(config)) | 37 if (!video_decoder->Initialize(config)) |
| 38 video_decoder.reset(); | 38 video_decoder.reset(); |
| 39 | 39 |
| 40 return video_decoder.Pass(); | 40 return video_decoder; |
| 41 } | 41 } |
| 42 #endif | 42 #endif |
| 43 | 43 |
| 44 #if defined(CLEAR_KEY_CDM_USE_FFMPEG_DECODER) | 44 #if defined(CLEAR_KEY_CDM_USE_FFMPEG_DECODER) |
| 45 video_decoder.reset(new FFmpegCdmVideoDecoder(host)); | 45 video_decoder.reset(new FFmpegCdmVideoDecoder(host)); |
| 46 | 46 |
| 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 |