public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
From: Deborah Brouwer <deborah.brouwer@collabora.com>
To: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Cc: daniel.almeida@collabora.com, nfraprado@collabora.com,
	nicolas.dufresne@collabora.com, deborahbrouwer3563@gmail.com,
	linux-media@vger.kernel.org
Subject: Re: [PATCH] v4l2-tracer: add support for most basic controls
Date: Tue, 15 Nov 2022 21:04:25 -0800	[thread overview]
Message-ID: <Y3Ru+Y6fzBX2Ym+9@xps> (raw)
In-Reply-To: <1c1fd714-5277-417e-bf69-0941dc40a8b7@xs4all.nl>

Hi Hans,
Thanks for this! I have one question below

On Tue, Nov 15, 2022 at 12:36:44PM +0100, Hans Verkuil wrote:
> The v4l2-tracer utility didn't support tracing simple controls without
> a payload (i.e. the 'size' field is 0) and just a simple value.
> 
> This adds support for that, plus the four standard INTEGER64 controls
> that use field value64.
> 
> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
> ---
> Hi Deb,
> 
> I think this is a nice addition for your v3 patch. Support for these
> common simple controls is easy to add, and it makes for much better
> tracing.
> 
> 	Hans
> ---
> diff --git a/utils/v4l2-tracer/retrace.cpp b/utils/v4l2-tracer/retrace.cpp
> index b736e835..f0353988 100644
> --- a/utils/v4l2-tracer/retrace.cpp
> +++ b/utils/v4l2-tracer/retrace.cpp
> @@ -734,7 +734,23 @@ struct v4l2_ext_control *retrace_v4l2_ext_control(json_object *parent_obj, int c
>  		p->value = retrace_v4l2_ext_control_value(v4l2_ext_control_obj,
>  		                                          v4l2_stateless_hevc_start_code_val_def);
>  		break;
> +	case V4L2_CID_MPEG_VIDEO_DEC_PTS:
> +	case V4L2_CID_MPEG_VIDEO_DEC_FRAME:
> +	case V4L2_CID_MPEG_VIDEO_DEC_CONCEAL_COLOR:
> +	case V4L2_CID_PIXEL_RATE: {
> +		json_object *value64_obj;
> +
> +		if (json_object_object_get_ex(v4l2_ext_control_obj, "value64", &value64_obj))
> +			p->value64 = json_object_get_int64(value64_obj);
> +		break;
> +	}
>  	default:
> +		if (!p->size) {
> +			json_object *value_obj;
> +
> +			if (json_object_object_get_ex(v4l2_ext_control_obj, "value", &value_obj))
> +				p->value = json_object_get_int64(value_obj);

The json library integers don't map to exactly what we need but should
this be just a plain int since value is __s32?

> +		}
>  		break;
>  	}
> 
> diff --git a/utils/v4l2-tracer/trace.cpp b/utils/v4l2-tracer/trace.cpp
> index f0bd7002..e26d6e6d 100644
> --- a/utils/v4l2-tracer/trace.cpp
> +++ b/utils/v4l2-tracer/trace.cpp
> @@ -405,9 +405,19 @@ void trace_v4l2_ext_control(void *arg, json_object *parent_obj, std::string key_
>  	case V4L2_CID_STATELESS_MPEG2_QUANTISATION:
>  		trace_v4l2_ctrl_mpeg2_quantisation_gen(p->p_mpeg2_quantisation, v4l2_ext_control_obj);
>  		break;
> +	case V4L2_CID_MPEG_VIDEO_DEC_PTS:
> +	case V4L2_CID_MPEG_VIDEO_DEC_FRAME:
> +	case V4L2_CID_MPEG_VIDEO_DEC_CONCEAL_COLOR:
> +	case V4L2_CID_PIXEL_RATE:
> +		json_object_object_add(v4l2_ext_control_obj, "value64", json_object_new_uint64(p->value64));
> +		break;
>  	default:
> -		fprintf(stderr, "%s:%s:%d: ", __FILE__, __func__, __LINE__);
> -		fprintf(stderr, "warning: cannot trace control: %s\n", val2s(p->id, control_val_def).c_str());
> +		if (p->size) {
> +			fprintf(stderr, "%s:%s:%d: ", __FILE__, __func__, __LINE__);
> +			fprintf(stderr, "warning: cannot trace control: %s\n", val2s(p->id, control_val_def).c_str());
> +		} else {
> +			json_object_object_add(v4l2_ext_control_obj, "value", json_object_new_uint64(p->value));

Same here I'm thinking to change uint64 to just int?

> +		}
>  		break;
>  	}
> 
> 

  reply	other threads:[~2022-11-16  5:03 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-14 18:44 [PATCH v3] utils: add v4l2-tracer utility Deborah Brouwer
2022-11-15 11:36 ` [PATCH] v4l2-tracer: add support for most basic controls Hans Verkuil
2022-11-16  5:04   ` Deborah Brouwer [this message]
2022-11-16  7:59 ` [PATCHv2] " Hans Verkuil

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Y3Ru+Y6fzBX2Ym+9@xps \
    --to=deborah.brouwer@collabora.com \
    --cc=daniel.almeida@collabora.com \
    --cc=deborahbrouwer3563@gmail.com \
    --cc=hverkuil-cisco@xs4all.nl \
    --cc=linux-media@vger.kernel.org \
    --cc=nfraprado@collabora.com \
    --cc=nicolas.dufresne@collabora.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox