Debian Codegraph @

gst/flv/gstflvdemux.h

raw symbols SCIP
1 /* GStreamer
2 * Copyright (C) <2007> Julien Moutte <[email protected]>
3 *
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version.
8 *
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Library General Public License for more details.
13 *
14 * You should have received a copy of the GNU Library General Public
15 * License along with this library; if not, write to the
16 * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
17 * Boston, MA 02110-1301, USA.
18 */
19
20 #ifndef __FLV_DEMUX_H__
21 #define __FLV_DEMUX_H__
22
23 #include <gst/gst.h>
24 #include <gst/base/gstadapter.h>
25 #include <gst/base/gstflowcombiner.h>
26 #include "gstindex.h"
27
28 G_BEGIN_DECLS
29 #define GST_TYPE_FLV_DEMUX \
30 (gst_flv_demux_get_type())
31 #define GST_FLV_DEMUX(obj) \
32 (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_FLV_DEMUX,GstFlvDemux))
33 #define GST_FLV_DEMUX_CLASS(klass) \
34 (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_FLV_DEMUX,GstFlvDemuxClass))
35 #define GST_IS_FLV_DEMUX(obj) \
36 (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_FLV_DEMUX))
37 #define GST_IS_FLV_DEMUX_CLASS(klass) \
38 (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_FLV_DEMUX))
39 typedef struct _GstFlvDemux GstFlvDemux;
40 typedef struct _GstFlvDemuxClass GstFlvDemuxClass;
41
42 typedef enum
43 {
44 FLV_STATE_HEADER,
45 FLV_STATE_TAG_TYPE,
46 FLV_STATE_TAG_VIDEO,
47 FLV_STATE_TAG_AUDIO,
48 FLV_STATE_TAG_SCRIPT,
49 FLV_STATE_SEEK,
50 FLV_STATE_DONE,
51 FLV_STATE_SKIP,
52 FLV_STATE_NONE
53 } GstFlvDemuxState;
54
55 struct _GstFlvDemux
56 {
57 GstElement element;
58
59 GstPad *sinkpad;
60
61 gboolean have_group_id;
62 guint group_id;
63
64 gchar *upstream_stream_id;
65 gboolean streams_aware;
66
67 /* <private> */
68
69 GstIndex *index;
70 gint index_id;
71 gboolean own_index;
72
73 GArray * times;
74 GArray * filepositions;
75
76 GstAdapter *adapter;
77
78 GstFlowCombiner *flowcombiner;
79
80 GstSegment segment;
81
82 GstEvent *new_seg_event;
83
84 GstTagList *taglist;
85
86 GstFlvDemuxState state;
87
88 guint64 offset;
89 guint64 cur_tag_offset;
90 GstClockTime duration;
91 guint64 tag_size;
92 guint64 tag_data_size;
93
94 gboolean random_access;
95 gboolean need_header;
96 gboolean has_audio;
97 gboolean has_video;
98 gboolean strict;
99 gboolean flushing;
100
101 gboolean no_more_pads;
102
103 #ifndef GST_DISABLE_DEBUG
104 gboolean no_audio_warned;
105 gboolean no_video_warned;
106 #endif
107
108 gboolean seeking;
109 gboolean building_index;
110 gboolean indexed; /* TRUE if index is completely built */
111 gboolean upstream_seekable; /* TRUE if upstream is seekable */
112 gint64 file_size;
113 GstEvent *seek_event;
114 gint64 seek_time;
115 guint32 segment_seqnum;
116
117 GstClockTime index_max_time;
118 gint64 index_max_pos;
119
120 /* reverse playback */
121 GstClockTime video_first_ts;
122 GstClockTime audio_first_ts;
123 gboolean video_done;
124 gboolean audio_done;
125 gint64 from_offset;
126 gint64 to_offset;
127
128 GPtrArray *audio_tracks;
129 GPtrArray *video_tracks;
130 };
131
132 struct _GstFlvDemuxClass
133 {
134 GstElementClass parent_class;
135 };
136
137 typedef struct _GstFlvDemuxAudioTrackInfo
138 {
139 guint16 rate;
140 guint16 channels;
141 guint16 width;
142 } GstFlvDemuxAudioTrackInfo;
143
144 typedef struct _GstFlvDemuxVideoTrackInfo
145 {
146 guint32 w;
147 guint32 h;
148 guint32 par_x;
149 guint32 par_y;
150 gdouble framerate;
151 gboolean got_par;
152 gboolean needs_renegotiation;
153 } GstFlvDemuxVideoTrackInfo;
154
155 typedef struct _GstFlvDemuxTrack
156 {
157 gboolean is_audio;
158 union {
159 GstFlvDemuxAudioTrackInfo audio;
160 GstFlvDemuxVideoTrackInfo video;
161 } info;
162 GstPad *pad;
163 guint32 codec_tag;
164 guint64 offset;
165 GstBuffer * codec_data;
166 GstClockTime start;
167 guint32 last_pts;
168 GstClockTime time_offset;
169 guint32 bitrate;
170 gint16 id;
171 gboolean need_segment;
172 gboolean need_discont;
173 GstStream *stream;
174 GstTagList *tags;
175 } GstFlvDemuxTrack;
176
177 GType gst_flv_demux_get_type (void);
178
179 G_END_DECLS
180 #endif /* __FLV_DEMUX_H__ */