| 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 29 matching lines...) Expand all Loading... |
| 40 } \ | 40 } \ |
| 41 } while (0) | 41 } while (0) |
| 42 | 42 |
| 43 class MEDIA_EXPORT MediaCodecUtil { | 43 class MEDIA_EXPORT MediaCodecUtil { |
| 44 public: | 44 public: |
| 45 // Returns true if MediaCodec is available on the device. | 45 // Returns true if MediaCodec is available on the device. |
| 46 // All other static methods check IsAvailable() internally. There's no need | 46 // All other static methods check IsAvailable() internally. There's no need |
| 47 // to check IsAvailable() explicitly before calling them. | 47 // to check IsAvailable() explicitly before calling them. |
| 48 static bool IsMediaCodecAvailable(); | 48 static bool IsMediaCodecAvailable(); |
| 49 | 49 |
| 50 // Returns true if MediaCodec is available, with |sdk| as the sdk version and |
| 51 // |model| as the model. This is provided for unit tests; you probably want |
| 52 // IsMediaCodecAvailable() otherwise. |
| 53 // TODO(liberato): merge this with IsMediaCodecAvailable, and provide a way |
| 54 // to mock BuildInfo instead. |
| 55 static bool IsMediaCodecAvailableFor(int sdk, const char* model); |
| 56 |
| 50 // Returns true if MediaCodec.setParameters() is available on the device. | 57 // Returns true if MediaCodec.setParameters() is available on the device. |
| 51 static bool SupportsSetParameters(); | 58 static bool SupportsSetParameters(); |
| 52 | 59 |
| 53 // Returns whether MediaCodecBridge has a decoder that |is_secure| and can | 60 // Returns whether MediaCodecBridge has a decoder that |is_secure| and can |
| 54 // decode |codec| type. | 61 // decode |codec| type. |
| 55 static bool CanDecode(const std::string& codec, bool is_secure); | 62 static bool CanDecode(const std::string& codec, bool is_secure); |
| 56 | 63 |
| 57 // Returns a vector of supported codecs profiles and levels. | 64 // Returns a vector of supported codecs profiles and levels. |
| 58 static bool AddSupportedCodecProfileLevels( | 65 static bool AddSupportedCodecProfileLevels( |
| 59 std::vector<CodecProfileLevel>* out); | 66 std::vector<CodecProfileLevel>* out); |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 93 // Indicates if the decoder is known to fail when flushed. (b/8125974, | 100 // Indicates if the decoder is known to fail when flushed. (b/8125974, |
| 94 // b/8347958) | 101 // b/8347958) |
| 95 // When true, the client should work around the issue by releasing the | 102 // When true, the client should work around the issue by releasing the |
| 96 // decoder and instantiating a new one rather than flushing the current one. | 103 // decoder and instantiating a new one rather than flushing the current one. |
| 97 static bool CodecNeedsFlushWorkaround(MediaCodecBridge* codec); | 104 static bool CodecNeedsFlushWorkaround(MediaCodecBridge* codec); |
| 98 }; | 105 }; |
| 99 | 106 |
| 100 } // namespace media | 107 } // namespace media |
| 101 | 108 |
| 102 #endif // MEDIA_BASE_ANDROID_MEDIA_CODEC_UTIL_H_ | 109 #endif // MEDIA_BASE_ANDROID_MEDIA_CODEC_UTIL_H_ |
| OLD | NEW |