Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(166)

Side by Side Diff: media/base/key_systems.cc

Issue 1624703002: Implement support for vp9 in ISO-BMFF (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 20 matching lines...) Expand all
31 const char kUnknownKeySystemNameForUMA[] = "Unknown"; 31 const char kUnknownKeySystemNameForUMA[] = "Unknown";
32 32
33 struct NamedCodec { 33 struct NamedCodec {
34 const char* name; 34 const char* name;
35 EmeCodec type; 35 EmeCodec type;
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
ddorwin 2016/01/27 01:39:15 Note: I believe this note is about the separation
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) 46 #if defined(USE_PROPRIETARY_CODECS)
47 {"audio/mp4", EME_CODEC_MP4_AUDIO_ALL}, 47 {"audio/mp4", EME_CODEC_MP4_AUDIO_ALL},
48 {"video/mp4", EME_CODEC_MP4_ALL} 48 {"video/mp4", EME_CODEC_MP4_ALL}
49 #endif // defined(USE_PROPRIETARY_CODECS) 49 #endif // defined(USE_PROPRIETARY_CODECS)
50 }; 50 };
51 51
52 // Mapping between codec names and enum values. 52 // Mapping between codec names and enum values.
53 static NamedCodec kCodecStrings[] = { 53 static NamedCodec kCodecStrings[] = {
54 {"opus", EME_CODEC_WEBM_OPUS}, 54 {"opus", EME_CODEC_WEBM_OPUS},
55 {"vorbis", EME_CODEC_WEBM_VORBIS}, 55 {"vorbis", EME_CODEC_WEBM_VORBIS},
56 {"vp8", EME_CODEC_WEBM_VP8}, 56 {"vp8", EME_CODEC_WEBM_VP8},
57 {"vp8.0", EME_CODEC_WEBM_VP8}, 57 {"vp8.0", EME_CODEC_WEBM_VP8},
58 {"vp08", EME_CODEC_MP4_VP8},
sandersd (OOO until July 31) 2016/01/27 00:47:00 These are only defined when USE_PROPRIETARY_CODECS
kqyang 2016/01/29 00:34:16 Good catch. Done.
58 {"vp9", EME_CODEC_WEBM_VP9}, 59 {"vp9", EME_CODEC_WEBM_VP9},
59 {"vp9.0", EME_CODEC_WEBM_VP9}, 60 {"vp9.0", EME_CODEC_WEBM_VP9},
61 {"vp09", EME_CODEC_MP4_VP9},
ddorwin 2016/01/27 01:39:15 Just to confirm, is "vp0x" the value being used in
kqyang 2016/01/29 00:34:16 Correct.
60 #if defined(USE_PROPRIETARY_CODECS) 62 #if defined(USE_PROPRIETARY_CODECS)
61 {"mp4a", EME_CODEC_MP4_AAC}, 63 {"mp4a", EME_CODEC_MP4_AAC},
62 {"avc1", EME_CODEC_MP4_AVC1}, 64 {"avc1", EME_CODEC_MP4_AVC1},
63 {"avc3", EME_CODEC_MP4_AVC1} 65 {"avc3", EME_CODEC_MP4_AVC1}
64 #endif // defined(USE_PROPRIETARY_CODECS) 66 #endif // defined(USE_PROPRIETARY_CODECS)
65 }; 67 };
66 68
67 static EmeRobustness ConvertRobustness(const std::string& robustness) { 69 static EmeRobustness ConvertRobustness(const std::string& robustness) {
68 if (robustness.empty()) 70 if (robustness.empty())
69 return EmeRobustness::EMPTY; 71 return EmeRobustness::EMPTY;
(...skipping 868 matching lines...) Expand 10 before | Expand all | Expand 10 after
938 KeySystemsImpl::GetInstance()->AddContainerMask(container, mask); 940 KeySystemsImpl::GetInstance()->AddContainerMask(container, mask);
939 } 941 }
940 942
941 MEDIA_EXPORT void AddCodecMask(EmeMediaType media_type, 943 MEDIA_EXPORT void AddCodecMask(EmeMediaType media_type,
942 const std::string& codec, 944 const std::string& codec,
943 uint32_t mask) { 945 uint32_t mask) {
944 KeySystemsImpl::GetInstance()->AddCodecMask(media_type, codec, mask); 946 KeySystemsImpl::GetInstance()->AddCodecMask(media_type, codec, mask);
945 } 947 }
946 948
947 } // namespace media 949 } // namespace media
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698