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

[Query] case when change pipe state #4491

Merged
merged 1 commit into from
Jun 25, 2024

Conversation

jaeyun-jung
Copy link
Collaborator

Set caps in edge handle before calling change-state callback.

Set caps in edge handle before calling change-state callback.

Signed-off-by: Jaeyun Jung <jy1210.jung@samsung.com>
Copy link
Contributor

@niley7464 niley7464 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!
Thank you :)

Comment on lines 206 to 210
case GST_STATE_CHANGE_PLAYING_TO_PAUSED:
gst_tensor_query_server_release_edge_handle (sink->sink_id);
break;
case GST_STATE_CHANGE_PAUSED_TO_PLAYING:
caps = gst_pad_peer_query_caps (GST_BASE_SINK_PAD (bsink), NULL);
gst_tensor_query_serversink_set_caps(bsink, caps);
break;
default:
break;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems like now the switch statement has only one case. maybe it can use an if statement?

if (transition == GST_STATE_CHANGE_PLAYING_TO_PAUSED) {
   gst_tensor_query_server_release_edge_handle (sink->sink_id);
}

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

possible, however for future work, use switch-case (guide from gst sample, I am not sure but if adding another state change is required later, better remaining current code.)

@jaeyun-jung jaeyun-jung merged commit c5f8378 into nnstreamer:main Jun 25, 2024
15 checks passed
@jaeyun-jung jaeyun-jung deleted the query-change-state branch June 25, 2024 08:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants