how to get the program list of a ts stream

This forum is about all development around libVLC.
sundk911
Blank Cone
Blank Cone
Posts: 16
Joined: 03 May 2012 14:44

how to get the program list of a ts stream

Postby sundk911 » 04 May 2012 14:38

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

sundk911
Blank Cone
Blank Cone
Posts: 16
Joined: 03 May 2012 14:44

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

Postby sundk911 » 06 May 2012 13:53

is there anyone who could give some suggestions?

sherington
Cone that earned his stripes
Cone that earned his stripes
Posts: 491
Joined: 10 Sep 2008 11:57
VLC version: master
Operating System: Linux

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

Postby sherington » 07 May 2012 11:18

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.

sundk911
Blank Cone
Blank Cone
Posts: 16
Joined: 03 May 2012 14:44

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

Postby sundk911 » 07 May 2012 16:19

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?

sherington
Cone that earned his stripes
Cone that earned his stripes
Posts: 491
Joined: 10 Sep 2008 11:57
VLC version: master
Operating System: Linux

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

Postby sherington » 07 May 2012 17:09

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.

sundk911
Blank Cone
Blank Cone
Posts: 16
Joined: 03 May 2012 14:44

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

Postby sundk911 » 08 May 2012 15:40

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.


Return to “Development around libVLC”

Who is online

Users browsing this forum: No registered users and 4 guests