about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
authorptitSeb <sebastien.chev@gmail.com>2024-04-03 17:20:29 +0200
committerptitSeb <sebastien.chev@gmail.com>2024-04-03 17:20:29 +0200
commit4a889e39ad9a8b39119e71a8c9640affd3591a34 (patch)
tree6449c89cb1106d3ee0d46b9f2300444230ae30ff /src
parentd206d69b25d3549502b39b83d01d1df576c22d66 (diff)
downloadbox64-4a889e39ad9a8b39119e71a8c9640affd3591a34.tar.gz
box64-4a889e39ad9a8b39119e71a8c9640affd3591a34.zip
Wrapped some more functions to gstreamer-1.0 and friends (for #1397)
Diffstat (limited to 'src')
-rw-r--r--src/wrapped/generated/functions_list.txt2
-rw-r--r--src/wrapped/generated/wrappedgstreamertypes.h2
-rw-r--r--src/wrapped/wrappedglib2_private.h4
-rw-r--r--src/wrapped/wrappedgstreamer.c56
-rw-r--r--src/wrapped/wrappedgstreamer_private.h6
-rw-r--r--src/wrapped/wrappedgstvideo_private.h2
6 files changed, 66 insertions, 6 deletions
diff --git a/src/wrapped/generated/functions_list.txt b/src/wrapped/generated/functions_list.txt
index 3bfcec5e..b998b300 100644
--- a/src/wrapped/generated/functions_list.txt
+++ b/src/wrapped/generated/functions_list.txt
@@ -3757,6 +3757,7 @@ wrappedgstreamer:
 - pFpA:
   - gst_caps_features_new_valist
 - vFppp:
+  - gst_pad_sticky_events_foreach
   - gst_structure_filter_and_map_in_place
   - gst_tag_list_foreach
 - vFppV:
@@ -3769,6 +3770,7 @@ wrappedgstreamer:
   - gst_structure_remove_fields_valist
   - gst_structure_set_valist
 - iFppp:
+  - gst_buffer_foreach_meta
   - gst_caps_foreach
   - gst_element_foreach_sink_pad
   - gst_init_check
diff --git a/src/wrapped/generated/wrappedgstreamertypes.h b/src/wrapped/generated/wrappedgstreamertypes.h
index 187a27bb..939f702e 100644
--- a/src/wrapped/generated/wrappedgstreamertypes.h
+++ b/src/wrapped/generated/wrappedgstreamertypes.h
@@ -52,6 +52,7 @@ typedef int32_t (*iFiipppppppp_t)(int32_t, int32_t, void*, void*, void*, void*,
 	GO(gst_make_element_message_details, pFpV_t) \
 	GO(gst_tag_list_new, pFpV_t) \
 	GO(gst_caps_features_new_valist, pFpA_t) \
+	GO(gst_pad_sticky_events_foreach, vFppp_t) \
 	GO(gst_structure_filter_and_map_in_place, vFppp_t) \
 	GO(gst_tag_list_foreach, vFppp_t) \
 	GO(gst_bin_add_many, vFppV_t) \
@@ -61,6 +62,7 @@ typedef int32_t (*iFiipppppppp_t)(int32_t, int32_t, void*, void*, void*, void*,
 	GO(gst_caps_set_simple_valist, vFppA_t) \
 	GO(gst_structure_remove_fields_valist, vFppA_t) \
 	GO(gst_structure_set_valist, vFppA_t) \
+	GO(gst_buffer_foreach_meta, iFppp_t) \
 	GO(gst_caps_foreach, iFppp_t) \
 	GO(gst_element_foreach_sink_pad, iFppp_t) \
 	GO(gst_init_check, iFppp_t) \
diff --git a/src/wrapped/wrappedglib2_private.h b/src/wrapped/wrappedglib2_private.h
index 1f64bd14..3d6263d8 100644
--- a/src/wrapped/wrappedglib2_private.h
+++ b/src/wrapped/wrappedglib2_private.h
@@ -315,10 +315,10 @@ GO(g_date_time_new_from_timeval_utc, pFp)
 GO(g_date_time_new_from_unix_utc, pFl)
 //GO(g_date_time_new_local, 
 GO(g_date_time_new_now, pFp)
-//GO(g_date_time_new_now_local, 
+GO(g_date_time_new_now_local, pFv)
 GO(g_date_time_new_now_utc, pFv)
 GO(g_date_time_new_utc, pFiiiiid)
-//GO(g_date_time_ref, 
+GO(g_date_time_ref, pFp)
 //GO(g_date_time_to_local, 
 GO(g_date_time_to_timeval, iFpp)
 GO(g_date_time_to_timezone, pFpp)
diff --git a/src/wrapped/wrappedgstreamer.c b/src/wrapped/wrappedgstreamer.c
index de486475..16fcc747 100644
--- a/src/wrapped/wrappedgstreamer.c
+++ b/src/wrapped/wrappedgstreamer.c
@@ -610,6 +610,52 @@ static void* findGstPadIterIntLinkFunctionFct(void* fct)
     printf_log(LOG_NONE, "Warning, no more slot for gstreamer GstPadIterIntLinkFunction callback\n");
     return NULL;
 }
+//GstPadStickyEventsForeachFunction
+#define GO(A)   \
+static uintptr_t my_GstPadStickyEventsForeachFunction_fct_##A = 0;                              \
+static int my_GstPadStickyEventsForeachFunction_##A(void* a, void* b, void* c)                  \
+{                                                                                               \
+    return (int)RunFunctionFmt(my_GstPadStickyEventsForeachFunction_fct_##A, "ppp", a, b, c);   \
+}
+SUPER()
+#undef GO
+static void* findGstPadStickyEventsForeachFunctionFct(void* fct)
+{
+    if(!fct) return fct;
+    void* p;
+    if((p = GetNativeFnc((uintptr_t)fct))) return p;
+    #define GO(A) if(my_GstPadStickyEventsForeachFunction_fct_##A == (uintptr_t)fct) return my_GstPadStickyEventsForeachFunction_##A;
+    SUPER()
+    #undef GO
+    #define GO(A) if(my_GstPadStickyEventsForeachFunction_fct_##A == 0) {my_GstPadStickyEventsForeachFunction_fct_##A = (uintptr_t)fct; return my_GstPadStickyEventsForeachFunction_##A; }
+    SUPER()
+    #undef GO
+    printf_log(LOG_NONE, "Warning, no more slot for gstreamer GstPadStickyEventsForeachFunction callback\n");
+    return NULL;
+}
+//GstBufferForeachMetaFunc
+#define GO(A)   \
+static uintptr_t my_GstBufferForeachMetaFunc_fct_##A = 0;                              \
+static int my_GstBufferForeachMetaFunc_##A(void* a, void* b, void* c)                  \
+{                                                                                      \
+    return (int)RunFunctionFmt(my_GstBufferForeachMetaFunc_fct_##A, "ppp", a, b, c);   \
+}
+SUPER()
+#undef GO
+static void* findGstBufferForeachMetaFuncFct(void* fct)
+{
+    if(!fct) return fct;
+    void* p;
+    if((p = GetNativeFnc((uintptr_t)fct))) return p;
+    #define GO(A) if(my_GstBufferForeachMetaFunc_fct_##A == (uintptr_t)fct) return my_GstBufferForeachMetaFunc_##A;
+    SUPER()
+    #undef GO
+    #define GO(A) if(my_GstBufferForeachMetaFunc_fct_##A == 0) {my_GstBufferForeachMetaFunc_fct_##A = (uintptr_t)fct; return my_GstBufferForeachMetaFunc_##A; }
+    SUPER()
+    #undef GO
+    printf_log(LOG_NONE, "Warning, no more slot for gstreamer GstBufferForeachMetaFunc callback\n");
+    return NULL;
+}
 
 #undef SUPER
 
@@ -1082,6 +1128,16 @@ EXPORT void my_gst_pad_set_iterate_internal_links_function_full(x64emu_t* emu, v
     my->gst_pad_set_iterate_internal_links_function_full(pad, findGstPadIterIntLinkFunctionFct(f), data, findDestroyFct(d));
 }
 
+EXPORT void my_gst_pad_sticky_events_foreach(x64emu_t* emu, void* pad, void* f, void* data)
+{
+    my->gst_pad_sticky_events_foreach(pad, findGstPadStickyEventsForeachFunctionFct(f), data);
+}
+
+EXPORT int my_gst_buffer_foreach_meta(x64emu_t* emu, void* buff, void* f, void* data)
+{
+    return my->gst_buffer_foreach_meta(buff, findGstBufferForeachMetaFuncFct(f), data);
+}
+
 #define PRE_INIT    \
     if(box64_nogtk) \
         return -1;
diff --git a/src/wrapped/wrappedgstreamer_private.h b/src/wrapped/wrappedgstreamer_private.h
index e9f2a36b..46bcc95f 100644
--- a/src/wrapped/wrappedgstreamer_private.h
+++ b/src/wrapped/wrappedgstreamer_private.h
@@ -62,7 +62,7 @@ GO(gst_buffer_extract_dup, vFpLLpp)
 GO(gst_buffer_fill, LFpLpL)
 GO(gst_buffer_find_memory, iFpLLppp)
 GO(gst_buffer_flags_get_type, LFv)
-//GOM(gst_buffer_foreach_meta, iFEpBp)
+GOM(gst_buffer_foreach_meta, iFEppp)
 GO(gst_buffer_get_all_memory, pFp)
 GO(gst_buffer_get_flags, iFp)
 GO(gst_buffer_get_max_memory, uFv)
@@ -326,7 +326,7 @@ GO(gst_clock_get_calibration, vFppppp)
 GO(gst_clock_get_internal_time, LFp)
 GO(gst_clock_get_master, pFp)
 //GO(gst_clock_get_resolution, 
-//GO(gst_clock_get_time, 
+GO(gst_clock_get_time, UFp)
 //GO(gst_clock_get_timeout, 
 //GO(gst_clock_get_type, 
 //GO(gst_clock_id_compare_func, 
@@ -1040,7 +1040,7 @@ GO(gst_pad_set_offset, vFpI)
 GOM(gst_pad_set_query_function_full, vFEpppp)
 //GOM(gst_pad_set_unlink_function_full, vFEpBpB)
 GOM(gst_pad_start_task, iFEpppp)
-//GOM(gst_pad_sticky_events_foreach, vFEpBp)
+GOM(gst_pad_sticky_events_foreach, vFEppp)
 GO(gst_pad_stop_task, iFp)
 GO(gst_pad_store_sticky_event, iFpp)
 GO(gst_pad_template_flags_get_type, LFv)
diff --git a/src/wrapped/wrappedgstvideo_private.h b/src/wrapped/wrappedgstvideo_private.h
index 56d66473..2cb724fa 100644
--- a/src/wrapped/wrappedgstvideo_private.h
+++ b/src/wrapped/wrappedgstvideo_private.h
@@ -399,7 +399,7 @@ GO(gst_video_time_code_new_empty, pFv)
 //GO(gst_video_time_code_new_from_date_time, 
 GO(gst_video_time_code_new_from_date_time_full, pFuupuu)
 GO(gst_video_time_code_new_from_string, pFp)
-//GO(gst_video_time_code_nsec_since_daily_jam, 
+GO(gst_video_time_code_nsec_since_daily_jam, UFp)
 GO(gst_video_time_code_to_date_time, pFp)
 GO(gst_video_time_code_to_string, pFp)
 GO(gst_video_transfer_function_from_iso, uFu)