Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inconsistent response json structure for element_get #313

Open
tinChe- opened this issue Oct 19, 2022 · 7 comments
Open

Inconsistent response json structure for element_get #313

tinChe- opened this issue Oct 19, 2022 · 7 comments
Assignees
Labels

Comments

@tinChe-
Copy link

tinChe- commented Oct 19, 2022

I’m receiving inconsistent JSON structure for responses of javascript function element_get(pipe_name, element, prop) and same using gstd-client tool. The data that should be in the param is in value for some requests. Below is an example (just the response part of JSON).

Correct response:

{
  "code" : 0,
  "description" : "Success",
  "response" : {
    "name" : "force-aspect-ratio",
    "value" : "true",
    "param" : {
        "description" : "When enabled, the pixel aspect ratio will be enforced",
        "type" : "gboolean",
        "access" : "((GstdParamFlags) READ | 226)"
    }
}
}

Wrong response

{
  "code" : 0,
  "description" : "Success",
  "response" : {
    "name" : "pixel-aspect-ratio",
    "value" : {
        "description" : "Overwrite the pixel aspect ratio of the device",
        "type" : "gchararray",
        "access" : "((GstdParamFlags) READ | 226)"
    }
}
}

In the wrong response, the data that should be inside "param" field is in "value" and there is no information of "value".

The GstD outputs following messages when the wrong response is generated:

** (gstd:11338): CRITICAL **: 12:41:54.123: gstd_json_set_string_value: assertion 'value' failed

(gstd:11338): Json-CRITICAL **: 12:41:54.123: json_builder_set_member_name: assertion 'json_builder_current_mode (builder) == JSON_BUILDER_MODE_OBJECT' failed

I'm using NVIDIA Jetson Nano with original SD card (Ubuntu)
GstD version 0.15.0

To reproduce:

gstd-client pipeline_create camera_stream v4l2src device=/dev/video0 ! image/jpeg,width=1920,height=1080,framerate=60/1,format=MJPG ! nvv4l2decoder mjpeg=1 ! nvvidconv ! nvv4l2h264enc bitrate=16000000 insert-sps-pps=true idrinterval=30 enable-lossless=true ! video/x-h264, mapping=/stream1 ! rtspsink service=12345
gstd-client element_get camera_stream v4l2src0 pixel-aspect-ratio
gstd-client element_get camera_stream v4l2src0 force-aspect-ratio
@lleon95 lleon95 self-assigned this Oct 19, 2022
@lleon95
Copy link
Contributor

lleon95 commented Oct 19, 2022

Hi @tinChe-

Thanks for your detailed report. Could you tell us which branch you are using?

Currently, I am integrating a change to fix a similar issue: #312

I think with the PR comments, this may be fixed. I will tell you as soon as I get it

BR,
Leon

@lleon95 lleon95 added the bug label Oct 19, 2022
@tinChe-
Copy link
Author

tinChe- commented Oct 19, 2022

@lleon95
Actually, I have tested master and develop branches. It behaves the same on both.

@lleon95
Copy link
Contributor

lleon95 commented Oct 19, 2022

Can you test this fix?

feature/fix-write-only-property-messages

@tinChe-
Copy link
Author

tinChe- commented Oct 20, 2022

@lleon95
I can confirm that using feature/fix-write-only-property-messages branch resolve this issue

@tinChe-
Copy link
Author

tinChe- commented Oct 20, 2022

This is probably unrelated but using the same pipeline and reading the element v4l2src0 extra-controls outputs the error on GstD:
(gstd:13182): GStreamer-CRITICAL **: 09:06:58.312: gst_structure_to_string: assertion 'structure != NULL' failed

To reproduce:

gstd-client pipeline_create camera_stream v4l2src device=/dev/video0 ! image/jpeg,width=1920,height=1080,framerate=60/1,format=MJPG ! nvv4l2decoder mjpeg=1 ! nvvidconv ! nvv4l2h264enc bitrate=16000000 insert-sps-pps=true idrinterval=30 enable-lossless=true ! video/x-h264, mapping=/stream1 ! rtspsink service=12345
gstd-client element_get camera_stream v4l2src0 extra-controls

@lleon95
Copy link
Contributor

lleon95 commented Oct 20, 2022

This is probably unrelated but using the same pipeline and reading the element v4l2src0 extra-controls outputs the error on GstD: (gstd:13182): GStreamer-CRITICAL **: 09:06:58.312: gst_structure_to_string: assertion 'structure != NULL' failed

To reproduce:

gstd-client pipeline_create camera_stream v4l2src device=/dev/video0 ! image/jpeg,width=1920,height=1080,framerate=60/1,format=MJPG ! nvv4l2decoder mjpeg=1 ! nvvidconv ! nvv4l2h264enc bitrate=16000000 insert-sps-pps=true idrinterval=30 enable-lossless=true ! video/x-h264, mapping=/stream1 ! rtspsink service=12345
gstd-client element_get camera_stream v4l2src0 extra-controls

Is this the only message that appears? It happens when the property returns an empty structure.

@tinChe-
Copy link
Author

tinChe- commented Oct 21, 2022

Yes, this is the only message output from the gstd, and it is outputted every time the element is queried.
I get the same behavior when querying extra-controls from other elements for example nvv4l2decoder0

Another thing that I noticed is when querying last-sample from example gstinterpipe or rtspsink I get 4 lines

(gstd:13704): GStreamer-CRITICAL **: 08:07:52.407: gst_sample_get_buffer: assertion 'GST_IS_SAMPLE (sample)' failed
(gstd:13704): GStreamer-CRITICAL **: 08:07:52.407: gst_sample_get_caps: assertion 'GST_IS_SAMPLE (sample)' failed
(gstd:13704): GStreamer-CRITICAL **: 08:07:52.407: gst_sample_get_segment: assertion 'GST_IS_SAMPLE (sample)' failed
(gstd:13704): GStreamer-CRITICAL **: 08:07:52.407: gst_sample_get_info: assertion 'GST_IS_SAMPLE (sample)' failed

If I query nvv4l2decoder0 device-name I get one line that opens something

Opening in BLOCKING MODE

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants