OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/media_util.h" | 5 #include "media/base/media_util.h" |
6 | 6 |
| 7 #include "base/command_line.h" |
| 8 #include "media/base/media_switches.h" |
| 9 |
7 namespace media { | 10 namespace media { |
8 | 11 |
9 std::vector<uint8_t> EmptyExtraData() { | 12 std::vector<uint8_t> EmptyExtraData() { |
10 return std::vector<uint8_t>(); | 13 return std::vector<uint8_t>(); |
11 } | 14 } |
12 | 15 |
13 EncryptionScheme Unencrypted() { | 16 EncryptionScheme Unencrypted() { |
14 return EncryptionScheme(); | 17 return EncryptionScheme(); |
15 } | 18 } |
16 | 19 |
17 EncryptionScheme AesCtrEncryptionScheme() { | 20 EncryptionScheme AesCtrEncryptionScheme() { |
18 return EncryptionScheme(EncryptionScheme::CIPHER_MODE_AES_CTR, | 21 return EncryptionScheme(EncryptionScheme::CIPHER_MODE_AES_CTR, |
19 EncryptionScheme::Pattern()); | 22 EncryptionScheme::Pattern()); |
20 } | 23 } |
21 | 24 |
| 25 std::string GetEffectiveAutoplayPolicy(const base::CommandLine& command_line) { |
| 26 if (command_line.HasSwitch(switches::kIgnoreAutoplayRestrictionsForTests)) |
| 27 return switches::autoplay::kNoUserGestureRequiredPolicy; |
| 28 |
| 29 // Return the default policy if none is specified in the command line. |
| 30 if (!command_line.HasSwitch(switches::kAutoplayPolicy)) { |
| 31 #if defined(OS_ANDROID) |
| 32 return switches::autoplay::kUserGestureRequiredPolicy; |
| 33 #else |
| 34 return switches::autoplay::kNoUserGestureRequiredPolicy; |
| 35 #endif |
| 36 } |
| 37 |
| 38 return command_line.GetSwitchValueASCII(switches::kAutoplayPolicy); |
| 39 } |
| 40 |
22 } // namespace media | 41 } // namespace media |
OLD | NEW |