* control the pace of reading.
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
- * $Id: input_ext-intf.h,v 1.94 2003/09/12 16:26:40 fenrir Exp $
+ * $Id: input_ext-intf.h,v 1.95 2003/09/12 18:34:44 fenrir Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
int (* pf_demux_control ) ( input_thread_t *, int, va_list );
demux_sys_t * p_demux_data; /* data of the demux */
+ /* es out */
+ es_out_t *p_es_out;
+
/* Buffer manager */
input_buffers_t *p_method_data; /* data of the packet manager */
data_buffer_t * p_data_buffer;
* ninput.h
*****************************************************************************
* Copyright (C) 1999-2001 VideoLAN
- * $Id: ninput.h,v 1.9 2003/09/12 16:26:40 fenrir Exp $
+ * $Id: ninput.h,v 1.10 2003/09/12 18:34:44 fenrir Exp $
*
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
*
#ifndef _NINPUT_H
#define _NINPUT_H 1
-#if 0
enum es_extra_type_e
{
ES_EXTRA_TYPE_UNKNOWN,
ES_OUT_GET_SELECT /* arg1= es_out_id_t* arg2=vlc_bool_t* */
};
-typedef struct es_out_t es_out_t;
-typedef struct es_out_id_t es_out_id_t;
-typedef struct es_out_sys_t es_out_sys_t;
-
struct es_out_t
{
- es_out_id_t (*pf_add) ( es_out_t *, es_format_t * );
- int (*pf_send) ( es_out_t *, es_out_id_t *, pes_packet_t * );
- void (*pf_del) ( es_out_t *, es_out_id_t * );
- int (*pf_control)( es_out_t *, int i_query, va_list );
+ es_out_id_t *(*pf_add) ( es_out_t *, es_format_t * );
+ int (*pf_send) ( es_out_t *, es_out_id_t *, pes_packet_t * );
+ void (*pf_del) ( es_out_t *, es_out_id_t * );
+ int (*pf_control)( es_out_t *, int i_query, va_list );
es_out_sys_t *p_sys;
};
va_end( args );
return i_result;
}
-#endif
/**
* \defgroup stream Stream
* stream_output.h : stream output module
*****************************************************************************
* Copyright (C) 2002 VideoLAN
- * $Id: stream_output.h,v 1.13 2003/08/14 17:50:43 sigmunau Exp $
+ * $Id: stream_output.h,v 1.14 2003/09/12 18:34:44 fenrir Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
* Laurent Aimar <fenrir@via.ecp.fr>
sout_instance_sys_t *p_sys;
};
-/* some macro */
-#define TAB_APPEND( count, tab, p ) \
- if( (count) > 0 ) \
- { \
- (tab) = realloc( (tab), sizeof( void ** ) * ( (count) + 1 ) ); \
- } \
- else \
- { \
- (tab) = malloc( sizeof( void ** ) ); \
- } \
- (void**)(tab)[(count)] = (void*)(p); \
- (count)++
-
-#define TAB_FIND( count, tab, p, index ) \
- { \
- int _i_; \
- (index) = -1; \
- for( _i_ = 0; _i_ < (count); _i_++ ) \
- { \
- if((void**)(tab)[_i_]==(void*)(p)) \
- { \
- (index) = _i_; \
- break; \
- } \
- } \
- }
-
-#define TAB_REMOVE( count, tab, p ) \
- { \
- int i_index; \
- TAB_FIND( count, tab, p, i_index ); \
- if( i_index >= 0 ) \
- { \
- if( count > 1 ) \
- { \
- memmove( ((void**)tab + i_index), \
- ((void**)tab + i_index+1), \
- ( (count) - i_index - 1 ) * sizeof( void* ) );\
- } \
- else \
- { \
- free( tab ); \
- (tab) = NULL; \
- } \
- (count)--; \
- } \
- }
-
static inline sout_cfg_t *sout_cfg_find( sout_cfg_t *p_cfg, char *psz_name )
{
while( p_cfg && strcmp( p_cfg->psz_name, psz_name ) )
* Collection of useful common types and macros definitions
*****************************************************************************
* Copyright (C) 1998, 1999, 2000 VideoLAN
- * $Id: vlc_common.h,v 1.76 2003/09/02 20:19:25 gbazin Exp $
+ * $Id: vlc_common.h,v 1.77 2003/09/12 18:34:44 fenrir Exp $
*
* Authors: Samuel Hocevar <sam@via.ecp.fr>
* Vincent Seguin <seguin@via.ecp.fr>
/* NInput */
typedef struct stream_t stream_t;
+typedef struct es_out_t es_out_t;
+typedef struct es_out_id_t es_out_id_t;
+typedef struct es_out_sys_t es_out_sys_t;
+
/* Audio */
typedef struct aout_instance_t aout_instance_t;
while( 0 )
+#define TAB_APPEND( count, tab, p ) \
+ if( (count) > 0 ) \
+ { \
+ (tab) = realloc( (tab), sizeof( void ** ) * ( (count) + 1 ) ); \
+ } \
+ else \
+ { \
+ (tab) = malloc( sizeof( void ** ) ); \
+ } \
+ (void**)(tab)[(count)] = (void*)(p); \
+ (count)++
+
+#define TAB_FIND( count, tab, p, index ) \
+ { \
+ int _i_; \
+ (index) = -1; \
+ for( _i_ = 0; _i_ < (count); _i_++ ) \
+ { \
+ if((void**)(tab)[_i_]==(void*)(p)) \
+ { \
+ (index) = _i_; \
+ break; \
+ } \
+ } \
+ }
+
+#define TAB_REMOVE( count, tab, p ) \
+ { \
+ int _i_index_; \
+ TAB_FIND( count, tab, p, _i_index_ ); \
+ if( _i_index_ >= 0 ) \
+ { \
+ if( (count) > 1 ) \
+ { \
+ memmove( ((void**)(tab) + _i_index_), \
+ ((void**)(tab) + _i_index_+1), \
+ ( (count) - _i_index_ - 1 ) * sizeof( void* ) );\
+ } \
+ else \
+ { \
+ free( tab ); \
+ (tab) = NULL; \
+ } \
+ (count)--; \
+ } \
+ }
+
/* MSB (big endian)/LSB (little endian) conversions - network order is always
* MSB, and should be used for both network communications and files. Note that
* byte orders other than little and big endians are not supported, but only
* decoders.
*****************************************************************************
* Copyright (C) 1998-2002 VideoLAN
- * $Id: input.c,v 1.238 2003/09/12 16:26:40 fenrir Exp $
+ * $Id: input.c,v 1.239 2003/09/12 18:34:45 fenrir Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
#include <stdlib.h>
#include <vlc/vlc.h>
-
-#include <string.h>
+#include <vlc/input.h>
+#include <vlc/vout.h>
#ifdef HAVE_SYS_TIMES_H
# include <sys/times.h>
#include "vlc_playlist.h"
-#include "stream_control.h"
-#include "input_ext-intf.h"
-#include "input_ext-dec.h"
-#include "input_ext-plugins.h"
-
#include "stream_output.h"
-#include <vlc/vout.h>
#include "vlc_interface.h"
-#include "ninput.h"
/*****************************************************************************
* Local prototypes
static void ParseOption ( input_thread_t *p_input,
const char *psz_option );
+
+static es_out_t *EsOutCreate ( input_thread_t * );
+static void EsOutRelease( es_out_t * );
+
/*****************************************************************************
* Callbacks
*****************************************************************************/
/* Stream */
p_input->s = NULL;
+ /* es out */
+ p_input->p_es_out = NULL;
+
/* Demux */
p_input->p_demux = NULL;
p_input->pf_demux = NULL;
free( val.psz_string );
}
+ p_input->p_es_out = EsOutCreate( p_input );
+
/* Find and open appropriate access module */
p_input->p_access = module_Need( p_input, "access",
p_input->psz_access );
/* Destroy the stream_t facilities */
stream_Release( p_input->s );
+ /* Destroy es out */
+ EsOutRelease( p_input->p_es_out );
+
/* Close the access plug-in */
module_Unneed( p_input, p_input->p_access );
return;
}
+/*****************************************************************************
+ * es_out_t input handler
+ *****************************************************************************/
+struct es_out_sys_t
+{
+ input_thread_t *p_input;
+
+ int i_id;
+ es_out_id_t **id;
+};
+struct es_out_id_t
+{
+ es_descriptor_t *p_es;
+};
+
+static es_out_id_t *EsOutAdd ( es_out_t *, es_format_t * );
+static int EsOutSend ( es_out_t *, es_out_id_t *, pes_packet_t * );
+static void EsOutDel ( es_out_t *, es_out_id_t * );
+static int EsOutControl( es_out_t *, int i_query, va_list );
+
+static es_out_t *EsOutCreate( input_thread_t *p_input )
+{
+ es_out_t *out = malloc( sizeof( es_out_t ) );
+
+ out->pf_add = EsOutAdd;
+ out->pf_send = EsOutSend;
+ out->pf_del = EsOutDel;
+ out->pf_control = EsOutControl;
+
+ out->p_sys = malloc( sizeof( es_out_sys_t ) );
+ out->p_sys->p_input = p_input;
+ out->p_sys->i_id = 0;
+ out->p_sys->id = NULL;
+
+ return out;
+}
+static void EsOutRelease( es_out_t *out )
+{
+ free( out->p_sys );
+ free( out );
+}
+
+static es_out_id_t *EsOutAdd( es_out_t *out, es_format_t *fmt )
+{
+ es_out_id_t *id = malloc( sizeof( es_out_id_t ) );
+
+ return id;
+}
+static int EsOutSend( es_out_t *out, es_out_id_t *id, pes_packet_t *p_pes )
+{
+ return VLC_SUCCESS;
+}
+static void EsOutDel( es_out_t *out, es_out_id_t *id )
+{
+ free( id );
+}
+static int EsOutControl( es_out_t *out, int i_query, va_list args )
+{
+ return VLC_EGENERIC;
+}
+
/*****************************************************************************
* Callbacks (position, time, state, rate )
*****************************************************************************/