2 * Copyright (C) 2009 David Schleef <ds@schleef.org>
4 * gstoggstream.h: header for GstOggStream
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Library General Public License for more details.
16 * You should have received a copy of the GNU Library General Public
17 * License along with this library; if not, write to the
18 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
19 * Boston, MA 02111-1307, USA.
22 #ifndef __GST_OGG_STREAM_H__
23 #define __GST_OGG_STREAM_H__
28 #include <gst/tag/tag.h>
33 GST_OGG_SKELETON_FISBONE,
34 GST_OGG_SKELETON_INDEX,
42 typedef struct _GstOggStream GstOggStream;
46 ogg_stream_state stream;
50 gboolean have_headers;
56 GList *stored_buffers;
60 gboolean have_fisbone;
65 gint n_header_packets;
66 gint n_header_packets_seen;
67 gint64 accumulated_granule;
77 int nln_increments[4];
81 int vorbis_log2_num_modes;
82 int vorbis_mode_sizes[256];
90 gboolean theora_has_zero_keyoffset;
97 guint16 skeleton_major, skeleton_minor;
108 gboolean gst_ogg_stream_setup_map (GstOggStream * pad, ogg_packet *packet);
109 gboolean gst_ogg_stream_setup_map_from_caps_headers (GstOggStream * pad,
110 const GstCaps * caps);
111 GstClockTime gst_ogg_stream_get_end_time_for_granulepos (GstOggStream *pad,
113 GstClockTime gst_ogg_stream_get_start_time_for_granulepos (GstOggStream *pad,
115 GstClockTime gst_ogg_stream_granule_to_time (GstOggStream *pad, gint64 granule);
116 gint64 gst_ogg_stream_granulepos_to_granule (GstOggStream * pad, gint64 granulepos);
117 gint64 gst_ogg_stream_granulepos_to_key_granule (GstOggStream * pad, gint64 granulepos);
118 gint64 gst_ogg_stream_granule_to_granulepos (GstOggStream * pad, gint64 granule, gint64 keyframe_granule);
119 GstClockTime gst_ogg_stream_get_packet_start_time (GstOggStream *pad,
121 gboolean gst_ogg_stream_granulepos_is_key_frame (GstOggStream *pad,
123 gboolean gst_ogg_stream_packet_is_header (GstOggStream *pad, ogg_packet *packet);
124 gint64 gst_ogg_stream_get_packet_duration (GstOggStream * pad, ogg_packet *packet);
125 void gst_ogg_stream_extract_tags (GstOggStream * pad, ogg_packet * packet);
127 gboolean gst_ogg_map_parse_fisbone (GstOggStream * pad, const guint8 * data, guint size,
128 guint32 * serialno, GstOggSkeleton *type);
129 gboolean gst_ogg_map_add_fisbone (GstOggStream * pad, GstOggStream * skel_pad, const guint8 * data, guint size,
130 GstClockTime * p_start_time);
131 gboolean gst_ogg_map_add_index (GstOggStream * pad, GstOggStream * skel_pad, const guint8 * data, guint size);
132 gboolean gst_ogg_map_search_index (GstOggStream * pad, gboolean before, guint64 *timestamp, guint64 *offset);
139 #endif /* __GST_OGG_STREAM_H__ */