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
 

Erel

Administrator
Staff member
Licensed User
Update to ExoPlayer v1.30.

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

B4X:
Sub CreateNativePlayer As Object
   Dim TrackSelectionFactory As JavaObject
   TrackSelectionFactory.InitializeNewInstance("com.google.android.exoplayer2.trackselection.AdaptiveTrackSelection.Factory", Null)
   Dim TrackSelector As JavaObject
   TrackSelector.InitializeNewInstance("com.google.android.exoplayer2.trackselection.DefaultTrackSelector", Array(TrackSelectionFactory))
   Dim np As JavaObject
   Dim ctxt As JavaObject
   ctxt.InitializeContext
   Dim RenderersFactory As JavaObject
   RenderersFactory.InitializeNewInstance("com.google.android.exoplayer2.DefaultRenderersFactory", Array(ctxt, Null, 2)) 'EXTENSION_RENDERER_MODE_PREFER
   np = np.InitializeStatic("com.google.android.exoplayer2.ExoPlayerFactory").RunMethod("newSimpleInstance", Array(ctxt, RenderersFactory,TrackSelector))
   Return np
End Sub
 
Top