]> git.sesse.net Git - vlc/blobdiff - src/input/input_internal.h
Qt4 - Simple Preferences, audio: you expect to deal with % for the volume not abstrac...
[vlc] / src / input / input_internal.h
index 07a8609a5d51970cc6a02351f85cb1284a81f359..93c67d1565561ae60779544798ab9db40623658c 100644 (file)
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
  *****************************************************************************/
 
+#if defined(__PLUGIN__) || defined(__BUILTIN__) || !defined(__LIBVLC__)
+# error This header file can only be included from LibVLC.
+#endif
+
 #ifndef _INPUT_INTERNAL_H
 #define _INPUT_INTERNAL_H 1
 
@@ -56,9 +60,13 @@ typedef struct
     int i_seekpoint_end;
 
     /* Properties */
-    vlc_bool_t b_can_pace_control;
     vlc_bool_t b_can_pause;
+    vlc_bool_t b_can_pace_control;
+    vlc_bool_t b_can_rate_control;
+    vlc_bool_t b_rescale_ts;
+
     vlc_bool_t b_eof;   /* eof of demuxer */
+    double     f_fps;
 
     /* Clock average variation */
     int     i_cr_average;
@@ -70,6 +78,7 @@ struct input_thread_private_t
 {
     /* Global properties */
     vlc_bool_t  b_can_pause;
+    vlc_bool_t  b_can_rate_control;
 
     int         i_rate;
     /* */
@@ -208,6 +217,99 @@ static inline void input_ControlPush( input_thread_t *p_input,
     vlc_mutex_unlock( &p_input->p->lock_control );
 }
 
+/** Stuff moved out of vlc_input.h -- FIXME: should probably not be inline
+ * anyway. */
+static inline void input_ItemInit( vlc_object_t *p_o, input_item_t *p_i )
+{
+    memset( p_i, 0, sizeof(input_item_t) );
+    p_i->psz_name = NULL;
+    p_i->psz_uri = NULL;
+    TAB_INIT( p_i->i_es, p_i->es );
+    TAB_INIT( p_i->i_options, p_i->ppsz_options );
+    TAB_INIT( p_i->i_categories, p_i->pp_categories );
+
+    p_i->i_type = ITEM_TYPE_UNKNOWN;
+    p_i->b_fixed_name = VLC_TRUE;
+
+    p_i->p_stats = NULL;
+    p_i->p_meta = NULL;
+
+    vlc_mutex_init( p_o, &p_i->lock );
+    vlc_event_manager_init( &p_i->event_manager, p_i, p_o );
+    vlc_event_manager_register_event_type( &p_i->event_manager,
+        vlc_InputItemMetaChanged );
+    vlc_event_manager_register_event_type( &p_i->event_manager,
+        vlc_InputItemSubItemAdded );
+    vlc_event_manager_register_event_type( &p_i->event_manager,
+        vlc_InputItemDurationChanged );
+    vlc_event_manager_register_event_type( &p_i->event_manager,
+        vlc_InputItemPreparsedChanged );
+}
+
+static inline void input_item_SetPreparsed( input_item_t *p_i, vlc_bool_t preparsed )
+{
+    vlc_bool_t send_event = VLC_FALSE;
+
+    if( !p_i->p_meta )
+        p_i->p_meta = vlc_meta_New();
+
+    vlc_mutex_lock( &p_i->lock );
+    int new_status;
+    if( preparsed )
+        new_status = p_i->p_meta->i_status | ITEM_PREPARSED;
+    else
+        new_status = p_i->p_meta->i_status & ~ITEM_PREPARSED;
+    if ( p_i->p_meta->i_status != new_status )
+    {
+        p_i->p_meta->i_status = new_status;
+        send_event = VLC_TRUE;
+    }
+
+    vlc_mutex_unlock( &p_i->lock );
+
+    if ( send_event == VLC_TRUE )
+    {
+        vlc_event_t event;
+        event.type = vlc_InputItemPreparsedChanged;
+        event.u.input_item_preparsed_changed.new_status = new_status;
+        vlc_event_send( &p_i->event_manager, &event );
+    }
+}
+
+static inline void input_item_SetMetaFetched( input_item_t *p_i, vlc_bool_t metafetched )
+{
+    if( !p_i->p_meta )
+        p_i->p_meta = vlc_meta_New();
+
+    if( metafetched )
+        p_i->p_meta->i_status |= ITEM_META_FETCHED;
+    else
+        p_i->p_meta->i_status &= ~ITEM_META_FETCHED;
+}
+
+static inline void input_item_SetArtNotFound( input_item_t *p_i, vlc_bool_t notfound )
+{
+    if( !p_i->p_meta )
+        p_i->p_meta = vlc_meta_New();
+
+    if( notfound )
+        p_i->p_meta->i_status |= ITEM_ART_NOTFOUND;
+    else
+        p_i->p_meta->i_status &= ~ITEM_ART_NOTFOUND;
+}
+
+static inline void input_item_SetArtFetched( input_item_t *p_i, vlc_bool_t artfetched )
+{
+    if( !p_i->p_meta )
+        p_i->p_meta = vlc_meta_New();
+
+    if( artfetched )
+        p_i->p_meta->i_status |= ITEM_ART_FETCHED;
+    else
+        p_i->p_meta->i_status &= ~ITEM_ART_FETCHED;
+}
+
+
 /**********************************************************************
  * Item metadata
  **********************************************************************/
@@ -215,6 +317,7 @@ typedef struct playlist_album_t
 {
     char *psz_artist;
     char *psz_album;
+    char *psz_arturl;
     vlc_bool_t b_found;
 } playlist_album_t;
 
@@ -257,14 +360,18 @@ void stream_AccessUpdate( stream_t *s );
 /* decoder.c */
 void       input_DecoderDiscontinuity( decoder_t * p_dec, vlc_bool_t b_flush );
 vlc_bool_t input_DecoderEmpty( decoder_t * p_dec );
+int        input_DecoderSetCcState( decoder_t *, vlc_bool_t b_decode, int i_channel );
+int        input_DecoderGetCcState( decoder_t *, vlc_bool_t *pb_decode, int i_channel );
+void       input_DecoderIsCcPresent( decoder_t *, vlc_bool_t pb_present[4] );
 
 /* es_out.c */
-es_out_t  *input_EsOutNew( input_thread_t * );
+es_out_t  *input_EsOutNew( input_thread_t *, int i_rate );
 void       input_EsOutDelete( es_out_t * );
 es_out_id_t *input_EsOutGetFromID( es_out_t *, int i_id );
-void       input_EsOutDiscontinuity( es_out_t *, vlc_bool_t b_flush, vlc_bool_t b_audio );
 void       input_EsOutSetDelay( es_out_t *, int i_cat, int64_t );
-void       input_EsOutSetRate( es_out_t * );
+void       input_EsOutChangeRate( es_out_t *, int );
+void       input_EsOutChangeState( es_out_t * );
+void       input_EsOutChangePosition( es_out_t * );
 vlc_bool_t input_EsOutDecodersEmpty( es_out_t * );
 
 /* clock.c */
@@ -296,22 +403,21 @@ typedef struct
     int                     i_delta_cr_residue;
 } input_clock_t;
 
-void    input_ClockInit( input_thread_t *, input_clock_t *, vlc_bool_t b_master, int i_cr_average );
+void    input_ClockInit( input_clock_t *, vlc_bool_t b_master, int i_cr_average, int i_rate );
 void    input_ClockSetPCR( input_thread_t *, input_clock_t *, mtime_t );
+void    input_ClockResetPCR( input_clock_t * );
 mtime_t input_ClockGetTS( input_thread_t *, input_clock_t *, mtime_t );
-void    input_ClockSetRate( input_thread_t *, input_clock_t *cl );
+void    input_ClockSetRate( input_clock_t *cl, int i_rate );
 
 /* Subtitles */
 char **subtitles_Detect( input_thread_t *, char* path, const char *fname );
 int subtitles_Filter( const char *);
 
-void MRLSplit( vlc_object_t *, char *, const char **, const char **, char ** );
+void MRLSplit( char *, const char **, const char **, char ** );
 
 static inline void input_ChangeState( input_thread_t *p_input, int state )
 {
-    vlc_value_t val;
-    val.i_int = p_input->i_state = state;
-    var_Change( p_input, "state", VLC_VAR_SETVALUE, &val, NULL );
+    var_SetInteger( p_input, "state", p_input->i_state = state );
 }
 
 /* Access */
@@ -352,9 +458,6 @@ static inline int demux2_Control( demux_t *p_demux, int i_query, ... )
     return i_result;
 }
 
-#if defined(__PLUGIN__) || defined(__BUILTIN__)
-# warning This is an internal header, please don't rely on it.
-#else
 /* Stream */
 /**
  * stream_t definition
@@ -363,9 +466,9 @@ struct stream_t
 {
     VLC_COMMON_MEMBERS
 
-    block_t *(*pf_block)  ( stream_t *, int i_size );
+    /*block_t *(*pf_block)  ( stream_t *, int i_size );*/
     int      (*pf_read)   ( stream_t *, void *p_read, int i_read );
-    int      (*pf_peek)   ( stream_t *, uint8_t **pp_peek, int i_peek );
+    int      (*pf_peek)   ( stream_t *, const uint8_t **pp_peek, int i_peek );
     int      (*pf_control)( stream_t *, int i_query, va_list );
     void     (*pf_destroy)( stream_t *);
 
@@ -384,6 +487,5 @@ static inline stream_t *vlc_stream_create( vlc_object_t *obj )
     return (stream_t *)vlc_custom_create( obj, sizeof(stream_t),
                                           VLC_OBJECT_STREAM, "stream" );
 }
-#endif
 
 #endif