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 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 static bool IsKnownUnaccelerated(const std::string& mime_type, | 68 static bool IsKnownUnaccelerated(const std::string& mime_type, |
69 MediaCodecDirection direction); | 69 MediaCodecDirection direction); |
70 | 70 |
71 // Test whether a URL contains "m3u8". (Using exactly the same logic as | 71 // Test whether a URL contains "m3u8". (Using exactly the same logic as |
72 // NuPlayer does to determine if a stream is HLS.) | 72 // NuPlayer does to determine if a stream is HLS.) |
73 static bool IsHLSURL(const GURL& url); | 73 static bool IsHLSURL(const GURL& url); |
74 | 74 |
75 // Test whether the path of a URL ends with ".m3u8". | 75 // Test whether the path of a URL ends with ".m3u8". |
76 static bool IsHLSPath(const GURL& url); | 76 static bool IsHLSPath(const GURL& url); |
77 | 77 |
78 static bool RegisterMediaCodecUtil(JNIEnv* env); | |
79 | |
80 // 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. |
81 static bool IsVp8DecoderAvailable(); | 79 static bool IsVp8DecoderAvailable(); |
82 static bool IsVp8EncoderAvailable(); | 80 static bool IsVp8EncoderAvailable(); |
83 | 81 |
84 // Indicates if the vp9 decoder is available on this device. | 82 // Indicates if the vp9 decoder is available on this device. |
85 static bool IsVp9DecoderAvailable(); | 83 static bool IsVp9DecoderAvailable(); |
86 | 84 |
87 // Indicates if SurfaceView and MediaCodec work well together on this device. | 85 // Indicates if SurfaceView and MediaCodec work well together on this device. |
88 static bool IsSurfaceViewOutputSupported(); | 86 static bool IsSurfaceViewOutputSupported(); |
89 | 87 |
90 // Indicates if the decoder is known to fail when flushed. (b/8125974, | 88 // Indicates if the decoder is known to fail when flushed. (b/8125974, |
91 // b/8347958) | 89 // b/8347958) |
92 // When true, the client should work around the issue by releasing the | 90 // When true, the client should work around the issue by releasing the |
93 // decoder and instantiating a new one rather than flushing the current one. | 91 // decoder and instantiating a new one rather than flushing the current one. |
94 static bool CodecNeedsFlushWorkaround(MediaCodecBridge* codec); | 92 static bool CodecNeedsFlushWorkaround(MediaCodecBridge* codec); |
95 }; | 93 }; |
96 | 94 |
97 } // namespace media | 95 } // namespace media |
98 | 96 |
99 #endif // MEDIA_BASE_ANDROID_MEDIA_CODEC_UTIL_H_ | 97 #endif // MEDIA_BASE_ANDROID_MEDIA_CODEC_UTIL_H_ |
OLD | NEW |