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

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

Issue 2809013002: EME contentType checks DolbyVision (Closed)
Patch Set: Created 3 years, 8 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
« media/base/eme_constants.h ('K') | « media/base/eme_constants.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 <memory> 9 #include <memory>
10 10
(...skipping 27 matching lines...) Expand all
38 }; 38 };
39 39
40 // Mapping between containers and their codecs. 40 // Mapping between containers and their codecs.
41 // Only audio codecs can belong to a "audio/*" mime_type, and only video codecs 41 // Only audio codecs can belong to a "audio/*" mime_type, and only video codecs
42 // can belong to a "video/*" mime_type. 42 // can belong to a "video/*" mime_type.
43 static const NamedCodec kMimeTypeToCodecMasks[] = { 43 static const NamedCodec kMimeTypeToCodecMasks[] = {
44 {"audio/webm", EME_CODEC_WEBM_AUDIO_ALL}, 44 {"audio/webm", EME_CODEC_WEBM_AUDIO_ALL},
45 {"video/webm", EME_CODEC_WEBM_VIDEO_ALL}, 45 {"video/webm", EME_CODEC_WEBM_VIDEO_ALL},
46 #if BUILDFLAG(USE_PROPRIETARY_CODECS) 46 #if BUILDFLAG(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_VIDEO_ALL} 48 {"video/mp4", EME_CODEC_MP4_VIDEO_ALL},
49 #endif // BUILDFLAG(USE_PROPRIETARY_CODECS) 49 #endif // BUILDFLAG(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 const NamedCodec kCodecStrings[] = { 53 static const NamedCodec kCodecStrings[] = {
54 {"opus", EME_CODEC_WEBM_OPUS}, // Opus. 54 {"opus", EME_CODEC_WEBM_OPUS}, // Opus.
55 {"vorbis", EME_CODEC_WEBM_VORBIS}, // Vorbis. 55 {"vorbis", EME_CODEC_WEBM_VORBIS}, // Vorbis.
56 {"vp8", EME_CODEC_WEBM_VP8}, // VP8. 56 {"vp8", EME_CODEC_WEBM_VP8}, // VP8.
57 {"vp8.0", EME_CODEC_WEBM_VP8}, // VP8. 57 {"vp8.0", EME_CODEC_WEBM_VP8}, // VP8.
58 {"vp9", EME_CODEC_WEBM_VP9}, // VP9. 58 {"vp9", EME_CODEC_WEBM_VP9}, // VP9.
59 {"vp9.0", EME_CODEC_WEBM_VP9}, // VP9. 59 {"vp9.0", EME_CODEC_WEBM_VP9}, // VP9.
60 {"vp09", EME_CODEC_COMMON_VP9}, // New multi-part VP9 for WebM and MP4. 60 {"vp09", EME_CODEC_COMMON_VP9}, // New multi-part VP9 for WebM and MP4.
61 #if BUILDFLAG(USE_PROPRIETARY_CODECS) 61 #if BUILDFLAG(USE_PROPRIETARY_CODECS)
62 {"mp4a", EME_CODEC_MP4_AAC}, // AAC. 62 {"mp4a", EME_CODEC_MP4_AAC}, // AAC.
63 {"avc1", EME_CODEC_MP4_AVC1}, // AVC1. 63 {"avc1", EME_CODEC_MP4_AVC1}, // AVC1.
64 {"avc3", EME_CODEC_MP4_AVC1}, // AVC3. 64 {"avc3", EME_CODEC_MP4_AVC1}, // AVC3.
65 #if BUILDFLAG(ENABLE_HEVC_DEMUXING) 65 #if BUILDFLAG(ENABLE_HEVC_DEMUXING)
66 {"hev1", EME_CODEC_MP4_HEVC}, // HEV1. 66 {"hev1", EME_CODEC_MP4_HEVC}, // HEV1.
67 {"hvc1", EME_CODEC_MP4_HEVC}, // HVC1. 67 {"hvc1", EME_CODEC_MP4_HEVC}, // HVC1.
68 #endif 68 #endif
69 #if BUILDFLAG(ENABLE_DOLBY_VISION_DEMUXING)
70 {"dva1", EME_CODEC_MP4_DV_AVC}, // DolbyVision AVC
71 {"dvav", EME_CODEC_MP4_DV_AVC}, // DolbyVision AVC
72 {"dvh1", EME_CDOEC_MP4_DV_HEVC}, // DolbyVision HEVC
73 {"dvhe", EME_CDOEC_MP4_DV_HEVC}, // DolbyVision HEVC
erickung1 2017/04/11 16:57:34 dvh1 and dvhe should also be protected inside ENA
yucliu1 2017/04/11 18:23:09 Done.
74 #endif
69 #endif // BUILDFLAG(USE_PROPRIETARY_CODECS) 75 #endif // BUILDFLAG(USE_PROPRIETARY_CODECS)
70 }; 76 };
71 77
72 class ClearKeyProperties : public KeySystemProperties { 78 class ClearKeyProperties : public KeySystemProperties {
73 public: 79 public:
74 std::string GetKeySystemName() const override { return kClearKeyKeySystem; } 80 std::string GetKeySystemName() const override { return kClearKeyKeySystem; }
75 81
76 bool IsSupportedInitDataType(EmeInitDataType init_data_type) const override { 82 bool IsSupportedInitDataType(EmeInitDataType init_data_type) const override {
77 #if BUILDFLAG(USE_PROPRIETARY_CODECS) 83 #if BUILDFLAG(USE_PROPRIETARY_CODECS)
78 if (init_data_type == EmeInitDataType::CENC) 84 if (init_data_type == EmeInitDataType::CENC)
(...skipping 644 matching lines...) Expand 10 before | Expand all | Expand 10 after
723 uint32_t mask) { 729 uint32_t mask) {
724 KeySystemsImpl::GetInstance()->AddCodecMask(media_type, codec, mask); 730 KeySystemsImpl::GetInstance()->AddCodecMask(media_type, codec, mask);
725 } 731 }
726 732
727 MEDIA_EXPORT void AddMimeTypeCodecMask(const std::string& mime_type, 733 MEDIA_EXPORT void AddMimeTypeCodecMask(const std::string& mime_type,
728 uint32_t mask) { 734 uint32_t mask) {
729 KeySystemsImpl::GetInstance()->AddMimeTypeCodecMask(mime_type, mask); 735 KeySystemsImpl::GetInstance()->AddMimeTypeCodecMask(mime_type, mask);
730 } 736 }
731 737
732 } // namespace media 738 } // namespace media
OLDNEW
« media/base/eme_constants.h ('K') | « media/base/eme_constants.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698