encoder(h264,h263,mpeg4): changed styles, names
authorWind Yuan <feng.yuan@intel.com>
Fri, 20 Jul 2012 07:27:57 +0000 (03:27 -0400)
committerZhong Cong <congx.zhong@intel.com>
Tue, 5 Feb 2013 07:37:11 +0000 (15:37 +0800)
current h264 encoder works in branch of 'vaapiext' of libva/intel-driver in GEN platform.
other encoders(h263,mpeg4) only tested in pvr long ago.
encoder need be configured with '--enable-encoders' explicitly.

26 files changed:
configure.ac
gst-libs/gst/vaapi/Makefile.am
gst-libs/gst/vaapi/gstvaapibaseencoder.c [moved from gst/vaapiencode/gstvaapibaseencoder.c with 100% similarity]
gst-libs/gst/vaapi/gstvaapibaseencoder.h [moved from gst/vaapiencode/gstvaapibaseencoder.h with 100% similarity]
gst-libs/gst/vaapi/gstvaapicontext.c
gst-libs/gst/vaapi/gstvaapiencoder.c [moved from gst/vaapiencode/gstvaapiencoder.c with 100% similarity]
gst-libs/gst/vaapi/gstvaapiencoder.h [moved from gst/vaapiencode/gstvaapiencoder.h with 100% similarity]
gst-libs/gst/vaapi/gstvaapiencoder_h263.c [moved from gst/vaapiencode/gstvaapih263encoder.c with 82% similarity]
gst-libs/gst/vaapi/gstvaapiencoder_h263.h [new file with mode: 0644]
gst-libs/gst/vaapi/gstvaapiencoder_h264.c [moved from gst/vaapiencode/gstvaapih264encoder.c with 90% similarity]
gst-libs/gst/vaapi/gstvaapiencoder_h264.h [moved from gst/vaapiencode/gstvaapih264encoder.h with 64% similarity]
gst-libs/gst/vaapi/gstvaapiencoder_mpeg4.c [moved from gst/vaapiencode/gstvaapimpeg4encoder.c with 84% similarity]
gst-libs/gst/vaapi/gstvaapiencoder_mpeg4.h [moved from gst/vaapiencode/gstvaapimpeg4encoder.h with 50% similarity]
gst/Makefile.am
gst/vaapi/Makefile.am
gst/vaapi/gstvaapi.c
gst/vaapi/gstvaapiencode.c [moved from gst/vaapiencode/gstvaapiencode.c with 94% similarity]
gst/vaapi/gstvaapiencode.h [moved from gst/vaapiencode/gstvaapiencode.h with 98% similarity]
gst/vaapi/gstvaapiencode_h263.c [moved from gst/vaapiencode/gstvaapih263encode.c with 73% similarity]
gst/vaapi/gstvaapiencode_h263.h [moved from gst/vaapiencode/gstvaapih263encode.h with 51% similarity]
gst/vaapi/gstvaapiencode_h264.c [moved from gst/vaapiencode/gstvaapih264encode.c with 79% similarity]
gst/vaapi/gstvaapiencode_h264.h [moved from gst/vaapiencode/gstvaapih264encode.h with 51% similarity]
gst/vaapi/gstvaapiencode_mpeg4.c [moved from gst/vaapiencode/gstvaapimpeg4encode.c with 70% similarity]
gst/vaapi/gstvaapiencode_mpeg4.h [moved from gst/vaapiencode/gstvaapimpeg4encode.h with 51% similarity]
gst/vaapiencode/Makefile.am [deleted file]
gst/vaapiencode/gstvaapih263encoder.h [deleted file]

index afe267a..2732285 100755 (executable)
@@ -133,6 +133,11 @@ AC_ARG_ENABLE(wayland,
                    [enable Wayland output @<:@default=yes@:>@]),
     [], [enable_wayland="yes"])
 
+AC_ARG_ENABLE(encoders,
+    AC_HELP_STRING([--enable-encoders],
+                   [enable encoders @<:@default=no@:>@]),
+    [], [enable_encoders="no"])
+
 dnl Check for basic libraries
 AC_CHECK_LIB(m, tan)
 
@@ -376,6 +381,16 @@ if test "$enable_opengl" = "yes"; then
     CPPFLAGS="$saved_CPPFLAGS"
 fi
 
+dnl Check for encoders
+USE_ENCODERS=0
+if test "$enable_encoders" = "yes"; then
+    USE_ENCODERS=1
+fi
+
+AC_DEFINE_UNQUOTED(USE_ENCODERS, $USE_ENCODERS,
+    [Defined to 1 if GStreamer Vaapi Encoder are used])
+AM_CONDITIONAL(USE_ENCODERS, test $USE_ENCODERS -eq 1)
+
 dnl ... GLX
 USE_GLX=0
 if test "$enable_glx" = "yes" -a $HAVE_GL -eq 1 -a $USE_X11 -eq 1; then
@@ -602,4 +617,5 @@ echo $PACKAGE configuration summary:
 echo
 echo VA-API version ................... : $VA_VERSION_STR
 echo Video outputs .................... : $VIDEO_OUTPUTS
+echo VaapiEncoder support....... ...... : $(yesno $USE_ENCODERS)
 echo
index a4d6e09..6489431 100644 (file)
@@ -97,6 +97,25 @@ libgstvaapi_source_h =                               \
        gstvaapipostprocess.h                   \
        $(NULL)
 
+if USE_ENCODERS
+libgstvaapi_source_c +=         \
+    gstvaapiencoder.c           \
+    gstvaapibaseencoder.c       \
+    gstvaapiencoder_h264.c      \
+    gstvaapiencoder_h263.c      \
+    gstvaapiencoder_mpeg4.c     \
+    $(NULL)
+
+libgstvaapi_source_h +=         \
+       gstvaapiencoder.h           \
+    gstvaapibaseencoder.h       \
+    gstvaapiencoder_h264.h      \
+    gstvaapiencoder_h263.h      \
+    gstvaapiencoder_mpeg4.h     \
+    $(NULL)
+
+endif
+
 libgstvaapi_source_priv_h =                    \
        glibcompat.h                            \
        gstvaapi_priv.h                         \
index 70199bd..9a5f116 100644 (file)
@@ -362,7 +362,7 @@ gst_vaapi_context_create(GstVaapiContext *context)
     if (!vaapi_check_status(status, "vaCreateConfig()"))
         goto end;
 
-    VASurfaceID *surface_ids = surfaces->data;
+    VASurfaceID *surface_ids = (VASurfaceID*)surfaces->data;
     int          surface_num = surfaces->len;
 
     if (VAEntrypointEncSlice == va_entrypoint) {
similarity index 82%
rename from gst/vaapiencode/gstvaapih263encoder.c
rename to gst-libs/gst/vaapi/gstvaapiencoder_h263.c
index 0cb500c..8bfa61b 100644 (file)
@@ -1,5 +1,5 @@
 /*
- *  gstvaapih263encoder.c - H.263 encoder
+ *  gstvaapiencoder_h263.c - H.263 encoder
  *
  *  Copyright (C) 2011 Intel Corporation
  *
@@ -19,7 +19,7 @@
  *  Boston, MA 02110-1301 USA
  */
 
-#include "gstvaapih263encoder.h"
+#include "gstvaapiencoder_h263.h"
 
 #include <string.h>
 #include <gst/gstclock.h>
@@ -34,7 +34,7 @@
 GST_DEBUG_CATEGORY_STATIC (gst_vaapi_h263_encoder_debug);
 #define GST_CAT_DEFAULT gst_vaapi_h263_encoder_debug
 
-struct _GstH263EncoderPrivate {
+struct _GstVaapiEncoderH263Private {
   GstVaapiSurface  *ref_surface;  /* reference buffer*/
   GstVaapiSurface  *recon_surface; /* reconstruct buffer*/
 
@@ -43,64 +43,65 @@ struct _GstH263EncoderPrivate {
   VABufferID        slice_parameter;
 };
 
-G_DEFINE_TYPE(GstH263Encoder, gst_h263_encoder, GST_TYPE_VAAPI_BASE_ENCODER);
+G_DEFINE_TYPE(GstVaapiEncoderH263, gst_vaapi_encoder_h263, GST_TYPE_VAAPI_BASE_ENCODER);
+
 /*
-static EncoderStatus gst_h263_encoder_flush(GstVaapiEncoder* encoder,
+static EncoderStatus gst_vaapi_encoder_h263_flush(GstVaapiEncoder* encoder,
                             GstVaapiDisplay *display, GstVaapiContext *context,
                             GList **coded_pics);
 */
 
-static void          gst_h263_encoder_class_init(GstH263EncoderClass *klass);
-static void          gst_h263_encoder_init(GstH263Encoder *encoder);
-static void          gst_h263_encoder_finalize(GObject *object);
+static void          gst_vaapi_encoder_h263_class_init(GstVaapiEncoderH263Class *klass);
+static void          gst_vaapi_encoder_h263_init(GstVaapiEncoderH263 *encoder);
+static void          gst_vaapi_encoder_h263_finalize(GObject *object);
 
 static gboolean      gst_h263_validate_parameters(GstVaapiBaseEncoder* encoder);
-static gboolean      gst_h263_encoder_release_resource(
+static gboolean      gst_vaapi_encoder_h263_release_resource(
                             GstVaapiBaseEncoder* encoder, GstVaapiDisplay *display,
                             GstVaapiContext *context);
-static EncoderStatus gst_h263_encoder_rendering(GstVaapiBaseEncoder *encoder,
+static EncoderStatus gst_vaapi_encoder_h263_rendering(GstVaapiBaseEncoder *encoder,
                             GstVaapiDisplay *display, GstVaapiContext *context,
                             GstVaapiSurface *surface, guint frame_index,
                             VABufferID coded_buf, gboolean *is_key);
 
-GstH263Encoder *
-gst_h263_encoder_new(void)
+GstVaapiEncoderH263 *
+gst_vaapi_encoder_h263_new(void)
 {
-  return GST_H263_ENCODER(g_object_new(GST_TYPE_H263_ENCODER, NULL));
+  return GST_VAAPI_ENCODER_H263(g_object_new(GST_TYPE_VAAPI_ENCODER_H263, NULL));
 }
 
 
 static void
-gst_h263_encoder_class_init(GstH263EncoderClass *klass)
+gst_vaapi_encoder_h263_class_init(GstVaapiEncoderH263Class *klass)
 {
   GObjectClass * const object_class = G_OBJECT_CLASS(klass);
   GstVaapiBaseEncoderClass * const base_class = GST_VAAPI_BASE_ENCODER_CLASS(klass);
   GstVaapiEncoderClass * const encoder_class = GST_VAAPI_ENCODER_CLASS(klass);
-  g_type_class_add_private(klass, sizeof(GstH263EncoderPrivate));
+  g_type_class_add_private(klass, sizeof(GstVaapiEncoderH263Private));
 
   GST_DEBUG_CATEGORY_INIT (gst_vaapi_h263_encoder_debug, "gst_va_h263_encoder", 0,
       "gst_va_h263_encoder element");
 
-  object_class->finalize = gst_h263_encoder_finalize;
+  object_class->finalize = gst_vaapi_encoder_h263_finalize;
 
   base_class->validate_attributes = gst_h263_validate_parameters;
   base_class->pre_alloc_resource  = NULL;
-  base_class->release_resource    = gst_h263_encoder_release_resource;
-  base_class->render_frame = gst_h263_encoder_rendering;
+  base_class->release_resource    = gst_vaapi_encoder_h263_release_resource;
+  base_class->render_frame = gst_vaapi_encoder_h263_rendering;
   base_class->notify_frame = NULL;
   base_class->copy_coded_frame = NULL;
 
   /*
-  encoder_class->flush = gst_h263_encoder_flush;
+  encoder_class->flush = gst_vaapi_encoder_h263_flush;
   */
   encoder_class->get_codec_data = NULL;
 
 }
 
 static void
-gst_h263_encoder_init(GstH263Encoder *h263_encoder)
+gst_vaapi_encoder_h263_init(GstVaapiEncoderH263 *h263_encoder)
 {
-  GstH263EncoderPrivate *h263_prv = GST_H263_ENCODER_GET_PRIVATE(h263_encoder);
+  GstVaapiEncoderH263Private *h263_prv = GST_VAAPI_ENCODER_H263_GET_PRIVATE(h263_encoder);
   ENCODER_ASSERT(h263_prv);
 
   /* init public */
@@ -119,7 +120,7 @@ gst_h263_encoder_init(GstH263Encoder *h263_encoder)
 }
 
 static void
-gst_h263_encoder_finalize(GObject *object)
+gst_vaapi_encoder_h263_finalize(GObject *object)
 {
   /*free private buffers*/
   GstVaapiEncoder *encoder = GST_VAAPI_ENCODER(object);
@@ -127,13 +128,13 @@ gst_h263_encoder_finalize(GObject *object)
   if (gst_vaapi_encoder_get_state(encoder) != VAAPI_ENC_NULL) {
     gst_vaapi_encoder_uninitialize(encoder);
   }
-  G_OBJECT_CLASS(gst_h263_encoder_parent_class)->finalize(object);
+  G_OBJECT_CLASS(gst_vaapi_encoder_h263_parent_class)->finalize(object);
 }
 
 static gboolean
 gst_h263_validate_parameters(GstVaapiBaseEncoder* encoder)
 {
-  GstH263Encoder *h263_encoder = GST_H263_ENCODER(encoder);
+  GstVaapiEncoderH263 *h263_encoder = GST_VAAPI_ENCODER_H263(encoder);
   if (!ENCODER_WIDTH(h263_encoder) || !ENCODER_HEIGHT(h263_encoder) || !ENCODER_FPS(h263_encoder)) {
     return FALSE;
   }
@@ -158,9 +159,9 @@ gst_h263_validate_parameters(GstVaapiBaseEncoder* encoder)
 
 
 static void
-h263_release_parameters(GstH263Encoder *h263_encoder, GstVaapiDisplay *display)
+h263_release_parameters(GstVaapiEncoderH263 *h263_encoder, GstVaapiDisplay *display)
 {
-  GstH263EncoderPrivate *h263_prv = GST_H263_ENCODER_GET_PRIVATE(h263_encoder);
+  GstVaapiEncoderH263Private *h263_prv = GST_VAAPI_ENCODER_H263_GET_PRIVATE(h263_encoder);
   VADisplay va_dpy = gst_vaapi_display_get_display(display);
   VAStatus va_status = VA_STATUS_SUCCESS;
 
@@ -182,12 +183,12 @@ h263_release_parameters(GstH263Encoder *h263_encoder, GstVaapiDisplay *display)
 }
 
 static gboolean
-gst_h263_encoder_release_resource(GstVaapiBaseEncoder* encoder,
+gst_vaapi_encoder_h263_release_resource(GstVaapiBaseEncoder* encoder,
                        GstVaapiDisplay *display,
                        GstVaapiContext *context)
 {
-  GstH263Encoder *h263_encoder = GST_H263_ENCODER(encoder);
-  GstH263EncoderPrivate *h263_prv = GST_H263_ENCODER_GET_PRIVATE(h263_encoder);
+  GstVaapiEncoderH263 *h263_encoder = GST_VAAPI_ENCODER_H263(encoder);
+  GstVaapiEncoderH263Private *h263_prv = GST_VAAPI_ENCODER_H263_GET_PRIVATE(h263_encoder);
 
   h263_release_parameters(h263_encoder, display);
 
@@ -215,13 +216,13 @@ gst_h263_encoder_release_resource(GstVaapiBaseEncoder* encoder,
 }
 
 static EncoderStatus
-gst_h263_encoder_rendering(GstVaapiBaseEncoder *encoder, GstVaapiDisplay *display,
+gst_vaapi_encoder_h263_rendering(GstVaapiBaseEncoder *encoder, GstVaapiDisplay *display,
                      GstVaapiContext *context, GstVaapiSurface *surface,
                      guint frame_index, VABufferID coded_buf, gboolean *is_key)
 
 {
-  GstH263Encoder *h263_encoder = GST_H263_ENCODER(encoder);
-  GstH263EncoderPrivate *h263_prv = GST_H263_ENCODER_GET_PRIVATE(h263_encoder);
+  GstVaapiEncoderH263 *h263_encoder = GST_VAAPI_ENCODER_H263(encoder);
+  GstVaapiEncoderH263Private *h263_prv = GST_VAAPI_ENCODER_H263_GET_PRIVATE(h263_encoder);
   VADisplay va_dpy = gst_vaapi_display_get_display(display);
   VAContextID context_id = GST_VAAPI_OBJECT_ID(context);
 
diff --git a/gst-libs/gst/vaapi/gstvaapiencoder_h263.h b/gst-libs/gst/vaapi/gstvaapiencoder_h263.h
new file mode 100644 (file)
index 0000000..06b5611
--- /dev/null
@@ -0,0 +1,76 @@
+/*
+ *  gstvaapiencoder_h263.h - H.263 encoder
+ *
+ *  Copyright (C) 2011 Intel Corporation
+ *
+ *  This library is free software; you can redistribute it and/or
+ *  modify it under the terms of the GNU Lesser General Public License
+ *  as published by the Free Software Foundation; either version 2.1
+ *  of the License, or (at your option) any later version.
+ *
+ *  This library is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ *  Lesser General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Lesser General Public
+ *  License along with this library; if not, write to the Free
+ *  Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ *  Boston, MA 02110-1301 USA
+ */
+
+#ifndef _GST_VAAPI_ENCODER_H263_H_
+#define _GST_VAAPI_ENCODER_H263_H_
+
+
+#include "gst/vaapi/gstvaapisurfacepool.h"
+
+#include "gstvaapibaseencoder.h"
+
+G_BEGIN_DECLS
+
+#define H263_DEFAULT_INTRA_PERIOD 30
+#define H263_DEFAULT_INIT_QP      15
+#define H263_DEFAULT_MIN_QP       1
+
+
+typedef struct _GstVaapiEncoderH263              GstVaapiEncoderH263;
+typedef struct _GstVaapiEncoderH263Private       GstVaapiEncoderH263Private;
+typedef struct _GstVaapiEncoderH263Class         GstVaapiEncoderH263Class;
+
+
+#define GST_TYPE_VAAPI_ENCODER_H263             (gst_vaapi_encoder_h263_get_type())
+#define GST_IS_VAAPI_ENCODER_H263(obj)          (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_VAAPI_ENCODER_H263))
+#define GST_IS_VAAPI_ENCODER_H263_CLASS(klass)  (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_VAAPI_ENCODER_H263))
+#define GST_VAAPI_ENCODER_H263_GET_CLASS(obj)   (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_VAAPI_ENCODER_H263, GstVaapiEncoderH263Class))
+#define GST_VAAPI_ENCODER_H263(obj)             (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_VAAPI_ENCODER_H263, GstVaapiEncoderH263))
+#define GST_VAAPI_ENCODER_H263_CLASS(klass)     (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_VAAPI_ENCODER_H263, GstVaapiEncoderH263Class))
+#define GST_VAAPI_ENCODER_H263_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE((obj),GST_TYPE_VAAPI_ENCODER_H263,GstVaapiEncoderH263Private))
+
+struct _GstVaapiEncoderH263 {
+  GstVaapiBaseEncoder parent;   /*based on gobject*/
+
+  guint32  bitrate;
+  guint32  intra_period;
+  guint32  init_qp;  /*default 15, 1~31*/
+  guint32  min_qp;   /*default 1, 1~31*/
+};
+
+struct _GstVaapiEncoderH263Class {
+    GstVaapiBaseEncoderClass parent_class;
+};
+
+
+GType    gst_vaapi_encoder_h263_get_type(void);
+
+GstVaapiEncoderH263 *gst_vaapi_encoder_h263_new(void);
+static inline void gst_vaapi_encoder_h263_unref (GstVaapiEncoderH263 * encoder)
+{
+  g_object_unref (encoder);
+}
+
+
+G_END_DECLS
+
+#endif /* _GST_VAAPI_ENCODER_H263_H_ */
+
similarity index 90%
rename from gst/vaapiencode/gstvaapih264encoder.c
rename to gst-libs/gst/vaapi/gstvaapiencoder_h264.c
index 3b4e622..01c5962 100644 (file)
@@ -1,5 +1,5 @@
 /*
- *  gstvaapih264encoder.c -  H.264 encoder
+ *  gstvaapiencoder_h264.c -  H.264 encoder
  *
  *  Copyright (C) 2011 Intel Corporation
  *
@@ -19,7 +19,7 @@
  *  Boston, MA 02110-1301 USA
  */
 
-#include "gstvaapih264encoder.h"
+#include "gstvaapiencoder_h264.h"
 
 #include <string.h>
 #include <stdlib.h>
@@ -83,8 +83,8 @@ typedef enum {
   SLICE_TYPE_I  = 2
 } H264_SLICE_TYPE;
 
-struct _GstH264EncoderPrivate {
-  GstH264Encoder   *public;
+struct _GstVaapiEncoderH264Private {
+  GstVaapiEncoderH264   *public;
   guint32           format;   /*NV12, I420,*/
   gboolean          avc_flag;  /*elementary flag*/
 
@@ -123,7 +123,7 @@ struct _GstH264EncoderPrivate {
   guint64           last_decode_time;
 };
 
-G_DEFINE_TYPE(GstH264Encoder, gst_h264_encoder, GST_TYPE_VAAPI_BASE_ENCODER);
+G_DEFINE_TYPE(GstVaapiEncoderH264, gst_vaapi_encoder_h264, GST_TYPE_VAAPI_BASE_ENCODER);
 
 
 // 4096-1
@@ -142,33 +142,33 @@ typedef struct _H264Bitstream H264Bitstream;
 
 static const guint8 h264_bit_mask[9] = {0x00, 0x01, 0x03, 0x07, 0x0F, 0x1F, 0x3F, 0x7F, 0xFF};
 
-static EncoderStatus gst_h264_encoder_flush(GstVaapiEncoder* encoder, GstVaapiDisplay *display,
+static EncoderStatus gst_vaapi_encoder_h264_flush(GstVaapiEncoder* encoder, GstVaapiDisplay *display,
                                     GstVaapiContext *context, GList **coded_pics);
 
 /*other functions*/
 /*other functions*/
-static EncoderStatus gst_h264_encoder_get_codec_data(
+static EncoderStatus gst_vaapi_encoder_h264_get_codec_data(
                                     GstVaapiEncoder* encoder, GstBuffer **buffer);
 static gboolean      gst_h264_validate_parameters(GstVaapiBaseEncoder *encoder);
-static void          gst_h264_encoder_finalize(GObject *object);
-static void          gst_h264_encoder_init_public_values(GstH264Encoder* encoder);
+static void          gst_vaapi_encoder_h264_finalize(GObject *object);
+static void          gst_vaapi_encoder_h264_init_public_values(GstVaapiEncoderH264* encoder);
 
-static gboolean      gst_h264_encoder_alloc_slices(GstVaapiBaseEncoder *encoder,
+static gboolean      gst_vaapi_encoder_h264_alloc_slices(GstVaapiBaseEncoder *encoder,
                                     GstVaapiDisplay *display, GstVaapiContext *context);
-static gboolean      gst_h264_encoder_release_resource(GstVaapiBaseEncoder* encoder,
+static gboolean      gst_vaapi_encoder_h264_release_resource(GstVaapiBaseEncoder* encoder,
                                     GstVaapiDisplay *display, GstVaapiContext *context);
-static EncoderStatus gst_h264_encoder_prepare_next_buffer(GstVaapiBaseEncoder* encoder,
+static EncoderStatus gst_vaapi_encoder_h264_prepare_next_buffer(GstVaapiBaseEncoder* encoder,
                                     GstVaapiVideoBuffer *display_buf,  gboolean need_flush,
                                     GstVaapiVideoBuffer **out_buf);
-static void          gst_h264_encoder_frame_failed(GstVaapiBaseEncoder *encoder,
+static void          gst_vaapi_encoder_h264_frame_failed(GstVaapiBaseEncoder *encoder,
                                     GstVaapiVideoBuffer* buffer);
-static EncoderStatus gst_h264_encoder_rendering(GstVaapiBaseEncoder *encoder, GstVaapiDisplay *display,
+static EncoderStatus gst_vaapi_encoder_h264_rendering(GstVaapiBaseEncoder *encoder, GstVaapiDisplay *display,
                                     GstVaapiContext *context, GstVaapiSurface *surface,
                                     guint frame_index, VABufferID coded_buf, gboolean *is_key);
 static void          gst_h264_notify_frame(GstVaapiBaseEncoder *encoder, guint8 *buf, guint32 size);
 //static EncoderStatus h264_encoder_read_sps_pps(
-//                                    GstH264EncoderPrivate *h264_prv, const guint8 *buf, guint32 size);
-static GstBuffer    *gst_h264_encoder_copy_coded_buffer(GstVaapiBaseEncoder *encoder,
+//                                    GstVaapiEncoderH264Private *h264_prv, const guint8 *buf, guint32 size);
+static GstBuffer    *gst_vaapi_encoder_h264_copy_coded_buffer(GstVaapiBaseEncoder *encoder,
                                     guint8 *frame, guint32 frame_size, VABufferID *coded_buf);
 
 /* h264 bitstream functions */
@@ -192,35 +192,35 @@ static gboolean h264_read_sps_attributes(const guint8 *sps_data, guint32 sps_siz
                                     guint32 *profile_idc, guint32 *profile_comp, guint32 *level_idc);
 
 static void
-gst_h264_encoder_class_init(GstH264EncoderClass *klass)
+gst_vaapi_encoder_h264_class_init(GstVaapiEncoderH264Class *klass)
 {
   GObjectClass * const object_class = G_OBJECT_CLASS(klass);
   GstVaapiEncoderClass * const encoder_class = GST_VAAPI_ENCODER_CLASS(klass);
   GstVaapiBaseEncoderClass * const base_class = GST_VAAPI_BASE_ENCODER_CLASS(klass);
 
-  g_type_class_add_private(klass, sizeof(GstH264EncoderPrivate));
+  g_type_class_add_private(klass, sizeof(GstVaapiEncoderH264Private));
 
   GST_DEBUG_CATEGORY_INIT (gst_vaapi_h264_encoder_debug, "gst_va_h264_encoder", 0,
       "gst_va_h264_encoder element");
 
-  object_class->finalize = gst_h264_encoder_finalize;
+  object_class->finalize = gst_vaapi_encoder_h264_finalize;
 
   base_class->validate_attributes = gst_h264_validate_parameters;
-  base_class->pre_alloc_resource  = gst_h264_encoder_alloc_slices;
-  base_class->release_resource    = gst_h264_encoder_release_resource;
-  base_class->prepare_next_input_buffer = gst_h264_encoder_prepare_next_buffer;
-  base_class->render_frame = gst_h264_encoder_rendering;
+  base_class->pre_alloc_resource  = gst_vaapi_encoder_h264_alloc_slices;
+  base_class->release_resource    = gst_vaapi_encoder_h264_release_resource;
+  base_class->prepare_next_input_buffer = gst_vaapi_encoder_h264_prepare_next_buffer;
+  base_class->render_frame = gst_vaapi_encoder_h264_rendering;
   base_class->notify_frame = gst_h264_notify_frame;
-  base_class->copy_coded_frame = gst_h264_encoder_copy_coded_buffer;
-  base_class->encode_frame_failed = gst_h264_encoder_frame_failed;
+  base_class->copy_coded_frame = gst_vaapi_encoder_h264_copy_coded_buffer;
+  base_class->encode_frame_failed = gst_vaapi_encoder_h264_frame_failed;
 
-  encoder_class->flush = gst_h264_encoder_flush;
+  encoder_class->flush = gst_vaapi_encoder_h264_flush;
 
-  encoder_class->get_codec_data = gst_h264_encoder_get_codec_data;
+  encoder_class->get_codec_data = gst_vaapi_encoder_h264_get_codec_data;
 
   /*
-  object_class->set_property = gst_h264_encoder_set_property;
-  object_class->get_property = gst_h264_encoder_get_property;
+  object_class->set_property = gst_vaapi_encoder_h264_set_property;
+  object_class->get_property = gst_vaapi_encoder_h264_get_property;
   */
 }
 
@@ -244,14 +244,14 @@ h264_get_va_profile(guint32 profile)
 }
 
 static void
-gst_h264_encoder_init(GstH264Encoder *encoder)
+gst_vaapi_encoder_h264_init(GstVaapiEncoderH264 *encoder)
 {
-  GstH264EncoderPrivate *h264_prv = GST_H264_ENCODER_GET_PRIVATE(encoder);
+  GstVaapiEncoderH264Private *h264_prv = GST_VAAPI_ENCODER_H264_GET_PRIVATE(encoder);
   ENCODER_ASSERT(h264_prv);
   h264_prv->public = encoder;
 
   /* init public attributes */
-  gst_h264_encoder_init_public_values(encoder);
+  gst_vaapi_encoder_h264_init_public_values(encoder);
   gst_vaapi_base_encoder_set_frame_notify(GST_VAAPI_BASE_ENCODER(encoder), TRUE);
 
   /* init private values*/
@@ -286,11 +286,11 @@ gst_h264_encoder_init(GstH264Encoder *encoder)
 }
 
 static void
-gst_h264_encoder_finalize(GObject *object)
+gst_vaapi_encoder_h264_finalize(GObject *object)
 {
   /*free private buffers*/
   GstVaapiEncoder *encoder = GST_VAAPI_ENCODER(object);
-  GstH264EncoderPrivate *h264_prv = GST_H264_ENCODER_GET_PRIVATE(object);
+  GstVaapiEncoderH264Private *h264_prv = GST_VAAPI_ENCODER_H264_GET_PRIVATE(object);
 
   if (gst_vaapi_encoder_get_state(encoder) != VAAPI_ENC_NULL) {
     gst_vaapi_encoder_uninitialize(encoder);
@@ -315,18 +315,18 @@ gst_h264_encoder_finalize(GObject *object)
     h264_prv->queued_buffers = NULL;
   }
 
-  G_OBJECT_CLASS(gst_h264_encoder_parent_class)->finalize(object);
+  G_OBJECT_CLASS(gst_vaapi_encoder_h264_parent_class)->finalize(object);
 }
 
 
-GstH264Encoder *
-gst_h264_encoder_new(void)
+GstVaapiEncoderH264 *
+gst_vaapi_encoder_h264_new(void)
 {
-  return GST_H264_ENCODER(g_object_new(GST_TYPE_H264_ENCODER, NULL));
+  return GST_VAAPI_ENCODER_H264(g_object_new(GST_TYPE_VAAPI_ENCODER_H264, NULL));
 }
 
 static void
-gst_h264_encoder_init_public_values(GstH264Encoder* encoder)
+gst_vaapi_encoder_h264_init_public_values(GstVaapiEncoderH264* encoder)
 {
   encoder->profile = 0;
   encoder->level = 0;
@@ -339,24 +339,24 @@ gst_h264_encoder_init_public_values(GstH264Encoder* encoder)
 }
 
 void
-gst_h264_encoder_set_avc_flag(GstH264Encoder* encoder, gboolean avc)
+gst_vaapi_encoder_h264_set_avc_flag(GstVaapiEncoderH264* encoder, gboolean avc)
 {
-  GstH264EncoderPrivate *h264_prv = GST_H264_ENCODER_GET_PRIVATE(encoder);
+  GstVaapiEncoderH264Private *h264_prv = GST_VAAPI_ENCODER_H264_GET_PRIVATE(encoder);
   h264_prv->avc_flag = avc;
 }
 
 gboolean
-gst_h264_encoder_get_avc_flag(GstH264Encoder* encoder)
+gst_vaapi_encoder_h264_get_avc_flag(GstVaapiEncoderH264* encoder)
 {
-  GstH264EncoderPrivate *h264_prv = GST_H264_ENCODER_GET_PRIVATE(encoder);
+  GstVaapiEncoderH264Private *h264_prv = GST_VAAPI_ENCODER_H264_GET_PRIVATE(encoder);
   return h264_prv->avc_flag;
 }
 
 gboolean
 gst_h264_validate_parameters(GstVaapiBaseEncoder *base_encoder)
 {
-  GstH264Encoder *encoder = GST_H264_ENCODER(base_encoder);
-  GstH264EncoderPrivate *h264_prv = GST_H264_ENCODER_GET_PRIVATE(encoder);
+  GstVaapiEncoderH264 *encoder = GST_VAAPI_ENCODER_H264(base_encoder);
+  GstVaapiEncoderH264Private *h264_prv = GST_VAAPI_ENCODER_H264_GET_PRIVATE(encoder);
   if (!ENCODER_WIDTH(encoder) || !ENCODER_HEIGHT(encoder) || !ENCODER_FPS(encoder)) {
     return FALSE;
   }
@@ -423,10 +423,10 @@ gst_h264_validate_parameters(GstVaapiBaseEncoder *base_encoder)
 
 
 static gboolean
-h264_encoder_release_parameters(GstH264Encoder *h264_encoder, GstVaapiDisplay *display, GstVaapiContext *context)
+h264_encoder_release_parameters(GstVaapiEncoderH264 *h264_encoder, GstVaapiDisplay *display, GstVaapiContext *context)
 {
   VAStatus va_status = VA_STATUS_SUCCESS;
-  GstH264EncoderPrivate *h264_prv = GST_H264_ENCODER_GET_PRIVATE(h264_encoder);
+  GstVaapiEncoderH264Private *h264_prv = GST_VAAPI_ENCODER_H264_GET_PRIVATE(h264_encoder);
 
   gboolean is_locked = FALSE;
 
@@ -486,7 +486,7 @@ h264_encoder_release_parameters(GstH264Encoder *h264_encoder, GstVaapiDisplay *d
 }
 
 static void
-h264_release_queued_buffers(GstH264EncoderPrivate *h264_prv)
+h264_release_queued_buffers(GstVaapiEncoderH264Private *h264_prv)
 {
     while (!g_queue_is_empty(h264_prv->queued_buffers)) {
     GstBuffer* tmp = g_queue_pop_head(h264_prv->queued_buffers);
@@ -497,11 +497,11 @@ h264_release_queued_buffers(GstH264EncoderPrivate *h264_prv)
 
 
 static gboolean
-gst_h264_encoder_release_resource(GstVaapiBaseEncoder* encoder, GstVaapiDisplay *display, GstVaapiContext *context)
+gst_vaapi_encoder_h264_release_resource(GstVaapiBaseEncoder* encoder, GstVaapiDisplay *display, GstVaapiContext *context)
 {
-  GstH264Encoder* h264_encoder = GST_H264_ENCODER(encoder);
+  GstVaapiEncoderH264* h264_encoder = GST_VAAPI_ENCODER_H264(encoder);
   gboolean ret = TRUE;
-  GstH264EncoderPrivate *h264_prv = GST_H264_ENCODER_GET_PRIVATE(h264_encoder);
+  GstVaapiEncoderH264Private *h264_prv = GST_VAAPI_ENCODER_H264_GET_PRIVATE(h264_encoder);
 
   /* release buffers first */
   h264_encoder_release_parameters(h264_encoder, display, context);
@@ -546,11 +546,11 @@ gst_h264_encoder_release_resource(GstVaapiBaseEncoder* encoder, GstVaapiDisplay
 }
 
 static gboolean
-gst_h264_encoder_alloc_slices(GstVaapiBaseEncoder *encoder, GstVaapiDisplay *display, GstVaapiContext *context)
+gst_vaapi_encoder_h264_alloc_slices(GstVaapiBaseEncoder *encoder, GstVaapiDisplay *display, GstVaapiContext *context)
 {
   gboolean ret = TRUE;
-  GstH264Encoder *h264_encoder = GST_H264_ENCODER(encoder);
-  GstH264EncoderPrivate *h264_prv = GST_H264_ENCODER_GET_PRIVATE(encoder);
+  GstVaapiEncoderH264 *h264_encoder = GST_VAAPI_ENCODER_H264(encoder);
+  GstVaapiEncoderH264Private *h264_prv = GST_VAAPI_ENCODER_H264_GET_PRIVATE(encoder);
 
   h264_prv->slice_param_buffers =
 #ifdef _SIMPLE_LIB_VA_
@@ -565,10 +565,10 @@ gst_h264_encoder_alloc_slices(GstVaapiBaseEncoder *encoder, GstVaapiDisplay *dis
 }
 
 static void
-gst_h264_encoder_frame_failed(GstVaapiBaseEncoder *encoder, GstVaapiVideoBuffer* buffer)
+gst_vaapi_encoder_h264_frame_failed(GstVaapiBaseEncoder *encoder, GstVaapiVideoBuffer* buffer)
 {
-  GstH264Encoder *h264_encoder = GST_H264_ENCODER(encoder);
-  GstH264EncoderPrivate *h264_prv = GST_H264_ENCODER_GET_PRIVATE(h264_encoder);
+  GstVaapiEncoderH264 *h264_encoder = GST_VAAPI_ENCODER_H264(encoder);
+  GstVaapiEncoderH264Private *h264_prv = GST_VAAPI_ENCODER_H264_GET_PRIVATE(h264_encoder);
 
   h264_release_queued_buffers(h264_prv);
   h264_prv->cur_display_num = 0;
@@ -579,13 +579,13 @@ gst_h264_encoder_frame_failed(GstVaapiBaseEncoder *encoder, GstVaapiVideoBuffer*
 }
 
 static EncoderStatus
-gst_h264_encoder_prepare_next_buffer(GstVaapiBaseEncoder* encoder,
+gst_vaapi_encoder_h264_prepare_next_buffer(GstVaapiBaseEncoder* encoder,
                               GstVaapiVideoBuffer *display_buf, gboolean need_flush,
                               GstVaapiVideoBuffer **out_buf)
 {
   EncoderStatus ret = ENCODER_NO_ERROR;
-  GstH264Encoder *h264_encoder = GST_H264_ENCODER(encoder);
-  GstH264EncoderPrivate *h264_prv = GST_H264_ENCODER_GET_PRIVATE(h264_encoder);
+  GstVaapiEncoderH264 *h264_encoder = GST_VAAPI_ENCODER_H264(encoder);
+  GstVaapiEncoderH264Private *h264_prv = GST_VAAPI_ENCODER_H264_GET_PRIVATE(h264_encoder);
   GstVaapiVideoBuffer  *return_buf = NULL;
   //guint64 pts = 0;
 
@@ -668,14 +668,14 @@ end:
 
 #ifdef _SIMPLE_LIB_VA_
 static EncoderStatus
-gst_h264_encoder_rendering(GstVaapiBaseEncoder *encoder, GstVaapiDisplay *display,
+gst_vaapi_encoder_h264_rendering(GstVaapiBaseEncoder *encoder, GstVaapiDisplay *display,
                              GstVaapiContext *context, GstVaapiSurface *surface,
                              guint frame_index, VABufferID coded_buf, gboolean *is_key)
 {
   EncoderStatus ret = ENCODER_NO_ERROR;
   VAStatus va_status = VA_STATUS_SUCCESS;
-  GstH264Encoder *h264_encoder = GST_H264_ENCODER(encoder);
-  GstH264EncoderPrivate *h264_prv = GST_H264_ENCODER_GET_PRIVATE(h264_encoder);
+  GstVaapiEncoderH264 *h264_encoder = GST_VAAPI_ENCODER_H264(encoder);
+  GstVaapiEncoderH264Private *h264_prv = GST_VAAPI_ENCODER_H264_GET_PRIVATE(h264_encoder);
   VAEncPictureParameterBufferH264 pic_h264;
   VAEncSliceParameterBuffer *slice_h264 = NULL;
 
@@ -811,10 +811,10 @@ static void h264_swap_surface(GstVaapiSurface **s1, GstVaapiSurface **s2)
 }
 
 static gboolean
-h264_recreate_seq_param(GstH264Encoder *h264_encoder,
+h264_recreate_seq_param(GstVaapiEncoderH264 *h264_encoder,
                         VADisplay va_dpy, VAContextID context_id)
 {
-  GstH264EncoderPrivate *h264_prv = GST_H264_ENCODER_GET_PRIVATE(h264_encoder);
+  GstVaapiEncoderH264Private *h264_prv = GST_VAAPI_ENCODER_H264_GET_PRIVATE(h264_encoder);
   VAEncSequenceParameterBufferH264 seq_h264 = { 0 };
   guint width_in_mbs, height_in_mbs;
   gboolean ret = TRUE;
@@ -932,11 +932,11 @@ end:
 }
 
 static gboolean
-h264_recreate_pic_param(GstH264Encoder *h264_encoder,
+h264_recreate_pic_param(GstVaapiEncoderH264 *h264_encoder,
                         VADisplay va_dpy, VAContextID context_id,
                         VABufferID coded_buf)
 {
-  GstH264EncoderPrivate *h264_prv = GST_H264_ENCODER_GET_PRIVATE(h264_encoder);
+  GstVaapiEncoderH264Private *h264_prv = GST_VAAPI_ENCODER_H264_GET_PRIVATE(h264_encoder);
   VAEncPictureParameterBufferH264 pic_h264;
   gboolean ret = TRUE;
   VAStatus va_status = VA_STATUS_SUCCESS;
@@ -1038,10 +1038,10 @@ end:
 
 
 static gboolean
-h264_recreate_slice_param(GstH264Encoder *h264_encoder,
+h264_recreate_slice_param(GstVaapiEncoderH264 *h264_encoder,
                         VADisplay va_dpy, VAContextID context_id)
 {
-  GstH264EncoderPrivate *h264_prv = GST_H264_ENCODER_GET_PRIVATE(h264_encoder);
+  GstVaapiEncoderH264Private *h264_prv = GST_VAAPI_ENCODER_H264_GET_PRIVATE(h264_encoder);
   VAEncSliceParameterBufferH264 *slice_h264 = NULL;
   guint width_in_mbs;
   gboolean ret = TRUE;
@@ -1102,14 +1102,14 @@ end:
 }
 
 static EncoderStatus
-gst_h264_encoder_rendering(GstVaapiBaseEncoder *encoder, GstVaapiDisplay *display,
+gst_vaapi_encoder_h264_rendering(GstVaapiBaseEncoder *encoder, GstVaapiDisplay *display,
                              GstVaapiContext *context, GstVaapiSurface *surface,
                              guint frame_index, VABufferID coded_buf, gboolean *is_key)
 {
   EncoderStatus ret = ENCODER_NO_ERROR;
   VAStatus va_status = VA_STATUS_SUCCESS;
-  GstH264Encoder *h264_encoder = GST_H264_ENCODER(encoder);
-  GstH264EncoderPrivate *h264_prv = GST_H264_ENCODER_GET_PRIVATE(h264_encoder);
+  GstVaapiEncoderH264 *h264_encoder = GST_VAAPI_ENCODER_H264(encoder);
+  GstVaapiEncoderH264Private *h264_prv = GST_VAAPI_ENCODER_H264_GET_PRIVATE(h264_encoder);
   VABufferID va_buffers[64];
   guint32    va_buffers_count = 0;
   gboolean is_params_ok = TRUE;
@@ -1204,12 +1204,12 @@ gst_h264_encoder_rendering(GstVaapiBaseEncoder *encoder, GstVaapiDisplay *displa
 #endif
 
 static GstBuffer *
-gst_h264_encoder_copy_coded_buffer(GstVaapiBaseEncoder *encoder,
+gst_vaapi_encoder_h264_copy_coded_buffer(GstVaapiBaseEncoder *encoder,
                                         guint8 *frame,
                                         guint32 frame_size,
                                         VABufferID *coded_buf)
 {
-  GstH264EncoderPrivate *h264_prv = GST_H264_ENCODER_GET_PRIVATE(encoder);
+  GstVaapiEncoderH264Private *h264_prv = GST_VAAPI_ENCODER_H264_GET_PRIVATE(encoder);
   GstBuffer *ret_buffer;
   guint32   nal_size;
   const guint8   *nal_start;
@@ -1251,7 +1251,7 @@ gst_h264_encoder_copy_coded_buffer(GstVaapiBaseEncoder *encoder,
 }
 
 static EncoderStatus
-h264_encoder_read_sps_pps(GstH264EncoderPrivate *h264_prv, const guint8 *buf, guint32 size)
+h264_encoder_read_sps_pps(GstVaapiEncoderH264Private *h264_prv, const guint8 *buf, guint32 size)
 {
   const guint8 *end = buf + size;
   const guint8 *nal_start = buf;
@@ -1298,7 +1298,7 @@ h264_encoder_read_sps_pps(GstH264EncoderPrivate *h264_prv, const guint8 *buf, gu
 static void
 gst_h264_notify_frame(GstVaapiBaseEncoder *encoder, guint8 *buf, guint32 size)
 {
-  GstH264EncoderPrivate *h264_prv = GST_H264_ENCODER_GET_PRIVATE(encoder);
+  GstVaapiEncoderH264Private *h264_prv = GST_VAAPI_ENCODER_H264_GET_PRIVATE(encoder);
   if (!h264_prv->sps_data || !h264_prv->pps_data) {
     h264_encoder_read_sps_pps(h264_prv, buf, size);
   }
@@ -1326,12 +1326,12 @@ h264_read_sps_attributes(const guint8 *sps_data, guint32 sps_size,
 
 
 static EncoderStatus
-gst_h264_encoder_flush(GstVaapiEncoder* encoder, GstVaapiDisplay *display,
+gst_vaapi_encoder_h264_flush(GstVaapiEncoder* encoder, GstVaapiDisplay *display,
                        GstVaapiContext *context, GList **coded_pics)
 {
-  GstH264Encoder* h264_encoder = GST_H264_ENCODER(encoder);
+  GstVaapiEncoderH264* h264_encoder = GST_VAAPI_ENCODER_H264(encoder);
   EncoderStatus ret = ENCODER_NO_ERROR;
-  GstH264EncoderPrivate *h264_prv = GST_H264_ENCODER_GET_PRIVATE(h264_encoder);
+  GstVaapiEncoderH264Private *h264_prv = GST_VAAPI_ENCODER_H264_GET_PRIVATE(h264_encoder);
 
   //h264_prv->frame_count = 0;
   h264_prv->cur_display_num = 0;
@@ -1370,7 +1370,7 @@ int main_test(int argc, char* argv[])
   if (!g_thread_supported ())
     g_thread_init (NULL);
 
-  GstH264Encoder *h264_encoder = gst_h264_encoder_new();
+  GstVaapiEncoderH264 *h264_encoder = gst_vaapi_encoder_h264_new();
   encoder = GST_VAAPI_ENCODER(h264_encoder);
   ENCODER_ASSERT(encoder);
 
@@ -1446,9 +1446,9 @@ int main_test(int argc, char* argv[])
 }
 
 EncoderStatus
-gst_h264_encoder_get_avcC_codec_data(GstH264Encoder *h264_encoder, GstBuffer **buffer)
+gst_vaapi_encoder_h264_get_avcC_codec_data(GstVaapiEncoderH264 *h264_encoder, GstBuffer **buffer)
 {
-  GstH264EncoderPrivate *h264_prv = GST_H264_ENCODER_GET_PRIVATE(h264_encoder);
+  GstVaapiEncoderH264Private *h264_prv = GST_VAAPI_ENCODER_H264_GET_PRIVATE(h264_encoder);
   GstBuffer *avc_codec;
   const guint32 configuration_version = 0x01;
   const guint32 length_size_minus_one = 0x03;
@@ -1505,22 +1505,22 @@ gst_h264_encoder_get_avcC_codec_data(GstH264Encoder *h264_encoder, GstBuffer **b
 }
 
 static EncoderStatus
-gst_h264_encoder_get_codec_data(GstVaapiEncoder* encoder, GstBuffer **buffer)
+gst_vaapi_encoder_h264_get_codec_data(GstVaapiEncoder* encoder, GstBuffer **buffer)
 {
-  GstH264Encoder *h264_encoder = GST_H264_ENCODER(encoder);
-  GstH264EncoderPrivate *h264_prv = GST_H264_ENCODER_GET_PRIVATE(h264_encoder);
+  GstVaapiEncoderH264 *h264_encoder = GST_VAAPI_ENCODER_H264(encoder);
+  GstVaapiEncoderH264Private *h264_prv = GST_VAAPI_ENCODER_H264_GET_PRIVATE(h264_encoder);
 
   if (h264_prv->avc_flag)
-    return gst_h264_encoder_get_avcC_codec_data(h264_encoder, buffer);
+    return gst_vaapi_encoder_h264_get_avcC_codec_data(h264_encoder, buffer);
   return ENCODER_NO_DATA;
 }
 
 #if 0
 EncoderStatus
-gst_h264_encoder_get_nal_codec_data(GstVaapiEncoder *encoder, GstBuffer **buffer)
+gst_vaapi_encoder_h264_get_nal_codec_data(GstVaapiEncoder *encoder, GstBuffer **buffer)
 {
-  GstH264Encoder *h264_encoder = GST_H264_ENCODER(encoder);
-  GstH264EncoderPrivate *h264_prv = GST_H264_ENCODER_GET_PRIVATE(h264_encoder);
+  GstVaapiEncoderH264 *h264_encoder = GST_VAAPI_ENCODER_H264(encoder);
+  GstVaapiEncoderH264Private *h264_prv = GST_VAAPI_ENCODER_H264_GET_PRIVATE(h264_encoder);
   GstBuffer *nal_sps_pps;
 
   ENCODER_ASSERT(buffer);
similarity index 64%
rename from gst/vaapiencode/gstvaapih264encoder.h
rename to gst-libs/gst/vaapi/gstvaapiencoder_h264.h
index c67b297..c3ed163 100644 (file)
@@ -1,5 +1,5 @@
 /*
- *  gstvaapih264encoder.h -  H.264 encoder
+ *  gstvaapiencoder_h264.h -  H.264 encoder
  *
  *  Copyright (C) 2011 Intel Corporation
  *
@@ -19,8 +19,8 @@
  *  Boston, MA 02110-1301 USA
  */
 
-#ifndef _GST_H264_ENCODER_H_
-#define _GST_H264_ENCODER_H_
+#ifndef _GST_VAAPI_ENCODER_H264_H_
+#define _GST_VAAPI_ENCODER_H264_H_
 
 
 #include "gst/vaapi/gstvaapisurfacepool.h"
 
 G_BEGIN_DECLS
 
-typedef struct _GstH264Encoder              GstH264Encoder;
-typedef struct _GstH264EncoderPrivate       GstH264EncoderPrivate;
-typedef struct _GstH264EncoderClass         GstH264EncoderClass;
+typedef struct _GstVaapiEncoderH264              GstVaapiEncoderH264;
+typedef struct _GstVaapiEncoderH264Private       GstVaapiEncoderH264Private;
+typedef struct _GstVaapiEncoderH264Class         GstVaapiEncoderH264Class;
 
 
-#define GST_TYPE_H264_ENCODER             (gst_h264_encoder_get_type())
-#define GST_IS_H264_ENCODER(obj)          (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_H264_ENCODER))
-#define GST_IS_H264_ENCODER_CLASS(klass)  (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_H264_ENCODER))
-#define GST_H264_ENCODER_GET_CLASS(obj)   (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_H264_ENCODER, GstH264EncoderClass))
-#define GST_H264_ENCODER(obj)             (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_H264_ENCODER, GstH264Encoder))
-#define GST_H264_ENCODER_CLASS(klass)     (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_H264_ENCODER, GstH264EncoderClass))
-#define GST_H264_ENCODER_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE((obj),GST_TYPE_H264_ENCODER,GstH264EncoderPrivate))
+#define GST_TYPE_VAAPI_ENCODER_H264             (gst_vaapi_encoder_h264_get_type())
+#define GST_IS_VAAPI_ENCODER_H264(obj)          (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_VAAPI_ENCODER_H264))
+#define GST_IS_VAAPI_ENCODER_H264_CLASS(klass)  (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_VAAPI_ENCODER_H264))
+#define GST_VAAPI_ENCODER_H264_GET_CLASS(obj)   (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_VAAPI_ENCODER_H264, GstVaapiEncoderH264Class))
+#define GST_VAAPI_ENCODER_H264(obj)             (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_VAAPI_ENCODER_H264, GstVaapiEncoderH264))
+#define GST_VAAPI_ENCODER_H264_CLASS(klass)     (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_VAAPI_ENCODER_H264, GstVaapiEncoderH264Class))
+#define GST_VAAPI_ENCODER_H264_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE((obj),GST_TYPE_VAAPI_ENCODER_H264,GstVaapiEncoderH264Private))
 
 typedef enum {
   H264_PROFILE_BASELINE = 66,
@@ -79,7 +79,7 @@ typedef enum {
 #define H264_DEFAULT_FPS          30
 #define H264_DEFAULT_SLICE_NUM    1
 
-struct _GstH264Encoder {
+struct _GstVaapiEncoderH264 {
   GstVaapiBaseEncoder parent;   /*based on gobject*/
 
   guint32         profile;
@@ -92,25 +92,25 @@ struct _GstH264Encoder {
   guint32         b_frame_num;
 };
 
-struct _GstH264EncoderClass {
+struct _GstVaapiEncoderH264Class {
     GstVaapiBaseEncoderClass parent_class;
 };
 
 
-GType    gst_h264_encoder_get_type(void);
+GType    gst_vaapi_encoder_h264_get_type(void);
 
-GstH264Encoder *gst_h264_encoder_new(void);
-static inline void gst_h264_encoder_unref (GstH264Encoder * encoder)
+GstVaapiEncoderH264 *gst_vaapi_encoder_h264_new(void);
+static inline void gst_vaapi_encoder_h264_unref (GstVaapiEncoderH264 * encoder)
 {
   g_object_unref (encoder);
 }
 
-void     gst_h264_encoder_set_avc_flag(GstH264Encoder* encoder, gboolean avc);
-gboolean gst_h264_encoder_get_avc_flag(GstH264Encoder* encoder);
+void     gst_vaapi_encoder_h264_set_avc_flag(GstVaapiEncoderH264* encoder, gboolean avc);
+gboolean gst_vaapi_encoder_h264_get_avc_flag(GstVaapiEncoderH264* encoder);
 
 
 
 G_END_DECLS
 
-#endif /*_GST_H264_ENCODER_H_ */
+#endif /*_GST_VAAPI_ENCODER_H264_H_ */
 
similarity index 84%
rename from gst/vaapiencode/gstvaapimpeg4encoder.c
rename to gst-libs/gst/vaapi/gstvaapiencoder_mpeg4.c
index 9d1994f..192fc90 100644 (file)
@@ -1,5 +1,5 @@
 /*
- *  gstvaapimpeg4encoder.c - MPEG-4 encoder
+ *  gstvaapiencoder_mpeg4.c - MPEG-4 encoder
  *
  *  Copyright (C) 2011 Intel Corporation
  *
@@ -19,7 +19,7 @@
  *  Boston, MA 02110-1301 USA
  */
 
-#include "gstvaapimpeg4encoder.h"
+#include "gstvaapiencoder_mpeg4.h"
 
 #include <string.h>
 #include "gst/gstclock.h"
@@ -35,7 +35,7 @@ GST_DEBUG_CATEGORY_STATIC (gst_vaapi_mpeg4_encoder_debug);
 #define GST_CAT_DEFAULT gst_vaapi_mpeg4_encoder_debug
 
 
-struct _GstMPEG4EncoderPrivate {
+struct _GstVaapiEncoderMpeg4Private {
   GstVaapiSurface  *ref_surface;  /* reference buffer*/
   GstVaapiSurface  *recon_surface; /* reconstruct buffer*/
 
@@ -46,73 +46,73 @@ struct _GstMPEG4EncoderPrivate {
   GstBuffer        *codec_data;
 };
 
-G_DEFINE_TYPE(GstMPEG4Encoder, gst_mpeg4_encoder, GST_TYPE_VAAPI_BASE_ENCODER);
+G_DEFINE_TYPE(GstVaapiEncoderMpeg4, gst_vaapi_encoder_mpeg4, GST_TYPE_VAAPI_BASE_ENCODER);
 
 /*
-static EncoderStatus gst_mpeg4_encoder_flush(GstVaapiEncoder* encoder,
+static EncoderStatus gst_vaapi_encoder_mpeg4_flush(GstVaapiEncoder* encoder,
                          GstVaapiDisplay *display, GstVaapiContext *context,
                          GList **coded_pics);
 */
-static EncoderStatus gst_mpeg4_encoder_get_codec_data(
+static EncoderStatus gst_vaapi_encoder_mpeg4_get_codec_data(
                          GstVaapiEncoder *encoder, GstBuffer **buffer);
 static gboolean      gst_mpeg4_validate_parameters(GstVaapiBaseEncoder *encoder);
-static gboolean      gst_mpeg4_encoder_release_resource(
+static gboolean      gst_vaapi_encoder_mpeg4_release_resource(
                          GstVaapiBaseEncoder* encoder, GstVaapiDisplay *display,
                          GstVaapiContext *context);
 static void          gst_mpeg4_notify_frame(GstVaapiBaseEncoder *encoder,
                          guint8 *buf, guint32 size);
 
-static EncoderStatus gst_mpeg4_encoder_rendering(GstVaapiBaseEncoder *encoder,
+static EncoderStatus gst_vaapi_encoder_mpeg4_rendering(GstVaapiBaseEncoder *encoder,
                        GstVaapiDisplay *display, GstVaapiContext *context,
                        GstVaapiSurface *surface, guint frame_index,
                        VABufferID coded_buf, gboolean *is_key);
 
 
-static void          gst_mpeg4_encoder_class_init(GstMPEG4EncoderClass *klass);
-static void          gst_mpeg4_encoder_init(GstMPEG4Encoder *encoder);
-static void          gst_mpeg4_encoder_finalize(GObject *object);
+static void          gst_vaapi_encoder_mpeg4_class_init(GstVaapiEncoderMpeg4Class *klass);
+static void          gst_vaapi_encoder_mpeg4_init(GstVaapiEncoderMpeg4 *encoder);
+static void          gst_vaapi_encoder_mpeg4_finalize(GObject *object);
 
 static gboolean      mpeg4_encoder_generate_codec_data(const guint8 *in_buffer,
                                           guint32 in_size, GstBuffer **out_buffer);
 
-GstMPEG4Encoder *
-gst_mpeg4_encoder_new(void)
+GstVaapiEncoderMpeg4 *
+gst_vaapi_encoder_mpeg4_new(void)
 {
-  return GST_MPEG4_ENCODER(g_object_new(GST_TYPE_MPEG4_ENCODER, NULL));
+  return GST_VAAPI_ENCODER_MPEG4(g_object_new(GST_TYPE_VAAPI_ENCODER_MPEG4, NULL));
 }
 
 
 static void
-gst_mpeg4_encoder_class_init(GstMPEG4EncoderClass *klass)
+gst_vaapi_encoder_mpeg4_class_init(GstVaapiEncoderMpeg4Class *klass)
 {
   GObjectClass * const object_class = G_OBJECT_CLASS(klass);
   GstVaapiEncoderClass * const encoder_class = GST_VAAPI_ENCODER_CLASS(klass);
   GstVaapiBaseEncoderClass * const base_class = GST_VAAPI_BASE_ENCODER_CLASS(klass);
 
-  g_type_class_add_private(klass, sizeof(GstMPEG4EncoderPrivate));
+  g_type_class_add_private(klass, sizeof(GstVaapiEncoderMpeg4Private));
 
   GST_DEBUG_CATEGORY_INIT (gst_vaapi_mpeg4_encoder_debug, "gst_va_mpeg4_encoder", 0,
       "gst_va_mpeg4_encoder element");
 
-  object_class->finalize = gst_mpeg4_encoder_finalize;
+  object_class->finalize = gst_vaapi_encoder_mpeg4_finalize;
 
   base_class->validate_attributes = gst_mpeg4_validate_parameters;
   base_class->pre_alloc_resource  = NULL;
-  base_class->release_resource    = gst_mpeg4_encoder_release_resource;
-  base_class->render_frame = gst_mpeg4_encoder_rendering;
+  base_class->release_resource    = gst_vaapi_encoder_mpeg4_release_resource;
+  base_class->render_frame = gst_vaapi_encoder_mpeg4_rendering;
   base_class->notify_frame = gst_mpeg4_notify_frame;
   base_class->copy_coded_frame = NULL;
 
   /*
-  encoder_class->flush = gst_mpeg4_encoder_flush;
+  encoder_class->flush = gst_vaapi_encoder_mpeg4_flush;
   */
-  encoder_class->get_codec_data = gst_mpeg4_encoder_get_codec_data;
+  encoder_class->get_codec_data = gst_vaapi_encoder_mpeg4_get_codec_data;
 }
 
 static void
-gst_mpeg4_encoder_init(GstMPEG4Encoder *mpeg4_encoder)
+gst_vaapi_encoder_mpeg4_init(GstVaapiEncoderMpeg4 *mpeg4_encoder)
 {
-  GstMPEG4EncoderPrivate *mpeg4_prv = GST_MPEG4_ENCODER_GET_PRIVATE(mpeg4_encoder);
+  GstVaapiEncoderMpeg4Private *mpeg4_prv = GST_VAAPI_ENCODER_MPEG4_GET_PRIVATE(mpeg4_encoder);
   ENCODER_ASSERT(mpeg4_prv);
 
   /* init public */
@@ -135,7 +135,7 @@ gst_mpeg4_encoder_init(GstMPEG4Encoder *mpeg4_encoder)
 }
 
 static void
-gst_mpeg4_encoder_finalize(GObject *object)
+gst_vaapi_encoder_mpeg4_finalize(GObject *object)
 {
   /*free private buffers*/
   GstVaapiEncoder *encoder = GST_VAAPI_ENCODER(object);
@@ -143,13 +143,13 @@ gst_mpeg4_encoder_finalize(GObject *object)
   if (gst_vaapi_encoder_get_state(encoder) != VAAPI_ENC_NULL) {
     gst_vaapi_encoder_uninitialize(encoder);
   }
-  G_OBJECT_CLASS(gst_mpeg4_encoder_parent_class)->finalize(object);
+  G_OBJECT_CLASS(gst_vaapi_encoder_mpeg4_parent_class)->finalize(object);
 }
 
 gboolean
 gst_mpeg4_validate_parameters(GstVaapiBaseEncoder *encoder)
 {
-  GstMPEG4Encoder *mpeg4_encoder = GST_MPEG4_ENCODER(encoder);
+  GstVaapiEncoderMpeg4 *mpeg4_encoder = GST_VAAPI_ENCODER_MPEG4(encoder);
   if (!ENCODER_WIDTH(mpeg4_encoder) || !ENCODER_HEIGHT(mpeg4_encoder) || !ENCODER_FPS(mpeg4_encoder)) {
     return FALSE;
   }
@@ -177,9 +177,9 @@ gst_mpeg4_validate_parameters(GstVaapiBaseEncoder *encoder)
 }
 
 static void
-mpeg4_release_parameters(GstMPEG4Encoder *mpeg4_encoder, GstVaapiDisplay *display)
+mpeg4_release_parameters(GstVaapiEncoderMpeg4 *mpeg4_encoder, GstVaapiDisplay *display)
 {
-  GstMPEG4EncoderPrivate *mpeg4_prv = GST_MPEG4_ENCODER_GET_PRIVATE(mpeg4_encoder);
+  GstVaapiEncoderMpeg4Private *mpeg4_prv = GST_VAAPI_ENCODER_MPEG4_GET_PRIVATE(mpeg4_encoder);
   VADisplay va_dpy = gst_vaapi_display_get_display(display);
   VAStatus va_status = VA_STATUS_SUCCESS;
 
@@ -200,12 +200,12 @@ mpeg4_release_parameters(GstMPEG4Encoder *mpeg4_encoder, GstVaapiDisplay *displa
 }
 
 static gboolean
-gst_mpeg4_encoder_release_resource(GstVaapiBaseEncoder* encoder,
+gst_vaapi_encoder_mpeg4_release_resource(GstVaapiBaseEncoder* encoder,
                        GstVaapiDisplay *display,
                        GstVaapiContext *context)
 {
-  GstMPEG4Encoder *mpeg4_encoder = GST_MPEG4_ENCODER(encoder);
-  GstMPEG4EncoderPrivate *mpeg4_prv = GST_MPEG4_ENCODER_GET_PRIVATE(mpeg4_encoder);
+  GstVaapiEncoderMpeg4 *mpeg4_encoder = GST_VAAPI_ENCODER_MPEG4(encoder);
+  GstVaapiEncoderMpeg4Private *mpeg4_prv = GST_VAAPI_ENCODER_MPEG4_GET_PRIVATE(mpeg4_encoder);
 
   mpeg4_release_parameters(mpeg4_encoder, display);
 
@@ -253,12 +253,12 @@ mpeg4_get_profile_level_indication(guint32 profile)
 
 
 static EncoderStatus
-gst_mpeg4_encoder_rendering(GstVaapiBaseEncoder *encoder, GstVaapiDisplay *display,
+gst_vaapi_encoder_mpeg4_rendering(GstVaapiBaseEncoder *encoder, GstVaapiDisplay *display,
                        GstVaapiContext *context, GstVaapiSurface *surface,
                        guint frame_index, VABufferID coded_buf, gboolean *is_key)
 {
-  GstMPEG4Encoder *mpeg4_encoder = GST_MPEG4_ENCODER(encoder);
-  GstMPEG4EncoderPrivate *mpeg4_prv = GST_MPEG4_ENCODER_GET_PRIVATE(mpeg4_encoder);
+  GstVaapiEncoderMpeg4 *mpeg4_encoder = GST_VAAPI_ENCODER_MPEG4(encoder);
+  GstVaapiEncoderMpeg4Private *mpeg4_prv = GST_VAAPI_ENCODER_MPEG4_GET_PRIVATE(mpeg4_encoder);
   VADisplay va_dpy = gst_vaapi_display_get_display(display);
   VAContextID context_id = GST_VAAPI_OBJECT_ID(context);
 
@@ -377,7 +377,7 @@ end:
 
 #if 0
 static GstBuffer *
-gst_mpeg4_encoder_copy_coded_buffer(GstVaapiBaseEncoder *encoder,
+gst_vaapi_encoder_mpeg4_copy_coded_buffer(GstVaapiBaseEncoder *encoder,
             guint8 *frame, guint32 frame_size, VABufferID *coded_buf)
 
 {
@@ -386,7 +386,7 @@ gst_mpeg4_encoder_copy_coded_buffer(GstVaapiBaseEncoder *encoder,
   memcpy(GST_BUFFER_DATA(buffer), frame, frame_size);
 
   #if 0
-  GstMPEG4Encoder *mpeg4_encoder = GST_MPEG4_ENCODER(encoder);
+  GstVaapiEncoderMpeg4 *mpeg4_encoder = GST_VAAPI_ENCODER_MPEG4(encoder);
   if (mpeg4_encoder->profile == VAProfileMPEG4AdvancedSimple) {
     guint8 *start_code = GST_BUFFER_DATA(buffer)+16; /*fix old issue of ASP in mrst platform*/
     if (start_code[0] == 0x01 && start_code[1] == 0x20
@@ -404,7 +404,7 @@ gst_mpeg4_encoder_copy_coded_buffer(GstVaapiBaseEncoder *encoder,
 static void
 gst_mpeg4_notify_frame(GstVaapiBaseEncoder *encoder, guint8 *buf, guint32 size)
 {
-  GstMPEG4EncoderPrivate *mpeg4_prv = GST_MPEG4_ENCODER_GET_PRIVATE(encoder);
+  GstVaapiEncoderMpeg4Private *mpeg4_prv = GST_VAAPI_ENCODER_MPEG4_GET_PRIVATE(encoder);
   if (!mpeg4_prv->codec_data) {
     if (!mpeg4_encoder_generate_codec_data(buf, size, &mpeg4_prv->codec_data)) {
       ENCODER_LOG_ERROR("mpeg4 encoder coded data error, please check <mpeg4_encoder_generate_codec_data>.");
@@ -417,10 +417,10 @@ gst_mpeg4_notify_frame(GstVaapiBaseEncoder *encoder, guint8 *buf, guint32 size)
 
 
 static EncoderStatus
-gst_mpeg4_encoder_flush(GstVaapiEncoder* encoder, GstVaapiDisplay *display,
+gst_vaapi_encoder_mpeg4_flush(GstVaapiEncoder* encoder, GstVaapiDisplay *display,
                        GstVaapiContext *context, GList **coded_pics)
 {
-  GstMPEG4Encoder *mpeg4_encoder = GST_MPEG4_ENCODER(encoder);
+  GstVaapiEncoderMpeg4 *mpeg4_encoder = GST_VAAPI_ENCODER_MPEG4(encoder);
 
   mpeg4_release_parameters(mpeg4_encoder, display);
   return ENCODER_NO_ERROR;
@@ -428,9 +428,9 @@ gst_mpeg4_encoder_flush(GstVaapiEncoder* encoder, GstVaapiDisplay *display,
 
 
 static EncoderStatus
-gst_mpeg4_encoder_get_codec_data(GstVaapiEncoder *encoder, GstBuffer **buffer)
+gst_vaapi_encoder_mpeg4_get_codec_data(GstVaapiEncoder *encoder, GstBuffer **buffer)
 {
-  GstMPEG4EncoderPrivate *mpeg4_prv = GST_MPEG4_ENCODER_GET_PRIVATE(encoder);
+  GstVaapiEncoderMpeg4Private *mpeg4_prv = GST_VAAPI_ENCODER_MPEG4_GET_PRIVATE(encoder);
 
   if (!mpeg4_prv->codec_data)
     return ENCODER_DATA_NOT_READY;
similarity index 50%
rename from gst/vaapiencode/gstvaapimpeg4encoder.h
rename to gst-libs/gst/vaapi/gstvaapiencoder_mpeg4.h
index f2fe828..c265646 100644 (file)
@@ -1,5 +1,5 @@
 /*
- *  gstvaapimpeg4encoder.h - MPEG-4 encoder
+ *  gstvaapiencoder_mpeg4.h - MPEG-4 encoder
  *
  *  Copyright (C) 2011 Intel Corporation
  *
@@ -19,8 +19,8 @@
  *  Boston, MA 02110-1301 USA
  */
 
-#ifndef _GST_VAAPI_MPEG4_ENCODER_H_
-#define _GST_VAAPI_MPEG4_ENCODER_H_
+#ifndef _GST_VAAPI_ENCODER_MPEG4_H_
+#define _GST_VAAPI__ENCODER_MPEG4_H_
 
 
 #include "gst/vaapi/gstvaapisurfacepool.h"
@@ -38,20 +38,20 @@ G_BEGIN_DECLS
 #define MPEG4_DEFAULT_FIXED_VOP_RATE FALSE
 
 
-typedef struct _GstMPEG4Encoder              GstMPEG4Encoder;
-typedef struct _GstMPEG4EncoderPrivate       GstMPEG4EncoderPrivate;
-typedef struct _GstMPEG4EncoderClass         GstMPEG4EncoderClass;
+typedef struct _GstVaapiEncoderMpeg4              GstVaapiEncoderMpeg4;
+typedef struct _GstVaapiEncoderMpeg4Private       GstVaapiEncoderMpeg4Private;
+typedef struct _GstVaapiEncoderMpeg4Class         GstVaapiEncoderMpeg4Class;
 
 
-#define GST_TYPE_MPEG4_ENCODER             (gst_mpeg4_encoder_get_type())
-#define GST_IS_MPEG4_ENCODER(obj)          (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_MPEG4_ENCODER))
-#define GST_IS_MPEG4_ENCODER_CLASS(klass)  (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_MPEG4_ENCODER))
-#define GST_MPEG4_ENCODER_GET_CLASS(obj)   (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_MPEG4_ENCODER, GstMPEG4EncoderClass))
-#define GST_MPEG4_ENCODER(obj)             (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_MPEG4_ENCODER, GstMPEG4Encoder))
-#define GST_MPEG4_ENCODER_CLASS(klass)     (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_MPEG4_ENCODER, GstMPEG4EncoderClass))
-#define GST_MPEG4_ENCODER_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE((obj),GST_TYPE_MPEG4_ENCODER,GstMPEG4EncoderPrivate))
+#define GST_TYPE_VAAPI_ENCODER_MPEG4             (gst_vaapi_encoder_mpeg4_get_type())
+#define GST_IS_VAAPI_ENCODER_MPEG4(obj)          (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_VAAPI_ENCODER_MPEG4))
+#define GST_IS_VAAPI_ENCODER_MPEG4_CLASS(klass)  (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_VAAPI_ENCODER_MPEG4))
+#define GST_VAAPI_ENCODER_MPEG4_GET_CLASS(obj)   (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_VAAPI_ENCODER_MPEG4, GstVaapiEncoderMpeg4Class))
+#define GST_VAAPI_ENCODER_MPEG4(obj)             (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_VAAPI_ENCODER_MPEG4, GstVaapiEncoderMpeg4))
+#define GST_VAAPI_ENCODER_MPEG4_CLASS(klass)     (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_VAAPI_ENCODER_MPEG4, GstVaapiEncoderMpeg4Class))
+#define GST_VAAPI_ENCODER_MPEG4_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE((obj),GST_TYPE_VAAPI_ENCODER_MPEG4,GstVaapiEncoderMpeg4Private))
 
-struct _GstMPEG4Encoder {
+struct _GstVaapiEncoderMpeg4 {
   GstVaapiBaseEncoder parent;   /*based on gobject*/
   VAProfile profile;  /* VAProfileMPEG4Simple, VAProfileMPEG4AdvancedSimple */
   guint32   bitrate;
@@ -60,15 +60,15 @@ struct _GstMPEG4Encoder {
   guint32   min_qp;   /*default 1, 1~31*/
 };
 
-struct _GstMPEG4EncoderClass {
+struct _GstVaapiEncoderMpeg4Class {
     GstVaapiBaseEncoderClass parent_class;
 };
 
 
-GType    gst_mpeg4_encoder_get_type(void);
+GType    gst_vaapi_encoder_mpeg4_get_type(void);
 
-GstMPEG4Encoder *gst_mpeg4_encoder_new(void);
-static inline void gst_mpeg4_encoder_unref (GstMPEG4Encoder * encoder)
+GstVaapiEncoderMpeg4 *gst_vaapi_encoder_mpeg4_new(void);
+static inline void gst_vaapi_encoder_mpeg4_unref (GstVaapiEncoderMpeg4 * encoder)
 {
   g_object_unref (encoder);
 }
@@ -76,5 +76,5 @@ static inline void gst_mpeg4_encoder_unref (GstMPEG4Encoder * encoder)
 
 G_END_DECLS
 
-#endif /* _GST_VAAPI_MPEG4_ENCODER_H_ */
+#endif /* _GST_VAAPI_ENCODER_MPEG4_H_ */
 
index 309c5d6..37d365d 100644 (file)
@@ -1,4 +1,4 @@
-SUBDIRS = vaapi vaapiencode
+SUBDIRS = vaapi
 
 # Extra clean files so that maintainer-clean removes *everything*
 MAINTAINERCLEANFILES = Makefile.in
index 0c1097c..ebe46bb 100644 (file)
@@ -50,6 +50,22 @@ noinst_HEADERS =             \
        gstvaapiupload.h        \
        $(NULL)
 
+if USE_ENCODERS
+libgstvaapi_la_SOURCES +=    \
+    gstvaapiencode.c    \
+    gstvaapiencode_h264.c \
+    gstvaapiencode_h263.c \
+    gstvaapiencode_mpeg4.c \
+       $(NULL)
+
+noinst_HEADERS +=        \
+    gstvaapiencode.h    \
+    gstvaapiencode_h264.h \
+    gstvaapiencode_h263.h \
+    gstvaapiencode_mpeg4.h \
+       $(NULL)
+endif
+
 libgstvaapi_la_CFLAGS =        \
        $(libgstvaapi_CFLAGS)   \
        $(GST_CFLAGS)           \
index 5a6462f..01c82f1 100644 (file)
 #include "gstvaapipostproc.h"
 #include "gstvaapisink.h"
 
+#if USE_ENCODERS
+#include "gstvaapiencode.h"
+#include "gstvaapiencode_h264.h"
+#include "gstvaapiencode_h263.h"
+#include "gstvaapiencode_mpeg4.h"
+
+/*  encoder plugin register*/
+static gboolean
+vaapi_encoder_plugins_init (GstPlugin * plugin)
+{
+  gboolean ret = TRUE;
+
+  ret &= gst_element_register (plugin, "vaapiencodeh264", GST_RANK_PRIMARY,
+      GST_TYPE_VAAPI_ENCODE_H264);
+  ret &= gst_element_register (plugin, "vaapiencodeh263", GST_RANK_PRIMARY,
+      GST_TYPE_VAAPI_ENCODE_H263);
+  ret &= gst_element_register (plugin, "vaapiencodempeg4", GST_RANK_PRIMARY,
+      GST_TYPE_VAAPI_ENCODE_MPEG4);
+  return ret;
+}
+#endif
+
 static gboolean
 plugin_init (GstPlugin *plugin)
 {
@@ -47,6 +69,9 @@ plugin_init (GstPlugin *plugin)
     gst_element_register(plugin, "vaapisink",
                          GST_RANK_PRIMARY,
                          GST_TYPE_VAAPISINK);
+#if USE_ENCODERS
+    return vaapi_encoder_plugins_init(plugin);
+#endif
     return TRUE;
 }
 
similarity index 94%
rename from gst/vaapiencode/gstvaapiencode.c
rename to gst/vaapi/gstvaapiencode.c
index 8968097..8eb15bb 100644 (file)
 
 #include "gst/vaapi/gstvaapivideobuffer.h"
 #include "gst/vaapi/gstvaapisurfacepool.h"
-
-#include "gstvaapih264encode.h"
-#include "gstvaapih263encode.h"
-#include "gstvaapimpeg4encode.h"
-#include "gstvaapibaseencoder.h"
-#include "gstvaapipluginutil.h"
+#include "gst/vaapi/gstvaapiencode_h264.h"
+#include "gst/vaapi/gstvaapiencode_h263.h"
+#include "gst/vaapi/gstvaapiencode_mpeg4.h"
+#include "gst/vaapi/gstvaapibaseencoder.h"
+#include "gst/vaapi/gstvaapipluginutil.h"
 
 #if USE_VAAPI_GLX
 #include <gst/vaapi/gstvaapivideobuffer_glx.h>
@@ -294,7 +293,7 @@ gst_vaapi_encode_set_caps(GstPad *sink_pad, GstCaps *caps)
     encode->encoder->frame_rate = fps_n/fps_d;
   }
   format_value = gst_structure_get_value (structure, "format");
-  if (format_value && GST_IS_H264ENCODE(encode)) {
+  if (format_value && GST_IS_VAAPI_ENCODE_H264(encode)) {
     ENCODER_CHECK_STATUS(format_value && GST_TYPE_FOURCC == G_VALUE_TYPE(format_value),
                          FALSE, "1st buffer caps' format type is not fourcc.");
     format = gst_value_get_fourcc (format_value);
@@ -505,31 +504,3 @@ _encode_dump_caps(GstCaps *cpas)
   return caps_string;
 }
 
-/* plugin register*/
-static gboolean
-vaapi_encode_sets_init (GstPlugin * plugin)
-{
-  gboolean ret = TRUE;
-
-  ret &= gst_element_register (plugin, "vah264encode", GST_RANK_PRIMARY,
-      GST_TYPE_H264ENCODE);
-  ret &= gst_element_register (plugin, "vah263encode", GST_RANK_PRIMARY,
-      GST_TYPE_H263ENCODE);
-  ret &= gst_element_register (plugin, "vampeg4encode", GST_RANK_PRIMARY,
-      GST_TYPE_MPEG4ENCODE);
-  return ret;
-}
-
-/* gstreamer looks for this structure to register mrstcamsrc */
-GST_PLUGIN_DEFINE (
-    GST_VERSION_MAJOR,
-    GST_VERSION_MINOR,
-    "vaapiencode",
-    "Vaapi Encoder",
-    vaapi_encode_sets_init,
-    VERSION,
-    "LGPL",
-    "gstreamer-vaapi",
-    "http://gstreamer.net/")
-
-
similarity index 98%
rename from gst/vaapiencode/gstvaapiencode.h
rename to gst/vaapi/gstvaapiencode.h
index 42e13d6..247218c 100644 (file)
@@ -23,7 +23,7 @@
 #define GST_VAAPI_ENCODE_H
 
 #include <gst/gst.h>
-#include "gstvaapiencoder.h"
+#include "gst/vaapi/gstvaapiencoder.h"
 
 G_BEGIN_DECLS
 
similarity index 73%
rename from gst/vaapiencode/gstvaapih263encode.c
rename to gst/vaapi/gstvaapiencode_h263.c
index cfe15e1..a5423cd 100644 (file)
@@ -1,5 +1,5 @@
 /*
- *  gstvaapih263encode.c - VA-API H.263 encoder
+ *  gstvaapiencode_h263.c - VA-API H.263 encoder
  *
  *  Copyright (C) 2011 Intel Corporation
  *
  *  Boston, MA 02110-1301 USA
  */
 
-#include "gstvaapih263encode.h"
-#include "gstvaapih263encoder.h"
+#include "gstvaapiencode_h263.h"
+#include "gst/vaapi/gstvaapiencoder_h263.h"
 
 GST_DEBUG_CATEGORY_STATIC (gst_vaapi_h263_encode_debug);
 #define GST_CAT_DEFAULT gst_vaapi_h263_encode_debug
 
 #define GST_VAAPI_ENCODE_GET_PRIVATE(obj)  (G_TYPE_INSTANCE_GET_PRIVATE ((obj), GST_TYPE_VAAPI_ENCODE, GstVaapiEncodePrivate))
 
-static const char gst_h263encode_sink_caps_str[] =
+static const char gst_vaapi_encode_h263_sink_caps_str[] =
     GST_VAAPI_SURFACE_CAPS;
 
-static const GstElementDetails gst_h263encode_details =
+static const GstElementDetails gst_vaapi_encode_h263_details =
     GST_ELEMENT_DETAILS(
       "VA-API h263 encoder",
       "Codec/Encoder/Video",
@@ -38,32 +38,32 @@ static const GstElementDetails gst_h263encode_details =
       "Feng Yuan <feng.yuan@intel.com>");
 
 
-static const char gst_h263encode_src_caps_str[] =
+static const char gst_vaapi_encode_h263_src_caps_str[] =
     GST_CAPS_CODEC("video/x-h263");
 
-static GstStaticPadTemplate gst_h263encode_sink_factory =
+static GstStaticPadTemplate gst_vaapi_encode_h263_sink_factory =
     GST_STATIC_PAD_TEMPLATE(
         "sink",
         GST_PAD_SINK,
         GST_PAD_ALWAYS,
-        GST_STATIC_CAPS(gst_h263encode_sink_caps_str));
+        GST_STATIC_CAPS(gst_vaapi_encode_h263_sink_caps_str));
 
-static GstStaticPadTemplate gst_h263encode_src_factory =
+static GstStaticPadTemplate gst_vaapi_encode_h263_src_factory =
     GST_STATIC_PAD_TEMPLATE(
         "src",
         GST_PAD_SRC,
         GST_PAD_ALWAYS,
-        GST_STATIC_CAPS(gst_h263encode_src_caps_str));
+        GST_STATIC_CAPS(gst_vaapi_encode_h263_src_caps_str));
 
-static void gst_h263encode_set_property(GObject *object, guint prop_id,
+static void gst_vaapi_encode_h263_set_property(GObject *object, guint prop_id,
     const GValue *value, GParamSpec *pspec);
-static void gst_h263encode_get_property (GObject * object, guint prop_id,
+static void gst_vaapi_encode_h263_get_property (GObject * object, guint prop_id,
     GValue * value, GParamSpec * pspec);
 
 /* h263 encode */
 GST_BOILERPLATE(
-    GstH263Encode,
-    gst_h263encode,
+    GstVaapiEncodeH263,
+    gst_vaapi_encode_h263,
     GstVaapiEncode,
     GST_TYPE_VAAPI_ENCODE);
 
@@ -77,27 +77,27 @@ enum {
 
 
 static void
-gst_h263encode_base_init(gpointer klass)
+gst_vaapi_encode_h263_base_init(gpointer klass)
 {
   GstElementClass * const element_class = GST_ELEMENT_CLASS(klass);
 
-  gst_element_class_set_details(element_class, &gst_h263encode_details);
+  gst_element_class_set_details(element_class, &gst_vaapi_encode_h263_details);
 
   /* sink pad */
   gst_element_class_add_pad_template(
       element_class,
-      gst_static_pad_template_get(&gst_h263encode_sink_factory)
+      gst_static_pad_template_get(&gst_vaapi_encode_h263_sink_factory)
   );
 
   /* src pad */
   gst_element_class_add_pad_template(
       element_class,
-      gst_static_pad_template_get(&gst_h263encode_src_factory)
+      gst_static_pad_template_get(&gst_vaapi_encode_h263_src_factory)
   );
 }
 
 static void
-gst_h263encode_class_init(GstH263EncodeClass *klass)
+gst_vaapi_encode_h263_class_init(GstVaapiEncodeH263Class *klass)
 {
   GObjectClass * const object_class = G_OBJECT_CLASS(klass);
 
@@ -107,9 +107,9 @@ gst_h263encode_class_init(GstH263EncodeClass *klass)
   GST_DEBUG_CATEGORY_INIT (gst_vaapi_h263_encode_debug, "vaapih263encode", 0,
       "vaapih263encode element");
 
-  /* object_class->finalize      = gst_h263encode_finalize; */
-  object_class->set_property  = gst_h263encode_set_property;
-  object_class->get_property  = gst_h263encode_get_property;
+  /* object_class->finalize      = gst_vaapi_encode_h263_finalize; */
+  object_class->set_property  = gst_vaapi_encode_h263_set_property;
+  object_class->get_property  = gst_vaapi_encode_h263_get_property;
 
   g_object_class_install_property (object_class, H263_PROP_BITRATE,
         g_param_spec_uint ("bitrate",
@@ -147,19 +147,19 @@ gst_h263encode_class_init(GstH263EncodeClass *klass)
 }
 
 static void
-gst_h263encode_init(GstH263Encode *h263_encode, GstH263EncodeClass *klass)
+gst_vaapi_encode_h263_init(GstVaapiEncodeH263 *h263_encode, GstVaapiEncodeH263Class *klass)
 {
   GstVaapiEncode *encode = GST_VAAPI_ENCODE(h263_encode);
-  encode->encoder = GST_VAAPI_ENCODER(gst_h263_encoder_new());
+  encode->encoder = GST_VAAPI_ENCODER(gst_vaapi_encoder_h263_new());
   ENCODER_ASSERT(encode->encoder);
 }
 
 static void
-gst_h263encode_set_property(GObject *object, guint prop_id,
+gst_vaapi_encode_h263_set_property(GObject *object, guint prop_id,
     const GValue *value, GParamSpec *pspec)
 {
   GstVaapiEncode *encode = GST_VAAPI_ENCODE(object);
-  GstH263Encoder *h263encoder = GST_H263_ENCODER(encode->encoder);
+  GstVaapiEncoderH263 *h263encoder = GST_VAAPI_ENCODER_H263(encode->encoder);
 
   ENCODER_ASSERT(h263encoder);
 
@@ -191,11 +191,11 @@ gst_h263encode_set_property(GObject *object, guint prop_id,
 }
 
 static void
-gst_h263encode_get_property (GObject * object, guint prop_id,
+gst_vaapi_encode_h263_get_property (GObject * object, guint prop_id,
     GValue * value, GParamSpec * pspec)
 {
   GstVaapiEncode *encode = GST_VAAPI_ENCODE(object);
-  GstH263Encoder *h263encoder = GST_H263_ENCODER(encode->encoder);
+  GstVaapiEncoderH263 *h263encoder = GST_VAAPI_ENCODER_H263(encode->encoder);
   ENCODER_ASSERT(h263encoder);
 
   switch (prop_id) {
similarity index 51%
rename from gst/vaapiencode/gstvaapih263encode.h
rename to gst/vaapi/gstvaapiencode_h263.h
index 2babce5..13dd136 100644 (file)
@@ -1,5 +1,5 @@
 /*
- *  gstvaapih263encode.h - VA-API H.263 encoder
+ *  gstvaapiencode_h263.h - VA-API H.263 encoder
  *
  *  Copyright (C) 2011 Intel Corporation
  *
 
 G_BEGIN_DECLS
 
-#define GST_TYPE_H263ENCODE             (gst_h263encode_get_type())
-#define GST_IS_H263ENCODE(obj)          (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_H263ENCODE))
-#define GST_IS_H263ENCODE_CLASS(klass)  (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_H263ENCODE))
-#define GST_H263ENCODE_GET_CLASS(obj)   (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_H263ENCODE, GstH263EncodeClass))
-#define GST_H263ENCODE(obj)             (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_H263ENCODE, GstH263Encode))
-#define GST_H263ENCODE_CLASS(klass)     (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_H263ENCODE, GstH263EncodeClass))
+#define GST_TYPE_VAAPI_ENCODE_H263             (gst_vaapi_encode_h263_get_type())
+#define GST_IS_VAAPI_ENCODE_H263(obj)          (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_VAAPI_ENCODE_H263))
+#define GST_IS_VAAPI_ENCODE_H263_CLASS(klass)  (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_VAAPI_ENCODE_H263))
+#define GST_VAAPI_ENCODE_H263_GET_CLASS(obj)   (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_VAAPI_ENCODE_H263, GstVaapiEncodeH263Class))
+#define GST_VAAPI_ENCODE_H263(obj)             (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_VAAPI_ENCODE_H263, GstVaapiEncodeH263))
+#define GST_VAAPI_ENCODE_H263_CLASS(klass)     (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_VAAPI_ENCODE_H263, GstVaapiEncodeH263Class))
 
 
-typedef struct _GstH263Encode        GstH263Encode;
-typedef struct _GstH263EncodeClass   GstH263EncodeClass;
+typedef struct _GstVaapiEncodeH263        GstVaapiEncodeH263;
+typedef struct _GstVaapiEncodeH263Class   GstVaapiEncodeH263Class;
 
-struct _GstH263Encode {
+struct _GstVaapiEncodeH263 {
   GstVaapiEncode parent;
 };
 
-struct _GstH263EncodeClass {
+struct _GstVaapiEncodeH263Class {
     GstVaapiEncodeClass     parent_class;
 };
 
-GType gst_h263encode_get_type(void);
+GType gst_vaapi_encode_h263_get_type(void);
 
 
 G_END_DECLS
similarity index 79%
rename from gst/vaapiencode/gstvaapih264encode.c
rename to gst/vaapi/gstvaapiencode_h264.c
index 6d8b7bb..7e8ef11 100644 (file)
@@ -1,5 +1,5 @@
 /*
- *  gstvaapih264encode.c - VA-API H.264 encoder
+ *  gstvaapiencode_h264.c - VA-API H.264 encoder
  *
  *  Copyright (C) 2011 Intel Corporation
  *
  *  Boston, MA 02110-1301 USA
  */
 
-#include "gstvaapih264encode.h"
-#include "gstvaapih264encoder.h"
+#include "gstvaapiencode_h264.h"
+#include "gst/vaapi/gstvaapiencoder_h264.h"
 
 #include <string.h>
 
 GST_DEBUG_CATEGORY_STATIC (gst_vaapi_h264_encode_debug);
 #define GST_CAT_DEFAULT gst_vaapi_h264_encode_debug
 
-static const char gst_h264encode_sink_caps_str[] =
+static const char gst_vaapi_encode_h264_sink_caps_str[] =
     GST_CAPS_CODEC("video/x-raw-yuv, " "format = (fourcc) { I420 } ")
     GST_CAPS_CODEC("video/x-raw-yuv, " "format = (fourcc) { NV12 } ")
     GST_VAAPI_SURFACE_CAPS;
 
-static const GstElementDetails gst_h264encode_details =
+static const GstElementDetails gst_vaapi_encode_h264_details =
     GST_ELEMENT_DETAILS(
         "VA-API h264 encoder",
         "Codec/Encoder/Video",
@@ -40,37 +40,37 @@ static const GstElementDetails gst_h264encode_details =
         "Feng Yuan<feng.yuan@intel.com>");
 
 
-static const char gst_h264encode_src_caps_str[] =
+static const char gst_vaapi_encode_h264_src_caps_str[] =
     GST_CAPS_CODEC("video/x-h264");
 
-static GstStaticPadTemplate gst_h264encode_sink_factory =
+static GstStaticPadTemplate gst_vaapi_encode_h264_sink_factory =
     GST_STATIC_PAD_TEMPLATE(
         "sink",
         GST_PAD_SINK,
         GST_PAD_ALWAYS,
-        GST_STATIC_CAPS(gst_h264encode_sink_caps_str));
+        GST_STATIC_CAPS(gst_vaapi_encode_h264_sink_caps_str));
 
-static GstStaticPadTemplate gst_h264encode_src_factory =
+static GstStaticPadTemplate gst_vaapi_encode_h264_src_factory =
     GST_STATIC_PAD_TEMPLATE(
         "src",
         GST_PAD_SRC,
         GST_PAD_ALWAYS,
-        GST_STATIC_CAPS(gst_h264encode_src_caps_str));
+        GST_STATIC_CAPS(gst_vaapi_encode_h264_src_caps_str));
 
-static void gst_h264encode_finalize(GObject *object);
-static void gst_h264encode_set_property(GObject *object, guint prop_id,
+static void gst_vaapi_encode_h264_finalize(GObject *object);
+static void gst_vaapi_encode_h264_set_property(GObject *object, guint prop_id,
     const GValue *value, GParamSpec *pspec);
-static void gst_h264encode_get_property (GObject * object, guint prop_id,
+static void gst_vaapi_encode_h264_get_property (GObject * object, guint prop_id,
     GValue * value, GParamSpec * pspec);
 static gboolean _h264_check_valid_profile(guint profile);
 static gboolean _h264_check_valid_level(guint level);
-static gboolean  gst_h264encode_set_src_caps(GstVaapiEncode* encode, GstCaps *caps);
+static gboolean  gst_vaapi_encode_h264_set_src_caps(GstVaapiEncode* encode, GstCaps *caps);
 
 
 /* h264 encode */
 GST_BOILERPLATE(
-    GstH264Encode,
-    gst_h264encode,
+    GstVaapiEncodeH264,
+    gst_vaapi_encode_h264,
     GstVaapiEncode,
     GST_TYPE_VAAPI_ENCODE);
 
@@ -88,27 +88,27 @@ enum {
 
 
 static void
-gst_h264encode_base_init(gpointer klass)
+gst_vaapi_encode_h264_base_init(gpointer klass)
 {
   GstElementClass * const element_class = GST_ELEMENT_CLASS(klass);
 
-  gst_element_class_set_details(element_class, &gst_h264encode_details);
+  gst_element_class_set_details(element_class, &gst_vaapi_encode_h264_details);
 
   /* sink pad */
   gst_element_class_add_pad_template(
       element_class,
-      gst_static_pad_template_get(&gst_h264encode_sink_factory)
+      gst_static_pad_template_get(&gst_vaapi_encode_h264_sink_factory)
   );
 
   /* src pad */
   gst_element_class_add_pad_template(
       element_class,
-      gst_static_pad_template_get(&gst_h264encode_src_factory)
+      gst_static_pad_template_get(&gst_vaapi_encode_h264_src_factory)
   );
 }
 
 static void
-gst_h264encode_class_init(GstH264EncodeClass *klass)
+gst_vaapi_encode_h264_class_init(GstVaapiEncodeH264Class *klass)
 {
   GObjectClass * const object_class = G_OBJECT_CLASS(klass);
   GstVaapiEncodeClass *const encode_class = GST_VAAPI_ENCODE_CLASS(klass);
@@ -118,11 +118,11 @@ gst_h264encode_class_init(GstH264EncodeClass *klass)
   GST_DEBUG_CATEGORY_INIT (gst_vaapi_h264_encode_debug, "vaapih264encode", 0,
       "vaapih264encode element");
 
-  object_class->finalize      = gst_h264encode_finalize;
-  object_class->set_property  = gst_h264encode_set_property;
-  object_class->get_property  = gst_h264encode_get_property;
+  object_class->finalize      = gst_vaapi_encode_h264_finalize;
+  object_class->set_property  = gst_vaapi_encode_h264_set_property;
+  object_class->get_property  = gst_vaapi_encode_h264_get_property;
 
-  encode_class->set_encoder_src_caps = gst_h264encode_set_src_caps;
+  encode_class->set_encoder_src_caps = gst_vaapi_encode_h264_set_src_caps;
 
   g_object_class_install_property (object_class, H264_PROP_PROFILE,
           g_param_spec_uint ("profile",
@@ -192,26 +192,26 @@ gst_h264encode_class_init(GstH264EncodeClass *klass)
 }
 
 static void
-gst_h264encode_init(GstH264Encode *h264_encode, GstH264EncodeClass *klass)
+gst_vaapi_encode_h264_init(GstVaapiEncodeH264 *h264_encode, GstVaapiEncodeH264Class *klass)
 {
   GstVaapiEncode *encode = GST_VAAPI_ENCODE(h264_encode);
-  encode->encoder = GST_VAAPI_ENCODER(gst_h264_encoder_new());
+  encode->encoder = GST_VAAPI_ENCODER(gst_vaapi_encoder_h264_new());
   ENCODER_ASSERT(encode->encoder);
 }
 
 static void
-gst_h264encode_finalize(GObject *object)
+gst_vaapi_encode_h264_finalize(GObject *object)
 {
-  //GstH264Encode * const h264_encode = GST_H264ENCODE(object);
+  //GstVaapiEncodeH264 * const h264_encode = GST_VAAPI_ENCODE_H264(object);
   G_OBJECT_CLASS(parent_class)->finalize(object);
 }
 
 static void
-gst_h264encode_set_property(GObject *object, guint prop_id,
+gst_vaapi_encode_h264_set_property(GObject *object, guint prop_id,
     const GValue *value, GParamSpec *pspec)
 {
   GstVaapiEncode *encode = GST_VAAPI_ENCODE(object);
-  GstH264Encoder *h264encoder = GST_H264_ENCODER(encode->encoder);
+  GstVaapiEncoderH264 *h264encoder = GST_VAAPI_ENCODER_H264(encode->encoder);
 
   ENCODER_ASSERT(h264encoder);
 
@@ -273,11 +273,11 @@ gst_h264encode_set_property(GObject *object, guint prop_id,
 }
 
 static void
-gst_h264encode_get_property (GObject * object, guint prop_id,
+gst_vaapi_encode_h264_get_property (GObject * object, guint prop_id,
     GValue * value, GParamSpec * pspec)
 {
   GstVaapiEncode *encode = GST_VAAPI_ENCODE(object);
-  GstH264Encoder *h264encoder = GST_H264_ENCODER(encode->encoder);
+  GstVaapiEncoderH264 *h264encoder = GST_VAAPI_ENCODER_H264(encode->encoder);
   ENCODER_ASSERT(h264encoder);
 
   switch (prop_id) {
@@ -369,9 +369,9 @@ _h264_check_valid_level(guint level)
 
 
 static gboolean
-gst_h264encode_set_src_caps(GstVaapiEncode* encode, GstCaps *caps)
+gst_vaapi_encode_h264_set_src_caps(GstVaapiEncode* encode, GstCaps *caps)
 {
-  GstH264Encoder *h264encoder = GST_H264_ENCODER(encode->encoder);
+  GstVaapiEncoderH264 *h264encoder = GST_VAAPI_ENCODER_H264(encode->encoder);
   GstCaps *peer_caps, *allowed_caps;
   GstStructure *s;
   const gchar *stream_format;
@@ -387,9 +387,9 @@ gst_h264encode_set_src_caps(GstVaapiEncode* encode, GstCaps *caps)
       stream_format = gst_structure_get_string (s, "stream-format");
       if (stream_format) {
         if (!strcmp (stream_format, "avc")) {
-            gst_h264_encoder_set_avc_flag(h264encoder, TRUE);
+            gst_vaapi_encoder_h264_set_avc_flag(h264encoder, TRUE);
         } else if (!strcmp (stream_format, "byte-stream")) {
-            gst_h264_encoder_set_avc_flag(h264encoder, FALSE);
+            gst_vaapi_encoder_h264_set_avc_flag(h264encoder, FALSE);
         }
       }
       gst_caps_unref(allowed_caps);
@@ -398,7 +398,7 @@ gst_h264encode_set_src_caps(GstVaapiEncode* encode, GstCaps *caps)
   }
   gst_caps_set_simple(caps, "stream-format",
                             G_TYPE_STRING,
-                            (gst_h264_encoder_get_avc_flag(h264encoder) ? "avc" : "byte-stream"),
+                            (gst_vaapi_encoder_h264_get_avc_flag(h264encoder) ? "avc" : "byte-stream"),
                             "alignment", G_TYPE_STRING, "au",
                             NULL);
   return TRUE;
similarity index 51%
rename from gst/vaapiencode/gstvaapih264encode.h
rename to gst/vaapi/gstvaapiencode_h264.h
index efe317c..3783cb1 100644 (file)
@@ -1,5 +1,5 @@
 /*
- *  gstvaapih264encode.h - VA-API H.264 encoder
+ *  gstvaapiencode_h264.h - VA-API H.264 encoder
  *
  *  Copyright (C) 2011 Intel Corporation
  *
 
 G_BEGIN_DECLS
 
-#define GST_TYPE_H264ENCODE             (gst_h264encode_get_type())
-#define GST_IS_H264ENCODE(obj)          (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_H264ENCODE))
-#define GST_IS_H264ENCODE_CLASS(klass)  (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_H264ENCODE))
-#define GST_H264ENCODE_GET_CLASS(obj)   (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_H264ENCODE, GstH264EncodeClass))
-#define GST_H264ENCODE(obj)             (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_H264ENCODE, GstH264Encode))
-#define GST_H264ENCODE_CLASS(klass)     (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_H264ENCODE, GstH264EncodeClass))
+#define GST_TYPE_VAAPI_ENCODE_H264             (gst_vaapi_encode_h264_get_type())
+#define GST_IS_VAAPI_ENCODE_H264(obj)          (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_VAAPI_ENCODE_H264))
+#define GST_IS_VAAPI_ENCODE_H264_CLASS(klass)  (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_VAAPI_ENCODE_H264))
+#define GST_VAAPI_ENCODE_H264_GET_CLASS(obj)   (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_VAAPI_ENCODE_H264, GstVaapiEncodeH264Class))
+#define GST_VAAPI_ENCODE_H264(obj)             (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_VAAPI_ENCODE_H264, GstVaapiEncodeH264))
+#define GST_VAAPI_ENCODE_H264_CLASS(klass)     (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_VAAPI_ENCODE_H264, GstVaapiEncodeH264Class))
 
 
-typedef struct _GstH264Encode        GstH264Encode;
-typedef struct _GstH264EncodeClass   GstH264EncodeClass;
+typedef struct _GstVaapiEncodeH264        GstVaapiEncodeH264;
+typedef struct _GstVaapiEncodeH264Class   GstVaapiEncodeH264Class;
 
-struct _GstH264Encode {
+struct _GstVaapiEncodeH264 {
   GstVaapiEncode parent;
 };
 
-struct _GstH264EncodeClass {
+struct _GstVaapiEncodeH264Class {
     GstVaapiEncodeClass     parent_class;
 };
 
-GType gst_h264encode_get_type(void);
+GType gst_vaapi_encode_h264_get_type(void);
 
 
 G_END_DECLS
similarity index 70%
rename from gst/vaapiencode/gstvaapimpeg4encode.c
rename to gst/vaapi/gstvaapiencode_mpeg4.c
index 3debbb5..f1afd9e 100644 (file)
@@ -1,5 +1,5 @@
 /*
- *  gstvaapimpeg4encode.c - VA-API MPEG-4 encoder
+ *  gstvaapiencode_mpeg4.c - VA-API MPEG-4 encoder
  *
  *  Copyright (C) 2011 Intel Corporation
  *
  *  Boston, MA 02110-1301 USA
  */
 
-#include "gstvaapimpeg4encode.h"
-#include "gstvaapimpeg4encoder.h"
+#include "gstvaapiencode_mpeg4.h"
+#include "gst/vaapi/gstvaapiencoder_mpeg4.h"
 
-GST_DEBUG_CATEGORY_STATIC (gst_vaapi_mpeg4_encode_debug);
-#define GST_CAT_DEFAULT gst_vaapi_mpeg4_encode_debug
+GST_DEBUG_CATEGORY_STATIC (gst_vaapi_encode_mpeg4_debug);
+#define GST_CAT_DEFAULT gst_vaapi_encode_mpeg4_debug
 
 
-static const char gst_mpeg4encode_sink_caps_str[] =
+static const char gst_vaapi_encode_mpeg4_sink_caps_str[] =
     GST_VAAPI_SURFACE_CAPS;
 
-static const GstElementDetails gst_mpeg4encode_details =
+static const GstElementDetails gst_vaapi_encode_mpeg4_details =
     GST_ELEMENT_DETAILS(
         "VA-API mpeg4 encoder",
         "Codec/Encoder/Video",
@@ -37,34 +37,34 @@ static const GstElementDetails gst_mpeg4encode_details =
         "Feng Yuan<feng.yuan@intel.com>");
 
 
-static const char gst_mpeg4encode_src_caps_str[] =
+static const char gst_vaapi_encode_mpeg4_src_caps_str[] =
     GST_CAPS_CODEC("video/mpeg, mpegversion=4");
 
-static GstStaticPadTemplate gst_mpeg4encode_sink_factory =
+static GstStaticPadTemplate gst_vaapi_encode_mpeg4_sink_factory =
     GST_STATIC_PAD_TEMPLATE(
         "sink",
         GST_PAD_SINK,
         GST_PAD_ALWAYS,
-        GST_STATIC_CAPS(gst_mpeg4encode_sink_caps_str));
+        GST_STATIC_CAPS(gst_vaapi_encode_mpeg4_sink_caps_str));
 
-static GstStaticPadTemplate gst_mpeg4encode_src_factory =
+static GstStaticPadTemplate gst_vaapi_encode_mpeg4_src_factory =
     GST_STATIC_PAD_TEMPLATE(
         "src",
         GST_PAD_SRC,
         GST_PAD_ALWAYS,
-        GST_STATIC_CAPS(gst_mpeg4encode_src_caps_str));
+        GST_STATIC_CAPS(gst_vaapi_encode_mpeg4_src_caps_str));
 
-static void gst_mpeg4encode_finalize(GObject *object);
-static void gst_mpeg4encode_set_property(GObject *object, guint prop_id,
+static void gst_vaapi_encode_mpeg4_finalize(GObject *object);
+static void gst_vaapi_encode_mpeg4_set_property(GObject *object, guint prop_id,
     const GValue *value, GParamSpec *pspec);
-static void gst_mpeg4encode_get_property (GObject * object, guint prop_id,
+static void gst_vaapi_encode_mpeg4_get_property (GObject * object, guint prop_id,
     GValue * value, GParamSpec * pspec);
 
 
 /* mpeg4 encode */
 GST_BOILERPLATE(
-    GstMPEG4Encode,
-    gst_mpeg4encode,
+    GstVaapiEncodeMpeg4,
+    gst_vaapi_encode_mpeg4,
     GstVaapiEncode,
     GST_TYPE_VAAPI_ENCODE);
 
@@ -79,36 +79,36 @@ enum {
 
 
 static void
-gst_mpeg4encode_base_init(gpointer klass)
+gst_vaapi_encode_mpeg4_base_init(gpointer klass)
 {
   GstElementClass * const element_class = GST_ELEMENT_CLASS(klass);
 
-  gst_element_class_set_details(element_class, &gst_mpeg4encode_details);
+  gst_element_class_set_details(element_class, &gst_vaapi_encode_mpeg4_details);
 
   /* sink pad */
   gst_element_class_add_pad_template(
       element_class,
-      gst_static_pad_template_get(&gst_mpeg4encode_sink_factory)
+      gst_static_pad_template_get(&gst_vaapi_encode_mpeg4_sink_factory)
   );
 
   /* src pad */
   gst_element_class_add_pad_template(
       element_class,
-      gst_static_pad_template_get(&gst_mpeg4encode_src_factory)
+      gst_static_pad_template_get(&gst_vaapi_encode_mpeg4_src_factory)
   );
 }
 
 static void
-gst_mpeg4encode_class_init(GstMPEG4EncodeClass *klass)
+gst_vaapi_encode_mpeg4_class_init(GstVaapiEncodeMpeg4Class *klass)
 {
   GObjectClass * const object_class = G_OBJECT_CLASS(klass);
 
-  GST_DEBUG_CATEGORY_INIT (gst_vaapi_mpeg4_encode_debug, "vaapimpeg4encode", 0,
+  GST_DEBUG_CATEGORY_INIT (gst_vaapi_encode_mpeg4_debug, "vaapimpeg4encode", 0,
       "vaapimpeg4encode element");
 
-  object_class->finalize      = gst_mpeg4encode_finalize;
-  object_class->set_property  = gst_mpeg4encode_set_property;
-  object_class->get_property  = gst_mpeg4encode_get_property;
+  object_class->finalize      = gst_vaapi_encode_mpeg4_finalize;
+  object_class->set_property  = gst_vaapi_encode_mpeg4_set_property;
+  object_class->get_property  = gst_vaapi_encode_mpeg4_get_property;
 
 
   g_object_class_install_property (object_class, MPEG4_PROP_PROFILE,
@@ -155,26 +155,26 @@ gst_mpeg4encode_class_init(GstMPEG4EncodeClass *klass)
 }
 
 static void
-gst_mpeg4encode_init(GstMPEG4Encode *mpeg4_encode, GstMPEG4EncodeClass *klass)
+gst_vaapi_encode_mpeg4_init(GstVaapiEncodeMpeg4 *mpeg4_encode, GstVaapiEncodeMpeg4Class *klass)
 {
   GstVaapiEncode *encode = GST_VAAPI_ENCODE(mpeg4_encode);
-  encode->encoder = GST_VAAPI_ENCODER(gst_mpeg4_encoder_new());
+  encode->encoder = GST_VAAPI_ENCODER(gst_vaapi_encoder_mpeg4_new());
   ENCODER_ASSERT(encode->encoder);
 }
 
 static void
-gst_mpeg4encode_finalize(GObject *object)
+gst_vaapi_encode_mpeg4_finalize(GObject *object)
 {
-  //GstMPEG4Encode * const mpeg4_encode = GST_MPEG4ENCODE(object);
+  //GstVaapiEncodeMpeg4 * const mpeg4_encode = GST_VAAPI_ENCODE_MPEG4(object);
   G_OBJECT_CLASS(parent_class)->finalize(object);
 }
 
 static void
-gst_mpeg4encode_set_property(GObject *object, guint prop_id,
+gst_vaapi_encode_mpeg4_set_property(GObject *object, guint prop_id,
     const GValue *value, GParamSpec *pspec)
 {
   GstVaapiEncode *encode = GST_VAAPI_ENCODE(object);
-  GstMPEG4Encoder *mpeg4encoder = GST_MPEG4_ENCODER(encode->encoder);
+  GstVaapiEncoderMpeg4 *mpeg4encoder = GST_VAAPI_ENCODER_MPEG4(encode->encoder);
 
   ENCODER_ASSERT(mpeg4encoder);
 
@@ -211,11 +211,11 @@ gst_mpeg4encode_set_property(GObject *object, guint prop_id,
 }
 
 static void
-gst_mpeg4encode_get_property (GObject * object, guint prop_id,
+gst_vaapi_encode_mpeg4_get_property (GObject * object, guint prop_id,
     GValue * value, GParamSpec * pspec)
 {
   GstVaapiEncode *encode = GST_VAAPI_ENCODE(object);
-  GstMPEG4Encoder *mpeg4encoder = GST_MPEG4_ENCODER(encode->encoder);
+  GstVaapiEncoderMpeg4 *mpeg4encoder = GST_VAAPI_ENCODER_MPEG4(encode->encoder);
   ENCODER_ASSERT(mpeg4encoder);
 
   switch (prop_id) {
similarity index 51%
rename from gst/vaapiencode/gstvaapimpeg4encode.h
rename to gst/vaapi/gstvaapiencode_mpeg4.h
index fa0347a..0e5668e 100644 (file)
@@ -1,5 +1,5 @@
 /*
- *  gstvaapimpeg4encode.h - VA-API MPEG-4 encoder
+ *  gstvaapiencode_mpeg4.h - VA-API MPEG-4 encoder
  *
  *  Copyright (C) 2011 Intel Corporation
  *
 
 G_BEGIN_DECLS
 
-#define GST_TYPE_MPEG4ENCODE             (gst_mpeg4encode_get_type())
-#define GST_IS_MPEG4ENCODE(obj)          (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_MPEG4ENCODE))
-#define GST_IS_MPEG4ENCODE_CLASS(klass)  (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_MPEG4ENCODE))
-#define GST_MPEG4ENCODE_GET_CLASS(obj)   (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_MPEG4ENCODE, GstMPEG4EncodeClass))
-#define GST_MPEG4ENCODE(obj)             (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_MPEG4ENCODE, GstMPEG4Encode))
-#define GST_MPEG4ENCODE_CLASS(klass)     (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_MPEG4ENCODE, GstMPEG4EncodeClass))
+#define GST_TYPE_VAAPI_ENCODE_MPEG4             (gst_vaapi_encode_mpeg4_get_type())
+#define GST_IS_VAAPI_ENCODE_MPEG4(obj)          (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_VAAPI_ENCODE_MPEG4))
+#define GST_IS_VAAPI_ENCODE_MPEG4_CLASS(klass)  (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_VAAPI_ENCODE_MPEG4))
+#define GST_VAAPI_ENCODE_MPEG4_GET_CLASS(obj)   (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_VAAPI_ENCODE_MPEG4, GstVaapiEncodeMpeg4Class))
+#define GST_VAAPI_ENCODE_MPEG4(obj)             (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_VAAPI_ENCODE_MPEG4, GstVaapiEncodeMpeg4))
+#define GST_VAAPI_ENCODE_MPEG4_CLASS(klass)     (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_VAAPI_ENCODE_MPEG4, GstVaapiEncodeMpeg4Class))
 
 
-typedef struct _GstMPEG4Encode        GstMPEG4Encode;
-typedef struct _GstMPEG4EncodeClass   GstMPEG4EncodeClass;
+typedef struct _GstVaapiEncodeMpeg4        GstVaapiEncodeMpeg4;
+typedef struct _GstVaapiEncodeMpeg4Class   GstVaapiEncodeMpeg4Class;
 
-struct _GstMPEG4Encode {
+struct _GstVaapiEncodeMpeg4 {
   GstVaapiEncode parent;
 };
 
-struct _GstMPEG4EncodeClass {
+struct _GstVaapiEncodeMpeg4Class {
     GstVaapiEncodeClass     parent_class;
 };
 
-GType gst_mpeg4encode_get_type(void);
+GType gst_vaapi_encode_mpeg4_get_type(void);
 
 
 G_END_DECLS
diff --git a/gst/vaapiencode/Makefile.am b/gst/vaapiencode/Makefile.am
deleted file mode 100644 (file)
index 657f1a1..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
-plugin_LTLIBRARIES = libgstvaapiencode.la
-
-libgstvaapi_CFLAGS = \
-       $(LIBVA_CFLAGS)         \
-       -DGST_USE_UNSTABLE_API \
-       -I$(top_srcdir)/gst-libs \
-       -I$(top_srcdir)/gst/vaapi
-
-if USE_VAAPI_GLX
-libgstvaapi_LIBS = \
-       $(top_builddir)/gst-libs/gst/vaapi/libgstvaapi-glx-$(GST_MAJORMINOR).la
-else
-libgstvaapi_LIBS = \
-       $(top_builddir)/gst-libs/gst/vaapi/libgstvaapi-x11-$(GST_MAJORMINOR).la
-endif
-
-libgstvaapiencode_la_SOURCES = \
-       gstvaapiencoder.c   \
-       gstvaapibaseencoder.c   \
-       gstvaapih264encoder.c \
-       gstvaapih263encoder.c \
-       gstvaapimpeg4encoder.c \
-       gstvaapiencode.c        \
-       gstvaapih264encode.c \
-       gstvaapih263encode.c \
-       gstvaapimpeg4encode.c \
-       $(top_srcdir)/gst/vaapi/gstvaapipluginutil.c \
-       $(NULL)
-
-noinst_HEADERS =               \
-       gstvaapiencoder.h   \
-       gstvaapibaseencoder.h \
-       gstvaapih264encoder.h \
-       gstvaapih263encoder.h   \
-       gstvaapimpeg4encoder.h \
-       gstvaapiencode.h        \
-       gstvaapih264encode.h \
-       gstvaapih263encode.h \
-       gstvaapimpeg4encode.h \
-       $(NULL)
-
-libgstvaapiencode_la_CFLAGS =  \
-       $(libgstvaapi_CFLAGS)   \
-       $(GST_CFLAGS)           \
-       $(GST_BASE_CFLAGS)      \
-       $(GST_VIDEO_CFLAGS)     \
-       $(GST_BASEVIDEO_CFLAGS) \
-       $(GST_INTERFACES_CFLAGS) \
-       $(GST_PLUGINS_BASE_CFLAGS) \
-       $(NULL)
-
-libgstvaapiencode_la_LIBADD =  \
-       $(libgstvaapi_LIBS)     \
-       $(GST_LIBS)             \
-       $(GST_BASE_LIBS)        \
-       $(GST_VIDEO_LIBS)       \
-       $(GST_BASEVIDEO_LIBS) \
-       $(GST_INTERFACES_LIBS) \
-       $(GST_PLUGINS_BASE_LIBS) \
-       $(NULL)
-
-libgstvaapiencode_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS)
-libgstvaapiencode_la_LIBTOOLFLAGS = --tag=disable-static
-
-# Extra clean files so that maintainer-clean removes *everything*
-MAINTAINERCLEANFILES = Makefile.in
diff --git a/gst/vaapiencode/gstvaapih263encoder.h b/gst/vaapiencode/gstvaapih263encoder.h
deleted file mode 100644 (file)
index 3d36584..0000000
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- *  gstvaapih263encoder.h - H.263 encoder
- *
- *  Copyright (C) 2011 Intel Corporation
- *
- *  This library is free software; you can redistribute it and/or
- *  modify it under the terms of the GNU Lesser General Public License
- *  as published by the Free Software Foundation; either version 2.1
- *  of the License, or (at your option) any later version.
- *
- *  This library is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- *  Lesser General Public License for more details.
- *
- *  You should have received a copy of the GNU Lesser General Public
- *  License along with this library; if not, write to the Free
- *  Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- *  Boston, MA 02110-1301 USA
- */
-
-#ifndef _GST_VAAPI_H263_ENCODER_H_
-#define _GST_VAAPI_H263_ENCODER_H_
-
-
-#include "gst/vaapi/gstvaapisurfacepool.h"
-
-#include "gstvaapibaseencoder.h"
-
-G_BEGIN_DECLS
-
-#define H263_DEFAULT_INTRA_PERIOD 30
-#define H263_DEFAULT_INIT_QP      15
-#define H263_DEFAULT_MIN_QP       1
-
-
-typedef struct _GstH263Encoder              GstH263Encoder;
-typedef struct _GstH263EncoderPrivate       GstH263EncoderPrivate;
-typedef struct _GstH263EncoderClass         GstH263EncoderClass;
-
-
-#define GST_TYPE_H263_ENCODER             (gst_h263_encoder_get_type())
-#define GST_IS_H263_ENCODER(obj)          (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_H263_ENCODER))
-#define GST_IS_H263_ENCODER_CLASS(klass)  (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_H263_ENCODER))
-#define GST_H263_ENCODER_GET_CLASS(obj)   (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_H263_ENCODER, GstH263EncoderClass))
-#define GST_H263_ENCODER(obj)             (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_H263_ENCODER, GstH263Encoder))
-#define GST_H263_ENCODER_CLASS(klass)     (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_H263_ENCODER, GstH263EncoderClass))
-#define GST_H263_ENCODER_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE((obj),GST_TYPE_H263_ENCODER,GstH263EncoderPrivate))
-
-struct _GstH263Encoder {
-  GstVaapiBaseEncoder parent;   /*based on gobject*/
-
-  guint32  bitrate;
-  guint32  intra_period;
-  guint32  init_qp;  /*default 15, 1~31*/
-  guint32  min_qp;   /*default 1, 1~31*/
-};
-
-struct _GstH263EncoderClass {
-    GstVaapiBaseEncoderClass parent_class;
-};
-
-
-GType    gst_h263_encoder_get_type(void);
-
-GstH263Encoder *gst_h263_encoder_new(void);
-static inline void gst_h263_encoder_unref (GstH263Encoder * encoder)
-{
-  g_object_unref (encoder);
-}
-
-
-G_END_DECLS
-
-#endif /* _GST_VAAPI_H263_ENCODER_H_ */
-