Chromium Code Reviews| 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 #ifndef MEDIA_BASE_ANDROID_MEDIA_CODEC_UTIL_H_ | 5 #ifndef MEDIA_BASE_ANDROID_MEDIA_CODEC_UTIL_H_ |
| 6 #define MEDIA_BASE_ANDROID_MEDIA_CODEC_UTIL_H_ | 6 #define MEDIA_BASE_ANDROID_MEDIA_CODEC_UTIL_H_ |
| 7 | 7 |
| 8 #include <jni.h> | 8 #include <jni.h> |
| 9 #include <set> | 9 #include <set> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 28 matching lines...) Expand all Loading... | |
| 39 } \ | 39 } \ |
| 40 } while (0) | 40 } while (0) |
| 41 | 41 |
| 42 class MEDIA_EXPORT MediaCodecUtil { | 42 class MEDIA_EXPORT MediaCodecUtil { |
| 43 public: | 43 public: |
| 44 // Returns true if MediaCodec is available on the device. | 44 // Returns true if MediaCodec is available on the device. |
| 45 // All other static methods check IsAvailable() internally. There's no need | 45 // All other static methods check IsAvailable() internally. There's no need |
| 46 // to check IsAvailable() explicitly before calling them. | 46 // to check IsAvailable() explicitly before calling them. |
| 47 static bool IsMediaCodecAvailable(); | 47 static bool IsMediaCodecAvailable(); |
| 48 | 48 |
| 49 // Returns true if MediaCodec is available, with |sdk| as the sdk version and | |
| 50 // |model| as the model. This is provided primarily for unit tests; you | |
|
watk
2017/02/10 22:14:13
nit: Remove "primarily". Makes it sound like there
liberato (no reviews please)
2017/02/13 21:24:09
Done.
| |
| 51 // probably want IsMediaCodecAvailable() otherwise. | |
| 52 // TODO(liberato): merge this with IsMediaCodecAvailable, and provide a way | |
| 53 // to mock BuildInfo instead. | |
| 54 static bool IsMediaCodecAvailableForSdk(int sdk, const char* model); | |
| 55 | |
| 49 // Returns true if MediaCodec.setParameters() is available on the device. | 56 // Returns true if MediaCodec.setParameters() is available on the device. |
| 50 static bool SupportsSetParameters(); | 57 static bool SupportsSetParameters(); |
| 51 | 58 |
| 52 // Returns whether MediaCodecBridge has a decoder that |is_secure| and can | 59 // Returns whether MediaCodecBridge has a decoder that |is_secure| and can |
| 53 // decode |codec| type. | 60 // decode |codec| type. |
| 54 static bool CanDecode(const std::string& codec, bool is_secure); | 61 static bool CanDecode(const std::string& codec, bool is_secure); |
| 55 | 62 |
| 56 // Get a list of encoder supported color formats for |mime_type|. | 63 // Get a list of encoder supported color formats for |mime_type|. |
| 57 // The mapping of color format name and its value refers to | 64 // The mapping of color format name and its value refers to |
| 58 // MediaCodecInfo.CodecCapabilities. | 65 // MediaCodecInfo.CodecCapabilities. |
| (...skipping 26 matching lines...) Expand all Loading... | |
| 85 // Indicates if the decoder is known to fail when flushed. (b/8125974, | 92 // Indicates if the decoder is known to fail when flushed. (b/8125974, |
| 86 // b/8347958) | 93 // b/8347958) |
| 87 // When true, the client should work around the issue by releasing the | 94 // When true, the client should work around the issue by releasing the |
| 88 // decoder and instantiating a new one rather than flushing the current one. | 95 // decoder and instantiating a new one rather than flushing the current one. |
| 89 static bool CodecNeedsFlushWorkaround(MediaCodecBridge* codec); | 96 static bool CodecNeedsFlushWorkaround(MediaCodecBridge* codec); |
| 90 }; | 97 }; |
| 91 | 98 |
| 92 } // namespace media | 99 } // namespace media |
| 93 | 100 |
| 94 #endif // MEDIA_BASE_ANDROID_MEDIA_CODEC_UTIL_H_ | 101 #endif // MEDIA_BASE_ANDROID_MEDIA_CODEC_UTIL_H_ |
| OLD | NEW |