Index: media/base/android/media_codec_util.h |
diff --git a/media/base/android/media_codec_util.h b/media/base/android/media_codec_util.h |
index 3bf0e5377235f7a7a52613e01d4683620f5b19e8..75c94bfda64798276bc33d07dbac1726756b8260 100644 |
--- a/media/base/android/media_codec_util.h |
+++ b/media/base/android/media_codec_util.h |
@@ -13,6 +13,7 @@ |
#include "base/compiler_specific.h" |
#include "base/macros.h" |
#include "media/base/android/media_codec_direction.h" |
+#include "media/base/audio_codecs.h" |
#include "media/base/media_export.h" |
#include "media/base/video_codecs.h" |
@@ -20,28 +21,26 @@ class GURL; |
namespace media { |
+namespace mime_type { |
+extern const char kMp3[]; |
+extern const char kAac[]; |
+extern const char kOpus[]; |
+extern const char kVorbis[]; |
+extern const char kAc3[]; |
+extern const char kEac3[]; |
+extern const char kAvc[]; |
+extern const char kHevc[]; |
+extern const char kVp8[]; |
+extern const char kVp9[]; |
+} |
+ |
class MediaCodecBridge; |
-// Helper macro to skip the test if MediaCodecBridge isn't available. |
-#define SKIP_TEST_IF_MEDIA_CODEC_BRIDGE_IS_NOT_AVAILABLE() \ |
- do { \ |
- if (!MediaCodecUtil::IsMediaCodecAvailable()) { \ |
- VLOG(0) << "Could not run test - not supported on device."; \ |
- return; \ |
- } \ |
- } while (0) |
- |
-// Helper macro to skip the test if VP8 decoding isn't supported. |
-#define SKIP_TEST_IF_VP8_DECODER_IS_NOT_SUPPORTED() \ |
- do { \ |
- if (!MediaCodecUtil::IsVp8DecoderAvailable()) { \ |
- VLOG(0) << "Could not run test - not supported on device."; \ |
- return; \ |
- } \ |
- } while (0) |
- |
class MEDIA_EXPORT MediaCodecUtil { |
public: |
+ static std::string CodecToAndroidMimeType(AudioCodec codec); |
+ static std::string CodecToAndroidMimeType(VideoCodec codec); |
+ |
// Returns true if MediaCodec is available on the device. |
// All other static methods check IsAvailable() internally. There's no need |
// to check IsAvailable() explicitly before calling them. |
@@ -50,9 +49,9 @@ class MEDIA_EXPORT MediaCodecUtil { |
// Returns true if MediaCodec.setParameters() is available on the device. |
static bool SupportsSetParameters(); |
- // Returns whether MediaCodecBridge has a decoder that |is_secure| and can |
- // decode |codec| type. |
- static bool CanDecode(const std::string& codec, bool is_secure); |
+ // Returns whether it's possible to create a MediaCodec for the given mime |
+ // type and secureness. |
+ static bool CanDecode(const std::string& mime_type, bool is_secure); |
// Returns a vector of supported codecs profiles and levels. |
static bool AddSupportedCodecProfileLevels( |
@@ -65,7 +64,7 @@ class MEDIA_EXPORT MediaCodecUtil { |
// Returns true if |mime_type| is known to be unaccelerated (i.e. backed by a |
// software codec instead of a hardware one). |
- static bool IsKnownUnaccelerated(const std::string& mime_type, |
+ static bool IsKnownUnaccelerated(VideoCodec codec, |
MediaCodecDirection direction); |
// Test whether a URL contains "m3u8". |