[vlc-commits] vlm: remove unmaintained (RTSP) VoD support

Rémi Denis-Courmont git at videolan.org
Sat Feb 29 18:20:51 CET 2020


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sat Feb 29 14:08:08 2020 +0200| [7b8c6467396d570ba5d0e144186fb01e77e6d306] | committer: Thomas Guillem

vlm: remove unmaintained (RTSP) VoD support

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=7b8c6467396d570ba5d0e144186fb01e77e6d306
---

 include/vlc_vlm.h        |  26 +---
 include/vlc_vod.h        |  80 -----------
 po/POTFILES.in           |   1 -
 src/Makefile.am          |   1 -
 src/input/vlm.c          | 366 ++---------------------------------------------
 src/input/vlm_internal.h |   9 --
 src/input/vlmshell.c     |  59 ++------
 7 files changed, 23 insertions(+), 519 deletions(-)

diff --git a/include/vlc_vlm.h b/include/vlc_vlm.h
index 10895bfdc7..cb2ebb8760 100644
--- a/include/vlc_vlm.h
+++ b/include/vlc_vlm.h
@@ -55,15 +55,10 @@ typedef struct
 
     char *psz_output;   /*< */
 
-    bool b_vod;         /*< vlm_media_t is of type VOD */
     struct
     {
         bool b_loop;    /*< this vlc_media_t broadcast item should loop */
     } broadcast;        /*< Broadcast specific information */
-    struct
-    {
-        char *psz_mux;  /*< name of muxer to use */
-    } vod;              /*< VOD specific information */
 
 } vlm_media_t;
 
@@ -136,22 +131,20 @@ enum vlm_query_e
     VLM_ADD_MEDIA,                      /* arg1=vlm_media_t* arg2=int64_t *p_id         res=can fail */
     /* Delete an existing media */
     VLM_DEL_MEDIA,                      /* arg1=int64_t id */
-    /* Change properties of an existing media (all fields but id and b_vod) */
+    /* Change properties of an existing media (all fields but id) */
     VLM_CHANGE_MEDIA,                   /* arg1=vlm_media_t*                            res=can fail */
     /* Get 1 media by it's ID */
     VLM_GET_MEDIA,                      /* arg1=int64_t id arg2=vlm_media_t **  */
     /* Get media ID from its name */
     VLM_GET_MEDIA_ID,                   /* arg1=const char *psz_name arg2=int64_t*  */
 
-    /* Media instance control XXX VOD control are for internal use only */
+    /* Media instance control */
     /* Get all media instances */
     VLM_GET_MEDIA_INSTANCES,            /* arg1=int64_t id arg2=vlm_media_instance_t *** arg3=int *pi_instance */
     /* Delete all media instances */
     VLM_CLEAR_MEDIA_INSTANCES,          /* arg1=int64_t id */
     /* Control broadcast instance */
     VLM_START_MEDIA_BROADCAST_INSTANCE, /* arg1=int64_t id, arg2=const char *psz_instance_name, int i_input_index  res=can fail */
-    /* Control VOD instance */
-    VLM_START_MEDIA_VOD_INSTANCE,       /* arg1=int64_t id, arg2=const char *psz_instance_name, int i_input_index char *psz_vod_output res=can fail */
     /* Stop an instance */
     VLM_STOP_MEDIA_INSTANCE,            /* arg1=int64_t id, arg2=const char *psz_instance_name      res=can fail */
     /* Pause an instance */
@@ -217,9 +210,7 @@ static inline void vlm_media_Init( vlm_media_t *p_media )
     TAB_INIT( p_media->i_input, p_media->ppsz_input );
     TAB_INIT( p_media->i_option, p_media->ppsz_option );
     p_media->psz_output = NULL;
-    p_media->b_vod = false;
 
-    p_media->vod.psz_mux = NULL;
     p_media->broadcast.b_loop = false;
 }
 
@@ -251,16 +242,7 @@ vlm_media_Copy( vlm_media_t *p_dst, const vlm_media_t *p_src )
     if( p_src->psz_output )
         p_dst->psz_output = strdup( p_src->psz_output );
 
-    p_dst->b_vod = p_src->b_vod;
-    if( p_src->b_vod )
-    {
-        if( p_src->vod.psz_mux )
-            p_dst->vod.psz_mux = strdup( p_src->vod.psz_mux );
-    }
-    else
-    {
-        p_dst->broadcast.b_loop = p_src->broadcast.b_loop;
-    }
+    p_dst->broadcast.b_loop = p_src->broadcast.b_loop;
 }
 
 /**
@@ -282,8 +264,6 @@ static inline void vlm_media_Clean( vlm_media_t *p_media )
     TAB_CLEAN(p_media->i_option, p_media->ppsz_option );
 
     free( p_media->psz_output );
-    if( p_media->b_vod )
-        free( p_media->vod.psz_mux );
 }
 
 /**
diff --git a/include/vlc_vod.h b/include/vlc_vod.h
deleted file mode 100644
index de0bf41d70..0000000000
--- a/include/vlc_vod.h
+++ /dev/null
@@ -1,80 +0,0 @@
-/*****************************************************************************
- * vlc_vod.h: interface for VoD server modules
- *****************************************************************************
- * Copyright (C) 2000, 2001 VLC authors and VideoLAN
- *
- * Author: Gildas Bazin <gbazin at videolan.org>
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2.1 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
- *****************************************************************************/
-
-#ifndef VLC_VOD_H
-#define VLC_VOD_H 1
-
-/**
- * \defgroup vod Video on Demand (VoD)
- * \ingroup server
- * Video on Demand (VOD) functionality provided by VLM
- * @{
- * \file
- * VLC VoD module interface
- */
-
-struct vod_t
-{
-    struct vlc_object_t obj;
-
-    /* Module properties */
-    module_t  *p_module;
-    void      *p_sys;
-
-    vod_media_t * (*pf_media_new)   ( vod_t *, const char *, input_item_t * );
-    void          (*pf_media_del)   ( vod_t *, vod_media_t * );
-
-    /* Owner properties */
-    int (*pf_media_control) ( void *, vod_media_t *, const char *, int, va_list );
-    void *p_data;
-};
-
-static inline int vod_MediaControl( vod_t *p_vod, vod_media_t *p_media,
-                                    const char *psz_id, int i_query, ... )
-{
-    va_list args;
-    int i_result;
-
-    if( !p_vod->pf_media_control ) return VLC_EGENERIC;
-
-    va_start( args, i_query );
-    i_result = p_vod->pf_media_control( p_vod->p_data, p_media, psz_id,
-                                        i_query, args );
-    va_end( args );
-    return i_result;
-}
-
-enum vod_query_e
-{
-    VOD_MEDIA_PLAY,         /* arg1= char *, arg2= int64_t *, res=    */
-    VOD_MEDIA_PAUSE,        /* arg1= int64_t *      res=    */
-    VOD_MEDIA_STOP,         /* arg1=                res=can fail    */
-    VOD_MEDIA_SEEK,         /* arg1= double         res=    */
-    VOD_MEDIA_REWIND,       /* arg1= double         res=    */
-    VOD_MEDIA_FORWARD,      /* arg1= double         res=    */
-};
-
-/**
- * @}
- */
-
-#endif
diff --git a/po/POTFILES.in b/po/POTFILES.in
index f6894ff2f3..4729b636c3 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -48,7 +48,6 @@ include/vlc_url.h
 include/vlc_variables.h
 include/vlc/vlc.h
 include/vlc_vlm.h
-include/vlc_vod.h
 include/vlc_vout.h
 include/vlc_vout_window.h
 include/vlc_xml.h
diff --git a/src/Makefile.am b/src/Makefile.am
index 896aeb558b..2b4dfcb7dd 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -124,7 +124,6 @@ noinst_HEADERS = \
 	../include/vlc_iso_lang.h \
 	../include/vlc_pgpkey.h \
 	../include/vlc_update.h \
-	../include/vlc_vod.h \
 	$(NULL)
 
 ../include/vlc_about.h: Makefile.am $(top_srcdir)/COPYING $(top_srcdir)/THANKS $(top_srcdir)/AUTHORS
diff --git a/src/input/vlm.c b/src/input/vlm.c
index 88cb8e5cad..116fc5296e 100644
--- a/src/input/vlm.c
+++ b/src/input/vlm.c
@@ -44,7 +44,6 @@
 #include <vlc_stream.h>
 #include "vlm_internal.h"
 #include "vlm_event.h"
-#include <vlc_vod.h>
 #include <vlc_sout.h>
 #include <vlc_url.h>
 #include "../stream_output/stream_output.h"
@@ -56,34 +55,6 @@
  *****************************************************************************/
 
 static void* Manage( void * );
-static int vlm_MediaVodControl( void *, vod_media_t *, const char *, int, va_list );
-
-typedef struct preparse_data_t
-{
-    vlc_sem_t *p_sem;
-    bool b_mux;
-} preparse_data_t;
-
-static void preparse_on_state_changed(vlc_player_t *player,
-                                      enum vlc_player_state new_state, void *data)
-{
-    VLC_UNUSED(player);
-    preparse_data_t *p_pre = data;
-
-    if (new_state == VLC_PLAYER_STATE_STOPPING)
-        vlc_sem_post(p_pre->p_sem);
-}
-
-static void preparse_on_media_meta_changed(vlc_player_t *player,
-                                           input_item_t *media, void *data)
-{
-    VLC_UNUSED(player); VLC_UNUSED(media);
-    preparse_data_t *p_pre = data;
-
-    if (p_pre->b_mux)
-        vlc_sem_post(p_pre->p_sem);
-}
-
 
 static void player_on_state_changed(vlc_player_t *player,
                                     enum vlc_player_state new_state, void *data)
@@ -173,7 +144,6 @@ vlm_t *vlm_New( libvlc_int_t *libvlc, const char *psz_vlmconf )
     p_vlm->i_id = 1;
     TAB_INIT( p_vlm->i_media, p_vlm->media );
     TAB_INIT( p_vlm->i_schedule, p_vlm->schedule );
-    p_vlm->p_vod = NULL;
     var_Create( p_vlm, "intf-event", VLC_VAR_ADDRESS );
 
     if( vlc_clone( &p_vlm->thread, Manage, p_vlm, VLC_THREAD_PRIORITY_LOW ) )
@@ -242,12 +212,6 @@ void vlm_Delete( vlm_t *p_vlm )
     vlc_cond_signal( &p_vlm->wait_manage );
     vlc_mutex_unlock( &p_vlm->lock_manage );
 
-    if( p_vlm->p_vod )
-    {
-        module_unneed( p_vlm->p_vod, p_vlm->p_vod->p_module );
-        vlc_object_delete(p_vlm->p_vod);
-    }
-
     libvlc_priv(vlc_object_instance(p_vlm))->p_vlm = NULL;
     vlc_mutex_unlock( &vlm_mutex );
 
@@ -270,123 +234,6 @@ int vlm_ExecuteCommand( vlm_t *p_vlm, const char *psz_command,
     return i_result;
 }
 
-/*****************************************************************************
- *
- *****************************************************************************/
-static int vlm_MediaVodControl( void *p_private, vod_media_t *p_vod_media,
-                                const char *psz_id, int i_query, va_list args )
-{
-    vlm_t *vlm = (vlm_t *)p_private;
-    int i, i_ret;
-    const char *psz;
-    int64_t id;
-
-    if( !p_private || !p_vod_media )
-        return VLC_EGENERIC;
-
-    vlc_mutex_lock( &vlm->lock );
-
-    /* Find media id */
-    for( i = 0, id = -1; i < vlm->i_media; i++ )
-    {
-        if( p_vod_media == vlm->media[i]->vod.p_media )
-        {
-            id = vlm->media[i]->cfg.id;
-            break;
-        }
-    }
-    if( id == -1 )
-    {
-        vlc_mutex_unlock( &vlm->lock );
-        return VLC_EGENERIC;
-    }
-
-    switch( i_query )
-    {
-    case VOD_MEDIA_PLAY:
-    {
-        psz = (const char *)va_arg( args, const char * );
-        int64_t *i_time = (int64_t *)va_arg( args, int64_t *);
-        bool b_retry = false;
-        if (*i_time < 0)
-        {
-            /* No start time requested: return the current NPT */
-            i_ret = vlm_ControlInternal( vlm, VLM_GET_MEDIA_INSTANCE_TIME, id, psz_id, i_time );
-            /* The instance is not running yet, it will start at 0 */
-            if (i_ret)
-                *i_time = 0;
-        }
-        else
-        {
-            /* We want to seek before unpausing, but it won't
-             * work if the instance is not running yet. */
-            b_retry = vlm_ControlInternal( vlm, VLM_SET_MEDIA_INSTANCE_TIME, id, psz_id, *i_time );
-        }
-
-        i_ret = vlm_ControlInternal( vlm, VLM_START_MEDIA_VOD_INSTANCE, id, psz_id, 0, psz );
-
-        if (!i_ret && b_retry)
-            i_ret = vlm_ControlInternal( vlm, VLM_SET_MEDIA_INSTANCE_TIME, id, psz_id, *i_time );
-        break;
-    }
-
-    case VOD_MEDIA_PAUSE:
-    {
-        int64_t *i_time = (int64_t *)va_arg( args, int64_t *);
-        i_ret = vlm_ControlInternal( vlm, VLM_PAUSE_MEDIA_INSTANCE, id, psz_id );
-        if (!i_ret)
-            i_ret = vlm_ControlInternal( vlm, VLM_GET_MEDIA_INSTANCE_TIME, id, psz_id, i_time );
-        break;
-    }
-
-    case VOD_MEDIA_STOP:
-        i_ret = vlm_ControlInternal( vlm, VLM_STOP_MEDIA_INSTANCE, id, psz_id );
-        break;
-
-    case VOD_MEDIA_SEEK:
-    {
-        int64_t i_time = (int64_t)va_arg( args, int64_t );
-        i_ret = vlm_ControlInternal( vlm, VLM_SET_MEDIA_INSTANCE_TIME, id, psz_id, i_time );
-        break;
-    }
-
-    case VOD_MEDIA_REWIND:
-    {
-        double d_scale = (double)va_arg( args, double );
-        double d_position;
-
-        vlm_ControlInternal( vlm, VLM_GET_MEDIA_INSTANCE_POSITION, id, psz_id, &d_position );
-        d_position -= (d_scale / 1000.0);
-        if( d_position < 0.0 )
-            d_position = 0.0;
-        i_ret = vlm_ControlInternal( vlm, VLM_SET_MEDIA_INSTANCE_POSITION, id, psz_id, d_position );
-        break;
-    }
-
-    case VOD_MEDIA_FORWARD:
-    {
-        double d_scale = (double)va_arg( args, double );
-        double d_position;
-
-        vlm_ControlInternal( vlm, VLM_GET_MEDIA_INSTANCE_POSITION, id, psz_id, &d_position );
-        d_position += (d_scale / 1000.0);
-        if( d_position > 1.0 )
-            d_position = 1.0;
-        i_ret = vlm_ControlInternal( vlm, VLM_SET_MEDIA_INSTANCE_POSITION, id, psz_id, d_position );
-        break;
-    }
-
-    default:
-        i_ret = VLC_EGENERIC;
-        break;
-    }
-
-    vlc_mutex_unlock( &vlm->lock );
-
-    return i_ret;
-}
-
-
 /*****************************************************************************
  * Manage:
  *****************************************************************************/
@@ -421,11 +268,10 @@ static void* Manage( void* p_object )
 
                     /* */
                     i_new_input_index = p_instance->i_index + 1;
-                    if( !p_media->cfg.b_vod && p_media->cfg.broadcast.b_loop && i_new_input_index >= p_media->cfg.i_input )
+                    if( p_media->cfg.broadcast.b_loop && i_new_input_index >= p_media->cfg.i_input )
                         i_new_input_index = 0;
 
-                    /* FIXME implement multiple input with VOD */
-                    if( p_media->cfg.b_vod || i_new_input_index >= p_media->cfg.i_input )
+                    if( i_new_input_index >= p_media->cfg.i_input )
                         vlm_ControlInternal( vlm, VLM_STOP_MEDIA_INSTANCE, p_media->cfg.id, p_instance->psz_name );
                     else
                         vlm_ControlInternal( vlm, VLM_START_MEDIA_BROADCAST_INSTANCE, p_media->cfg.id, p_instance->psz_name, i_new_input_index );
@@ -536,11 +382,6 @@ static void* Manage( void* p_object )
 /*
 typedef struct
 {
-    struct
-    {
-        int i_connection_count;
-        int i_connection_active;
-    } vod;
     struct
     {
         int        i_count;
@@ -591,141 +432,10 @@ static int vlm_MediaDescriptionCheck( vlm_t *p_vlm, vlm_media_t *p_cfg )
 static int vlm_OnMediaUpdate( vlm_t *p_vlm, vlm_media_sys_t *p_media )
 {
     vlm_media_t *p_cfg = &p_media->cfg;
-    /* Check if we need to create/delete a vod media */
-    if( p_cfg->b_vod && p_vlm->p_vod )
-    {
-        if( !p_cfg->b_enabled && p_media->vod.p_media )
-        {
-            p_vlm->p_vod->pf_media_del( p_vlm->p_vod, p_media->vod.p_media );
-            p_media->vod.p_media = NULL;
-        }
-        else if( p_cfg->b_enabled && !p_media->vod.p_media && p_cfg->i_input )
-        {
-            /* Pre-parse the input */
-            char *psz_output;
-            char *psz_dup;
-
-            input_item_Release( p_media->vod.p_item );
-
-            if( strstr( p_cfg->ppsz_input[0], "://" ) == NULL )
-            {
-                char *psz_uri = vlc_path2uri( p_cfg->ppsz_input[0], NULL );
-                p_media->vod.p_item = input_item_New( psz_uri,
-                                                      p_cfg->psz_name );
-                free( psz_uri );
-            }
-            else
-                p_media->vod.p_item = input_item_New( p_cfg->ppsz_input[0],
-                                                      p_cfg->psz_name );
-
-            if( p_cfg->psz_output )
-            {
-                if( asprintf( &psz_output, "%s:description", p_cfg->psz_output )  == -1 )
-                    psz_output = NULL;
-            }
-            else
-                psz_output = strdup( "#description" );
-
-            if( psz_output && asprintf( &psz_dup, "sout=%s", psz_output ) != -1 )
-            {
-                input_item_AddOption( p_media->vod.p_item, psz_dup, VLC_INPUT_OPTION_TRUSTED );
-                free( psz_dup );
-            }
-            free( psz_output );
-
-            for( int i = 0; i < p_cfg->i_option; i++ )
-                input_item_AddOption( p_media->vod.p_item,
-                                      p_cfg->ppsz_option[i], VLC_INPUT_OPTION_TRUSTED );
-
-            sout_description_data_t data;
-            TAB_INIT(data.i_es, data.es);
-
-            vlc_player_t *player = vlc_player_New(VLC_OBJECT(p_media),
-                                                  VLC_PLAYER_LOCK_NORMAL,
-                                                  NULL, NULL);
-            if (player)
-            {
-                vlc_player_Lock(player);
-
-                vlc_sem_t sem_preparse;
-                vlc_sem_init( &sem_preparse, 0 );
-
-                preparse_data_t preparse = { .p_sem = &sem_preparse,
-                                    .b_mux = (p_cfg->vod.psz_mux != NULL) };
-
-                data.sem = &sem_preparse;
-                var_Create( p_media, "sout-description-data", VLC_VAR_ADDRESS );
-                var_SetAddress( p_media, "sout-description-data", &data );
-
-                static struct vlc_player_cbs cbs = {
-                    .on_state_changed = preparse_on_state_changed,
-                    .on_media_meta_changed = preparse_on_media_meta_changed,
-                };
-                vlc_player_listener_id *listener =
-                    vlc_player_AddListener(player, &cbs, &preparse);
-                if (listener)
-                {
-                    vlc_player_SetCurrentMedia(player, p_media->vod.p_item);
-                    if (vlc_player_Start(player) == VLC_SUCCESS)
-                    {
-                        vlc_player_Unlock(player);
-                        vlc_sem_wait(&sem_preparse);
-                        vlc_player_Lock(player);
-                        vlc_player_Stop(player);
-                    }
-                    vlc_player_RemoveListener(player, listener);
-                }
-                vlc_player_Unlock(player);
-                vlc_player_Delete(player);
-
-            }
-
-            /* XXX: Don't do it that way, but properly use a new input item ref. */
-            input_item_t item = *p_media->vod.p_item;;
-            es_format_t es, *p_es = &es;
-            if( p_cfg->vod.psz_mux )
-            {
-                const char *psz_mux;
-                if (!strcmp(p_cfg->vod.psz_mux, "ps"))
-                    psz_mux = "mp2p";
-                else if (!strcmp(p_cfg->vod.psz_mux, "ts"))
-                    psz_mux = "mp2t";
-                else
-                    psz_mux = p_cfg->vod.psz_mux;
-
-                union {
-                    char text[5];
-                    unsigned char utext[5];
-                    uint32_t value;
-                } fourcc;
-
-                sprintf( fourcc.text, "%4.4s", psz_mux );
-                for( int i = 0; i < 4; i++ )
-                    fourcc.utext[i] = tolower(fourcc.utext[i]);
 
-                item.i_es = 1;
-                item.es = &p_es;
-                es_format_Init( &es, VIDEO_ES, fourcc.value );
-            }
-            else
-            {
-                item.i_es = data.i_es;
-                item.es = data.es;
-            }
-            p_media->vod.p_media = p_vlm->p_vod->pf_media_new( p_vlm->p_vod,
-                                                    p_cfg->psz_name, &item );
+    /* TODO start media if needed */
 
-            TAB_CLEAN(data.i_es, data.es);
-        }
-    }
-    else if ( p_cfg->b_vod )
-        msg_Err( p_vlm, "vod server is not loaded" );
-    else
-    {
-        /* TODO start media if needed */
-    }
-
-    /* TODO add support of var vlm_media_broadcast/vlm_media_vod */
+    /* TODO add support of var vlm_media_broadcast */
 
     vlm_SendEventMediaChanged( p_vlm, p_cfg->id, p_cfg->psz_name );
     return VLC_SUCCESS;
@@ -737,8 +447,6 @@ static int vlm_ControlMediaChange( vlm_t *p_vlm, vlm_media_t *p_cfg )
     /* */
     if( !p_media || vlm_MediaDescriptionCheck( p_vlm, p_cfg ) )
         return VLC_EGENERIC;
-    if( ( p_media->cfg.b_vod && !p_cfg->b_vod ) || ( !p_media->cfg.b_vod && p_cfg->b_vod ) )
-        return VLC_EGENERIC;
 
     if( 0 )
     {
@@ -761,23 +469,6 @@ static int vlm_ControlMediaAdd( vlm_t *p_vlm, vlm_media_t *p_cfg, int64_t *p_id
         msg_Err( p_vlm, "invalid media description" );
         return VLC_EGENERIC;
     }
-    /* Check if we need to load the VOD server */
-    if( p_cfg->b_vod && !p_vlm->p_vod )
-    {
-        p_vlm->p_vod = vlc_custom_create( VLC_OBJECT(p_vlm), sizeof( vod_t ),
-                                          "vod server" );
-        p_vlm->p_vod->p_module = module_need_var( p_vlm->p_vod, "vod server", "vod-server" );
-        if( !p_vlm->p_vod->p_module )
-        {
-            msg_Err( p_vlm, "cannot find vod server" );
-            vlc_object_delete(p_vlm->p_vod);
-            p_vlm->p_vod = NULL;
-            return VLC_EGENERIC;
-        }
-
-        p_vlm->p_vod->p_data = p_vlm;
-        p_vlm->p_vod->pf_media_control = vlm_MediaVodControl;
-    }
 
     p_media = vlc_custom_create( VLC_OBJECT(p_vlm), sizeof( *p_media ),
                                  "media" );
@@ -803,9 +494,6 @@ static int vlm_ControlMediaAdd( vlm_t *p_vlm, vlm_media_t *p_cfg, int64_t *p_id
     p_media->cfg.id = p_vlm->i_id++;
     /* FIXME do we do something here if enabled is true ? */
 
-    p_media->vod.p_item = input_item_New( NULL, NULL );
-
-    p_media->vod.p_media = NULL;
     TAB_INIT( p_media->i_instance, p_media->instance );
 
     /* */
@@ -829,22 +517,11 @@ static int vlm_ControlMediaDel( vlm_t *p_vlm, int64_t id )
     while( p_media->i_instance > 0 )
         vlm_ControlInternal( p_vlm, VLM_STOP_MEDIA_INSTANCE, id, p_media->instance[0]->psz_name );
 
-    if( p_media->cfg.b_vod )
-    {
-        p_media->cfg.b_enabled = false;
-        vlm_OnMediaUpdate( p_vlm, p_media );
-    }
-
     /* */
     vlm_SendEventMediaRemoved( p_vlm, id, p_media->cfg.psz_name );
 
     vlm_media_Clean( &p_media->cfg );
 
-    input_item_Release( p_media->vod.p_item );
-
-    if( p_media->vod.p_media )
-        p_vlm->p_vod->pf_media_del( p_vlm->p_vod, p_media->vod.p_media );
-
     TAB_REMOVE( p_vlm->i_media, p_vlm->media, p_media );
     vlc_LogDestroy( p_media->obj.logger );
     vlc_object_delete(p_media);
@@ -976,7 +653,7 @@ static void vlm_MediaInstanceDelete( vlm_t *p_vlm, int64_t id, vlm_media_instanc
 }
 
 
-static int vlm_ControlMediaInstanceStart( vlm_t *p_vlm, int64_t id, const char *psz_id, int i_input_index, const char *psz_vod_output )
+static int vlm_ControlMediaInstanceStart( vlm_t *p_vlm, int64_t id, const char *psz_id, int i_input_index )
 {
     vlm_media_sys_t *p_media = vlm_ControlMediaGetById( p_vlm, id );
     vlm_media_instance_sys_t *p_instance;
@@ -984,11 +661,6 @@ static int vlm_ControlMediaInstanceStart( vlm_t *p_vlm, int64_t id, const char *
     if( !p_media || !p_media->cfg.b_enabled || p_media->cfg.i_input <= 0 )
         return VLC_EGENERIC;
 
-    /* TODO support multiple input for VOD with sout-keep ? */
-
-    if( ( p_media->cfg.b_vod && !psz_vod_output ) || ( !p_media->cfg.b_vod && psz_vod_output ) )
-        return VLC_EGENERIC;
-
     if( i_input_index < 0 || i_input_index >= p_media->cfg.i_input )
         return VLC_EGENERIC;
 
@@ -1001,22 +673,10 @@ static int vlm_ControlMediaInstanceStart( vlm_t *p_vlm, int64_t id, const char *
         if( !p_instance )
             return VLC_ENOMEM;
 
-        if ( p_cfg->b_vod )
-        {
-            var_Create( p_instance->p_parent, "vod-media", VLC_VAR_ADDRESS );
-            var_SetAddress( p_instance->p_parent, "vod-media",
-                            p_media->vod.p_media );
-            var_Create( p_instance->p_parent, "vod-session", VLC_VAR_STRING );
-            var_SetString( p_instance->p_parent, "vod-session", psz_id );
-        }
-
-        if( p_cfg->psz_output != NULL || psz_vod_output != NULL )
+        if( p_cfg->psz_output != NULL )
         {
             char *psz_buffer;
-            if( asprintf( &psz_buffer, "sout=%s%s%s",
-                      p_cfg->psz_output ? p_cfg->psz_output : "",
-                      (p_cfg->psz_output && psz_vod_output) ? ":" : psz_vod_output ? "#" : "",
-                      psz_vod_output ? psz_vod_output : "" ) != -1 )
+            if( asprintf( &psz_buffer, "sout=%s", p_cfg->psz_output ) != -1 )
             {
                 input_item_AddOption( p_instance->p_item, psz_buffer, VLC_INPUT_OPTION_TRUSTED );
                 free( psz_buffer );
@@ -1200,7 +860,6 @@ static int vlm_vaControlInternal( vlm_t *p_vlm, int i_query, va_list args )
     vlm_media_t ***ppp_dsc;
     vlm_media_instance_t ***ppp_idsc;
     const char *psz_id;
-    const char *psz_vod;
     int64_t *p_id;
     int64_t id;
     int i_int;
@@ -1262,16 +921,7 @@ static int vlm_vaControlInternal( vlm_t *p_vlm, int i_query, va_list args )
         id = (int64_t)va_arg( args, int64_t );
         psz_id = (const char*)va_arg( args, const char* );
         i_int = (int)va_arg( args, int );
-        return vlm_ControlMediaInstanceStart( p_vlm, id, psz_id, i_int, NULL );
-
-    case VLM_START_MEDIA_VOD_INSTANCE:
-        id = (int64_t)va_arg( args, int64_t );
-        psz_id = (const char*)va_arg( args, const char* );
-        i_int = (int)va_arg( args, int );
-        psz_vod = (const char*)va_arg( args, const char* );
-        if( !psz_vod )
-            return VLC_EGENERIC;
-        return vlm_ControlMediaInstanceStart( p_vlm, id, psz_id, i_int, psz_vod );
+        return vlm_ControlMediaInstanceStart( p_vlm, id, psz_id, i_int );
 
     case VLM_STOP_MEDIA_INSTANCE:
         id = (int64_t)va_arg( args, int64_t );
diff --git a/src/input/vlm_internal.h b/src/input/vlm_internal.h
index d3d82a5e13..2a74930343 100644
--- a/src/input/vlm_internal.h
+++ b/src/input/vlm_internal.h
@@ -49,12 +49,6 @@ typedef struct
     struct vlc_object_t obj;
     vlm_media_t cfg;
 
-    struct
-    {
-        input_item_t *p_item;
-        vod_media_t *p_media;
-    } vod;
-
     /* actual input instances */
     int                      i_instance;
     vlm_media_instance_sys_t **instance;
@@ -96,9 +90,6 @@ struct vlm_t
     /* */
     int64_t        i_id;
 
-    /* Vod server (used by media) */
-    vod_t          *p_vod;
-
     /* Media list */
     int                i_media;
     vlm_media_sys_t    **media;
diff --git a/src/input/vlmshell.c b/src/input/vlmshell.c
index c1c650ce64..8b4b0fb309 100644
--- a/src/input/vlmshell.c
+++ b/src/input/vlmshell.c
@@ -306,7 +306,7 @@ static int ExecuteHelp( vlm_message_t **pp_status )
     *pp_status = vlm_MessageSimpleNew( "help" );
 
     message_child = MessageAdd( "Commands Syntax:" );
-    MessageAddChild( "new (name) vod|broadcast|schedule [properties]" );
+    MessageAddChild( "new (name) broadcast|schedule [properties]" );
     MessageAddChild( "setup (name) (properties)" );
     MessageAddChild( "show [(name)|media|schedule]" );
     MessageAddChild( "del (name)|all|media|schedule" );
@@ -402,10 +402,7 @@ static int ExecuteControl( vlm_t *p_vlm, const char *psz_name, const int i_arg,
             }
         }
 
-        if( p_media->cfg.b_vod )
-            i_result = vlm_ControlInternal( p_vlm, VLM_START_MEDIA_VOD_INSTANCE, p_media->cfg.id, psz_instance, i_input_index, (const char *)NULL );    // we should get here now
-        else
-            i_result = vlm_ControlInternal( p_vlm, VLM_START_MEDIA_BROADCAST_INSTANCE, p_media->cfg.id, psz_instance, i_input_index );
+        i_result = vlm_ControlInternal( p_vlm, VLM_START_MEDIA_BROADCAST_INSTANCE, p_media->cfg.id, psz_instance, i_input_index );
     }
     else if( !strcmp( psz_control, "seek" ) )
     {
@@ -730,26 +727,12 @@ static int ExecuteMediaProperty( vlm_t *p_vlm, int64_t id, bool b_new,
         }
         else if( !strcmp( psz_option, "loop" ) )
         {
-            if( p_cfg->b_vod )
-                ERROR( "invalid loop option for vod" );
             p_cfg->broadcast.b_loop = true;
         }
         else if( !strcmp( psz_option, "unloop" ) )
         {
-            if( p_cfg->b_vod )
-                ERROR( "invalid unloop option for vod" );
             p_cfg->broadcast.b_loop = false;
         }
-        else if( !strcmp( psz_option, "mux" ) )
-        {
-            MISSING( "mux" );
-            if( !p_cfg->b_vod )
-                ERROR( "invalid mux option for broadcast" );
-
-            free( p_cfg->vod.psz_mux );
-            p_cfg->vod.psz_mux = *psz_value ? strdup( psz_value ) : NULL;
-            i++;
-        }
         else
         {
             fprintf( stderr, "PROP: name=%s unknown\n", psz_option );
@@ -800,14 +783,13 @@ static int ExecuteNew( vlm_t *p_vlm, const char *psz_name, const char *psz_type,
         }
         return ExecuteScheduleProperty( p_vlm, p_schedule, true, i_property, ppsz_property, pp_status );
     }
-    else if( !strcmp( psz_type, "vod" ) || !strcmp( psz_type, "broadcast" ) )
+    else if( !strcmp( psz_type, "broadcast" ) )
     {
         vlm_media_t cfg;
         int64_t id;
 
         vlm_media_Init( &cfg );
         cfg.psz_name = strdup( psz_name );
-        cfg.b_vod = !strcmp( psz_type, "vod" );
 
         if( vlm_ControlInternal( p_vlm, VLM_ADD_MEDIA, &cfg, &id ) )
         {
@@ -820,7 +802,7 @@ static int ExecuteNew( vlm_t *p_vlm, const char *psz_name, const char *psz_type,
     }
     else
     {
-        *pp_status = vlm_MessageNew( "new", "%s: Choose between vod, broadcast or schedule", psz_type );
+        *pp_status = vlm_MessageNew( "new", "%s: Choose between broadcast or schedule", psz_type );
         return VLC_EGENERIC;
     }
 }
@@ -1289,16 +1271,12 @@ static vlm_message_t *vlm_ShowMedia( vlm_media_sys_t *p_media )
 
     p_msg = vlm_MessageSimpleNew( p_cfg->psz_name );
     vlm_MessageAdd( p_msg,
-                    vlm_MessageNew( "type", p_cfg->b_vod ? "vod" : "broadcast" ) );
+                    vlm_MessageNew( "type", "broadcast" ) );
     vlm_MessageAdd( p_msg,
                     vlm_MessageNew( "enabled", p_cfg->b_enabled ? "yes" : "no" ) );
 
-    if( p_cfg->b_vod )
-        vlm_MessageAdd( p_msg,
-                        vlm_MessageNew( "mux", "%s", p_cfg->vod.psz_mux ) );
-    else
-        vlm_MessageAdd( p_msg,
-                        vlm_MessageNew( "loop", p_cfg->broadcast.b_loop ? "yes" : "no" ) );
+    vlm_MessageAdd( p_msg,
+                    vlm_MessageNew( "loop", p_cfg->broadcast.b_loop ? "yes" : "no" ) );
 
     p_msg_sub = vlm_MessageAdd( p_msg, vlm_MessageSimpleNew( "inputs" ) );
     for( i = 0; i < p_cfg->i_input; i++ )
@@ -1453,20 +1431,11 @@ static vlm_message_t *vlm_Show( vlm_t *vlm, vlm_media_sys_t *media,
     {
         vlm_message_t *p_msg;
         vlm_message_t *p_msg_child;
-        int i_vod = 0, i_broadcast = 0;
-
-        for( int i = 0; i < vlm->i_media; i++ )
-        {
-            if( vlm->media[i]->cfg.b_vod )
-                i_vod++;
-            else
-                i_broadcast++;
-        }
+        int i_broadcast = vlm->i_media;
 
         p_msg = vlm_MessageSimpleNew( "show" );
         p_msg_child = vlm_MessageAdd( p_msg, vlm_MessageNew( "media",
-                                      "( %d broadcast - %d vod )", i_broadcast,
-                                      i_vod ) );
+                                      "( %d broadcast )", i_broadcast ) );
 
         for( int i = 0; i < vlm->i_media; i++ )
             vlm_MessageAdd( p_msg_child, vlm_ShowMedia( vlm->media[i] ) );
@@ -1609,11 +1578,11 @@ static char *Save( vlm_t *vlm )
         vlm_media_sys_t *media = vlm->media[i];
         vlm_media_t *p_cfg = &media->cfg;
 
-        vlc_memstream_printf( &stream, "new %s %s %sabled", p_cfg->psz_name,
-                              p_cfg->b_vod ? "vod" : "broadcast",
+        vlc_memstream_printf( &stream, "new %s broadcast %sabled",
+                              p_cfg->psz_name,
                               p_cfg->b_enabled ? "en" : "dis" );
 
-        if( !p_cfg->b_vod && p_cfg->broadcast.b_loop )
+        if( p_cfg->broadcast.b_loop )
             vlc_memstream_puts( &stream, " loop" );
         vlc_memstream_putc( &stream, '\n' );
 
@@ -1628,10 +1597,6 @@ static char *Save( vlm_t *vlm )
         for( int j = 0; j < p_cfg->i_option; j++ )
             vlc_memstream_printf( &stream, "setup %s option %s\n",
                                   p_cfg->psz_name, p_cfg->ppsz_option[j] );
-
-        if( p_cfg->b_vod && p_cfg->vod.psz_mux )
-            vlc_memstream_printf( &stream, "setup %s mux %s\n",
-                                  p_cfg->psz_name, p_cfg->vod.psz_mux );
     }
 
     /* and now, the schedule scripts */



More information about the vlc-commits mailing list