From 85ce893faa9e30eaacc98ab794fd790f77cc349c Mon Sep 17 00:00:00 2001 From: Gwenole Beauchesne Date: Thu, 9 Jan 2014 10:09:38 +0100 Subject: [PATCH] vaapiencode: rename a few member functions. Rename a few member functions to make them more consistent: - alloc_encoder(): now reduced to allocate the encoder object only; - alloc_buffer(): allocate buffer from srcpad, and copy bitstream. --- gst/vaapi/gstvaapiencode.c | 10 +++++----- gst/vaapi/gstvaapiencode.h | 10 +++++----- gst/vaapi/gstvaapiencode_h264.c | 10 +++++----- gst/vaapi/gstvaapiencode_mpeg2.c | 4 ++-- 4 files changed, 17 insertions(+), 17 deletions(-) diff --git a/gst/vaapi/gstvaapiencode.c b/gst/vaapi/gstvaapiencode.c index 7c797d62a5..2276b11765 100644 --- a/gst/vaapi/gstvaapiencode.c +++ b/gst/vaapi/gstvaapiencode.c @@ -173,7 +173,7 @@ gst_vaapiencode_default_set_property (GstVaapiEncode * encode, guint prop_id, } static GstFlowReturn -gst_vaapiencode_default_allocate_buffer (GstVaapiEncode * encode, +gst_vaapiencode_default_alloc_buffer (GstVaapiEncode * encode, GstVaapiCodedBuffer * coded_buf, GstBuffer ** outbuf_ptr) { GstBuffer *buf; @@ -246,7 +246,7 @@ gst_vaapiencode_push_frame (GstVaapiEncode * encode, gint64 timeout) /* Allocate and copy buffer into system memory */ out_buffer = NULL; - ret = klass->allocate_buffer (encode, + ret = klass->alloc_buffer (encode, GST_VAAPI_CODED_BUFFER_PROXY_BUFFER (codedbuf_proxy), &out_buffer); gst_vaapi_coded_buffer_proxy_replace (&codedbuf_proxy, NULL); if (ret != GST_FLOW_OK) @@ -388,12 +388,12 @@ ensure_encoder (GstVaapiEncode * encode) GPtrArray *const prop_values = encode->prop_values; guint i; - g_return_val_if_fail (klass->create_encoder, FALSE); + g_return_val_if_fail (klass->alloc_encoder, FALSE); if (!ensure_uploader (encode)) return FALSE; - encode->encoder = klass->create_encoder (encode, + encode->encoder = klass->alloc_encoder (encode, GST_VAAPI_PLUGIN_BASE_DISPLAY (encode)); if (!encode->encoder) return FALSE; @@ -712,7 +712,7 @@ gst_vaapiencode_class_init (GstVaapiEncodeClass * klass) klass->get_property = gst_vaapiencode_default_get_property; klass->set_property = gst_vaapiencode_default_set_property; - klass->allocate_buffer = gst_vaapiencode_default_allocate_buffer; + klass->alloc_buffer = gst_vaapiencode_default_alloc_buffer; /* Registering debug symbols for function pointers */ GST_DEBUG_REGISTER_FUNCPTR (gst_vaapiencode_query); diff --git a/gst/vaapi/gstvaapiencode.h b/gst/vaapi/gstvaapiencode.h index 7eeabc4f5d..91712af339 100644 --- a/gst/vaapi/gstvaapiencode.h +++ b/gst/vaapi/gstvaapiencode.h @@ -75,11 +75,11 @@ struct _GstVaapiEncodeClass gboolean (*set_property) (GstVaapiEncode * encode, guint prop_id, const GValue * value); - GstVaapiEncoder * (*create_encoder) (GstVaapiEncode * encode, - GstVaapiDisplay * display); - GstFlowReturn (*allocate_buffer) (GstVaapiEncode * encode, - GstVaapiCodedBuffer * coded_buf, - GstBuffer ** outbuf_ptr); + GstVaapiEncoder * (*alloc_encoder) (GstVaapiEncode * encode, + GstVaapiDisplay * display); + GstFlowReturn (*alloc_buffer) (GstVaapiEncode * encode, + GstVaapiCodedBuffer * coded_buf, + GstBuffer ** outbuf_ptr); }; GType diff --git a/gst/vaapi/gstvaapiencode_h264.c b/gst/vaapi/gstvaapiencode_h264.c index b559e3b1b8..0d222b50dc 100644 --- a/gst/vaapi/gstvaapiencode_h264.c +++ b/gst/vaapi/gstvaapiencode_h264.c @@ -122,7 +122,7 @@ gst_vaapiencode_h264_get_property (GObject * object, } static GstVaapiEncoder * -gst_vaapiencode_h264_create_encoder (GstVaapiEncode * base, +gst_vaapiencode_h264_alloc_encoder (GstVaapiEncode * base, GstVaapiDisplay * display) { return gst_vaapi_encoder_h264_new (display); @@ -221,7 +221,7 @@ error: } static GstFlowReturn -gst_vaapiencode_h264_allocate_buffer (GstVaapiEncode * encode, +gst_vaapiencode_h264_alloc_buffer (GstVaapiEncode * encode, GstVaapiCodedBuffer * coded_buf, GstBuffer ** out_buffer_ptr) { GstVaapiEncoderH264 *const encoder = (GstVaapiEncoderH264 *) encode->encoder; @@ -230,7 +230,7 @@ gst_vaapiencode_h264_allocate_buffer (GstVaapiEncode * encode, g_return_val_if_fail (encoder != NULL, GST_FLOW_ERROR); ret = - GST_VAAPIENCODE_CLASS (gst_vaapiencode_h264_parent_class)->allocate_buffer + GST_VAAPIENCODE_CLASS (gst_vaapiencode_h264_parent_class)->alloc_buffer (encode, coded_buf, out_buffer_ptr); if (ret != GST_FLOW_OK) return ret; @@ -267,8 +267,8 @@ gst_vaapiencode_h264_class_init (GstVaapiEncodeH264Class * klass) object_class->get_property = gst_vaapiencode_h264_get_property; encode_class->get_properties = gst_vaapi_encoder_h264_get_default_properties; - encode_class->create_encoder = gst_vaapiencode_h264_create_encoder; - encode_class->allocate_buffer = gst_vaapiencode_h264_allocate_buffer; + encode_class->alloc_encoder = gst_vaapiencode_h264_alloc_encoder; + encode_class->alloc_buffer = gst_vaapiencode_h264_alloc_buffer; gst_element_class_set_static_metadata (element_class, "VA-API H.264 encoder", diff --git a/gst/vaapi/gstvaapiencode_mpeg2.c b/gst/vaapi/gstvaapiencode_mpeg2.c index 90c513abf1..7579b2ac06 100644 --- a/gst/vaapi/gstvaapiencode_mpeg2.c +++ b/gst/vaapi/gstvaapiencode_mpeg2.c @@ -124,7 +124,7 @@ gst_vaapiencode_mpeg2_get_property (GObject * object, } static GstVaapiEncoder * -gst_vaapiencode_mpeg2_create_encoder (GstVaapiEncode * base, +gst_vaapiencode_mpeg2_alloc_encoder (GstVaapiEncode * base, GstVaapiDisplay * display) { return gst_vaapi_encoder_mpeg2_new (display); @@ -145,7 +145,7 @@ gst_vaapiencode_mpeg2_class_init (GstVaapiEncodeMpeg2Class * klass) object_class->get_property = gst_vaapiencode_mpeg2_get_property; encode_class->get_properties = gst_vaapi_encoder_mpeg2_get_default_properties; - encode_class->create_encoder = gst_vaapiencode_mpeg2_create_encoder; + encode_class->alloc_encoder = gst_vaapiencode_mpeg2_alloc_encoder; gst_element_class_set_static_metadata (element_class, "VA-API MPEG-2 encoder", -- 2.34.1