Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Ewout ter Hoeven
VLC-Android
Commits
2bf1fc1e
Commit
2bf1fc1e
authored
Jul 29, 2012
by
Edward Wang
Browse files
Add an option to use time-stretching audio
parent
41cce1ca
Changes
4
Hide whitespace changes
Inline
Side-by-side
vlc-android/jni/libvlcjni.c
View file @
2bf1fc1e
...
...
@@ -289,6 +289,9 @@ void Java_org_videolan_vlc_LibVLC_nativeInit(JNIEnv *env, jobject thiz, jboolean
jmethodID
methodId
=
(
*
env
)
->
GetMethodID
(
env
,
cls
,
"getAout"
,
"()I"
);
bool
use_opensles
=
(
*
env
)
->
CallIntMethod
(
env
,
thiz
,
methodId
)
==
AOUT_OPENSLES
;
methodId
=
(
*
env
)
->
GetMethodID
(
env
,
cls
,
"timeStretchingEnabled"
,
"()Z"
);
bool
enable_time_stretch
=
(
*
env
)
->
CallBooleanMethod
(
env
,
thiz
,
methodId
);
verbosity
=
verbose
;
libvlc_log_subscribe
(
&
debug_subscriber
,
debug_log
,
&
verbosity
);
...
...
@@ -301,6 +304,7 @@ void Java_org_videolan_vlc_LibVLC_nativeInit(JNIEnv *env, jobject thiz, jboolean
"--no-plugins-cache"
,
"--no-drop-late-frames"
,
"--avcodec-fast"
,
enable_time_stretch
?
"--audio-time-stretch"
:
"--no-audio-time-stretch"
,
use_opensles
?
"--aout=opensles"
:
"--aout=android_audiotrack"
,
};
libvlc_instance_t
*
instance
=
libvlc_new
(
sizeof
(
argv
)
/
sizeof
(
*
argv
),
argv
);
...
...
vlc-android/res/values/strings.xml
View file @
2bf1fc1e
...
...
@@ -130,6 +130,8 @@
<string
name=
"aout_audiotrack"
>
AudioTrack (native)
</string>
<string
name=
"aout_audiotrack_java"
>
AudioTrack (Java)
</string>
<string
name=
"aout_opensles"
>
OpenSL ES
</string>
<string
name=
"enable_time_stretching_audio"
>
Enable time-stretching audio
</string>
<string
name=
"enable_time_stretching_audio_detail"
>
Speed up and slow down audio without changing the pitch (requires a fast device)
</string>
<string-array
name=
"aouts_froyo"
>
<item>
@string/aout_audiotrack_java
</item>
<item>
@string/aout_audiotrack
</item>
...
...
vlc-android/res/xml/preferences.xml
View file @
2bf1fc1e
...
...
@@ -46,8 +46,12 @@
<ListPreference
android:key=
"aout"
android:defaultValue=
"@string/aout_audiotrack_java"
android:title=
"@string/aout"
>
</ListPreference>
android:title=
"@string/aout"
/>
<CheckBoxPreference
android:key=
"enable_time_stretching_audio"
android:title=
"@string/enable_time_stretching_audio"
android:summary=
"@string/enable_time_stretching_audio_detail"
android:defaultValue=
"false"
/>
<PreferenceScreen
android:title=
"@string/advanced_debugging"
>
<Preference
android:title=
"@string/quit"
...
...
vlc-android/src/org/videolan/vlc/LibVLC.java
View file @
2bf1fc1e
...
...
@@ -176,6 +176,11 @@ public class LibVLC {
}
}
public
boolean
timeStretchingEnabled
()
{
SharedPreferences
p
=
PreferenceManager
.
getDefaultSharedPreferences
(
VLCApplication
.
getAppContext
());
return
p
.
getBoolean
(
"enable_time_stretching_audio"
,
false
);
}
/**
* Initialize the libVLC class
*/
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment