]> git.sesse.net Git - vlc/blobdiff - include/vlc_access.h
codec: avcodec: use TS_INVALID for 0 time init
[vlc] / include / vlc_access.h
index c9121435793c461277b515f72ee40c5cf7cc1e10..e83d53f4a2ab027b7e994e0935ac823367b5fdc0 100644 (file)
@@ -47,15 +47,14 @@ enum access_query_e
 
     /* */
     ACCESS_GET_PTS_DELAY = 0x101,/* arg1= int64_t*       cannot fail */
-    /* */
-    ACCESS_GET_TITLE_INFO,  /* arg1=input_title_t*** arg2=int*      res=can fail */
-    /* Meta data */
-    ACCESS_GET_META,        /* arg1= vlc_meta_t **                  res=can fail */
+    ACCESS_GET_TITLE_INFO,  /* arg1=input_title_t*** arg2=int*  res=can fail */
+    ACCESS_GET_TITLE,       /* arg1=unsigned * res=can fail */
+    ACCESS_GET_SEEKPOINT,   /* arg1=unsigned * res=can fail */
 
-    /* */
-    ACCESS_GET_CONTENT_TYPE,/* arg1=char **ppsz_content_type                       res=can fail */
+    /* Meta data */
+    ACCESS_GET_META,        /* arg1= vlc_meta_t ** res=can fail */
+    ACCESS_GET_CONTENT_TYPE,/* arg1=char **ppsz_content_type res=can fail */
 
-    /* */
     ACCESS_GET_SIGNAL,      /* arg1=double *pf_quality, arg2=double *pf_strength   res=can fail */
 
     /* */
@@ -89,10 +88,11 @@ struct access_t
      * (if you fail, this value won't be reseted */
     char        *psz_demux;
 
-    /* pf_read/pf_block is used to read data.
+    /* pf_read/pf_block/pf_readdir is used to read data.
      * XXX A access should set one and only one of them */
-    ssize_t     (*pf_read) ( access_t *, uint8_t *, size_t );  /* Return -1 if no data yet, 0 if no more data, else real data read */
-    block_t    *(*pf_block)( access_t * );                  /* return a block of data in his 'natural' size, NULL if not yet data or eof */
+    ssize_t     (*pf_read)   ( access_t *, uint8_t *, size_t );  /* Return -1 if no data yet, 0 if no more data, else real data read */
+    block_t    *(*pf_block)  ( access_t * );                     /* Return a block of data in his 'natural' size, NULL if not yet data or eof */
+    int         (*pf_readdir)( access_t *, input_item_node_t * );/* Fills the provided item_node, see doc/browsing.txt for details */
 
     /* Called for each seek.
      * XXX can be null */
@@ -105,14 +105,8 @@ struct access_t
     /* Access has to maintain them uptodate */
     struct
     {
-        unsigned int i_update;  /* Access sets them on change,
-                                   Input removes them once take into account*/
-
         uint64_t     i_pos;     /* idem */
         bool         b_eof;     /* idem */
-
-        int          i_title;    /* idem, start from 0 (could be menu) */
-        int          i_seekpoint;/* idem, start from 0 */
     } info;
     access_sys_t *p_sys;
 
@@ -147,11 +141,8 @@ static inline uint64_t access_GetSize( access_t *p_access )
 
 static inline void access_InitFields( access_t *p_a )
 {
-    p_a->info.i_update = 0;
     p_a->info.i_pos = 0;
     p_a->info.b_eof = false;
-    p_a->info.i_title = 0;
-    p_a->info.i_seekpoint = 0;
 }
 
 /**
@@ -172,7 +163,7 @@ VLC_API input_thread_t * access_GetParentInput( access_t *p_access ) VLC_USED;
     do { \
         access_InitFields( p_access ); \
         ACCESS_SET_CALLBACKS( Read, NULL, Control, Seek ); \
-        p_sys = p_access->p_sys = calloc( 1, sizeof( access_sys_t ) ); \
+        p_sys = p_access->p_sys = (access_sys_t*)calloc( 1, sizeof( access_sys_t ) ); \
         if( !p_sys ) return VLC_ENOMEM;\
     } while(0);
 
@@ -180,7 +171,7 @@ VLC_API input_thread_t * access_GetParentInput( access_t *p_access ) VLC_USED;
     do { \
         access_InitFields( p_access ); \
         ACCESS_SET_CALLBACKS( NULL, Block, Control, Seek ); \
-        p_sys = p_access->p_sys = calloc( 1, sizeof( access_sys_t ) ); \
+        p_sys = p_access->p_sys = (access_sys_t*)calloc( 1, sizeof( access_sys_t ) ); \
         if( !p_sys ) return VLC_ENOMEM; \
     } while(0);