0

I compiled vlc for android with version 1.8 and I found a official demo with link: https://bitbucket.org/edwardcw/libvlc-android-sample .It's works fine with localVideo. I try to play a http stream, so I change the code below:

 // Create LibVLC
// TODO: make this more robust, and sync with audio demo
ArrayList<String> options = new ArrayList<String>();
//options.add("--subsdec-encoding <encoding>");
options.add("--aout=opensles");
options.add("--audio-time-stretch"); // time stretching
options.add("-vvv"); // verbosity
libvlc = new LibVLC(options);
libvlc.setOnHardwareAccelerationError(this);
holder.setKeepScreenOn(true);

// Create media player
mMediaPlayer = new MediaPlayer(libvlc);
mMediaPlayer.setEventListener(mPlayerListener);

// Set up video output
final IVLCVout vout = mMediaPlayer.getVLCVout();
vout.setVideoView(mSurface);
//vout.setSubtitlesView(mSurfaceSubtitles);
 vout.addCallback(this);
 vout.attachViews();

//Media m = new Media(libvlc, media);
 Uri uri =  Uri.parse(httpAddress);
  Media m = new Media(libvlc,  uri);
  mMediaPlayer.setMedia(m);
  mMediaPlayer.play();

It's works fine on samsung,android 4.1.2. But it's crash with mi4 mobile. with start, it's has 2 seconds sound without image, then it's crash,just like ANR but stay the black screen for ever. here is the logcat:

core video output: picture is too late to be displayed (missing 953 ms)
core vout display: Failed to change zoom
android_window vout display: change source crop/aspect
core video output: picture is too late to be displayed (missing 1156 ms)
core vout display: auto hiding mouse cursor
core audio output: playback too late (66254): up-sampling
core video output: picture is too late to be displayed (missing 1155 ms)
core video output: picture is too late to be displayed (missing 1153 ms)
[OMX.qcom.video.decoder.avc] ERROR(0x80001009)
Codec reported an error. (omx error 0x80001009, internalError -2147483648)
mediacodec decoder: Exception in MediaCodec.dequeueOutputBuffer
mediacodec decoder: dequeue_out failed
mediacodec decoder: OutThread stopped
threadid=16: thread exiting, not yet detached (count=0)
Error with hardware acceleration

more log info where can i find a httpstream demo with vlc complied 1.8? Thanks for your help

1 Answers1

1

Issue of this nature are due to HardwareDecoder on board, this awesome page compiles up all the Decoding capability on Android.

The MediaCodec class first became available in Android 4.1 (API 16).

In Android 4.3 (API 18), MediaCodec was expanded to include a way to provide input through a Surface (via the createInputSurface method).

Even though Android Introduced MediaCodec in a big way on 4.3, not all vendors support them, need to have intelligent Player/Decoder to switch to Software Decoding.

LibVLC does it intelligently but need to manage it through LibVLC Options.

Abhijeet
  • 8,561
  • 5
  • 70
  • 76