]> git.sesse.net Git - vlc/blobdiff - include/input_ext-intf.h
* src/input/control.c, include/ninput.h: Added INPUT_GET_INFO.
[vlc] / include / input_ext-intf.h
index 20e39fddf39dbba32fc9f696ebc9c6e0f0e6cde6..1944abb2d2a25b9f7bd4f18711e6dd8cc8e0ef0d 100644 (file)
@@ -3,8 +3,8 @@
  * This header provides structures to read the stream descriptors and
  * control the pace of reading.
  *****************************************************************************
- * Copyright (C) 1999, 2000 VideoLAN
- * $Id: input_ext-intf.h,v 1.97 2003/11/06 16:36:41 nitrox Exp $
+ * Copyright (C) 1999, 2000, 2003 VideoLAN
+ * $Id$
  *
  * Authors: Christophe Massiot <massiot@via.ecp.fr>
  *
@@ -26,6 +26,9 @@
 #ifndef _VLC_INPUT_EXT_INTF_H
 #define _VLC_INPUT_EXT_INTF_H 1
 
+#include "vlc_block.h"
+#include "ninput.h"
+
 /*
  * Communication input -> interface
  */
@@ -36,8 +39,6 @@
 #define REQUESTED_DTS          4
 #define REQUESTED_NOAUDIO    255
 
-#define OFFSETTOTIME_MAX_SIZE       10
-
 /*****************************************************************************
  * es_descriptor_t: elementary stream descriptor
  *****************************************************************************
@@ -65,10 +66,12 @@ struct es_descriptor_t
     unsigned int            i_pes_real_size;   /* as indicated by the header */
 
     /* Decoder information */
-    decoder_fifo_t *        p_decoder_fifo;
+    es_format_t             fmt;
     void *                  p_waveformatex;
     void *                  p_bitmapinfoheader;
     void *                  p_spuinfo;
+    /* Decoder */
+    decoder_t *             p_dec;
 
     count_t                 c_packets;                 /* total packets read */
     count_t                 c_invalid_packets;       /* invalid packets read */
@@ -83,14 +86,6 @@ struct es_descriptor_t
 #define CONDITIONNAL_ACCESS_TABLE_PID   0x0001                   /* not used */
 #define EMPTY_ID                        0xffff    /* empty record in a table */
 
-
-/* ES Categories to be used by interface plugins */
-#define UNKNOWN_ES      0x00
-#define VIDEO_ES        0x01
-#define AUDIO_ES        0x02
-#define SPU_ES          0x03
-#define NAV_ES          0x04
-
 /*****************************************************************************
  * pgrm_descriptor_t
  *****************************************************************************
@@ -158,57 +153,8 @@ struct input_area_t
     off_t                   i_plugin_data;
 };
 
-/**
- * \brief A list of info items.
- *
- * Composes a linked list of name/value pairs intended to inform the
- * user about the current stream
- * \see input_AddInfo
- */
-struct input_info_t {
-    /**
-     * Name of this item
-     */
-    char *         psz_name;
-
-    /**
-     * Value of this item
-     */
-    char *         psz_value;
-
-    /**
-     * Pointer to next item in list, or NULL it at end of list
-     */
-    input_info_t * p_next;
-};
-
-/**
- * \brief A list of info categories.
- *
- * Composes a NULL terminated linked list of categories in which to
- * place info about the stream.
- *
- * \see input_InfoCategory
- */
-struct input_info_category_t {
-    /**
-     * The name of this category
-     */
-    char *                  psz_name;
-
-    /**
-     * first element of a linked list containing info items
-     */
-    input_info_t *          p_info;
-
-    /**
-     * Pointer to next element in this list, or NULL if at end of list
-     */
-    input_info_category_t * p_next;
-};
-
 /*****************************************************************************
-* stream_descriptor_t
+ * stream_descriptor_t
  *****************************************************************************
  * Describes a stream and list its associated programs. Build upon
  * the information carried in program association sections (for instance)
@@ -243,9 +189,8 @@ struct stream_descriptor_t
     int                     b_new_mute;          /* int because it can be -1 */
     vlc_cond_t              stream_wait; /* interface -> input in case of a
                                           * status change request            */
-
     /* Demultiplexer data */
-    stream_sys_t *          p_demux_data;
+    void *                  p_demux_data;
 
     /* Programs descriptions */
     unsigned int            i_pgrm_number;    /* size of the following array */
@@ -268,9 +213,6 @@ struct stream_descriptor_t
     /* Optional stream output */
     sout_instance_t *       p_sout;
 
-    /* Input info */
-    input_info_category_t * p_info;
-
     /* Statistics */
     count_t                 c_packets_read;                  /* packets read */
     count_t                 c_packets_trashed;            /* trashed packets */
@@ -292,6 +234,53 @@ struct stream_position_t
 
 #define MUTE_NO_CHANGE      -1
 
+/*****************************************************************************
+ * info_t
+ *****************************************************************************/
+
+/**
+ * Info item
+ */
+
+struct info_t
+{
+    char *psz_name;            /**< Name of this info */
+    char *psz_value;           /**< Value of the info */
+};
+
+/**
+ * Info category
+ * \see info_t
+ */
+struct info_category_t
+{
+    char   *psz_name;      /**< Name of this category */
+    int    i_infos;        /**< Number of infos in the category */
+    struct info_t **pp_infos;     /**< Pointer to an array of infos */
+};
+
+/*****************************************************************************
+ * input_item_t
+ *****************************************************************************
+ * Describes an input and is used to spawn input_thread_t objects.
+ *****************************************************************************/
+struct input_item_t
+{
+    char       *psz_name;            /**< text describing this item */
+    char       *psz_uri;             /**< mrl of this item */
+
+    int        i_options;            /**< Number of input options */
+    char       **ppsz_options;       /**< Array of input options */
+
+    mtime_t    i_duration;           /**< A hint about the duration of this
+                                      * item, in milliseconds*/
+
+    int        i_categories;         /**< Number of info categories */
+    info_category_t **pp_categories; /**< Pointer to the first info category */
+
+    vlc_mutex_t lock;                /**< Item cannot be changed without this lock */
+};
+
 /*****************************************************************************
  * input_thread_t
  *****************************************************************************
@@ -303,6 +292,7 @@ struct input_thread_t
 
     /* Thread properties */
     vlc_bool_t              b_eof;
+    vlc_bool_t              b_out_pace_control;
 
     /* Access module */
     module_t *       p_access;
@@ -313,6 +303,7 @@ struct input_thread_t
     access_sys_t *   p_access_data;
     size_t           i_mtu;
     int              i_pts_delay;                        /* internal caching */
+    int              i_cr_average;
 
     /* Stream */
     stream_t        *s;
@@ -339,6 +330,9 @@ struct input_thread_t
     /* General stream description */
     stream_descriptor_t     stream;
 
+    /* Input item description */
+    input_item_t *p_item;
+
     /* Playlist item */
     char *  psz_source;
     char *  psz_dupsource;
@@ -348,6 +342,10 @@ struct input_thread_t
 
     count_t c_loops;
 
+    /* User bookmarks */
+    int         i_bookmarks;
+    seekpoint_t **pp_bookmarks;
+
     /* private, do not touch it */
     input_thread_sys_t  *p_sys;
 };
@@ -389,9 +387,9 @@ struct input_thread_t
  * Prototypes
  *****************************************************************************/
 #define input_CreateThread(a,b) __input_CreateThread(VLC_OBJECT(a),b)
-input_thread_t * __input_CreateThread ( vlc_object_t *, playlist_item_t * );
-void   input_StopThread     ( input_thread_t * );
-void   input_DestroyThread  ( input_thread_t * );
+VLC_EXPORT( input_thread_t *, __input_CreateThread, ( vlc_object_t *, input_item_t * ) );
+VLC_EXPORT( void,             input_StopThread,     ( input_thread_t * ) );
+VLC_EXPORT( void,             input_DestroyThread,  ( input_thread_t * ) );
 
 #define input_SetStatus(a,b) __input_SetStatus(VLC_OBJECT(a),b)
 VLC_EXPORT( void, __input_SetStatus, ( vlc_object_t *, int ) );