Page 1 of 1

how to get the program list of a ts stream

Posted: 04 May 2012 14:38
by sundk911
Hi,all!

how to get the program list of a ts stream and choose one to play.
in my project,I get ts stream from usb and play it properly.and the main code is as follows:

libvlc_media_t *m;
const char * const vlc_args[] = {
"-I",
//"dvb-t://frequency=666000", // No special interface
"dumy", "--ignore-config", // Don't use VLC's config
"--plugin-path=./plugins" };

// init vlc modules, should be done only once
pVLCInstance_ = libvlc_new (sizeof(vlc_args) / sizeof(vlc_args[0]), vlc_args);

/* Create a new item */
m = libvlc_media_new_path (pVLCInstance_, "dvb-t://frequency=666000");

/* Create a media player playing environement */
pMediaPlayer_ = libvlc_media_player_new_from_media (m);

// Create a media player playing environement
//pMediaPlayer_ = libvlc_media_player_new(pVLCInstance_);

// Create an event manager for the player for handling e.g. time change events
pEventManager_ = libvlc_media_player_event_manager(pMediaPlayer_);

libvlc_media_player_play (pMediaPlayer_);

with the above codes the ts stream can be played properly. as there are many programs in a ts stream so I want to get the program list. so could you tell me which codes should I add to the above or do you give me some suggestions?

many thanks !!
Dekui

Re: how to get the program list of a ts stream

Posted: 06 May 2012 13:53
by sundk911
is there anyone who could give some suggestions?

Re: how to get the program list of a ts stream

Posted: 07 May 2012 11:18
by sherington
Did you try looking at sub-items?

libvlc.libvlc_media_subitems(mediaInstance)

You can then try iterating the returned media list to see if your expected programs are there.

Re: how to get the program list of a ts stream

Posted: 07 May 2012 16:19
by sundk911
thanks for your reply. I have try the function you mentioned. libvlc_media_subitems() return NULL although the media can be played normally. so what is the reason and do you have any idea?

after i do some research i find that maybe the program list can be got by libdvbpsi. but i am not sure. and do you know the relationship between libdvbpsi and libdvb?

Re: how to get the program list of a ts stream

Posted: 07 May 2012 17:09
by sherington
thanks for your reply. I have try the function you mentioned. libvlc_media_subitems() return NULL although the media can be played normally. so what is the reason and do you have any idea?

after i do some research i find that maybe the program list can be got by libdvbpsi. but i am not sure. and do you know the relationship between libdvbpsi and libdvb?
From what I remember, you play the media, then wait for the asynchronous "finished" event to be raised - only at this point are the sub-items created. You might be calling libvlc_media_subitems too early.

I have done this with dvb and I get a list of all of the channels.

Maybe you're asking about something else, I don't know.

The above is the sum total of my knowledge on this topic so I can't help you further.

Re: how to get the program list of a ts stream

Posted: 08 May 2012 15:40
by sundk911
many thanks for your quick reply. as you have done this with dvb and get a list of all of the channels, could you give some demo or some key codes. my email is sundk@marvell.com. thanks a lot.