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

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

Issue 1027363002: Change EmeInitDataType to be an enum class (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 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 #ifndef MEDIA_BASE_KEY_SYSTEMS_H_ 5 #ifndef MEDIA_BASE_KEY_SYSTEMS_H_
6 #define MEDIA_BASE_KEY_SYSTEMS_H_ 6 #define MEDIA_BASE_KEY_SYSTEMS_H_
7 7
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
11 #include "base/memory/scoped_ptr.h" 11 #include "base/memory/scoped_ptr.h"
12 #include "media/base/eme_constants.h" 12 #include "media/base/eme_constants.h"
13 #include "media/base/media_export.h" 13 #include "media/base/media_export.h"
14 14
15 namespace media { 15 namespace media {
16 16
17 // Prefixed EME API only supports prefixed (webkit-) key system name for 17 // Prefixed EME API only supports prefixed (webkit-) key system name for
18 // certain key systems. But internally only unprefixed key systems are 18 // certain key systems. But internally only unprefixed key systems are
19 // supported. The following two functions help convert between prefixed and 19 // supported. The following two functions help convert between prefixed and
20 // unprefixed key system names. 20 // unprefixed key system names.
21 21
22 // Gets the unprefixed key system name for |key_system|. 22 // Gets the unprefixed key system name for |key_system|.
23 MEDIA_EXPORT std::string GetUnprefixedKeySystemName( 23 MEDIA_EXPORT std::string GetUnprefixedKeySystemName(
24 const std::string& key_system); 24 const std::string& key_system);
25 25
26 // Gets the prefixed key system name for |key_system|. 26 // Gets the prefixed key system name for |key_system|.
27 MEDIA_EXPORT std::string GetPrefixedKeySystemName( 27 MEDIA_EXPORT std::string GetPrefixedKeySystemName(
28 const std::string& key_system); 28 const std::string& key_system);
29 29
30 // Returns false if a container-specific |init_data_type| is specified with an
31 // inappropriate container.
32 // TODO(sandersd): Remove this essentially internal detail if the spec is
33 // updated to not convolve the two in a single method call.
34 // TODO(sandersd): Use enum values instead of strings. http://crbug.com/417440
35 MEDIA_EXPORT bool IsSaneInitDataTypeWithContainer(
36 const std::string& init_data_type,
37 const std::string& container);
38
39 // Use for unprefixed EME only! 30 // Use for unprefixed EME only!
40 // Returns whether |key_system| is a supported key system. 31 // Returns whether |key_system| is a supported key system.
41 // Note: Shouldn't be used for prefixed API as the original 32 // Note: Shouldn't be used for prefixed API as the original
42 // IsSupportedKeySystemWithMediaMimeType() path reports UMAs, but this path does 33 // IsSupportedKeySystemWithMediaMimeType() path reports UMAs, but this path does
43 // not. 34 // not.
44 MEDIA_EXPORT bool IsSupportedKeySystem(const std::string& key_system); 35 MEDIA_EXPORT bool IsSupportedKeySystem(const std::string& key_system);
45 36
46 MEDIA_EXPORT bool IsSupportedKeySystemWithInitDataType( 37 MEDIA_EXPORT bool IsSupportedKeySystemWithInitDataType(
47 const std::string& key_system, 38 const std::string& key_system,
48 const std::string& init_data_type); 39 const std::string& init_data_type);
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
109 100
110 #if defined(UNIT_TEST) 101 #if defined(UNIT_TEST)
111 // Helper functions to add container/codec types for testing purposes. 102 // Helper functions to add container/codec types for testing purposes.
112 MEDIA_EXPORT void AddContainerMask(const std::string& container, uint32 mask); 103 MEDIA_EXPORT void AddContainerMask(const std::string& container, uint32 mask);
113 MEDIA_EXPORT void AddCodecMask(const std::string& codec, uint32 mask); 104 MEDIA_EXPORT void AddCodecMask(const std::string& codec, uint32 mask);
114 #endif // defined(UNIT_TEST) 105 #endif // defined(UNIT_TEST)
115 106
116 } // namespace media 107 } // namespace media
117 108
118 #endif // MEDIA_BASE_KEY_SYSTEMS_H_ 109 #endif // MEDIA_BASE_KEY_SYSTEMS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698