From 6b4918fa9b29926cfe96e10376d313f968d245bd Mon Sep 17 00:00:00 2001 From: vigneshv Date: Tue, 12 Jul 2016 10:46:41 -0700 Subject: [PATCH] vp9: Expose libvpx build configuration ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=127216536 --- .../android/exoplayer2/ext/vp9/LibvpxVideoRenderer.java | 7 +++++++ .../com/google/android/exoplayer2/ext/vp9/VpxDecoder.java | 5 +++++ extensions/vp9/src/main/jni/vpx_jni.cc | 4 ++++ 3 files changed, 16 insertions(+) diff --git a/extensions/vp9/src/main/java/com/google/android/exoplayer2/ext/vp9/LibvpxVideoRenderer.java b/extensions/vp9/src/main/java/com/google/android/exoplayer2/ext/vp9/LibvpxVideoRenderer.java index 5d4c171adc..bc3ecad6de 100644 --- a/extensions/vp9/src/main/java/com/google/android/exoplayer2/ext/vp9/LibvpxVideoRenderer.java +++ b/extensions/vp9/src/main/java/com/google/android/exoplayer2/ext/vp9/LibvpxVideoRenderer.java @@ -131,6 +131,13 @@ public final class LibvpxVideoRenderer extends Renderer { return isLibvpxAvailable() ? VpxDecoder.getLibvpxVersion() : null; } + /** + * Returns the configuration string with which the underlying libvpx library was built. + */ + public static String getLibvpxConfig() { + return isLibvpxAvailable() ? VpxDecoder.getLibvpxConfig() : null; + } + @Override public int getTrackType() { return C.TRACK_TYPE_VIDEO; diff --git a/extensions/vp9/src/main/java/com/google/android/exoplayer2/ext/vp9/VpxDecoder.java b/extensions/vp9/src/main/java/com/google/android/exoplayer2/ext/vp9/VpxDecoder.java index 4a657b5a2e..2c3eecdca9 100644 --- a/extensions/vp9/src/main/java/com/google/android/exoplayer2/ext/vp9/VpxDecoder.java +++ b/extensions/vp9/src/main/java/com/google/android/exoplayer2/ext/vp9/VpxDecoder.java @@ -52,6 +52,11 @@ import java.nio.ByteBuffer; */ public static native String getLibvpxVersion(); + /** + * Returns the configuration string with which the underlying libvpx library was built. + */ + public static native String getLibvpxConfig(); + private final long vpxDecContext; private volatile int outputMode; diff --git a/extensions/vp9/src/main/jni/vpx_jni.cc b/extensions/vp9/src/main/jni/vpx_jni.cc index 484a23ba6c..65ab0dd87d 100644 --- a/extensions/vp9/src/main/jni/vpx_jni.cc +++ b/extensions/vp9/src/main/jni/vpx_jni.cc @@ -170,6 +170,10 @@ FUNC(jstring, getLibvpxVersion) { return env->NewStringUTF(vpx_codec_version_str()); } +FUNC(jstring, getLibvpxConfig) { + return env->NewStringUTF(vpx_codec_build_config()); +} + FUNC(jstring, vpxGetErrorMessage, jlong jContext) { vpx_codec_ctx_t* const context = reinterpret_cast(jContext); return env->NewStringUTF(vpx_codec_error(context));