2 * Copyright (C) 2011, Hewlett-Packard Development Company, L.P.
3 * Author: Sebastian Dröge <sebastian.droege@collabora.co.uk>, Collabora Ltd.
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation
8 * version 2.1 of the License.
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21 #ifndef __GST_OMX_VIDEO_ENC_H__
22 #define __GST_OMX_VIDEO_ENC_H__
25 #include <gst/video/video.h>
26 #include <gst/video/gstvideoencoder.h>
27 #include <tbm_bufmgr.h>
33 #define GST_TYPE_OMX_VIDEO_ENC \
34 (gst_omx_video_enc_get_type())
35 #define GST_OMX_VIDEO_ENC(obj) \
36 (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_OMX_VIDEO_ENC,GstOMXVideoEnc))
37 #define GST_OMX_VIDEO_ENC_CLASS(klass) \
38 (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_OMX_VIDEO_ENC,GstOMXVideoEncClass))
39 #define GST_OMX_VIDEO_ENC_GET_CLASS(obj) \
40 (G_TYPE_INSTANCE_GET_CLASS((obj),GST_TYPE_OMX_VIDEO_ENC,GstOMXVideoEncClass))
41 #define GST_IS_OMX_VIDEO_ENC(obj) \
42 (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_OMX_VIDEO_ENC))
43 #define GST_IS_OMX_VIDEO_ENC_CLASS(obj) \
44 (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_OMX_VIDEO_ENC))
46 typedef struct _GstOMXVideoEnc GstOMXVideoEnc;
47 typedef struct _GstOMXVideoEncClass GstOMXVideoEncClass;
49 struct _GstOMXVideoEnc
51 GstVideoEncoder parent;
55 GstOMXPort *enc_in_port, *enc_out_port;
58 GstVideoCodecState *input_state;
59 /* TRUE if the component is configured and saw
63 GstClockTime last_upstream_ts;
68 /* TRUE if EOS buffers shouldn't be forwarded */
73 guint32 target_bitrate;
74 guint32 quant_i_frames;
75 guint32 quant_p_frames;
76 guint32 quant_b_frames;
78 GstFlowReturn downstream_flow_ret;
79 #ifdef TIZEN_FEATURE_OMX
85 struct _GstOMXVideoEncClass
87 GstVideoEncoderClass parent_class;
89 GstOMXClassData cdata;
91 gboolean (*set_format) (GstOMXVideoEnc * self, GstOMXPort * port, GstVideoCodecState * state);
92 GstCaps *(*get_caps) (GstOMXVideoEnc * self, GstOMXPort * port, GstVideoCodecState * state);
93 GstFlowReturn (*handle_output_frame) (GstOMXVideoEnc * self, GstOMXPort * port, GstOMXBuffer * buffer, GstVideoCodecFrame * frame);
96 GType gst_omx_video_enc_get_type (void);
100 #endif /* __GST_OMX_VIDEO_ENC_H__ */