[Android] Add an option for frame skip
Edward Wang
git at videolan.org
Mon Aug 19 21:56:22 CEST 2013
vlc-ports/android | branch: master | Edward Wang <edward.c.wang at compdigitec.com> | Mon Aug 19 15:54:49 2013 -0400| [c6aeb86cae26a623a15b17e79b747c05a7640046] | committer: Edward Wang
Add an option for frame skip
Close #8383
> http://git.videolan.org/gitweb.cgi/vlc-ports/android.git/?a=commit;h=c6aeb86cae26a623a15b17e79b747c05a7640046
---
NEWS | 1 +
vlc-android/jni/libvlcjni.c | 5 +++++
vlc-android/res/values-fr/strings.xml | 2 ++
vlc-android/res/values/strings.xml | 2 ++
vlc-android/res/xml/preferences.xml | 5 +++++
vlc-android/src/org/videolan/libvlc/LibVLC.java | 9 +++++++++
vlc-android/src/org/videolan/vlc/Util.java | 1 +
vlc-android/src/org/videolan/vlc/gui/PreferencesActivity.java | 1 +
8 files changed, 26 insertions(+)
diff --git a/NEWS b/NEWS
index 64eac51..df13c95 100644
--- a/NEWS
+++ b/NEWS
@@ -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:
diff --git a/vlc-android/jni/libvlcjni.c b/vlc-android/jni/libvlcjni.c
index 85e020d..cada5e4 100644
--- a/vlc-android/jni/libvlcjni.c
+++ b/vlc-android/jni/libvlcjni.c
@@ -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",
};
diff --git a/vlc-android/res/values-fr/strings.xml b/vlc-android/res/values-fr/strings.xml
index c2a121c..6554d93 100644
--- a/vlc-android/res/values-fr/strings.xml
+++ b/vlc-android/res/values-fr/strings.xml
@@ -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>
diff --git a/vlc-android/res/values/strings.xml b/vlc-android/res/values/strings.xml
index 9cebce5..c1090ea 100644
--- a/vlc-android/res/values/strings.xml
+++ b/vlc-android/res/values/strings.xml
@@ -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>
diff --git a/vlc-android/res/xml/preferences.xml b/vlc-android/res/xml/preferences.xml
index 58206b7..342931f 100644
--- a/vlc-android/res/xml/preferences.xml
+++ b/vlc-android/res/xml/preferences.xml
@@ -53,6 +53,11 @@
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"
android:title="@string/enable_iomx" />
diff --git a/vlc-android/src/org/videolan/libvlc/LibVLC.java b/vlc-android/src/org/videolan/libvlc/LibVLC.java
index b7b4eae..60058fe 100644
--- a/vlc-android/src/org/videolan/libvlc/LibVLC.java
+++ b/vlc-android/src/org/videolan/libvlc/LibVLC.java
@@ -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
*/
diff --git a/vlc-android/src/org/videolan/vlc/Util.java b/vlc-android/src/org/videolan/vlc/Util.java
index 99b41d0..34d2e69 100644
--- a/vlc-android/src/org/videolan/vlc/Util.java
+++ b/vlc-android/src/org/videolan/vlc/Util.java
@@ -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));
diff --git a/vlc-android/src/org/videolan/vlc/gui/PreferencesActivity.java b/vlc-android/src/org/videolan/vlc/gui/PreferencesActivity.java
index 901ed46..7e2d735 100644
--- a/vlc-android/src/org/videolan/vlc/gui/PreferencesActivity.java
+++ b/vlc-android/src/org/videolan/vlc/gui/PreferencesActivity.java
@@ -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")
More information about the Android
mailing list