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

gst.wasm: fix g_list_deep_copy GCopyFunc signature mismatch #46

Open
wants to merge 3 commits into
base: wasm-main-function-pointer
Choose a base branch
from

Conversation

aslobodeniuk
Copy link
Contributor

No description provided.

@rgonzalezfluendo
Copy link

This PR must point to a feature branch of https://github.com/fluendo/gst.wasm/blob/main/guw/gstreamer.gst.wasm.toml

@cfoch
Copy link

cfoch commented Feb 11, 2025

This should target wasm-main-function-pointer, IMO

@@ -3633,7 +3638,7 @@ gst_element_get_contexts (GstElement * element)
g_return_val_if_fail (GST_IS_ELEMENT (element), NULL);

GST_OBJECT_LOCK (element);
ret = g_list_copy_deep (element->contexts, (GCopyFunc) gst_context_ref, NULL);
ret = g_list_copy_deep (element->contexts, gst_context_gcopy_proxy, NULL);
Copy link

Choose a reason for hiding this comment

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

What do you think about creating a function in gstcontext.c/.h named gst_context_ref_with_data?

Copy link
Contributor Author

@aslobodeniuk aslobodeniuk Feb 12, 2025

Choose a reason for hiding this comment

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

Ready to agree with any of the ways, but I think this might bring problems at the moment of upstreaming, since it would be a new API, and new API also needs documentation, bindings generated, etc.
Maybe we could create a private header like gstemscripten.h or put into gstcompat.h macro like

#define GST_GCOPY(func) gst_gcopy_with_##func

#define GST_DEFINE_GCOPY_WITH(func)  \
static gpointer                                                 \
gst_gcopy_with_##func (gconstpointer src, gpointer data) {  \
  return func (src);                                                                            \
}

GST_DEFINE_GCOPY(gst_context_ref);
GST_DEFINE_GCOPY(gst_buffer_ref);
GST_DEFINE_GCOPY(g_strdup);
...

so the code in this file would be

ret = g_list_copy_deep (element->contexts, GST_GCOPY(gst_context_ref), NULL);

Copy link

Choose a reason for hiding this comment

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

I like the idea (cc @turran). Should we do it on this PR, @aslobodeniuk ?

Copy link

Choose a reason for hiding this comment

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

I think not here, otherwise we have to fix several stuff. So I just approve.

@cfoch
Copy link

cfoch commented Feb 13, 2025

Wrong target branch. Watch out!

@cfoch cfoch changed the base branch from gst.wasm to wasm-main-function-pointer February 13, 2025 12:59
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.

3 participants