From 70e7868f18db93dfe3b8798c402e44f4a67cd89c Mon Sep 17 00:00:00 2001 From: Nicolas Dufresne Date: Thu, 13 Mar 2014 19:24:51 +0100 Subject: [PATCH] v4l2object: Rename setup_format() method into acquire_format() The setup_format() was confusing since it does not set anything, in fact it reads the setup from the driver and save it. --- sys/v4l2/gstv4l2object.c | 8 +++++--- sys/v4l2/gstv4l2object.h | 8 ++++---- sys/v4l2/gstv4l2videodec.c | 2 +- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/sys/v4l2/gstv4l2object.c b/sys/v4l2/gstv4l2object.c index 65dd8eb6d9..4399563090 100644 --- a/sys/v4l2/gstv4l2object.c +++ b/sys/v4l2/gstv4l2object.c @@ -2657,7 +2657,7 @@ pool_failed: } /** - * gst_v4l2_object_setup_format: + * gst_v4l2_object_acquire_format: * @v4l2object the object * @info a GstVideoInfo to be filled * @align a GstVideoAlignment to be filled @@ -2665,12 +2665,14 @@ pool_failed: * Setup the format base on the currently configured format. This is useful in * decoder or encoder elements where the output format is dictated by the * input. + * Acquire the driver choosen format. This is useful in decoder or encoder elements where + * the output format is choosen by the HW. * * Returns: %TRUE on success, %FALSE on failure. */ gboolean -gst_v4l2_object_setup_format (GstV4l2Object * v4l2object, - GstVideoInfo * info, GstVideoAlignment * align) +gst_v4l2_object_acquire_format (GstV4l2Object * v4l2object, GstVideoInfo * info, + GstVideoAlignment * align) { struct v4l2_fmtdesc *fmtdesc; struct v4l2_format fmt; diff --git a/sys/v4l2/gstv4l2object.h b/sys/v4l2/gstv4l2object.h index c205b2ef48..d61a274c84 100644 --- a/sys/v4l2/gstv4l2object.h +++ b/sys/v4l2/gstv4l2object.h @@ -253,10 +253,10 @@ gboolean gst_v4l2_object_copy (GstV4l2Object * v4l2object, GstCaps * gst_v4l2_object_get_caps (GstV4l2Object * v4l2object, GstCaps * filter); -gboolean gst_v4l2_object_setup_format (GstV4l2Object * v4l2object, - GstVideoInfo * info, - GstVideoAlignment * align); - +gboolean gst_v4l2_object_acquire_format (GstV4l2Object * v4l2object, + GstVideoInfo * info, + GstVideoAlignment * align); + gboolean gst_v4l2_object_decide_allocation (GstV4l2Object * v4l2object, GstQuery * query); diff --git a/sys/v4l2/gstv4l2videodec.c b/sys/v4l2/gstv4l2videodec.c index bb757446f1..ece54403d8 100644 --- a/sys/v4l2/gstv4l2videodec.c +++ b/sys/v4l2/gstv4l2videodec.c @@ -475,7 +475,7 @@ gst_v4l2_video_dec_handle_frame (GstVideoDecoder * decoder, gst_buffer_unref (codec_data); - if (!gst_v4l2_object_setup_format (self->v4l2capture, &info, &self->align)) + if (!gst_v4l2_object_acquire_format (self->v4l2capture, &info)) goto not_negotiated; output_state = gst_video_decoder_set_output_state (decoder,