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;
63 gint64 granule_offset;
66 gint n_header_packets;
67 gint n_header_packets_seen;
68 gint64 accumulated_granule;
77 gboolean always_flush_page;
80 int nln_increments[4];
84 int vorbis_log2_num_modes;
85 int vorbis_mode_sizes[256];
93 gboolean theora_has_zero_keyoffset;
100 guint16 skeleton_major, skeleton_minor;
111 gboolean gst_ogg_stream_setup_map (GstOggStream * pad, ogg_packet *packet);
112 gboolean gst_ogg_stream_setup_map_from_caps_headers (GstOggStream * pad,
113 const GstCaps * caps);
114 GstClockTime gst_ogg_stream_get_end_time_for_granulepos (GstOggStream *pad,
116 GstClockTime gst_ogg_stream_get_start_time_for_granulepos (GstOggStream *pad,
118 GstClockTime gst_ogg_stream_granule_to_time (GstOggStream *pad, gint64 granule);
119 gint64 gst_ogg_stream_granulepos_to_granule (GstOggStream * pad, gint64 granulepos);
120 gint64 gst_ogg_stream_granulepos_to_key_granule (GstOggStream * pad, gint64 granulepos);
121 gint64 gst_ogg_stream_granule_to_granulepos (GstOggStream * pad, gint64 granule, gint64 keyframe_granule);
122 GstClockTime gst_ogg_stream_get_packet_start_time (GstOggStream *pad,
124 gboolean gst_ogg_stream_granulepos_is_key_frame (GstOggStream *pad,
126 gboolean gst_ogg_stream_packet_is_header (GstOggStream *pad, ogg_packet *packet);
127 gboolean gst_ogg_stream_packet_is_key_frame (GstOggStream *pad, ogg_packet *packet);
128 gint64 gst_ogg_stream_get_packet_duration (GstOggStream * pad, ogg_packet *packet);
129 void gst_ogg_stream_extract_tags (GstOggStream * pad, ogg_packet * packet);
130 const char *gst_ogg_stream_get_media_type (GstOggStream * pad);
132 gboolean gst_ogg_map_parse_fisbone (GstOggStream * pad, const guint8 * data, guint size,
133 guint32 * serialno, GstOggSkeleton *type);
134 gboolean gst_ogg_map_add_fisbone (GstOggStream * pad, GstOggStream * skel_pad, const guint8 * data, guint size,
135 GstClockTime * p_start_time);
136 gboolean gst_ogg_map_add_index (GstOggStream * pad, GstOggStream * skel_pad, const guint8 * data, guint size);
137 gboolean gst_ogg_map_search_index (GstOggStream * pad, gboolean before, guint64 *timestamp, guint64 *offset);
144 #endif /* __GST_OGG_STREAM_H__ */