]> git.sesse.net Git - vlc/blobdiff - modules/demux/ogg.h
demux: mp4: use data type for cover
[vlc] / modules / demux / ogg.h
index a2d547a085bc5c00ed30dbc66f4aac9eba56d1f9..ff6d5381b09145607e62f277ff1f47e7cc5a2fad 100644 (file)
  * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
  *****************************************************************************/
 
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#ifdef HAVE_LIBVORBIS
+  #include <vorbis/codec.h>
+#endif
+
 /*****************************************************************************
  * Definitions of structures and functions used by this plugin
  *****************************************************************************/
 typedef struct oggseek_index_entry demux_index_entry_t;
 typedef struct ogg_skeleton_t ogg_skeleton_t;
 
+typedef struct backup_queue
+{
+    block_t *p_block;
+    mtime_t i_duration;
+} backup_queue_t;
+
 typedef struct logical_stream_s
 {
     ogg_stream_state os;                        /* logical stream of packets */
@@ -58,24 +72,22 @@ typedef struct logical_stream_s
      * data for the decoder. We back them up here in case we need to re-feed
      * them to the decoder. */
     bool             b_force_backup;
-    bool             b_have_updated_format;
     int              i_packets_backup;
     int32_t          i_extra_headers_packets;
     void             *p_headers;
     int              i_headers;
     ogg_int64_t      i_previous_granulepos;
+    ogg_int64_t      i_granulepos_offset;/* first granule offset */
 
     /* program clock reference (in units of 90kHz) derived from the previous
      * granulepos */
     mtime_t          i_pcr;
-    mtime_t          i_interpolated_pcr;
     mtime_t          i_previous_pcr;
 
     /* Misc */
     bool b_initializing;
     bool b_finished;
     bool b_reinit;
-    bool b_reusing;
     bool b_oggds;
     int i_granule_shift;
 
@@ -94,18 +106,51 @@ typedef struct logical_stream_s
     ogg_skeleton_t *p_skel;
 
     /* skip some frames after a seek */
-    int i_skip_frames;
+    unsigned int i_skip_frames;
 
     /* data start offset (absolute) in bytes */
     int64_t i_data_start;
 
-    /* kate streams have the number of headers in the ID header */
-    int i_kate_num_headers;
-
     /* for Annodex logical bitstreams */
     int i_secondary_header_packets;
 
+    /* All blocks which can't be sent because track PCR isn't known yet */
+    struct
+    {
+        block_t **pp_blocks;
+        uint8_t i_size; /* max 255 */
+        uint8_t i_used;
+    } prepcr;
+    /* All blocks that are queued because ES isn't created yet */
     block_t *p_preparse_block;
+
+    union
+    {
+#ifdef HAVE_LIBVORBIS
+        struct
+        {
+            vorbis_info *p_info;
+            vorbis_comment *p_comment;
+            int i_headers_flags;
+            int i_prev_blocksize;
+        } vorbis;
+#endif
+        struct
+        {
+            /* kate streams have the number of headers in the ID header */
+            int i_num_headers;
+        } kate;
+        struct
+        {
+            bool b_interlaced;
+        } dirac;
+        struct
+        {
+            int32_t i_framesize;
+            int32_t i_framesperpacket;
+        } speex;
+    } special;
+
 } logical_stream_t;
 
 struct ogg_skeleton_t
@@ -133,6 +178,10 @@ struct demux_sys_t
     /* program clock reference (in units of 90kHz) derived from the pcr of
      * the sub-streams */
     mtime_t i_pcr;
+    mtime_t i_nzpcr_offset;
+    /* informative only */
+    mtime_t i_pcr_jitter;
+    int64_t i_access_delay;
 
     /* new stream or starting from a chain */
     bool b_chained_boundary;
@@ -174,11 +223,11 @@ struct demux_sys_t
 
     /* preparsing info */
     bool b_preparsing_done;
+    bool b_es_created;
 
     /* Length, if available. */
     int64_t i_length;
 
-    DemuxDebug( bool b_seeked; )
 };