Exemplo n.º 1
0
void libvlc_vlm_add_vod( libvlc_instance_t *p_instance, char *psz_name,
                         char *psz_input, int i_options,
                         char **ppsz_options, int b_enabled,
                         char *psz_mux, libvlc_exception_t *p_exception )
{
#ifdef ENABLE_VLM
    vlm_t *p_vlm;
    vlm_media_t m;
    int n;

    VLM(p_vlm);

    vlm_media_Init( &m );
    m.psz_name = strdup( psz_name );
    m.b_enabled = b_enabled;
    m.b_vod = true;
    m.vod.psz_mux = psz_mux ? strdup( psz_mux ) : NULL;
    if( psz_input )
        TAB_APPEND( m.i_input, m.ppsz_input, strdup(psz_input) );
    for( n = 0; n < i_options; n++ )
        TAB_APPEND( m.i_option, m.ppsz_option, strdup(ppsz_options[n]) );

    n = vlm_Control( p_vlm, VLM_ADD_MEDIA, &m, NULL );
    vlm_media_Clean( &m );
    if( n )
        libvlc_exception_raise( p_exception, "Media %s creation failed", psz_name );
#else
    libvlc_exception_raise( p_exception, "VLM has been disabled in this libvlc." );
    return VLC_EGENERIC;
#endif
}
Exemplo n.º 2
0
Arquivo: vlm.c Projeto: FLYKingdom/vlc
void libvlc_vlm_add_vod( libvlc_instance_t *p_instance, const char *psz_name,
                         const char *psz_input, int i_options,
                         const char * const *ppsz_options, int b_enabled,
                         const char *psz_mux, libvlc_exception_t *p_exception )
{
    vlm_t *p_vlm;
    vlm_media_t m;
    int n;

    VLM(p_vlm);

    vlm_media_Init( &m );
    m.psz_name = strdup( psz_name );
    m.b_enabled = b_enabled;
    m.b_vod = true;
    m.vod.psz_mux = psz_mux ? strdup( psz_mux ) : NULL;
    if( psz_input )
        TAB_APPEND( m.i_input, m.ppsz_input, strdup(psz_input) );
    for( n = 0; n < i_options; n++ )
        TAB_APPEND( m.i_option, m.ppsz_option, strdup(ppsz_options[n]) );

    n = vlm_Control( p_vlm, VLM_ADD_MEDIA, &m, NULL );
    vlm_media_Clean( &m );
    if( n )
    {
        libvlc_exception_raise( p_exception );
        libvlc_printerr( "Media %s creation failed", psz_name );
    }
}
Exemplo n.º 3
0
void libvlc_vlm_release( libvlc_instance_t *p_instance, libvlc_exception_t *p_exception)
{
#ifdef ENABLE_VLM
    vlm_t *p_vlm;

    VLM(p_vlm);

    vlm_Delete( p_vlm );
#else
    libvlc_exception_raise( p_exception, "VLM has been disabled in this libvlc." );
    return VLC_EGENERIC;
#endif
}
Exemplo n.º 4
0
Arquivo: vlm.c Projeto: FLYKingdom/vlc
void libvlc_vlm_del_media( libvlc_instance_t *p_instance, const char *psz_name,
                           libvlc_exception_t *p_exception )
{
    vlm_t *p_vlm;
    int64_t id;

    VLM(p_vlm);

    if( vlm_Control( p_vlm, VLM_GET_MEDIA_ID, psz_name, &id ) ||
        vlm_Control( p_vlm, VLM_DEL_MEDIA, id ) )
    {
        libvlc_exception_raise( p_exception );
        libvlc_printerr( "Unable to delete %s", psz_name );
    }
}
Exemplo n.º 5
0
Arquivo: vlm.c Projeto: FLYKingdom/vlc
void libvlc_vlm_pause_media( libvlc_instance_t *p_instance,
                             const char *psz_name,
                             libvlc_exception_t *p_exception )
{
    vlm_t *p_vlm;
    int64_t id;

    VLM(p_vlm);

    if( vlm_Control( p_vlm, VLM_GET_MEDIA_ID, psz_name, &id ) ||
        vlm_Control( p_vlm, VLM_PAUSE_MEDIA_INSTANCE, id, NULL ) )
    {
        libvlc_exception_raise( p_exception );
        libvlc_printerr( "Unable to pause %s", psz_name );
    }
}
Exemplo n.º 6
0
Arquivo: vlm.c Projeto: FLYKingdom/vlc
void libvlc_vlm_seek_media( libvlc_instance_t *p_instance,
                            const char *psz_name, float f_percentage,
                            libvlc_exception_t *p_exception )
{
    vlm_t *p_vlm;
    int64_t id;

    VLM(p_vlm);

    if( vlm_Control( p_vlm, VLM_GET_MEDIA_ID, psz_name, &id ) ||
        vlm_Control( p_vlm, VLM_SET_MEDIA_INSTANCE_POSITION, id, NULL,
                     f_percentage ) )
    {
        libvlc_exception_raise( p_exception );
        libvlc_printerr( "Unable to seek %s to %f%%", psz_name, f_percentage );
    }
}
Exemplo n.º 7
0
void libvlc_vlm_seek_media( libvlc_instance_t *p_instance, char *psz_name,
                            float f_percentage, libvlc_exception_t *p_exception )
{
#ifdef ENABLE_VLM
    vlm_t *p_vlm;
    int64_t id;

    VLM(p_vlm);

    if( vlm_Control( p_vlm, VLM_GET_MEDIA_ID, psz_name, &id ) ||
        vlm_Control( p_vlm, VLM_SET_MEDIA_INSTANCE_POSITION, id, NULL, f_percentage ) )
    {
        libvlc_exception_raise( p_exception, "Unable to seek %s to %f", psz_name, f_percentage );
    }
#else
    libvlc_exception_raise( p_exception, "VLM has been disabled in this libvlc." );
    return VLC_EGENERIC;
#endif
}
Exemplo n.º 8
0
void libvlc_vlm_pause_media( libvlc_instance_t *p_instance, char *psz_name,
                            libvlc_exception_t *p_exception )
{
#ifdef ENABLE_VLM
    vlm_t *p_vlm;
    int64_t id;

    VLM(p_vlm);

    if( vlm_Control( p_vlm, VLM_GET_MEDIA_ID, psz_name, &id ) ||
        vlm_Control( p_vlm, VLM_PAUSE_MEDIA_INSTANCE, id, NULL ) )
    {
        libvlc_exception_raise( p_exception, "Unable to pause %s", psz_name );
    }
#else
    libvlc_exception_raise( p_exception, "VLM has been disabled in this libvlc." );
    return VLC_EGENERIC;
#endif
}