Commit c6aeb86c authored by Edward Wang's avatar Edward Wang

Add an option for frame skip

Close #8383
parent 81a12c63
......@@ -9,6 +9,7 @@ Main Application:
* Fix opening MRLs and video streaming
* Fix many crashes and warnings
* New equalizer
* Option for frame skip to improve performance
Changes between 0.1.1 and 0.1.2:
......
......@@ -216,6 +216,9 @@ void Java_org_videolan_libvlc_LibVLC_nativeInit(JNIEnv *env, jobject thiz)
methodId = (*env)->GetMethodID(env, cls, "timeStretchingEnabled", "()Z");
bool enable_time_stretch = (*env)->CallBooleanMethod(env, thiz, methodId);
methodId = (*env)->GetMethodID(env, cls, "frameSkipEnabled", "()Z");
bool enable_frame_skip = (*env)->CallBooleanMethod(env, thiz, methodId);
methodId = (*env)->GetMethodID(env, cls, "getDeblocking", "()I");
int deblocking = (*env)->CallIntMethod(env, thiz, methodId);
char deblockstr[2] = "3";
......@@ -252,6 +255,8 @@ void Java_org_videolan_libvlc_LibVLC_nativeInit(JNIEnv *env, jobject thiz)
"--subsdec-encoding", subsencodingstr,
enable_time_stretch ? "--audio-time-stretch" : "--no-audio-time-stretch",
"--avcodec-skiploopfilter", deblockstr,
"--avcodec-skip-frame", enable_frame_skip ? "4" : "0",
"--avcodec-skip-idct", enable_frame_skip ? "4" : "0",
use_opensles ? "--aout=opensles" : "--aout=android_audiotrack",
"--androidsurface-chroma", chromastr != NULL && chromastr[0] != 0 ? chromastr : "RV32",
};
......
......@@ -166,6 +166,8 @@
<string name="enable_iomx_summary">Active l\'accélération matérielle pour améliorer les performances. Ne fonctionne pas sur tous les appareils.</string>
<string name="enable_time_stretching_audio">Correction audio</string>
<string name="enable_time_stretching_audio_summary">Active la correction audio en lecture accélérée ou ralentie. Nécessite un appareil puissant</string>
<string name="enable_frame_skip">Activer le sautage des trames</string>
<string name="enable_frame_skip_summary">Accélérer le décodage pour améliore les performances, mais diminue la qualité</string>
<string name="deblocking">Filtre de déblocage</string>
<string name="deblocking_summary">Améliore la qualité mais nécessite un appareil puissant</string>
<string name="deblocking_always">Déblocage max (plus lente)</string>
......
......@@ -192,6 +192,8 @@
<string name="enable_iomx_summary">Improves performance, but may not work with all devices.</string>
<string name="enable_time_stretching_audio">Time-stretching audio</string>
<string name="enable_time_stretching_audio_summary">Speed up and slow down audio without changing the pitch (requires a fast device).</string>
<string name="enable_frame_skip">Enable frame skip</string>
<string name="enable_frame_skip_summary">Speed up decoding but could lower video quality.</string>
<string name="deblocking">Deblocking filter settings</string>
<string name="deblocking_summary">Change the deblocking filter settings. Could improve video quality. Advanced users only.</string>
<string name="deblocking_always">Full deblocking (slowest)</string>
......
......@@ -52,6 +52,11 @@
android:key="deblocking"
android:title="@string/deblocking"
android:summary="@string/deblocking_summary" />
<CheckBoxPreference
android:defaultValue="false"
android:key="enable_frame_skip"
android:summary="@string/enable_frame_skip_summary"
android:title="@string/enable_frame_skip" />
<CheckBoxPreference
android:key="enable_iomx"
android:summary="@string/enable_iomx_summary"
......
......@@ -62,6 +62,7 @@ public class LibVLC {
private String chroma = "";
private boolean verboseMode = true;
private float[] equalizer = null;
private boolean frameSkip = false;
/** Check in libVLC already initialized otherwise crash */
private boolean mIsInitialized = false;
......@@ -260,6 +261,14 @@ public class LibVLC {
setNativeEqualizer(this.equalizer);
}
public boolean frameSkipEnabled() {
return frameSkip;
}
public void setFrameSkip(boolean frameskip) {
this.frameSkip = frameskip;
}
/**
* Initialize the libVLC class
*/
......
......@@ -117,6 +117,7 @@ public class Util {
instance.setIomx(pref.getBoolean("enable_iomx", false));
instance.setSubtitlesEncoding(pref.getString("subtitles_text_encoding", ""));
instance.setTimeStretching(pref.getBoolean("enable_time_stretching_audio", false));
instance.setFrameSkip(pref.getBoolean("enable_frame_skip", false));
instance.setChroma(pref.getString("chroma_format", ""));
instance.setVerboseMode(pref.getBoolean("enable_verbose_mode", true));
......
......@@ -203,6 +203,7 @@ public class PreferencesActivity extends PreferenceActivity implements OnSharedP
if(key.equalsIgnoreCase("enable_iomx")
|| key.equalsIgnoreCase("subtitles_text_encoding")
|| key.equalsIgnoreCase("aout")
|| key.equalsIgnoreCase("enable_frame_skip")
|| key.equalsIgnoreCase("enable_time_stretching_audio")
|| key.equalsIgnoreCase("deblocking")
|| key.equalsIgnoreCase("chroma_format")
......
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