compiling passed in for new vaapiencode
authorWind Yuan <feng.yuan@intel.com>
Thu, 22 Dec 2011 06:42:40 +0000 (14:42 +0800)
committerZhong Cong <congx.zhong@intel.com>
Tue, 5 Feb 2013 07:37:11 +0000 (15:37 +0800)
gst/vaapiencode/gstvaapih264encoder.c

index a358aad..483453d 100644 (file)
@@ -63,12 +63,6 @@ typedef enum {
   SLICE_TYPE_I  = 2
 } H264_SLICE_TYPE;
 
-struct _GstH264EncodeBuffer {
-  GstBuffer           buffer;
-  VABufferID         *coded_id;
-  GstH264EncoderPrivate *encoder;
-};
-
 struct _GstH264EncoderPrivate {
   GstH264Encoder   *public;
   guint32           format;   /*NV12, I420,*/
@@ -212,115 +206,6 @@ gst_h264_encoder_class_init(GstH264EncoderClass *klass)
   */
 }
 
-
-static void
-gst_h264_encode_buffer_class_init (gpointer g_class, gpointer class_data)
-{
-  GstMiniObjectClass *mini_object_class = GST_MINI_OBJECT_CLASS(g_class);
-
-  h264_encode_buffer_parent_class = g_type_class_peek_parent(g_class);
-  ENCODER_ASSERT(h264_encode_buffer_parent_class);
-
-  mini_object_class->finalize = (GstMiniObjectFinalizeFunction)
-      gst_h264_encode_buffer_finalize;
-}
-
-
-static GType
-gst_h264_encode_buffer_get_type (void)
-{
-  static GType s_h264_encode_buffer_type = 0;
-  if (G_UNLIKELY (s_h264_encode_buffer_type == 0)) {
-    static const GTypeInfo s_h264_encode_buffer_info = {
-      sizeof(GstBufferClass),
-      NULL,
-      NULL,
-      gst_h264_encode_buffer_class_init,
-      NULL,
-      NULL,
-      sizeof(GstH264EncodeBuffer),
-      0,
-      NULL,
-      NULL
-    };
-    s_h264_encode_buffer_type = g_type_register_static (GST_TYPE_BUFFER,
-        "GstH264EncodeBuffer", &s_h264_encode_buffer_info, 0);
-  }
-  return s_h264_encode_buffer_type;
-}
-
-static void
-gst_h264_encode_buffer_finalize (GstH264EncodeBuffer *h264_buffer)
-{
-  GstH264EncoderPrivate *h264_prv = NULL;
-  VABufferID* coded_id = NULL;
-  GstVaapiDisplay *display = NULL;
-
-  gboolean is_locked = FALSE;
-
-  h264_prv = h264_buffer->encoder;
-  coded_id = h264_buffer->coded_id;
-  display = ENCODER_DISPLAY(h264_prv->public);
-
-  ENCODER_ASSERT(display);
-  VADisplay va_dpy = gst_vaapi_display_get_display(display);
-
-  ENCODER_ASSERT(h264_prv);
-  ENCODER_ASSERT(coded_id && VA_INVALID_ID!= *coded_id);
-
-  /*if (--(*h264_buffer->ref_coded_id) == 0) */
-  {
-    /*g_free(h264_buffer->ref_coded_id);*/
-    ENCODER_ACQUIRE_DISPLAY_LOCK(display);
-    vaUnmapBuffer(va_dpy, *coded_id);
-    ENCODER_RELEASE_DISPLAY_LOCK(display);
-    push_available_coded_buffer(h264_prv, coded_id);
-  }
-
-  if (GST_MINI_OBJECT_CLASS(h264_encode_buffer_parent_class)->finalize) {
-    GST_MINI_OBJECT_CLASS(h264_encode_buffer_parent_class)->finalize(GST_MINI_OBJECT(h264_buffer));
-  }
-}
-
-static GstH264EncodeBuffer *
-gst_h264_encode_buffer_new(GstH264EncoderPrivate *h264_prv,
-                           VABufferID *coded_id)
-{
-  GstH264EncodeBuffer *buf = (GstH264EncodeBuffer*)gst_mini_object_new(GST_TYPE_H264_ENCODE_BUFFER);
-  buf->coded_id = coded_id;
-  buf->encoder = h264_prv;
-  return buf;
-}
-
-
-static GstVaapiSurface *
-h264_get_video_surface(GstH264EncoderPrivate *h264_prv, GstVaapiVideoBuffer *video_buffer)
-{
-  //ref_surface
-  GstVaapiSurface *ret = gst_vaapi_video_buffer_get_surface(video_buffer);
-
-  ENCODER_CHECK_STATUS(ret, NULL, "video buffer doesn't have a surface");
-#if 0
-  g_queue_push_tail(h264_prv->video_buffer_caches,video_buffer);
-  gst_buffer_ref(GST_BUFFER(video_buffer));
-#endif
-  return ret;
-
-  end:
-  return NULL;
-}
-
-static void
-h264_release_video_surface(GstH264EncoderPrivate *h264_prv, VASurfaceID surface)
-{
-#if 0
-  ENCODER_ASSERT(h264_prv->video_buffer_caches);
-  g_queue_find_custom(h264_prv->video_buffer_caches,xx, compare_func);
-  for (h264_prv->video_buffer_caches) {
-  }
-#endif
-}
-
 static VAProfile
 h264_get_va_profile(guint32 profile)
 {