| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/video/video_decode_accelerator.h" | 5 #include "media/video/video_decode_accelerator.h" |
| 6 | 6 |
| 7 #include <GLES2/gl2.h> | 7 #include <GLES2/gl2.h> |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 | 9 |
| 10 namespace media { | 10 namespace media { |
| 11 | 11 |
| 12 VideoDecodeAccelerator::Config::Config(VideoCodecProfile video_codec_profile) | 12 VideoDecodeAccelerator::Config::Config(VideoCodecProfile video_codec_profile) |
| 13 : profile(video_codec_profile) {} | 13 : profile(video_codec_profile) {} |
| 14 | 14 |
| 15 VideoDecodeAccelerator::Config::Config( | |
| 16 const VideoDecoderConfig& video_decoder_config) | |
| 17 : profile(video_decoder_config.profile()), | |
| 18 is_encrypted(video_decoder_config.is_encrypted()) {} | |
| 19 | |
| 20 std::string VideoDecodeAccelerator::Config::AsHumanReadableString() const { | 15 std::string VideoDecodeAccelerator::Config::AsHumanReadableString() const { |
| 21 std::ostringstream s; | 16 std::ostringstream s; |
| 22 s << "profile: " << GetProfileName(profile) << " encrypted? " | 17 s << "profile: " << GetProfileName(profile) << " encrypted? " |
| 23 << (is_encrypted ? "true" : "false"); | 18 << (is_encrypted ? "true" : "false"); |
| 24 return s.str(); | 19 return s.str(); |
| 25 } | 20 } |
| 26 | 21 |
| 27 void VideoDecodeAccelerator::Client::NotifyInitializationComplete( | 22 void VideoDecodeAccelerator::Client::NotifyInitializationComplete( |
| 28 bool success) { | 23 bool success) { |
| 29 NOTREACHED() << "By default deferred initialization is not supported."; | 24 NOTREACHED() << "By default deferred initialization is not supported."; |
| 30 } | 25 } |
| 31 | 26 |
| 32 VideoDecodeAccelerator::~VideoDecodeAccelerator() {} | 27 VideoDecodeAccelerator::~VideoDecodeAccelerator() {} |
| 33 | 28 |
| 34 void VideoDecodeAccelerator::SetCdm(int cdm_id) { | |
| 35 NOTREACHED() << "By default CDM is not supported."; | |
| 36 } | |
| 37 | |
| 38 bool VideoDecodeAccelerator::TryToSetupDecodeOnSeparateThread( | 29 bool VideoDecodeAccelerator::TryToSetupDecodeOnSeparateThread( |
| 39 const base::WeakPtr<Client>& decode_client, | 30 const base::WeakPtr<Client>& decode_client, |
| 40 const scoped_refptr<base::SingleThreadTaskRunner>& decode_task_runner) { | 31 const scoped_refptr<base::SingleThreadTaskRunner>& decode_task_runner) { |
| 41 // Implementations in the process that VDA runs in must override this. | 32 // Implementations in the process that VDA runs in must override this. |
| 42 LOG(FATAL) << "This may only be called in the same process as VDA impl."; | 33 LOG(FATAL) << "This may only be called in the same process as VDA impl."; |
| 43 return false; | 34 return false; |
| 44 } | 35 } |
| 45 | 36 |
| 46 void VideoDecodeAccelerator::ImportBufferForPicture( | 37 void VideoDecodeAccelerator::ImportBufferForPicture( |
| 47 int32_t picture_buffer_id, | 38 int32_t picture_buffer_id, |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 85 } // namespace media | 76 } // namespace media |
| 86 | 77 |
| 87 namespace std { | 78 namespace std { |
| 88 | 79 |
| 89 void default_delete<media::VideoDecodeAccelerator>::operator()( | 80 void default_delete<media::VideoDecodeAccelerator>::operator()( |
| 90 media::VideoDecodeAccelerator* vda) const { | 81 media::VideoDecodeAccelerator* vda) const { |
| 91 vda->Destroy(); | 82 vda->Destroy(); |
| 92 } | 83 } |
| 93 | 84 |
| 94 } // namespace std | 85 } // namespace std |
| OLD | NEW |