mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-10-05 18:22:23 +00:00
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.
This commit is contained in:
parent
a43d06dcf5
commit
85ce893faa
4 changed files with 17 additions and 17 deletions
|
@ -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);
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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",
|
||||
|
|
|
@ -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",
|
||||
|
|
Loading…
Reference in a new issue