1 /* Quicktime muxer plugin for GStreamer
2 * Copyright (C) 2008 Thiago Sousa Santos <thiagoss@embedded.ufcg.edu.br>
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.
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.
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., 59 Temple Place - Suite 330,
17 * Boston, MA 02111-1307, USA.
20 #ifndef __GST_QT_MUX_H__
21 #define __GST_QT_MUX_H__
24 #include <gst/base/gstcollectpads.h>
28 #include "gstqtmuxmap.h"
32 #define GST_TYPE_QT_MUX (gst_qt_mux_get_type())
33 #define GST_QT_MUX(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_QT_MUX, GstQTMux))
34 #define GST_QT_MUX_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_QT_MUX, GstQTMux))
35 #define GST_IS_QT_MUX(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_QT_MUX))
36 #define GST_IS_QT_MUX_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_QT_MUX))
37 #define GST_QT_MUX_CAST(obj) ((GstQTMux*)(obj))
40 typedef struct _GstQTMux GstQTMux;
41 typedef struct _GstQTMuxClass GstQTMuxClass;
43 typedef struct _GstQTPad
45 GstCollectData collect; /* we extend the CollectData */
47 /* fourcc id of stream */
49 /* whether using format that have out of order buffers */
50 gboolean is_out_of_order;
51 /* whether upstream provides valid PTS data */
53 /* if not 0, track with constant sized samples, e.g. raw audio */
55 /* make sync table entry */
60 GstClockTime last_dts;
62 /* all the atom and chunk book-keeping is delegated here
63 * unowned/uncounted reference, parent MOOV owns */
67 typedef enum _GstQTMuxState
69 GST_QT_MUX_STATE_NONE,
70 GST_QT_MUX_STATE_STARTED,
71 GST_QT_MUX_STATE_DATA,
80 GstCollectPads *collect;
85 /* size of header (prefix, atoms (ftyp, mdat)) */
87 /* accumulated size of raw media data (a priori not including mdat header) */
89 /* position of mdat extended size field (for later updating) */
92 /* atom helper objects */
93 AtomsContext *context;
98 FILE *fast_start_file;
104 AtomsTreeFlavor flavor;
108 gchar *fast_start_file_path;
110 /* for collect pads event handling function */
111 GstPadEventFunction collect_event;
114 struct _GstQTMuxClass
116 GstElementClass parent_class;
118 GstQTMuxFormat format;
121 /* type register helper struct */
122 typedef struct _GstQTMuxClassParams
124 GstQTMuxFormatProp *prop;
126 GstCaps *video_sink_caps;
127 GstCaps *audio_sink_caps;
128 } GstQTMuxClassParams;
130 #define GST_QT_MUX_PARAMS_QDATA g_quark_from_static_string("qt-mux-params")
132 GType gst_qt_mux_get_type (void);
136 #endif /* __GST_QT_MUX_H__ */