Skip to content

Add: Async session creation for st40p GStreamer #1149

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

DawidWesierski4
Copy link
Collaborator

Introduce async session creation for the st40p
into GStreamer plugin.
Unlike the st30p and st20p plugins,
this implementation uses the START signal instead
of the capabilities negotiation signal,
as the st40p plugin accepts all caps.

@DawidWesierski4 DawidWesierski4 force-pushed the Async_st40 branch 4 times, most recently from 069f13d to bac66d7 Compare May 12, 2025 12:02
Introduce async session creation for the st40p
into GStreamer plugin.
Unlike the st30p and st20p plugins,
this implementation uses the START signal instead
of the capabilities negotiation signal,
as the st40p plugin accepts all caps.
return FALSE;
case GST_EVENT_STREAM_START:
if (sink->async_session_create) {
thread_data = malloc(sizeof(GstMtlSt40pTxThreadData));
Copy link
Collaborator

Choose a reason for hiding this comment

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

handle malloc fail and pthread_create fail cases.

return;
}
if (sink->async_session_create) {
if (sink->session_thread) pthread_join(sink->session_thread, NULL);
Copy link
Collaborator

Choose a reason for hiding this comment

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

I would prefer to deallocate GstMtlSt40pTxThreadData here, after join(), so as not to split the responsibility for memory control between 2 threads, but your way is valid too.

pthread_create(&sink->session_thread, NULL,
gst_mtl_st40p_tx_session_create_thread, thread_data);
} else {
ret = gst_mtl_st40p_tx_session_create(sink);
Copy link
Collaborator

Choose a reason for hiding this comment

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

do you know how much later GST_EVENT_STREAM_START is send after gst_mtl_st40p_tx_start() was called? Are we ok with introducing this delay to the case when async_session_create == false?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

we absolutly are not
I was under the impression that this signal is being "sent" much faster, it is noooot after the packets starts flowing its being sent
i though that leaving this in signals would be fine but i don't think so no more will move him

Add memory error handling in Gstreamer for mallocs
in our Gstreamer plugins.
Add error handling for pthread_create and
pthread_init
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.

2 participants