ebf801e0fd36710e882d196aa4c67ea304a3e140
[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.h>
27
28
29 #ifdef __cplusplus
30 extern "C" {
31 #endif /* __cplusplus */
32
33
34 #define GST_TYPE_AVIMUX \
35   (gst_avimux_get_type())
36 #define GST_AVIMUX(obj) \
37   (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_AVIMUX,GstAviMux))
38 #define GST_AVIMUX_CLASS(klass) \
39   (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_AVIMUX,GstAviMux))
40 #define GST_IS_AVIMUX(obj) \
41   (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_AVIMUX))
42 #define GST_IS_AVIMUX_CLASS(obj) \
43   (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_AVIMUX))
44
45
46 typedef struct _GstAviMux GstAviMux;
47 typedef struct _GstAviMuxClass GstAviMuxClass;
48
49 #define MAX_NUM_AUDIO_PADS 8
50 #define MAX_NUM_VIDEO_PADS 8
51
52 struct _GstAviMux {
53   GstElement element;
54
55   /* pads */
56   GstPad *srcpad;
57   GstPad *audiosinkpad[MAX_NUM_AUDIO_PADS];
58   gint num_audio_pads;
59   GstPad *videosinkpad[MAX_NUM_VIDEO_PADS];
60   gint num_video_pads;
61
62   /* timestamps of first and current frame + num_frames for fps calculation */
63   guint64 first_timestamp;
64   guint64 current_timestamp;
65
66   /* the AVI header */
67   gst_riff_avih avi_hdr;
68   guint32 total_frames; /* total number of frames */
69   guint64 total_data; /* amount of total data */
70   guint32 data_size, datax_size; /* amount of data (bytes) in the AVI/AVIX block */
71   guint32 num_frames, numx_frames; /* num frames in the AVI/AVIX block */
72   guint32 header_size;
73   gboolean write_header;
74   gboolean restart;
75   guint32 audio_size;
76
77   /* video header */
78   gst_riff_strh vids_hdr;
79   gst_riff_strf_vids vids;
80
81   /* audio header */
82   gst_riff_strh auds_hdr;
83   gst_riff_strf_auds auds;
84
85   /* information about the AVI index ('idx') */
86   gst_riff_index_entry *idx;
87   gint idx_index, idx_count;
88   guint32 idx_offset, idx_size;
89
90   /* are we a big file already? */
91   gboolean is_bigfile;
92   guint64 avix_start;
93
94   /* whether to use "large AVI files" or just stick to small indexed files */
95   gboolean enable_large_avi;
96 };
97
98 struct _GstAviMuxClass {
99   GstElementClass parent_class;
100 };
101
102 GType gst_avimux_get_type(void);
103
104 #ifdef __cplusplus
105 }
106 #endif /* __cplusplus */
107
108
109 #endif /* __GST_AVIMUX_H__ */