[vlc-devel] Add input option to libvlc_media_instance

jboileau jboileau at gmail.com
Fri Dec 14 15:35:57 CET 2007


If this helps, I have written the code but haven't tested it. I don't have
the environment setup for it, neither do I have subversion. I hope I am not
stepping on anyones toes here. I just want to help the best I can.

/**************************************************************************
 * Create a new media descriptor object with options
 **************************************************************************/
libvlc_media_descriptor_t * libvlc_media_descriptor_new_extended(
                                   libvlc_instance_t *p_instance,
                                   const char * psz_mrl,
                                   int i_options,
                                   const char ** ppsz_options,
                                   libvlc_exception_t *p_e )
{
    input_item_t * p_input_item;
    libvlc_media_descriptor_t * p_md;

    p_input_item = input_ItemNewExt( p_instance->p_libvlc_int, psz_mrl,
i_options, ppz_options, NULL );

    if (!p_input_item)
    {
        libvlc_exception_raise( p_e, "Can't create md's input_item" );
        return NULL;
    }

    p_md = libvlc_media_descriptor_new_from_input_item( p_instance,
                p_input_item, p_e );

    return p_md;
}

for even better code practice, libvlc_media_descriptor_new could be changed
to:

**************************************************************************
 * Create a new media descriptor object
 **************************************************************************/
libvlc_media_descriptor_t * libvlc_media_descriptor_new(
                                   libvlc_instance_t *p_instance,
                                   const char * psz_mrl,
                                   libvlc_exception_t *p_e )
{
    return libvlc_media_descriptor_new_extended(p_instance, psz_mrl, 0,
NULL, p_e);
}
Jacques


On Dec 14, 2007 9:10 AM, jboileau <jboileau at gmail.com> wrote:

> I had tried using the ':' notation first. The results are the same:
>
> creating access '' path=' test.avi :sout-all'
>
> I just gave the trace of my second attempt using the '--' notation. Never
> hurts to try things :-)
>
> I also tried:
>
> file://test.avi :volume=10
>
> which also fails. Every format I tried works if I remove options but fail
> with options added. It seems the options are taken as part of the path and
> thus the file is not found.
>
> `file://test.avi :volume=10' gives access `file' demux `' path `test.avi
> :volume=10'
>
> Jacques
>
>
> On Dec 13, 2007 10:45 PM, Pierre d'Herbemont <pdherbemont at free.fr> wrote:
>
> >
> > On Dec 13, 2007, at 11:11 PM, Rafaël Carré wrote:
> >
> > > Le Thu, 13 Dec 2007 17:09:27 -0500,
> > > jboileau <jboileau at gmail.com> a écrit :
> > >
> > >> creating demux: access='' demux='' path='test.avi --sout-all'
> > >
> > >> On Dec 13, 2007 2:57 PM, Pierre d'Herbemont <pdherbemont at free.fr >
> > >> wrote:
> > >>> libvlc_media_descriptor_new( p_libvlc, "myfile.avi :sout-all", &e);
> > >
> > > You used "--" (command line) instead of ":" (mrl)
> >
> > Well, that's the point, err. Is there a misunderstanding.
> >
> > Pierre.
> >  _______________________________________________
> > vlc-devel mailing list
> > To unsubscribe or modify your subscription options:
> > http://mailman.videolan.org/listinfo/vlc-devel
> >
>
>
>
> --
> Jacques Boileau




-- 
Jacques Boileau
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20071214/0b9b3e62/attachment.html>


More information about the vlc-devel mailing list