Point video to x window number in media_list mode

This forum is about all development around libVLC.
brushhead
Blank Cone
Blank Cone
Posts: 13
Joined: 04 Sep 2008 13:57
VLC version: 2.0.1
Operating System: Debian
Location: Wales, UK

Point video to x window number in media_list mode

Postby brushhead » 26 Nov 2011 18:06

Hello,
I have been able to show video in an x window using a call to the libvlc_media_player_set_xwindow and that works fine. I am now hoping to use a player in medialist mode using libvlc_media_list_player_new but I cannot seem to find a function for point my video to the relevant window.

I am programming in bog standard C.

Have I misunderstood how this works?

Thanks,

Rob.
Robert Wilson,
Robstech Consulting Ltd,

Rémi Denis-Courmont
Developer
Developer
Posts: 15330
Joined: 07 Jun 2004 16:01
VLC version: master
Operating System: Linux
Contact:

Re: Point video to x window number in media_list mode

Postby Rémi Denis-Courmont » 26 Nov 2011 18:45

You need to retrieve the underling media_player object from the list player. Yes, the list API is confusing.
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded

brushhead
Blank Cone
Blank Cone
Posts: 13
Joined: 04 Sep 2008 13:57
VLC version: 2.0.1
Operating System: Debian
Location: Wales, UK

Re: Point video to x window number in media_list mode

Postby brushhead » 28 Nov 2011 21:24

Hello Rémi,
Thanks for responding. Been at Uni today and not been able to respond.

I did some more reading and I think i've got code that'll work.

I am calling in sequence:

// Define pointers and set them NULL.
//
libvlc_media_list_t* MediaListing = NULL;
libvlc_instance_t * VLC_Inst = NULL;
libvlc_media_t *Media = NULL;
libvlc_media_player_t * ThePlayer = NULL;
libvlc_media_list_player_t * ListPlayer = NULL;
int Loop = 0;

// First thing's first.
//
VLC_Inst = libvlc_new(0, NULL);

// Create a new media listing based on our player object.
//
MediaListing = libvlc_media_list_new(VLC_Inst);

//Create the list player.
//
ListPlayer = libvlc_media_list_player_new(VLC_Inst);

// The main player to which we will tie to the xwindow.
//
ThePlayer = libvlc_media_player_new(VLC_Inst);

// Build up media listing for list_player
//
while(ChannelsData[Loop].MulticastAddress !=NULL){

Media = libvlc_media_new_path(VLC_Inst, ChannelsData[Loop].MulticastAddress);
libvlc_media_list_add_media(MediaListing, Media);
Loop++;
}

// Point the media list at our media list player. This is the crucial bit I think I missed.
//
libvlc_media_list_player_set_media_player(ListPlayer, ThePlayer);


// Get the handle to the main window.
//
xwin = GDK_WINDOW_XWINDOW (GTK_WIDGET (window)->window);

// Set the window into which our video will be played.
//
libvlc_media_player_set_xwindow ( ThePlayer, xwin);

// Start the player off based on our media listing.
//
libvlc_media_list_player_play(ListPlayer);

I think i've got this right but thought it might be helpful to post some code. I'm running 1.1.3 on Debian Squeeze. I did try and build VLC from source but found it quite difficult. Am looking forward to 1.2 because of the enhanced DVD navitation functions.

Thanks,

Rob.
Robert Wilson,
Robstech Consulting Ltd,


Return to “Development around libVLC”

Who is online

Users browsing this forum: No registered users and 11 guests