libvlc_media_new_fd problem

This forum is about all development around libVLC.
FreshIce
New Cone
New Cone
Posts: 3
Joined: 29 Aug 2011 11:40

libvlc_media_new_fd problem

Postby FreshIce » 29 Aug 2011 11:51

Hi everyone, I have some trouble with the libvlc_media_new_fd function on Windows. I read in the doc that this function should work fine for libVLC 1.1.5 and later. However
i cannot play any video. Each time i used this function, i get the log "Invalid parameter passed to C runtime function.". I use VLC with Qt 4.7.2 and vmem to render the video (because my
application has transparent background VLC cannot normally render in a QWidget).

Here is the code

Code: Select all

char const* vlc_argv[] = { "--no-xlib", "-I", "dummy", /* Don't use any interface */ "--ignore-config", "--no-video-title-show", }; int vlc_argc = sizeof(vlc_argv) / sizeof(*vlc_argv); vlc = libvlc_new( vlc_argc, vlc_argv); QFile* file = new QFile(path); if (!file->open(QIODevice::ReadOnly)) return false; qDebug() << "FILE OPENED " << file->handle(); mediaplayer = libvlc_media_player_new(vlc); media = libvlc_media_new_fd(vlc, file->handle()); libvlc_media_player_set_media(mediaplayer, media); libvlc_media_player_play();
Can someone help me out ?

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

Re: libvlc_media_new_fd problem

Postby Rémi Denis-Courmont » 29 Aug 2011 13:55

Hmm, are you sure the function gets a file descriptor, not a Win32 file handle?
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded

FreshIce
New Cone
New Cone
Posts: 3
Joined: 29 Aug 2011 11:40

Re: libvlc_media_new_fd problem

Postby FreshIce » 29 Aug 2011 14:04

Indeed, its a Win32 file handle. How can i get a File Descriptor on Win32 platform (I thought that handle were windows FD) ?

Thank you for your answer :)

Edit: I gave up the FD. I use imem instead.

Arkaid
New Cone
New Cone
Posts: 5
Joined: 02 Sep 2011 03:47

Re: libvlc_media_new_fd problem

Postby Arkaid » 02 Sep 2011 03:51

You can open a file descriptor for a windows file handle using _open_osfhandle, declared in io.h. However, I must be doing something wrong because nothing happens.

How did you solve it with imem? Can you give me some tips? I need to do something similar.


Return to “Development around libVLC”

Who is online

Users browsing this forum: No registered users and 18 guests