Commit e9097e4f authored by Gildas Bazin's avatar Gildas Bazin

* src/misc/vlm.c: started "vod server" integration (not much done yet).

* modules/misc/rtsp.c, include/vlc_vod.h: vod server api update.
* include/vlc_input.h: extended input_item_t a bit for the vod server.
parent 30f94f7d
......@@ -357,6 +357,7 @@ typedef struct httpd_stream_t httpd_stream_t;
/* vod server */
typedef struct vod_t vod_t;
typedef struct vod_sys_t vod_sys_t;
typedef struct vod_media_t vod_media_t;
/* opengl */
typedef struct opengl_t opengl_t;
......
......@@ -27,7 +27,7 @@
#define _VLC__INPUT_H 1
/*****************************************************************************
* input_item_t: Describes an input and is used to spawn input_thread_t objects.
* input_item_t: Describes an input and is used to spawn input_thread_t objects
*****************************************************************************/
struct info_t
{
......@@ -56,6 +56,9 @@ struct input_item_t
int i_categories; /**< Number of info categories */
info_category_t **pp_categories; /**< Pointer to the first info category */
int i_es; /**< Number of es format descriptions */
es_format_t **es; /**< Pointer to an array of es formats */
vlc_mutex_t lock; /**< Item cannot be changed without this lock */
};
......
......@@ -46,6 +46,9 @@ typedef struct
/* only for broadcast */
vlc_bool_t b_loop;
/* only for vod */
vod_media_t *vod_media;
/* "playlist" index */
int i_index;
......@@ -101,28 +104,21 @@ struct vlm_t
vlc_mutex_t lock;
#if 0
int i_vod;
vlm_media_t **vod;
int i_broadcast;
vlm_media_t **broadcast;
#endif
int i_media;
vlm_media_t **media;
int i_vod;
vod_t *vod;
int i_schedule;
vlm_schedule_t **schedule;
};
#define vlm_New( a ) __vlm_New( VLC_OBJECT(a) )
VLC_EXPORT( vlm_t *, __vlm_New, ( vlc_object_t * ) );
VLC_EXPORT( void, vlm_Delete, ( vlm_t * ) );
VLC_EXPORT( int, vlm_ExecuteCommand, ( vlm_t *, char *, vlm_message_t **) );
VLC_EXPORT( void, vlm_MessageDelete, ( vlm_message_t* ) );
VLC_EXPORT( void, vlm_Delete, ( vlm_t * ) );
VLC_EXPORT( int, vlm_ExecuteCommand, ( vlm_t *, char *, vlm_message_t ** ) );
VLC_EXPORT( void, vlm_MessageDelete, ( vlm_message_t* ) );
#endif
......@@ -24,8 +24,6 @@
#ifndef _VLC_VOD_H
#define _VLC_VOD_H 1
typedef struct vod_media_t vod_media_t;
struct vod_t
{
VLC_COMMON_MEMBERS
......@@ -34,7 +32,7 @@ struct vod_t
module_t *p_module;
vod_sys_t *p_sys;
vod_media_t * (*pf_media_new) ( vod_t *, void * );
vod_media_t * (*pf_media_new) ( vod_t *, char *, input_item_t * );
void (*pf_media_del) ( vod_t *, vod_media_t * );
int (*pf_media_add_es)( vod_t *, vod_media_t *, es_format_t * );
void (*pf_media_del_es)( vod_t *, vod_media_t *, es_format_t * );
......
......@@ -118,7 +118,7 @@ struct vod_sys_t
vod_media_t **media;
};
static vod_media_t *MediaNew( vod_t *, void *needsomethingthere );
static vod_media_t *MediaNew( vod_t *, char *, input_item_t * );
static void MediaDel( vod_t *, vod_media_t * );
static int MediaAddES( vod_t *, vod_media_t *, es_format_t * );
static void MediaDelES( vod_t *, vod_media_t *, es_format_t * );
......@@ -209,14 +209,14 @@ static void Close( vlc_object_t * p_this )
/*****************************************************************************
* Media handling
*****************************************************************************/
static vod_media_t *MediaNew( vod_t *p_vod, void *needsomethinghere )
static vod_media_t *MediaNew( vod_t *p_vod, char *psz_name,
input_item_t *p_item )
{
vod_sys_t *p_sys = p_vod->p_sys;
vod_media_t *p_media = malloc( sizeof(vod_media_t) );
memset( p_media, 0, sizeof(vod_media_t) );
asprintf( &p_media->psz_rtsp_path, "%s%i", p_sys->psz_path,
p_sys->i_media );
asprintf( &p_media->psz_rtsp_path, "%s%s", p_sys->psz_path, psz_name );
p_media->p_rtsp_url =
httpd_UrlNewUnique( p_sys->p_rtsp_host, p_media->psz_rtsp_path, 0, 0 );
......@@ -226,6 +226,7 @@ static vod_media_t *MediaNew( vod_t *p_vod, void *needsomethinghere )
msg_Err( p_vod, "cannot create http url" );
free( p_media->psz_rtsp_path );
free( p_media );
return 0;
}
msg_Dbg( p_vod, "created rtsp url: %s", p_media->psz_rtsp_path );
......
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment