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 /* if not 0, track with constant sized samples, e.g. raw audio */
53 /* make sync table entry */
58 GstClockTime last_dts;
60 /* all the atom and chunk book-keeping is delegated here
61 * unowned/uncounted reference, parent MOOV owns */
65 typedef enum _GstQTMuxState
67 GST_QT_MUX_STATE_NONE,
68 GST_QT_MUX_STATE_STARTED,
69 GST_QT_MUX_STATE_DATA,
78 GstCollectPads *collect;
83 /* size of header (prefix, atoms (ftyp, mdat)) */
85 /* accumulated size of raw media data (a priori not including mdat header) */
87 /* position of mdat extended size field (for later updating) */
90 /* atom helper objects */
91 AtomsContext *context;
96 FILE *fast_start_file;
102 AtomsTreeFlavor flavor;
106 gchar *fast_start_file_path;
108 /* for collect pads event handling function */
109 GstPadEventFunction collect_event;
112 struct _GstQTMuxClass
114 GstElementClass parent_class;
116 GstQTMuxFormat format;
119 /* type register helper struct */
120 typedef struct _GstQTMuxClassParams
122 GstQTMuxFormatProp *prop;
124 GstCaps *video_sink_caps;
125 GstCaps *audio_sink_caps;
126 } GstQTMuxClassParams;
128 #define GST_QT_MUX_PARAMS_QDATA g_quark_from_static_string("qt-mux-params")
130 GType gst_qt_mux_get_type (void);
134 #endif /* __GST_QT_MUX_H__ */