Skip to content

Commit

Permalink
[WRAPPER] Added 1 wrapped function and fixed one on gstreamer
Browse files Browse the repository at this point in the history
  • Loading branch information
ptitSeb committed Jan 29, 2025
1 parent 4892c68 commit ed7147e
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/wrapped/generated/functions_list.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4124,7 +4124,6 @@ wrappedgstreamer:
- pFA:
- gst_tag_list_new_valist
- vFpp:
- _gst_debug_register_funcptr
- gst_init
- pFuV:
- gst_caps_features_new_id
Expand Down Expand Up @@ -4192,6 +4191,7 @@ wrappedgstreamer:
- gst_pad_set_link_function_full
- gst_pad_set_query_function_full
- iFpppp:
- gst_iterator_find_custom
- gst_pad_start_task
- uFpppp:
- gst_iterator_fold
Expand Down
2 changes: 1 addition & 1 deletion src/wrapped/generated/wrappedgstreamertypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ typedef int32_t (*iFiipppppppp_t)(int32_t, int32_t, void*, void*, void*, void*,

#define SUPER() ADDED_FUNCTIONS() \
GO(gst_tag_list_new_valist, pFA_t) \
GO(_gst_debug_register_funcptr, vFpp_t) \
GO(gst_init, vFpp_t) \
GO(gst_caps_features_new_id, pFuV_t) \
GO(gst_caps_features_new_id_valist, pFuA_t) \
Expand Down Expand Up @@ -97,6 +96,7 @@ typedef int32_t (*iFiipppppppp_t)(int32_t, int32_t, void*, void*, void*, void*,
GO(gst_pad_set_iterate_internal_links_function_full, vFpppp_t) \
GO(gst_pad_set_link_function_full, vFpppp_t) \
GO(gst_pad_set_query_function_full, vFpppp_t) \
GO(gst_iterator_find_custom, iFpppp_t) \
GO(gst_pad_start_task, iFpppp_t) \
GO(gst_iterator_fold, uFpppp_t) \
GO(gst_registry_feature_filter, pFppip_t) \
Expand Down
26 changes: 26 additions & 0 deletions src/wrapped/wrappedgstreamer.c
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,27 @@ static void* findGstIteratorFoldFunctionFct(void* fct)
printf_log(LOG_NONE, "Warning, no more slot for gstreamer GstIteratorFoldFunction callback\n");
return NULL;
}
//GCompareFunc
#define GO(A) \
static uintptr_t my_GCompareFunc_fct_##A = 0; \
static int my_GCompareFunc_##A(void* a, void* b) \
{ \
return (int)RunFunctionFmt(my_GCompareFunc_fct_##A, "pp", a, b); \
}
SUPER()
#undef GO
static void* findGCompareFuncFct(void* fct)
{
if(!fct) return fct;
#define GO(A) if(my_GCompareFunc_fct_##A == (uintptr_t)fct) return my_GCompareFunc_##A;
SUPER()
#undef GO
#define GO(A) if(my_GCompareFunc_fct_##A == 0) {my_GCompareFunc_fct_##A = (uintptr_t)fct; return my_GCompareFunc_##A; }
SUPER()
#undef GO
printf_log(LOG_NONE, "Warning, no more slot for gstreamer GCompareFunc callback\n");
return NULL;
}
//GCompareDataFunc
#define GO(A) \
static uintptr_t my_GCompareDataFunc_fct_##A = 0; \
Expand Down Expand Up @@ -1228,6 +1249,11 @@ EXPORT void my_gst_mini_object_init(x64emu_t* emu, void* obj, uint32_t flags, si
my->gst_mini_object_init(obj, flags, type, findGstMiniObjectCopyFunctionFct(copy_f), findGstMiniObjectDisposeFunctionFct(disp_f), findGstMiniObjectFreeFunctionFct(free_f));
}

EXPORT int my_gst_iterator_find_custom(x64emu_t* emu, void* it, void* f, void* elem, void* data)
{
return my->gst_iterator_find_custom(it, findGCompareFuncFct(f), elem, data);
}

#define PRE_INIT \
if(BOX64ENV(nogtk)) \
return -1;
Expand Down
4 changes: 2 additions & 2 deletions src/wrapped/wrappedgstreamer_private.h
Original file line number Diff line number Diff line change
Expand Up @@ -446,7 +446,7 @@ GO(gst_debug_message_get, pFp)
DATAB(_gst_debug_min, 4)
//GOM(_gst_debug_nameof_funcptr, pFEp)
GO(gst_debug_print_stack_trace, vFv)
GOM(_gst_debug_register_funcptr, vFpp) //no need to wrap it seems, it's the name that get registered
GO(_gst_debug_register_funcptr, vFpp) //no need to wrap it seems, it's the name that get registered
//GOM(gst_debug_remove_log_function, uFEp)
GO(gst_debug_remove_log_function_by_data, uFp)
GO(gst_debug_remove_ring_buffer_logger, vFv)
Expand Down Expand Up @@ -743,7 +743,7 @@ GO(gst_is_caps_features, iFp)
GO(gst_is_initialized, iFv)
GO(gst_iterator_copy, pFp)
//GOM(gst_iterator_filter, pFEppp)
//GOM(gst_iterator_find_custom, iFEpppp)
GOM(gst_iterator_find_custom, iFEpppp)
GOM(gst_iterator_fold, uFEpppp)
//GOM(gst_iterator_foreach, uFEppp)
GO(gst_iterator_free, vFp)
Expand Down

0 comments on commit ed7147e

Please sign in to comment.