2 * (c) 2003 Ronald Bultje <rbultje@ronald.bitfreak.net>
4 * ebml-write.c: write EBML data to file/stream
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_EBML_WRITE_H__
23 #define __GST_EBML_WRITE_H__
29 #define GST_TYPE_EBML_WRITE \
30 (gst_ebml_write_get_type ())
31 #define GST_EBML_WRITE(obj) \
32 (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_EBML_WRITE, GstEbmlWrite))
33 #define GST_EBML_WRITE_CLASS(klass) \
34 (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_EBML_WRITE, GstEbmlWriteClass))
35 #define GST_IS_EBML_WRITE(obj) \
36 (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_EBML_WRITE))
37 #define GST_IS_EBML_WRITE_CLASS(obj) \
38 (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_EBML_WRITE))
39 #define GST_EBML_WRITE_GET_CLASS(obj) \
40 (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_EBML_WRITE, GstEbmlWriteClass))
41 typedef struct _GstEbmlWrite
52 typedef struct _GstEbmlWriteClass
54 GstElementClass parent;
57 GType gst_ebml_write_get_type (void);
60 * Caching means that we do not push one buffer for
61 * each element, but fill this one until a flush.
63 void gst_ebml_write_set_cache (GstEbmlWrite * ebml, guint size);
64 void gst_ebml_write_flush_cache (GstEbmlWrite * ebml);
69 void gst_ebml_write_seek (GstEbmlWrite * ebml, guint64 pos);
74 void gst_ebml_write_uint (GstEbmlWrite * ebml, guint32 id, guint64 num);
75 void gst_ebml_write_sint (GstEbmlWrite * ebml, guint32 id, gint64 num);
76 void gst_ebml_write_float (GstEbmlWrite * ebml, guint32 id, gdouble num);
77 void gst_ebml_write_ascii (GstEbmlWrite * ebml, guint32 id, const gchar * str);
78 void gst_ebml_write_utf8 (GstEbmlWrite * ebml, guint32 id, const gchar * str);
79 void gst_ebml_write_date (GstEbmlWrite * ebml, guint32 id, gint64 date);
80 guint64 gst_ebml_write_master_start (GstEbmlWrite * ebml, guint32 id);
81 void gst_ebml_write_master_finish (GstEbmlWrite * ebml, guint64 startpos);
82 void gst_ebml_write_binary (GstEbmlWrite * ebml,
83 guint32 id, guchar * binary, guint64 length);
84 void gst_ebml_write_header (GstEbmlWrite * ebml,
85 gchar * doctype, guint version);
88 * Note: this is supposed to be used only for media data.
90 void gst_ebml_write_buffer_header (GstEbmlWrite * ebml,
91 guint32 id, guint64 length);
92 void gst_ebml_write_buffer (GstEbmlWrite * ebml, GstBuffer * data);
95 * A hack, basically... See matroska-mux.c. I should actually
96 * make a nice _replace_element_with_size() or so, but this
99 void gst_ebml_replace_uint (GstEbmlWrite * ebml, guint64 pos, guint64 num);
102 #endif /* __GST_EBML_WRITE_H__ */