452b72212d561ba9f77bbd600bcf760072b8ca5f
[platform/upstream/gst-plugins-good.git] / gst / avi / gstavimux.h
1 /* AVI muxer plugin for GStreamer
2  * Copyright (C) 2002 Ronald Bultje <rbultje@ronald.bitfreak.net>
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., 59 Temple Place - Suite 330,
17  * Boston, MA 02111-1307, USA.
18  */
19
20
21 #ifndef __GST_AVIMUX_H__
22 #define __GST_AVIMUX_H__
23
24
25 #include <gst/gst.h>
26 #include <gst/riff/riff-ids.h>
27 #include "avi-ids.h"
28
29
30 #ifdef __cplusplus
31 extern "C" {
32 #endif /* __cplusplus */
33
34
35 #define GST_TYPE_AVIMUX \
36   (gst_avimux_get_type())
37 #define GST_AVIMUX(obj) \
38   (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_AVIMUX,GstAviMux))
39 #define GST_AVIMUX_CLASS(klass) \
40   (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_AVIMUX,GstAviMux))
41 #define GST_IS_AVIMUX(obj) \
42   (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_AVIMUX))
43 #define GST_IS_AVIMUX_CLASS(obj) \
44   (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_AVIMUX))
45
46
47 typedef struct _GstAviMux GstAviMux;
48 typedef struct _GstAviMuxClass GstAviMuxClass;
49
50 struct _GstAviMux {
51   GstElement element;
52
53   /* pads */
54   GstPad *srcpad;
55   GstPad *audiosinkpad;
56   gboolean audio_pad_connected, audio_pad_eos;
57   GstPad *videosinkpad;
58   gboolean video_pad_connected, video_pad_eos;
59
60   /* the AVI header */
61   gst_riff_avih avi_hdr;
62   guint32 total_frames; /* total number of frames */
63   guint64 total_data; /* amount of total data */
64   guint32 data_size, datax_size; /* amount of data (bytes) in the AVI/AVIX block */
65   guint32 num_frames, numx_frames; /* num frames in the AVI/AVIX block */
66   guint32 header_size;
67   gboolean write_header;
68   gboolean restart;
69   guint32 audio_size;
70   guint64 audio_time;
71
72   /* video header */
73   gst_riff_strh vids_hdr;
74   gst_riff_strf_vids vids;
75
76   /* audio header */
77   gst_riff_strh auds_hdr;
78   gst_riff_strf_auds auds;
79
80   /* information about the AVI index ('idx') */
81   gst_riff_index_entry *idx;
82   gint idx_index, idx_count;
83   guint32 idx_offset, idx_size;
84
85   /* are we a big file already? */
86   gboolean is_bigfile;
87   guint64 avix_start;
88
89   /* whether to use "large AVI files" or just stick to small indexed files */
90   gboolean enable_large_avi;
91
92   /* in order to be usable as a loopbased element, we need an internal
93    * 'buffered' buffer for each pad, so one for audio, one for video */
94   GstBuffer *audio_buffer_queue, *video_buffer_queue;
95 };
96
97 struct _GstAviMuxClass {
98   GstElementClass parent_class;
99 };
100
101 GType gst_avimux_get_type(void);
102
103 #ifdef __cplusplus
104 }
105 #endif /* __cplusplus */
106
107
108 #endif /* __GST_AVIMUX_H__ */