Tizen 2.0 Release
[framework/multimedia/gstreamer-vaapi.git] / gst-libs / gst / vaapi / gstvaapiencoder_mpeg4.h
1 /*
2  *  gstvaapiencoder_mpeg4.h - MPEG-4 encoder
3  *
4  *  Copyright (C) 2011 Intel Corporation
5  *
6  *  This library is free software; you can redistribute it and/or
7  *  modify it under the terms of the GNU Lesser General Public License
8  *  as published by the Free Software Foundation; either version 2.1
9  *  of the License, or (at your option) any later version.
10  *
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  *  Lesser General Public License for more details.
15  *
16  *  You should have received a copy of the GNU Lesser General Public
17  *  License along with this library; if not, write to the Free
18  *  Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19  *  Boston, MA 02110-1301 USA
20  */
21
22 #ifndef GST_VAAPI_ENCODER_MPEG4_H
23 #define GST_VAAPI_ENCODER_MPEG4_H
24
25 #include "gst/vaapi/gstvaapisurfacepool.h"
26 #include "gst/vaapi/gstvaapibaseencoder.h"
27
28 G_BEGIN_DECLS
29
30 #define MPEG4_DEFAULT_INTRA_PERIOD 30
31 #define MPEG4_DEFAULT_INIT_QP      15
32 #define MPEG4_DEFAULT_MIN_QP       1
33 #define MPEG4_DEFAULT_SIMPLE_PROFILE_AND_LEVEL          0x03
34 #define MPEG4_DEFAULT_ADVANCED_SIMPLE_PROFILE_AND_LEVEL 0xF3
35
36 #define MPEG4_DEFAULT_FIXED_VOP_RATE FALSE
37
38
39 typedef struct _GstVaapiEncoderMpeg4              GstVaapiEncoderMpeg4;
40 typedef struct _GstVaapiEncoderMpeg4Private       GstVaapiEncoderMpeg4Private;
41 typedef struct _GstVaapiEncoderMpeg4Class         GstVaapiEncoderMpeg4Class;
42
43
44 #define GST_TYPE_VAAPI_ENCODER_MPEG4 \
45     (gst_vaapi_encoder_mpeg4_get_type())
46
47 #define GST_IS_VAAPI_ENCODER_MPEG4(obj) \
48     (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_VAAPI_ENCODER_MPEG4))
49
50 #define GST_IS_VAAPI_ENCODER_MPEG4_CLASS(klass) \
51     (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_VAAPI_ENCODER_MPEG4))
52
53 #define GST_VAAPI_ENCODER_MPEG4_GET_CLASS(obj)                 \
54     (G_TYPE_INSTANCE_GET_CLASS ((obj),                         \
55                                 GST_TYPE_VAAPI_ENCODER_MPEG4,  \
56                                 GstVaapiEncoderMpeg4Class))
57
58 #define GST_VAAPI_ENCODER_MPEG4(obj)                           \
59     (G_TYPE_CHECK_INSTANCE_CAST ((obj),                        \
60                                  GST_TYPE_VAAPI_ENCODER_MPEG4, \
61                                  GstVaapiEncoderMpeg4))
62
63 #define GST_VAAPI_ENCODER_MPEG4_CLASS(klass)                   \
64     (G_TYPE_CHECK_CLASS_CAST ((klass),                         \
65                               GST_TYPE_VAAPI_ENCODER_MPEG4,    \
66                               GstVaapiEncoderMpeg4Class))
67
68 #define GST_VAAPI_ENCODER_MPEG4_GET_PRIVATE(obj)               \
69     (G_TYPE_INSTANCE_GET_PRIVATE((obj),                        \
70                                  GST_TYPE_VAAPI_ENCODER_MPEG4, \
71                                  GstVaapiEncoderMpeg4Private))
72
73 struct _GstVaapiEncoderMpeg4 {
74   GstVaapiBaseEncoder parent;   /*based on gobject*/
75   VAProfile profile;  /* VAProfileMPEG4Simple, VAProfileMPEG4AdvancedSimple */
76   guint32   bitrate;
77   guint32   intra_period;
78   guint32   init_qp;  /*default 15, 1~31*/
79   guint32   min_qp;   /*default 1, 1~31*/
80
81   GstVaapiEncoderMpeg4Private *priv;
82 };
83
84 struct _GstVaapiEncoderMpeg4Class {
85     GstVaapiBaseEncoderClass parent_class;
86 };
87
88 GType
89 gst_vaapi_encoder_mpeg4_get_type(void);
90
91 GstVaapiEncoderMpeg4 *
92 gst_vaapi_encoder_mpeg4_new(void);
93
94 static inline void
95 gst_vaapi_encoder_mpeg4_unref (GstVaapiEncoderMpeg4 * encoder)
96 {
97   g_object_unref (encoder);
98 }
99
100
101 G_END_DECLS
102
103 #endif /* GST_VAAPI_ENCODER_MPEG4_H */