Chromium Code Reviews| 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/base/key_systems.h" | 5 #include "media/base/key_systems.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include "base/containers/hash_tables.h" | 9 #include "base/containers/hash_tables.h" |
| 10 #include "base/lazy_instance.h" | 10 #include "base/lazy_instance.h" |
| (...skipping 25 matching lines...) Expand all Loading... | |
| 36 }; | 36 }; |
| 37 | 37 |
| 38 // Mapping between containers and their codecs. | 38 // Mapping between containers and their codecs. |
| 39 // Only audio codec can belong to a "audio/*" container. Both audio and video | 39 // Only audio codec can belong to a "audio/*" container. Both audio and video |
| 40 // codecs can belong to a "video/*" container. | 40 // codecs can belong to a "video/*" container. |
| 41 // TODO(sandersd): This definition only makes sense for prefixed EME. Change it | 41 // TODO(sandersd): This definition only makes sense for prefixed EME. Change it |
| 42 // when prefixed EME is removed. http://crbug.com/249976 | 42 // when prefixed EME is removed. http://crbug.com/249976 |
| 43 static NamedCodec kContainerToCodecMasks[] = { | 43 static NamedCodec kContainerToCodecMasks[] = { |
| 44 {"audio/webm", EME_CODEC_WEBM_AUDIO_ALL}, | 44 {"audio/webm", EME_CODEC_WEBM_AUDIO_ALL}, |
| 45 {"video/webm", EME_CODEC_WEBM_ALL}, | 45 {"video/webm", EME_CODEC_WEBM_ALL}, |
| 46 #if defined(USE_PROPRIETARY_CODECS) | |
|
sandersd (OOO until July 31)
2016/01/26 21:21:20
Should be left in.
kqyang
2016/01/27 00:17:42
Done.
| |
| 47 {"audio/mp4", EME_CODEC_MP4_AUDIO_ALL}, | 46 {"audio/mp4", EME_CODEC_MP4_AUDIO_ALL}, |
| 48 {"video/mp4", EME_CODEC_MP4_ALL} | 47 {"video/mp4", EME_CODEC_MP4_ALL} |
| 49 #endif // defined(USE_PROPRIETARY_CODECS) | |
| 50 }; | 48 }; |
| 51 | 49 |
| 52 // Mapping between codec names and enum values. | 50 // Mapping between codec names and enum values. |
| 53 static NamedCodec kCodecStrings[] = { | 51 static NamedCodec kCodecStrings[] = { |
| 54 {"opus", EME_CODEC_WEBM_OPUS}, | 52 {"opus", EME_CODEC_WEBM_OPUS}, |
| 55 {"vorbis", EME_CODEC_WEBM_VORBIS}, | 53 {"vorbis", EME_CODEC_WEBM_VORBIS}, |
| 56 {"vp8", EME_CODEC_WEBM_VP8}, | 54 {"vp8", EME_CODEC_WEBM_VP8}, |
| 57 {"vp8.0", EME_CODEC_WEBM_VP8}, | 55 {"vp8.0", EME_CODEC_WEBM_VP8}, |
| 56 {"vp08", EME_CODEC_MP4_VP8}, | |
|
sandersd (OOO until July 31)
2016/01/26 21:21:20
Is this the actual codec string? It's rather stran
kqyang
2016/01/27 00:17:42
The codec strings are of the form "vp08.xxxxxxx" o
| |
| 58 {"vp9", EME_CODEC_WEBM_VP9}, | 57 {"vp9", EME_CODEC_WEBM_VP9}, |
| 59 {"vp9.0", EME_CODEC_WEBM_VP9}, | 58 {"vp9.0", EME_CODEC_WEBM_VP9}, |
| 59 {"vp09", EME_CODEC_MP4_VP9}, | |
| 60 #if defined(USE_PROPRIETARY_CODECS) | 60 #if defined(USE_PROPRIETARY_CODECS) |
| 61 {"mp4a", EME_CODEC_MP4_AAC}, | 61 {"mp4a", EME_CODEC_MP4_AAC}, |
| 62 {"avc1", EME_CODEC_MP4_AVC1}, | 62 {"avc1", EME_CODEC_MP4_AVC1}, |
| 63 {"avc3", EME_CODEC_MP4_AVC1} | 63 {"avc3", EME_CODEC_MP4_AVC1} |
| 64 #endif // defined(USE_PROPRIETARY_CODECS) | 64 #endif // defined(USE_PROPRIETARY_CODECS) |
| 65 }; | 65 }; |
| 66 | 66 |
| 67 static EmeRobustness ConvertRobustness(const std::string& robustness) { | 67 static EmeRobustness ConvertRobustness(const std::string& robustness) { |
| 68 if (robustness.empty()) | 68 if (robustness.empty()) |
| 69 return EmeRobustness::EMPTY; | 69 return EmeRobustness::EMPTY; |
| (...skipping 868 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 938 KeySystemsImpl::GetInstance()->AddContainerMask(container, mask); | 938 KeySystemsImpl::GetInstance()->AddContainerMask(container, mask); |
| 939 } | 939 } |
| 940 | 940 |
| 941 MEDIA_EXPORT void AddCodecMask(EmeMediaType media_type, | 941 MEDIA_EXPORT void AddCodecMask(EmeMediaType media_type, |
| 942 const std::string& codec, | 942 const std::string& codec, |
| 943 uint32_t mask) { | 943 uint32_t mask) { |
| 944 KeySystemsImpl::GetInstance()->AddCodecMask(media_type, codec, mask); | 944 KeySystemsImpl::GetInstance()->AddCodecMask(media_type, codec, mask); |
| 945 } | 945 } |
| 946 | 946 |
| 947 } // namespace media | 947 } // namespace media |
| OLD | NEW |