Events catching when receiving net stream
Posted: 21 May 2012 03:38
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.
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.