Commit 63e6d597 authored by Edward Wang's avatar Edward Wang

libvlcjni: YV12 option

parent 35d3d413
......@@ -407,6 +407,9 @@ void Java_org_videolan_vlc_LibVLC_nativeInit(JNIEnv *env, jobject thiz, jboolean
methodId = (*env)->GetMethodID(env, cls, "timeStretchingEnabled", "()Z");
bool enable_time_stretch = (*env)->CallBooleanMethod(env, thiz, methodId);
methodId = (*env)->GetMethodID(env, cls, "yv12Enabled", "()Z");
bool yv12enabled = (*env)->CallBooleanMethod(env, thiz, methodId);
methodId = (*env)->GetMethodID(env, cls, "getSubtitlesEncoding", "()Ljava/lang/String;");
jstring subsencoding = (*env)->CallObjectMethod(env, thiz, methodId);
const char *subsencodingstr = (*env)->GetStringUTFChars(env, subsencoding, 0);
......@@ -429,6 +432,7 @@ void Java_org_videolan_vlc_LibVLC_nativeInit(JNIEnv *env, jobject thiz, jboolean
"--subsdec-encoding", subsencodingstr,
enable_time_stretch ? "--audio-time-stretch" : "--no-audio-time-stretch",
use_opensles ? "--aout=opensles" : "--aout=android_audiotrack",
yv12enabled ? "--androidsurface-chroma=YV12" : "--androidsurface-chroma=RV32",
};
libvlc_instance_t *instance = libvlc_new(sizeof(argv) / sizeof(*argv), argv);
......
......@@ -179,6 +179,10 @@ public class LibVLC {
final SharedPreferences p = PreferenceManager.getDefaultSharedPreferences(VLCApplication.getAppContext());
return p.getBoolean("enable_time_stretching_audio", false);
}
public boolean yv12Enabled() {
final SharedPreferences p = PreferenceManager.getDefaultSharedPreferences(VLCApplication.getAppContext());
return (p.getBoolean("enable_yv12_format", false) && Util.isGingerbreadOrLater());
}
/**
* Initialize the libVLC class
......
......@@ -207,7 +207,8 @@ public class PreferencesActivity extends PreferenceActivity implements OnSharedP
if (key.equalsIgnoreCase("enable_iomx") ||
key.equalsIgnoreCase("subtitles_text_encoding") ||
key.equalsIgnoreCase("aout") ||
key.equalsIgnoreCase("enable_time_stretching_audio")) {
key.equalsIgnoreCase("enable_time_stretching_audio") ||
key.equalsIgnoreCase("enable_yv12_format")) {
LibVLC.restart();
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment