107246bccb9be65a18182ea88cd67d1520339609
[profile/ivi/gstreamer-vaapi.git] / gst / vaapiencode / gstvaapiencode.h
1 /*
2  *  gstvaapiencode.h - VA-API video encode
3  *
4  *  gstreamer-vaapi (C) 2010-2011 Splitted-Desktop Systems
5  *  Copyright (C) 2011 Intel Corporation
6  *
7  *  This program is free software; you can redistribute it and/or modify
8  *  it under the terms of the GNU General Public License as published by
9  *  the Free Software Foundation; either version 2 of the License, or
10  *  (at your option) any later version.
11  *
12  *  This program is distributed in the hope that it will be useful,
13  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15  *  GNU General Public License for more details.
16  *
17  *  You should have received a copy of the GNU General Public License
18  *  along with this program; if not, write to the Free Software
19  *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
20  */
21
22 #ifndef GST_VAAPI_ENCODE_H
23 #define GST_VAAPI_ENCODE_H
24
25 #include <gst/gst.h>
26 #include "gstvaapiencoder.h"
27
28 G_BEGIN_DECLS
29
30 /* Default templates */
31 #define GST_CAPS_CODEC(CODEC)          \
32     CODEC ", "                         \
33     "width  = (int) [ 1, MAX ], "      \
34     "height = (int) [ 1, MAX ]; "
35
36
37 #define GST_TYPE_VAAPI_ENCODE             (gst_vaapi_encode_get_type())
38 #define GST_IS_VAAPI_ENCODE(obj)          (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_VAAPI_ENCODE))
39 #define GST_IS_VAAPI_ENCODE_CLASS(klass)  (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_VAAPI_ENCODE))
40 #define GST_VAAPI_ENCODE_GET_CLASS(obj)   (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_VAAPI_ENCODE, GstVaapiEncodeClass))
41 #define GST_VAAPI_ENCODE(obj)             (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_VAAPI_ENCODE, GstVaapiEncode))
42 #define GST_VAAPI_ENCODE_CLASS(klass)     (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_VAAPI_ENCODE, GstVaapiEncodeClass))
43
44
45 typedef struct _GstVaapiEncode        GstVaapiEncode;
46 typedef struct _GstVaapiEncodeClass   GstVaapiEncodeClass;
47
48 struct _GstVaapiEncode {
49     GstElement          parent_instance;
50
51     GstPad             *sinkpad;
52     GstCaps            *sinkpad_caps;
53
54     GstPad             *srcpad;
55     GstCaps            *srcpad_caps;
56
57     GstVaapiEncoder    *encoder;
58     gboolean            first_sink_frame;
59     gboolean            first_src_frame;
60 };
61
62 struct _GstVaapiEncodeClass {
63     GstElementClass     parent_class;
64     gboolean          (*set_encoder_src_caps)(GstVaapiEncode* encode, GstCaps *caps);
65 };
66
67 GType gst_vaapi_encode_get_type(void);
68
69 G_END_DECLS
70
71 #endif /* GST_VAAPI_ENCODE_H */
72