I am working on Xamarin.Android project with simple layout and streaming RTSP video from IP Camera.
However, I checkout and build the official sample: RTSP Mosaic https://code.videolan.org/mfkl/libvlcsharp-samples/tree/master/VideoMosaic/VideoMosaic.Android
It seems unstable and VLC streaming is close after 1 minutes, but it is stable if I download the VLC player and stream from URL.
Below is the debug log just before the streaming shutdown from VS2017:
06-26 17:31:26.895 I/MediaCodec(30979): setCodecState state : 0
06-26 17:31:28.317 E/VLC (30979): [00000074eba29690/791e] libvlc input: ES_OUT_SET_(GROUP_)PCR is called too late (pts_delay increased to 1000 ms)
06-26 17:31:28.319 I/ACodec (30979): [OMX.qcom.video.decoder.avc] signalFlush
06-26 17:31:28.320 I/ACodec (30979): [OMX.qcom.video.decoder.avc] ExecutingState flushing now (codec owns 1/4 input, 10/15 output).
06-26 17:31:28.321 E/NdkMediaCodec(30979): sf error code: -38
06-26 17:31:28.329 I/ACodec (30979): [OMX.qcom.video.decoder.avc] Now Flushing
06-26 17:31:28.337 I/ACodec (30979): [OMX.qcom.video.decoder.avc] FlushingState onOMXEvent(0,1,1)
06-26 17:31:28.337 I/ACodec (30979): [OMX.qcom.video.decoder.avc] FlushingState onOMXEvent(0,1,0)
06-26 17:31:28.337 I/ACodec (30979): [OMX.qcom.video.decoder.avc] Now Executing
06-26 17:31:28.469 I/MediaCodec(30979): setCodecState state : 1
06-26 17:31:49.475 I/MediaCodec(30979): setCodecState state : 0
06-26 17:31:57.456 E/VLC (30979): [00000074e86c9210/7933] libvlc decoder: Decoder is draining
06-26 17:31:57.478 I/MediaCodec(30979): setCodecState state : 1
06-26 17:31:57.558 E/NdkMediaCodec(30979): sf error code: -38
06-26 17:31:57.558 I/ACodec (30979): [OMX.qcom.video.decoder.avc] signalFlush
06-26 17:31:57.559 I/ACodec (30979): [OMX.qcom.video.decoder.avc] ExecutingState flushing now (codec owns 0/4 input, 8/15 output).
06-26 17:31:57.560 I/ACodec (30979): [OMX.qcom.video.decoder.avc] Now Flushing
06-26 17:31:57.564 I/ACodec (30979): [OMX.qcom.video.decoder.avc] FlushingState onOMXEvent(0,1,1)
06-26 17:31:57.564 I/ACodec (30979): [OMX.qcom.video.decoder.avc] FlushingState onOMXEvent(0,1,0)
06-26 17:31:57.564 I/ACodec (30979): [OMX.qcom.video.decoder.avc] Now Executing
06-26 17:31:57.572 I/ACodec (30979): [OMX.qcom.video.decoder.avc] Now Executing->Idle
06-26 17:31:57.592 I/ACodec (30979): [OMX.qcom.video.decoder.avc] Now Idle->Loaded
06-26 17:31:57.594 I/ACodec (30979): [OMX.qcom.video.decoder.avc] Now Loaded
06-26 17:31:57.594 I/ACodec (30979): [OMX.qcom.video.decoder.avc] Now kWhatShutdownCompleted event : 8563
06-26 17:31:57.594 D/SurfaceUtils(30979): disconnecting from surface 0x75075b0010, reason disconnectFromSurface
06-26 17:31:57.606 I/ACodec (30979): [OMX.qcom.video.decoder.avc] Now uninitialized
06-26 17:31:57.606 I/ACodec (30979): [] Now kWhatShutdownCompleted event : 8563
06-26 17:31:57.610 I/MediaCodec(30979): Codec shutdown complete