Skip to content
Snippets Groups Projects
Commit ddeb0990 authored by Nicolas Pomepuy's avatar Nicolas Pomepuy
Browse files

VLCOptions: remove HWDecoderUtil.AudioOutput.AUDIOTRACK handling

HWDecoderUtil.getAudioOutputFromDevice() can only return OPENSLES or ALL.
parent 37efbd9b
No related branches found
No related tags found
1 merge request!1625Update the libs
......@@ -35,6 +35,10 @@ android {
}
sourceSets.main {
java.srcDirs = rootProject.ext.vlcMajorVersion == 4 ? ['src', 'vlc4/src'] : ['src', 'vlc3/src']
}
sourceSets.debug {
res.srcDirs = ['flavors/debug/res']
}
......
package org.videolan.resources
import androidx.test.platform.app.InstrumentationRegistry
import androidx.test.ext.junit.runners.AndroidJUnit4
import org.junit.Test
import org.junit.runner.RunWith
import org.junit.Assert.*
/**
* Instrumented test, which will execute on an Android device.
*
* See [testing documentation](http://d.android.com/tools/testing).
*/
@RunWith(AndroidJUnit4::class)
class ExampleInstrumentedTest {
@Test
fun useAppContext() {
// Context of the app under test.
val appContext = InstrumentationRegistry.getInstrumentation().targetContext
assertEquals("org.videolan.resources", appContext.packageName)
}
}
......@@ -38,6 +38,7 @@ import org.videolan.medialibrary.interfaces.media.MediaWrapper
import org.videolan.tools.Preferences
import org.videolan.tools.Settings
import org.videolan.tools.putSingle
import org.videolan.vlc.isVLC4
import java.io.File
import java.util.*
......@@ -119,7 +120,7 @@ object VLCOptions {
options.add("soxr")
options.add("--audiotrack-session-id=$audiotrackSessionId")
options.add("--freetype-rel-fontsize=" + freetypeRelFontsize!!)
if (isVLC4()) options.add("--sub-text-scale=" + (1600 / freetypeRelFontsize!!.toFloat()).toString()) else options.add("--freetype-rel-fontsize=" + freetypeRelFontsize!!)
if (freetypeBold) options.add("--freetype-bold")
options.add("--freetype-color=$freetypeColor")
options.add("--freetype-opacity=$freetypeColorOpacity")
......@@ -147,11 +148,14 @@ object VLCOptions {
options.add("--keystore-file")
options.add(File(context.getDir("keystore", Context.MODE_PRIVATE), "file").absolutePath)
options.add(if (verboseMode) "-vv" else "-v")
if (pref.getBoolean("casting_passthrough", false))
options.add("--sout-chromecast-audio-passthrough")
else
options.add("--no-sout-chromecast-audio-passthrough")
options.add("--sout-chromecast-conversion-quality=" + pref.getString("casting_quality", "2")!!)
// fixme comment temporarily
if (!isVLC4()) {
if (pref.getBoolean("casting_passthrough", false))
options.add("--sout-chromecast-audio-passthrough")
else
options.add("--no-sout-chromecast-audio-passthrough")
options.add("--sout-chromecast-conversion-quality=" + pref.getString("casting_quality", "2")!!)
}
options.add("--sout-keep")
val customOptions = pref.getString("custom_libvlc_options", null)
......@@ -201,8 +205,8 @@ object VLCOptions {
}
val hwaout = HWDecoderUtil.getAudioOutputFromDevice()
if (hwaout == HWDecoderUtil.AudioOutput.AUDIOTRACK || hwaout == HWDecoderUtil.AudioOutput.OPENSLES)
aout = if (hwaout == HWDecoderUtil.AudioOutput.OPENSLES) AOUT_OPENSLES else AOUT_AUDIOTRACK
if (hwaout == HWDecoderUtil.AudioOutput.OPENSLES)
aout = AOUT_OPENSLES
return if (aout == AOUT_OPENSLES) "opensles_android" else null /* audiotrack is the default */
}
......
package org.videolan.vlc
/*
* ************************************************************************
* Vlc3.kt
* *************************************************************************
* Copyright © 2022 VLC authors and VideoLAN
* Author: Nicolas POMEPUY
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
* **************************************************************************
*
*
*/
fun isVLC4() = false
\ No newline at end of file
package org.videolan.vlc
/*
* ************************************************************************
* Verlc3.kt
* *************************************************************************
* Copyright © 2022 VLC authors and VideoLAN
* Author: Nicolas POMEPUY
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
* **************************************************************************
*
*
*/
fun isVLC4() = true
\ No newline at end of file
......@@ -95,6 +95,3 @@ fun MediaPlayer.unselectTrackType(type: Int) {
fun getDisableTrack(context: Context) : VlcTrack {
throw IllegalStateException("This is a VLC 4 only API. It should not be called by VLC 3")
}
fun isVLC4() = false
\ No newline at end of file
......@@ -101,5 +101,3 @@ fun getDisableTrack(context: Context) = object : VlcTrack {
override fun getFrameRateNum() = 0
}
fun isVLC4() = true
\ No newline at end of file
......@@ -259,9 +259,9 @@ fi
if [ "$FORCE_VLC_4" = 1 ]; then
LIBVLCJNI_TESTED_HASH=965402da3c2004dcef4f6575406ace343b2f1b15
LIBVLCJNI_TESTED_HASH=e4b4ba27687f781e01e09ad687cfc9613d3abac6
else
LIBVLCJNI_TESTED_HASH=6c512862228c833234068b50abb67ea03ec8dcde
LIBVLCJNI_TESTED_HASH=cc744e179ec245053ff57602744e8d5d5d17fdc4
fi
LIBVLCJNI_REPOSITORY=https://code.videolan.org/videolan/libvlcjni
if [ ! -d "libvlcjni" ] || [ ! -d "libvlcjni/.git" ]; then
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment