2 * gstvaapih264encoder.h - H.264 encoder
4 * Copyright (C) 2011 Intel Corporation
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.
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.
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
22 #ifndef _GST_H264_ENCODER_H_
23 #define _GST_H264_ENCODER_H_
26 #include "gst/vaapi/gstvaapisurfacepool.h"
28 #include "gstvaapibaseencoder.h"
32 typedef struct _GstH264Encoder GstH264Encoder;
33 typedef struct _GstH264EncoderPrivate GstH264EncoderPrivate;
34 typedef struct _GstH264EncoderClass GstH264EncoderClass;
37 #define GST_TYPE_H264_ENCODER (gst_h264_encoder_get_type())
38 #define GST_IS_H264_ENCODER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_H264_ENCODER))
39 #define GST_IS_H264_ENCODER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_H264_ENCODER))
40 #define GST_H264_ENCODER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_H264_ENCODER, GstH264EncoderClass))
41 #define GST_H264_ENCODER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_H264_ENCODER, GstH264Encoder))
42 #define GST_H264_ENCODER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_H264_ENCODER, GstH264EncoderClass))
43 #define GST_H264_ENCODER_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE((obj),GST_TYPE_H264_ENCODER,GstH264EncoderPrivate))
46 H264_PROFILE_BASELINE = 66,
47 H264_PROFILE_MAIN = 77,
48 H264_PROFILE_EXTENDED = 88,
49 H264_PROFILE_HIGH = 100,
50 H264_PROFILE_HIGH10 = 110,
51 H264_PROFILE_HIGH422 = 122,
52 H264_PROFILE_HIGH444 = 144,
53 H264_PROFILE_HIGH444_PREDICTIVE = 244,
57 H264_LEVEL_10 = 10, /* QCIF format, < 380160 samples/sec */
58 H264_LEVEL_11 = 11, /* CIF format, < 768000 samples/sec */
59 H264_LEVEL_12 = 12, /* CIF format, < 1536000 samples/sec */
60 H264_LEVEL_13 = 13, /* CIF format, < 3041280 samples/sec */
61 H264_LEVEL_20 = 20, /* CIF format, < 3041280 samples/sec */
62 H264_LEVEL_21 = 21, /* HHR format, < 5068800 samples/sec */
63 H264_LEVEL_22 = 22, /* SD/4CIF format, < 5184000 samples/sec */
64 H264_LEVEL_30 = 30, /* SD/4CIF format, < 10368000 samples/sec */
65 H264_LEVEL_31 = 31, /* 720pHD format, < 27648000 samples/sec */
66 H264_LEVEL_32 = 32, /* SXGA format, < 55296000 samples/sec */
67 H264_LEVEL_40 = 40, /* 2Kx1K format, < 62914560 samples/sec */
68 H264_LEVEL_41 = 41, /* 2Kx1K format, < 62914560 samples/sec */
69 H264_LEVEL_42 = 42, /* 2Kx1K format, < 125829120 samples/sec */
70 H264_LEVEL_50 = 50, /* 3672x1536 format, < 150994944 samples/sec */
71 H264_LEVEL_51 = 51, /* 4096x2304 format, < 251658240 samples/sec */
74 #define H264_DEFAULT_PROFILE H264_PROFILE_BASELINE
75 #define H264_DEFAULT_LEVEL H264_LEVEL_30
76 #define H264_DEFAULT_INIT_QP 24
77 #define H264_DEFAULT_MIN_QP 1
78 #define H264_DEFAULT_INTRA_PERIOD 30
79 #define H264_DEFAULT_FPS 30
80 #define H264_DEFAULT_SLICE_NUM 1
82 struct _GstH264Encoder {
83 GstVaapiBaseEncoder parent; /*based on gobject*/
89 guint32 init_qp; /*default 24*/
90 guint32 min_qp; /*default 1*/
95 struct _GstH264EncoderClass {
96 GstVaapiBaseEncoderClass parent_class;
100 GType gst_h264_encoder_get_type(void);
102 GstH264Encoder *gst_h264_encoder_new(void);
103 static inline void gst_h264_encoder_unref (GstH264Encoder * encoder)
105 g_object_unref (encoder);
108 void gst_h264_encoder_set_avc_flag(GstH264Encoder* encoder, gboolean avc);
109 gboolean gst_h264_encoder_get_avc_flag(GstH264Encoder* encoder);
115 #endif /*_GST_H264_ENCODER_H_ */