Page 1 of 1

vmem module: how to know height width

Posted: 16 Oct 2008 17:03
by arturo
Hi

I'm using the new vmem module to display a video through opengl. It's working right but I need some functionality that I don't know exactly how to implement.

When I pass the parameters to the libvlc_new call, using vmem, I have to specify the height and width of the movie. What I need is to specify this parameters after loading the file so I can make a generic loader. But I can't find an option to do this.

What I have now is something like:

Code: Select all

vlc_argv[6]="--vout"; vlc_argv[7]= "vmem"; vlc_argv[8]="--vmem-width"; vlc_argv[9]=vlc_width; vlc_argv[10]="--vmem-height"; vlc_argv[11]=vlc_height; vlc_argv[12]="--vmem-pitch"; vlc_argv[13]= pitch; vlc_argv[14]="--vmem-chroma"; vlc_argv[15]="RV24"; vlc_argv[16]="--vmem-lock"; vlc_argv[17]=clock; vlc_argv[18]="--vmem-unlock"; vlc_argv[19]=cunlock; vlc_argv[20]="--vmem-data"; vlc_argv[21]=cdata; sprintf(clock, "%lld", (long long int)(intptr_t)vmem_lock); sprintf(cunlock, "%lld", (long long int)(intptr_t)vmem_unlock); sprintf(cdata, "%lld", (long long int)(intptr_t)&vpixels); sprintf(vlc_width, "%i", 800); sprintf(vlc_height, "%i", 600); sprintf(pitch, "%i", 800 *3); libvlc = libvlc_new(vlc_argc, vlc_argv, &ex); m = libvlc_media_new(libvlc, path.c_str(), &ex); mp = libvlc_media_player_new_from_media(m, &ex); libvlc_media_player_play(mp, &ex);
what I need is some way of specifying the height and width from the loaded file after calling libvlc_media_new.

What's the best way to do that, do I need to load the file in a diferent libvlc instance without vout and set the width and height from there?

thanks