add Intel Copyright
[profile/ivi/gstreamer-vaapi.git] / gst / vaapiencode / gstvaapimpeg4encoder.h
1 /*
2  *  gstvaapimpeg4encoder.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_MPEG4_ENCODER_H_
23 #define _GST_VAAPI_MPEG4_ENCODER_H_
24
25
26 #include "gst/vaapi/gstvaapisurfacepool.h"
27
28 #include "gstvaapibaseencoder.h"
29
30 G_BEGIN_DECLS
31
32 #define MPEG4_DEFAULT_INTRA_PERIOD 30
33 #define MPEG4_DEFAULT_INIT_QP      15
34 #define MPEG4_DEFAULT_MIN_QP       1
35 #define MPEG4_DEFAULT_SIMPLE_PROFILE_AND_LEVEL          0x03
36 #define MPEG4_DEFAULT_ADVANCED_SIMPLE_PROFILE_AND_LEVEL 0xF3
37
38 #define MPEG4_DEFAULT_FIXED_VOP_RATE FALSE
39
40
41 typedef struct _GstMPEG4Encoder              GstMPEG4Encoder;
42 typedef struct _GstMPEG4EncoderPrivate       GstMPEG4EncoderPrivate;
43 typedef struct _GstMPEG4EncoderClass         GstMPEG4EncoderClass;
44
45
46 #define GST_TYPE_MPEG4_ENCODER             (gst_mpeg4_encoder_get_type())
47 #define GST_IS_MPEG4_ENCODER(obj)          (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_MPEG4_ENCODER))
48 #define GST_IS_MPEG4_ENCODER_CLASS(klass)  (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_MPEG4_ENCODER))
49 #define GST_MPEG4_ENCODER_GET_CLASS(obj)   (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_MPEG4_ENCODER, GstMPEG4EncoderClass))
50 #define GST_MPEG4_ENCODER(obj)             (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_MPEG4_ENCODER, GstMPEG4Encoder))
51 #define GST_MPEG4_ENCODER_CLASS(klass)     (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_MPEG4_ENCODER, GstMPEG4EncoderClass))
52 #define GST_MPEG4_ENCODER_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE((obj),GST_TYPE_MPEG4_ENCODER,GstMPEG4EncoderPrivate))
53
54 struct _GstMPEG4Encoder {
55   GstVaapiBaseEncoder parent;   /*based on gobject*/
56   VAProfile profile;  /* VAProfileMPEG4Simple, VAProfileMPEG4AdvancedSimple */
57   guint32   bitrate;
58   guint32   intra_period;
59   guint32   init_qp;  /*default 15, 1~31*/
60   guint32   min_qp;   /*default 1, 1~31*/
61 };
62
63 struct _GstMPEG4EncoderClass {
64     GstVaapiBaseEncoderClass parent_class;
65 };
66
67
68 GType    gst_mpeg4_encoder_get_type(void);
69
70 GstMPEG4Encoder *gst_mpeg4_encoder_new(void);
71 static inline void gst_mpeg4_encoder_unref (GstMPEG4Encoder * encoder)
72 {
73   g_object_unref (encoder);
74 }
75
76
77 G_END_DECLS
78
79 #endif /* _GST_VAAPI_MPEG4_ENCODER_H_ */
80