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

Side by Side Diff: content/renderer/media/crypto/key_systems.cc

Issue 252513005: Encrypted Media: Add VP9 support to IsTypeSupported(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 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 | Annotate | Revision Log
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 "content/renderer/media/crypto/key_systems.h" 5 #include "content/renderer/media/crypto/key_systems.h"
6 6
7 #include <string> 7 #include <string>
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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 {"audio/mp4", EME_CODEC_MP4_AUDIO_ALL}, 43 {"audio/mp4", EME_CODEC_MP4_AUDIO_ALL},
44 {"video/mp4", EME_CODEC_MP4_ALL} 44 {"video/mp4", EME_CODEC_MP4_ALL}
45 #endif // defined(USE_PROPRIETARY_CODECS) 45 #endif // defined(USE_PROPRIETARY_CODECS)
46 }; 46 };
47 47
48 // Mapping between codec types and their masks. 48 // Mapping between codec types and their masks.
49 CodecMask kCodecMasks[] = { 49 CodecMask kCodecMasks[] = {
50 {"vorbis", EME_CODEC_WEBM_VORBIS}, 50 {"vorbis", EME_CODEC_WEBM_VORBIS},
51 {"vp8", EME_CODEC_WEBM_VP8}, 51 {"vp8", EME_CODEC_WEBM_VP8},
52 {"vp8.0", EME_CODEC_WEBM_VP8}, 52 {"vp8.0", EME_CODEC_WEBM_VP8},
53 {"vp9", EME_CODEC_WEBM_VP9},
ddorwin 2014/04/24 23:00:23 I thought the .x was going to be required for VP9.
xhwang 2014/04/25 16:49:08 Checked and we don't need to support x > 0. http:
ddorwin 2014/04/28 18:30:51 That doesn't say anything about VP9.
54 {"vp9.0", EME_CODEC_WEBM_VP9},
53 #if defined(USE_PROPRIETARY_CODECS) 55 #if defined(USE_PROPRIETARY_CODECS)
54 {"mp4a", EME_CODEC_MP4_AAC}, 56 {"mp4a", EME_CODEC_MP4_AAC},
55 {"avc1", EME_CODEC_MP4_AVC1}, 57 {"avc1", EME_CODEC_MP4_AVC1},
56 {"avc3", EME_CODEC_MP4_AVC1} 58 {"avc3", EME_CODEC_MP4_AVC1}
57 #endif // defined(USE_PROPRIETARY_CODECS) 59 #endif // defined(USE_PROPRIETARY_CODECS)
58 }; 60 };
59 61
60 static void AddClearKey(std::vector<KeySystemInfo>* concrete_key_systems) { 62 static void AddClearKey(std::vector<KeySystemInfo>* concrete_key_systems) {
61 KeySystemInfo info(kClearKeyKeySystem); 63 KeySystemInfo info(kClearKeyKeySystem);
62 64
63 // On Android, Vorbis, VP8, AAC and AVC1 are supported in all MediaCodec 65 info.supported_codecs = EME_CODEC_WEBM_ALL;
64 // implementations: 66
67 #if defined(OS_ANDROID)
68 // On Android, all WebM codecs (Vorbis, VP8, AAC and AVC1) except VP9 are
ddorwin 2014/04/24 23:00:23 I think you need to reword this "all" statement.
xhwang 2014/04/25 16:49:08 Done.
69 // supported in MediaCodec implementations:
65 // http://developer.android.com/guide/appendix/media-formats.html 70 // http://developer.android.com/guide/appendix/media-formats.html
71 // Temporarily disable VP9 support for Android.
72 // TODO(xhwang): Query MediaCodec for VP9 support on Android.
ddorwin 2014/04/24 23:00:23 Or just mime_util? Can content/renderer access net
xhwang 2014/04/25 16:49:08 It seems so: https://code.google.com/p/chromium/co
73 info.supported_codecs &= ~EME_CODEC_WEBM_VP9;
74 #endif // defined(OS_ANDROID)
66 75
67 info.supported_codecs = EME_CODEC_WEBM_ALL;
68 #if defined(USE_PROPRIETARY_CODECS) 76 #if defined(USE_PROPRIETARY_CODECS)
69 info.supported_codecs |= EME_CODEC_MP4_ALL; 77 info.supported_codecs |= EME_CODEC_MP4_ALL;
70 #endif // defined(USE_PROPRIETARY_CODECS) 78 #endif // defined(USE_PROPRIETARY_CODECS)
71 79
72 info.use_aes_decryptor = true; 80 info.use_aes_decryptor = true;
73 81
74 concrete_key_systems->push_back(info); 82 concrete_key_systems->push_back(info);
75 } 83 }
76 84
77 class KeySystems { 85 class KeySystems {
(...skipping 366 matching lines...) Expand 10 before | Expand all | Expand 10 after
444 CONTENT_EXPORT void AddContainerMask(const std::string& container, 452 CONTENT_EXPORT void AddContainerMask(const std::string& container,
445 uint32 mask) { 453 uint32 mask) {
446 KeySystems::GetInstance().AddContainerMask(container, mask); 454 KeySystems::GetInstance().AddContainerMask(container, mask);
447 } 455 }
448 456
449 CONTENT_EXPORT void AddCodecMask(const std::string& codec, uint32 mask) { 457 CONTENT_EXPORT void AddCodecMask(const std::string& codec, uint32 mask) {
450 KeySystems::GetInstance().AddCodecMask(codec, mask); 458 KeySystems::GetInstance().AddCodecMask(codec, mask);
451 } 459 }
452 460
453 } // namespace content 461 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698