| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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/base/android/media_source_player.h" | 5 #include "media/base/android/media_source_player.h" |
| 6 | 6 |
| 7 #include <limits> | 7 #include <limits> |
| 8 | 8 |
| 9 #include "base/android/jni_android.h" | 9 #include "base/android/jni_android.h" |
| 10 #include "base/android/jni_string.h" | 10 #include "base/android/jni_string.h" |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 | 26 |
| 27 // Use 16bit PCM for audio output. Keep this value in sync with the output | 27 // Use 16bit PCM for audio output. Keep this value in sync with the output |
| 28 // format we passed to AudioTrack in MediaCodecBridge. | 28 // format we passed to AudioTrack in MediaCodecBridge. |
| 29 const int kBytesPerAudioOutputSample = 2; | 29 const int kBytesPerAudioOutputSample = 2; |
| 30 } | 30 } |
| 31 | 31 |
| 32 namespace media { | 32 namespace media { |
| 33 | 33 |
| 34 // static | 34 // static |
| 35 bool MediaSourcePlayer::IsTypeSupported( | 35 bool MediaSourcePlayer::IsTypeSupported( |
| 36 const std::vector<uint8>& scheme_uuid, | 36 const std::string& key_system, |
| 37 MediaDrmBridge::SecurityLevel security_level, | 37 MediaDrmBridge::SecurityLevel security_level, |
| 38 const std::string& container, | 38 const std::string& container, |
| 39 const std::vector<std::string>& codecs) { | 39 const std::vector<std::string>& codecs) { |
| 40 if (!MediaDrmBridge::IsCryptoSchemeSupported(scheme_uuid, container)) { | 40 if (!MediaDrmBridge::IsCryptoSchemeSupported(key_system, container)) { |
| 41 DVLOG(1) << "UUID and container '" << container << "' not supported."; | 41 DVLOG(1) << "Key system and container '" << container << "' not supported."; |
| 42 return false; | 42 return false; |
| 43 } | 43 } |
| 44 | 44 |
| 45 if (!MediaDrmBridge::IsSecurityLevelSupported(scheme_uuid, security_level)) { | 45 if (!MediaDrmBridge::IsSecurityLevelSupported(key_system, security_level)) { |
| 46 DVLOG(1) << "UUID and security level '" << security_level | 46 DVLOG(1) << "Key system and security level '" << security_level |
| 47 << "' not supported."; | 47 << "' not supported."; |
| 48 return false; | 48 return false; |
| 49 } | 49 } |
| 50 | 50 |
| 51 bool is_secure = MediaDrmBridge::IsSecureDecoderRequired(security_level); | 51 bool is_secure = MediaDrmBridge::IsSecureDecoderRequired(security_level); |
| 52 for (size_t i = 0; i < codecs.size(); ++i) { | 52 for (size_t i = 0; i < codecs.size(); ++i) { |
| 53 if (!MediaCodecBridge::CanDecode(codecs[i], is_secure)) { | 53 if (!MediaCodecBridge::CanDecode(codecs[i], is_secure)) { |
| 54 DVLOG(1) << "Codec '" << codecs[i] << "' " | 54 DVLOG(1) << "Codec '" << codecs[i] << "' " |
| 55 << (is_secure ? "in secure mode " : "") << "not supported."; | 55 << (is_secure ? "in secure mode " : "") << "not supported."; |
| 56 return false; | 56 return false; |
| (...skipping 930 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 987 | 987 |
| 988 void MediaSourcePlayer::ClearPendingEvent(PendingEventFlags event) { | 988 void MediaSourcePlayer::ClearPendingEvent(PendingEventFlags event) { |
| 989 DVLOG(1) << __FUNCTION__ << "(" << GetEventName(event) << ")"; | 989 DVLOG(1) << __FUNCTION__ << "(" << GetEventName(event) << ")"; |
| 990 DCHECK_NE(event, NO_EVENT_PENDING); | 990 DCHECK_NE(event, NO_EVENT_PENDING); |
| 991 DCHECK(IsEventPending(event)) << GetEventName(event); | 991 DCHECK(IsEventPending(event)) << GetEventName(event); |
| 992 | 992 |
| 993 pending_event_ &= ~event; | 993 pending_event_ &= ~event; |
| 994 } | 994 } |
| 995 | 995 |
| 996 } // namespace media | 996 } // namespace media |
| OLD | NEW |