validate: tool: Use gst_macos_main

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7056>
This commit is contained in:
Thibault Saunier 2024-06-18 09:53:27 -04:00 committed by GStreamer Marge Bot
parent e35c08c067
commit c8dfb7c8f0
4 changed files with 96 additions and 8 deletions

View file

@ -27,8 +27,8 @@
#include <gst/video/video.h>
#include <locale.h> /* for LC_ALL */
int
main (int argc, char **argv)
static int
real_main (int argc, char **argv)
{
GstValidateSsim *ssim;
gint rep_err, ret = 0;
@ -120,3 +120,25 @@ main (int argc, char **argv)
return ret;
}
int
main (int argc, char *argv[])
{
int ret;
#ifdef G_OS_WIN32
argv = g_win32_get_command_line ();
#endif
#if defined(__APPLE__) && TARGET_OS_MAC && !TARGET_OS_IPHONE
ret = gst_macos_main ((GstMainFunc) real_main, argc, argv, NULL);
#else
ret = real_main (argc, argv);
#endif
#ifdef G_OS_WIN32
g_strfreev (argv);
#endif
return ret;
}

View file

@ -62,8 +62,8 @@ remove_map (GstRTSPServer * server)
}
#endif
int
main (int argc, gchar * argv[])
static int
real_main (int argc, gchar * argv[])
{
GMainLoop *loop;
GstRTSPServer *server;
@ -157,3 +157,25 @@ failed:
return -1;
}
}
int
main (int argc, char *argv[])
{
int ret;
#ifdef G_OS_WIN32
argv = g_win32_get_command_line ();
#endif
#if defined(__APPLE__) && TARGET_OS_MAC && !TARGET_OS_IPHONE
ret = gst_macos_main ((GstMainFunc) real_main, argc, argv, NULL);
#else
ret = real_main (argc, argv);
#endif
#ifdef G_OS_WIN32
g_strfreev (argv);
#endif
return ret;
}

View file

@ -220,8 +220,8 @@ _register_actions (void)
/* *INDENT-ON* */
}
int
main (int argc, gchar ** argv)
static int
real_main (int argc, gchar ** argv)
{
guint i;
GOptionContext *ctx;
@ -387,3 +387,25 @@ main (int argc, gchar ** argv)
return finish_transcoding (pipeline, ret);
}
int
main (int argc, char *argv[])
{
int ret;
#ifdef G_OS_WIN32
argv = g_win32_get_command_line ();
#endif
#if defined(__APPLE__) && TARGET_OS_MAC && !TARGET_OS_IPHONE
ret = gst_macos_main ((GstMainFunc) real_main, argc, argv, NULL);
#else
ret = real_main (argc, argv);
#endif
#ifdef G_OS_WIN32
g_strfreev (argv);
#endif
return ret;
}

View file

@ -333,8 +333,8 @@ run_test_from_file (gchar * testfile, gboolean use_fakesinks)
return ret;
}
int
main (int argc, gchar ** argv)
static int
real_main (int argc, gchar ** argv)
{
GError *err = NULL;
gchar *scenario = NULL, *configs = NULL, *media_info = NULL,
@ -634,3 +634,25 @@ exit:
gst_deinit ();
return ret;
}
int
main (int argc, char *argv[])
{
int ret;
#ifdef G_OS_WIN32
argv = g_win32_get_command_line ();
#endif
#if defined(__APPLE__) && TARGET_OS_MAC && !TARGET_OS_IPHONE
ret = gst_macos_main ((GstMainFunc) real_main, argc, argv, NULL);
#else
ret = real_main (argc, argv);
#endif
#ifdef G_OS_WIN32
g_strfreev (argv);
#endif
return ret;
}