Android Question Exoplayer software decoding

Sasuke Sama

Active Member
Licensed User
Dose anyone know how to force exo to run in SW Decoding mode?

i found this :

As a side note, if you need software decoders you can use:

DefaultRenderersFactory rf = new DefaultRenderersFactory(this.getApplicationContext(), null, DefaultRenderersFactory.EXTENSION_RENDERER_MODE_ON); player = ExoPlayerFactory.newSimpleInstance( rf, new DefaultTrackSelector(), new DefaultLoadControl() );

If you want to prefer the use of software decoders (i.e. ffmpeg for audio) just set the EXTENSION_RENDERER_MODE_ON to EXTENSION_RENDERER_MODE_PREFER *

can anyone translate this into a b4a code? thanx


Staff member
Licensed User
Update to ExoPlayer v1.30.

Use this code to create the player and initialize SimpleExoPlayer with InitializeCustom.

Sub CreateNativePlayer As Object
   Dim TrackSelectionFactory As JavaObject
   TrackSelectionFactory.InitializeNewInstance("", Null)
   Dim TrackSelector As JavaObject
   TrackSelector.InitializeNewInstance("", Array(TrackSelectionFactory))
   Dim np As JavaObject
   Dim ctxt As JavaObject
   Dim RenderersFactory As JavaObject
   RenderersFactory.InitializeNewInstance("", Array(ctxt, Null, 2)) 'EXTENSION_RENDERER_MODE_PREFER
   np = np.InitializeStatic("").RunMethod("newSimpleInstance", Array(ctxt, RenderersFactory,TrackSelector))
   Return np
End Sub