| 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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 // Get a list of encoder supported color formats for |mime_type|. | 59 // Get a list of encoder supported color formats for |mime_type|. |
| 60 // The mapping of color format name and its value refers to | 60 // The mapping of color format name and its value refers to |
| 61 // MediaCodecInfo.CodecCapabilities. | 61 // MediaCodecInfo.CodecCapabilities. |
| 62 static std::set<int> GetEncoderColorFormats(const std::string& mime_type); | 62 static std::set<int> GetEncoderColorFormats(const std::string& mime_type); |
| 63 | 63 |
| 64 // Returns true if |mime_type| is known to be unaccelerated (i.e. backed by a | 64 // Returns true if |mime_type| is known to be unaccelerated (i.e. backed by a |
| 65 // software codec instead of a hardware one). | 65 // software codec instead of a hardware one). |
| 66 static bool IsKnownUnaccelerated(const std::string& mime_type, | 66 static bool IsKnownUnaccelerated(const std::string& mime_type, |
| 67 MediaCodecDirection direction); | 67 MediaCodecDirection direction); |
| 68 | 68 |
| 69 // Test whether the path of a URL ends with ".m3u8". | 69 // Test whether a URL contains "m3u8". (Using exactly the same logic as |
| 70 // NuPlayer does to determine if a stream is HLS.) |
| 70 static bool IsHLSURL(const GURL& url); | 71 static bool IsHLSURL(const GURL& url); |
| 71 | 72 |
| 72 // Test whether a URL contains "m3u8". (Using exactly the same logic as | 73 // Test whether the path of a URL ends with ".m3u8". |
| 73 // NuPlayer does to determine if a stream is HLS.) | |
| 74 static bool IsHLSPath(const GURL& url); | 74 static bool IsHLSPath(const GURL& url); |
| 75 | 75 |
| 76 static bool RegisterMediaCodecUtil(JNIEnv* env); | 76 static bool RegisterMediaCodecUtil(JNIEnv* env); |
| 77 | 77 |
| 78 // Indicates if the vp8 decoder or encoder is available on this device. | 78 // Indicates if the vp8 decoder or encoder is available on this device. |
| 79 static bool IsVp8DecoderAvailable(); | 79 static bool IsVp8DecoderAvailable(); |
| 80 static bool IsVp8EncoderAvailable(); | 80 static bool IsVp8EncoderAvailable(); |
| 81 | 81 |
| 82 // Indicates if the vp9 decoder is available on this device. | 82 // Indicates if the vp9 decoder is available on this device. |
| 83 static bool IsVp9DecoderAvailable(); | 83 static bool IsVp9DecoderAvailable(); |
| 84 | 84 |
| 85 // Indicates if SurfaceView and MediaCodec work well together on this device. | 85 // Indicates if SurfaceView and MediaCodec work well together on this device. |
| 86 static bool IsSurfaceViewOutputSupported(); | 86 static bool IsSurfaceViewOutputSupported(); |
| 87 }; | 87 }; |
| 88 | 88 |
| 89 } // namespace media | 89 } // namespace media |
| 90 | 90 |
| 91 #endif // MEDIA_BASE_ANDROID_MEDIA_CODEC_UTIL_H_ | 91 #endif // MEDIA_BASE_ANDROID_MEDIA_CODEC_UTIL_H_ |
| OLD | NEW |