Skip to content

Commit

Permalink
* src/misc/vlm.c: started "vod server" integration (not much done yet).
Browse files Browse the repository at this point in the history
* 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.
  • Loading branch information
Gildas Bazin committed Sep 14, 2004
1 parent 30f94f7 commit e9097e4
Show file tree
Hide file tree
Showing 6 changed files with 362 additions and 271 deletions.
1 change: 1 addition & 0 deletions include/vlc_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
5 changes: 4 additions & 1 deletion include/vlc_input.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down Expand Up @@ -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 */
};

Expand Down
22 changes: 9 additions & 13 deletions include/vlc_vlm.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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
4 changes: 1 addition & 3 deletions include/vlc_vod.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 * );
Expand Down
9 changes: 5 additions & 4 deletions modules/misc/rtsp.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 * );
Expand Down Expand Up @@ -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 );
Expand All @@ -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 );
Expand Down
Loading

0 comments on commit e9097e4

Please sign in to comment.