Page 1 of 1

Events catching when receiving net stream

Posted: 21 May 2012 03:38
by Tommy_y
Hi, hope my poor English can clearly describe my questions:
1. How can I catch the state when receiving steam from network? I'd like to show some local picture on the output dialog when the net status is not good(I mean, always buffering, can not play smoothly).
2. What can I do when access to the MRL interrupted? Seems the player will not automatically resume, even call libvlc_media_player_play() function is useless. I think perhaps I'll have to recreate a libvlc_media_t type object after receiving a specific event.

To solve the first problem, I tried the libvlc_event_attach() function, to catch some events like libvlc_MediaPlayerBuffering,libvlc_MediaPlayerSeekableChanged, and so on, but they are just not the right ones.
I also tried to compare the libvlc_media_stats_t at two times, if i_decoded_video data of libvlc_media_stats_t didn't change, then the steam might be buffering. Hoever, this is not efficent. Is there a better solution?
And I searched from google, but can't find a appropriate keyword, so I did not get the information I need.

At last, thank you all.

Re: Events catching when receiving net stream

Posted: 22 May 2012 04:50
by Tommy_y
Is it too stupid? then would you please give me a link of relevant documents or demo :( ..

Re: Events catching when receiving net stream

Posted: 23 May 2012 14:15
by Jean-Baptiste Kempf
To solve the first problem, I tried the libvlc_event_attach() function, to catch some events like libvlc_MediaPlayerBuffering,libvlc_MediaPlayerSeekableChanged, and so on, but they are just not the right ones.
How so?

Re: Events catching when receiving net stream

Posted: 25 May 2012 03:21
by Tommy_y
I expect the libvlc_MediaPlayerBuffering event would be sent, but I simulated a streaming interruption, nothing happened, no event triggered.
I attached all events to a callback and output triggered events, result is :
258||270||269||273||260||273||
268||267||268||267||268||267||268||267||268||267||268||267||268||267||268||267||268||267||268||267||268||267||268||267||268||267||268||267||268||267||268||267||268||267||268||267||
258 ->libvlc_MediaPlayerOpening
270 ->libvlc_MediaPlayerPausableChanged
269 ->libvlc_MediaPlayerSeekableChanged
273 ->libvlc_MediaPlayerLengthChanged
260 ->libvlc_MediaPlayerPlaying
267 ->libvlc_MediaPlayerTimeChanged
268 ->libvlc_MediaPlayerPositionChanged
---------------------------------------------------------------------

nothing special happened when a flow stopped, but the libvlc_MediaPlayerTimeChanged no longer be sent. I think this information is not enough to identify if the media was played smothly or not.

Re: Events catching when receiving net stream

Posted: 25 May 2012 03:24
by Tommy_y
Sorry, Jean-Baptiste Kempf I didn't notice that we should not PM...