From 6cd13c3b0956c4b8994b18533085f3efa08dfe48 Mon Sep 17 00:00:00 2001 From: Seungha Yang Date: Wed, 28 Apr 2021 00:57:35 +0900 Subject: [PATCH] ges: Port to gst_print* Sync with gst-launch, as g_print* will print broken string on Windows. See also https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/258 Part-of: --- examples/c/concatenate.c | 6 ++-- examples/c/ges-ui.c | 8 ++--- examples/c/gessrc.c | 8 ++--- examples/c/multifilesrc.c | 4 +-- examples/c/overlays.c | 4 +-- examples/c/play_timeline_with_one_clip.c | 5 ++-- examples/c/simple1.c | 4 +-- examples/c/test2.c | 4 +-- examples/c/test3.c | 4 +-- examples/c/test4.c | 10 +++---- examples/c/text_properties.c | 4 +-- examples/c/thumbnails.c | 12 ++++---- examples/c/transition.c | 8 ++--- ges/ges-asset.c | 6 ++-- ges/ges-timeline-tree.c | 4 +-- ges/ges-uri-asset.c | 4 +-- ges/ges.c | 2 +- tests/benchmarks/timeline.c | 8 ++--- tests/check/ges/test-utils.c | 20 ++++++------- tools/ges-launcher.c | 20 ++++++------- tools/ges-validate.c | 2 +- tools/utils.c | 38 ++++++++++++------------ 22 files changed, 93 insertions(+), 92 deletions(-) diff --git a/examples/c/concatenate.c b/examples/c/concatenate.c index 3a0f54e510..b543cc99c1 100644 --- a/examples/c/concatenate.c +++ b/examples/c/concatenate.c @@ -85,7 +85,7 @@ main (int argc, char **argv) if (argc < 3) { - g_print ("Usage: %s \n", argv[0]); + gst_print ("Usage: %s \n", argv[0]); return -1; } @@ -131,11 +131,11 @@ bus_message_cb (GstBus * bus, GstMessage * message, GMainLoop * mainloop) { switch (GST_MESSAGE_TYPE (message)) { case GST_MESSAGE_ERROR: - g_print ("ERROR\n"); + gst_print ("ERROR\n"); g_main_loop_quit (mainloop); break; case GST_MESSAGE_EOS: - g_print ("Done\n"); + gst_print ("Done\n"); g_main_loop_quit (mainloop); break; default: diff --git a/examples/c/ges-ui.c b/examples/c/ges-ui.c index 45694a6bb6..5f7d2d5e94 100644 --- a/examples/c/ges-ui.c +++ b/examples/c/ges-ui.c @@ -380,7 +380,7 @@ layer_object_removed_cb (GESLayer * layer, GESClip * clip, App * app) GST_INFO ("layer clip removed cb %p %p %p", layer, clip, app); if (!find_row_for_object (GTK_LIST_STORE (app->model), &iter, clip)) { - g_print ("clip deleted but we don't own it"); + gst_print ("clip deleted but we don't own it"); return; } app->n_objects--; @@ -446,11 +446,11 @@ project_bus_message_cb (GstBus * bus, GstMessage * message, { switch (GST_MESSAGE_TYPE (message)) { case GST_MESSAGE_ERROR: - g_printerr ("ERROR\n"); + gst_printerr ("ERROR\n"); g_main_loop_quit (mainloop); break; case GST_MESSAGE_EOS: - g_printerr ("Done\n"); + gst_printerr ("Done\n"); g_main_loop_quit (mainloop); break; default: @@ -466,7 +466,7 @@ bus_message_cb (GstBus * bus, GstMessage * message, App * app) switch (GST_MESSAGE_TYPE (message)) { case GST_MESSAGE_ERROR: - g_print ("ERROR\n"); + gst_print ("ERROR\n"); break; case GST_MESSAGE_EOS: gst_element_set_state (GST_ELEMENT (app->pipeline), GST_STATE_READY); diff --git a/examples/c/gessrc.c b/examples/c/gessrc.c index 8e52078514..40917f14a3 100644 --- a/examples/c/gessrc.c +++ b/examples/c/gessrc.c @@ -28,11 +28,11 @@ bus_message_cb (GstBus * bus, GstMessage * message, GMainLoop * mainloop) { switch (GST_MESSAGE_TYPE (message)) { case GST_MESSAGE_ERROR: - g_printerr ("Got error message on the bus\n"); + gst_printerr ("Got error message on the bus\n"); g_main_loop_quit (mainloop); break; case GST_MESSAGE_EOS: - g_print ("Done\n"); + gst_print ("Done\n"); g_main_loop_quit (mainloop); break; default: @@ -60,7 +60,7 @@ main (int argc, char **argv) GstClockTime start = 0; if (argc < 2) { - g_print ("Usage: %s \n", argv[0]); + gst_print ("Usage: %s \n", argv[0]); return -1; } @@ -85,7 +85,7 @@ main (int argc, char **argv) clip = GES_CLIP (ges_uri_clip_new (uri)); if (!clip) { - g_printerr ("Could not create clip for file: %s\n", argv[i]); + gst_printerr ("Could not create clip for file: %s\n", argv[i]); g_free (uri); goto err; } diff --git a/examples/c/multifilesrc.c b/examples/c/multifilesrc.c index 05a4c29883..ac57ff9666 100644 --- a/examples/c/multifilesrc.c +++ b/examples/c/multifilesrc.c @@ -50,14 +50,14 @@ main (int argc, gchar ** argv) g_option_context_add_group (ctx, gst_init_get_option_group ()); if (!g_option_context_parse (ctx, &argc, &argv, &err)) { - g_print ("Error initializing %s\n", err->message); + gst_print ("Error initializing %s\n", err->message); g_option_context_free (ctx); g_clear_error (&err); exit (1); } if (filepattern == NULL) { - g_print ("%s", g_option_context_get_help (ctx, TRUE, NULL)); + gst_print ("%s", g_option_context_get_help (ctx, TRUE, NULL)); exit (0); } g_option_context_free (ctx); diff --git a/examples/c/overlays.c b/examples/c/overlays.c index d0edc3b5b2..331504f36c 100644 --- a/examples/c/overlays.c +++ b/examples/c/overlays.c @@ -148,14 +148,14 @@ main (int argc, char **argv) g_option_context_add_group (ctx, gst_init_get_option_group ()); if (!g_option_context_parse (ctx, &argc, &argv, &err)) { - g_print ("Error initializing %s\n", err->message); + gst_print ("Error initializing %s\n", err->message); g_option_context_free (ctx); g_clear_error (&err); exit (1); } if (argc > 1) { - g_print ("%s", g_option_context_get_help (ctx, TRUE, NULL)); + gst_print ("%s", g_option_context_get_help (ctx, TRUE, NULL)); exit (0); } diff --git a/examples/c/play_timeline_with_one_clip.c b/examples/c/play_timeline_with_one_clip.c index cfb8481ab1..53ae235cc9 100644 --- a/examples/c/play_timeline_with_one_clip.c +++ b/examples/c/play_timeline_with_one_clip.c @@ -10,7 +10,7 @@ main (int argc, char **argv) GESTimeline *timeline; if (argc == 1) { - g_printerr ("Usage: play_timeline_with_one_clip file:///clip/uri\n"); + gst_printerr ("Usage: play_timeline_with_one_clip file:///clip/uri\n"); return 1; } @@ -26,7 +26,8 @@ main (int argc, char **argv) GESClip *clip = GES_CLIP (ges_uri_clip_new (argv[1])); if (clip == NULL) { - g_printerr ("%s can not be used, make sure it is a supported media file", + gst_printerr + ("%s can not be used, make sure it is a supported media file", argv[1]); return 1; diff --git a/examples/c/simple1.c b/examples/c/simple1.c index bc008e6868..e97c84d3fa 100644 --- a/examples/c/simple1.c +++ b/examples/c/simple1.c @@ -56,14 +56,14 @@ main (int argc, gchar ** argv) g_option_context_add_group (ctx, gst_init_get_option_group ()); if (!g_option_context_parse (ctx, &argc, &argv, &err)) { - g_print ("Error initializing %s\n", err->message); + gst_print ("Error initializing %s\n", err->message); g_option_context_free (ctx); g_clear_error (&err); exit (1); } if (argc == 1) { - g_print ("%s", g_option_context_get_help (ctx, TRUE, NULL)); + gst_print ("%s", g_option_context_get_help (ctx, TRUE, NULL)); exit (0); } g_option_context_free (ctx); diff --git a/examples/c/test2.c b/examples/c/test2.c index c0bf994c21..86229aa9d0 100644 --- a/examples/c/test2.c +++ b/examples/c/test2.c @@ -31,7 +31,7 @@ main (int argc, gchar ** argv) guint i; if (argc < 2) { - g_print ("Usage: %s \n", argv[0]); + gst_print ("Usage: %s \n", argv[0]); return -1; } @@ -58,7 +58,7 @@ main (int argc, gchar ** argv) if (!ges_timeline_add_track (timeline, tracka)) return -1; - /* Here we've finished initializing our timeline, we're + /* Here we've finished initializing our timeline, we're * ready to start using it... by solely working with the layer ! */ for (i = 1; i < argc; i++, offset += GST_SECOND) { diff --git a/examples/c/test3.c b/examples/c/test3.c index d458c977b5..51a6e31b07 100644 --- a/examples/c/test3.c +++ b/examples/c/test3.c @@ -30,7 +30,7 @@ main (int argc, gchar ** argv) guint i; if (argc < 2) { - g_print ("Usage: %s \n", argv[0]); + gst_print ("Usage: %s \n", argv[0]); return -1; } @@ -57,7 +57,7 @@ main (int argc, gchar ** argv) if (!ges_timeline_add_track (timeline, tracka)) return -1; - /* Here we've finished initializing our timeline, we're + /* Here we've finished initializing our timeline, we're * ready to start using it... by solely working with the layer ! */ for (i = 1; i < argc; i++) { diff --git a/examples/c/test4.c b/examples/c/test4.c index 070b869ec1..1cec66b6f0 100644 --- a/examples/c/test4.c +++ b/examples/c/test4.c @@ -23,7 +23,7 @@ GstEncodingProfile *make_encoding_profile (gchar * audio, gchar * container); /* This example will take a series of files and create a audio-only timeline - * containing the first second of each file and render it to the output uri + * containing the first second of each file and render it to the output uri * using ogg/vorbis */ /* make_encoding_profile @@ -79,7 +79,7 @@ main (int argc, gchar ** argv) g_option_context_add_group (ctx, gst_init_get_option_group ()); if (!g_option_context_parse (ctx, &argc, &argv, &err)) { - g_printerr ("Error initializing: %s\n", err->message); + gst_printerr ("Error initializing: %s\n", err->message); g_option_context_free (ctx); g_clear_error (&err); return -1; @@ -87,7 +87,7 @@ main (int argc, gchar ** argv) g_option_context_free (ctx); if (argc < 3) { - g_print ("Usage: %s \n", argv[0]); + gst_print ("Usage: %s \n", argv[0]); return -1; } @@ -114,7 +114,7 @@ main (int argc, gchar ** argv) if (!ges_timeline_add_track (timeline, tracka)) return -1; - /* Here we've finished initializing our timeline, we're + /* Here we've finished initializing our timeline, we're * ready to start using it... by solely working with the layer ! */ for (i = 2; i < argc; i++) { @@ -147,7 +147,7 @@ main (int argc, gchar ** argv) } else if (g_file_test (argv[1], G_FILE_TEST_EXISTS)) { output_uri = gst_filename_to_uri (argv[1], NULL); } else { - g_printerr ("Unrecognised command line argument '%s'.\n" + gst_printerr ("Unrecognised command line argument '%s'.\n" "Please pass an URI or file as argument!\n", argv[1]); return -1; } diff --git a/examples/c/text_properties.c b/examples/c/text_properties.c index 3dc6e06115..2252587529 100644 --- a/examples/c/text_properties.c +++ b/examples/c/text_properties.c @@ -111,14 +111,14 @@ main (int argc, char **argv) g_option_context_add_group (ctx, gst_init_get_option_group ()); if (!g_option_context_parse (ctx, &argc, &argv, &err)) { - g_print ("Error initializing %s\n", err->message); + gst_print ("Error initializing %s\n", err->message); g_option_context_free (ctx); g_clear_error (&err); exit (1); } if (argc > 1) { - g_print ("%s", g_option_context_get_help (ctx, TRUE, NULL)); + gst_print ("%s", g_option_context_get_help (ctx, TRUE, NULL)); exit (0); } diff --git a/examples/c/thumbnails.c b/examples/c/thumbnails.c index 9211bc7f2e..0047cb5efe 100644 --- a/examples/c/thumbnails.c +++ b/examples/c/thumbnails.c @@ -112,19 +112,19 @@ bus_message_cb (GstBus * bus, GstMessage * message, GMainLoop * mainloop) { switch (GST_MESSAGE_TYPE (message)) { case GST_MESSAGE_ERROR: - g_print ("ERROR\n"); + gst_print ("ERROR\n"); g_main_loop_quit (mainloop); break; case GST_MESSAGE_EOS: if (repeat > 0) { - g_print ("Looping again\n"); + gst_print ("Looping again\n"); /* No need to change state before */ gst_element_seek_simple (GST_ELEMENT (pipeline), GST_FORMAT_TIME, GST_SEEK_FLAG_FLUSH, 0); gst_element_set_state (GST_ELEMENT (pipeline), GST_STATE_PLAYING); repeat -= 1; } else { - g_print ("Done\n"); + gst_print ("Done\n"); g_main_loop_quit (mainloop); } break; @@ -150,7 +150,7 @@ main (int argc, gchar ** argv) g_option_context_add_group (ctx, gst_init_get_option_group ()); if (!g_option_context_parse (ctx, &argc, &argv, &err)) { - g_print ("Error initializing: %s\n", err->message); + gst_print ("Error initializing: %s\n", err->message); g_option_context_free (ctx); g_clear_error (&err); exit (1); @@ -170,7 +170,7 @@ main (int argc, gchar ** argv) /* Play the pipeline */ mainloop = g_main_loop_new (NULL, FALSE); - g_print ("thumbnailing every 1 seconds\n"); + gst_print ("thumbnailing every 1 seconds\n"); g_timeout_add (1000, thumbnail_cb, pipeline); bus = gst_pipeline_get_bus (GST_PIPELINE (pipeline)); @@ -179,7 +179,7 @@ main (int argc, gchar ** argv) if (gst_element_set_state (GST_ELEMENT (pipeline), GST_STATE_PLAYING) == GST_STATE_CHANGE_FAILURE) { - g_print ("Failed to start the encoding\n"); + gst_print ("Failed to start the encoding\n"); return 1; } g_main_loop_run (mainloop); diff --git a/examples/c/transition.c b/examples/c/transition.c index 7992e2ac2c..8a38549054 100644 --- a/examples/c/transition.c +++ b/examples/c/transition.c @@ -76,7 +76,7 @@ print_transition_data (GESClip * tr) g_object_get (nleobj, "start", &start, "duration", &duration, "priority", &priority, "name", &name, NULL); - g_print ("nleobject for %s: %f %f %d\n", name, + gst_print ("nleobject for %s: %f %f %d\n", name, ((gfloat) start) / GST_SECOND, ((gfloat) duration) / GST_SECOND, priority); @@ -128,7 +128,7 @@ make_timeline (gchar * nick, gdouble tdur, gchar * patha, gfloat adur, g_timeout_add_seconds (1, (GSourceFunc) print_transition_data, srcb); if (tduration != 0) { - g_print ("creating transition at %" GST_TIME_FORMAT " of %f duration (%" + gst_print ("creating transition at %" GST_TIME_FORMAT " of %f duration (%" GST_TIME_FORMAT ")\n", GST_TIME_ARGS (tstart), tdur, GST_TIME_ARGS (tduration)); if (!(tr = ges_transition_clip_new_for_nick (nick))) @@ -172,14 +172,14 @@ main (int argc, char **argv) g_option_context_add_group (ctx, gst_init_get_option_group ()); if (!g_option_context_parse (ctx, &argc, &argv, &err)) { - g_print ("Error initializing %s\n", err->message); + gst_print ("Error initializing %s\n", err->message); g_option_context_free (ctx); g_clear_error (&err); exit (1); } if (argc < 4) { - g_print ("%s", g_option_context_get_help (ctx, TRUE, NULL)); + gst_print ("%s", g_option_context_get_help (ctx, TRUE, NULL)); exit (0); } diff --git a/ges/ges-asset.c b/ges/ges-asset.c index 6641ba29d5..7a4aa859a5 100644 --- a/ges/ges-asset.c +++ b/ges/ges-asset.c @@ -70,7 +70,7 @@ * * // Print some infos about the formatter GESAsset * for (tmp = formatter_assets; tmp; tmp = tmp->next) { - * g_print ("Name of the formatter: %s, file extension it produces: %s", + * gst_print ("Name of the formatter: %s, file extension it produces: %s", * ges_meta_container_get_string ( * GES_META_CONTAINER (tmp->data), GES_META_FORMATTER_NAME), * ges_meta_container_get_string ( @@ -1364,10 +1364,10 @@ ges_asset_request (GType extractable_type, const gchar * id, GError ** error) * * asset = ges_asset_request_finish (res, &error); * if (asset) { - * g_print ("The file: %s is usable as a GESUriClip", + * gst_print ("The file: %s is usable as a GESUriClip", * ges_asset_get_id (asset)); * } else { - * g_print ("The file: %s is *not* usable as a GESUriClip because: %s", + * gst_print ("The file: %s is *not* usable as a GESUriClip because: %s", * ges_asset_get_id (source), error->message); * } * diff --git a/ges/ges-timeline-tree.c b/ges/ges-timeline-tree.c index ece5a5bf34..423eef93ad 100644 --- a/ges/ges-timeline-tree.c +++ b/ges/ges-timeline-tree.c @@ -183,11 +183,11 @@ static gboolean print_node (GNode * node, gpointer unused_data) { if (G_NODE_IS_ROOT (node)) { - g_print ("Timeline: %p\n", node->data); + gst_print ("Timeline: %p\n", node->data); return FALSE; } - g_print ("%*c- %" GES_FORMAT " - layer %" G_GINT32_FORMAT "\n", + gst_print ("%*c- %" GES_FORMAT " - layer %" G_GINT32_FORMAT "\n", 2 * g_node_depth (node), ' ', GES_ARGS (node->data), ges_timeline_element_get_layer_priority (node->data)); diff --git a/ges/ges-uri-asset.c b/ges/ges-uri-asset.c index dba14148f3..f33d8e99b7 100644 --- a/ges/ges-uri-asset.c +++ b/ges/ges-uri-asset.c @@ -633,12 +633,12 @@ ges_uri_clip_asset_is_image (GESUriClipAsset * self) * * filesource_asset = ges_uri_clip_asset_finish (res, &error); * if (filesource_asset) { - * g_print ("The file: %s is usable as a FileSource, it is%s an image and lasts %" GST_TIME_FORMAT, + * gst_print ("The file: %s is usable as a FileSource, it is%s an image and lasts %" GST_TIME_FORMAT, * ges_asset_get_id (GES_ASSET (filesource_asset)) * ges_uri_clip_asset_is_image (filesource_asset) ? "" : " not", * GST_TIME_ARGS (ges_uri_clip_asset_get_duration (filesource_asset)); * } else { - * g_print ("The file: %s is *not* usable as a FileSource because: %s", + * gst_print ("The file: %s is *not* usable as a FileSource because: %s", * ges_asset_get_id (source), error->message); * } * diff --git a/ges/ges.c b/ges/ges.c index da465322c1..d34c4efd79 100644 --- a/ges/ges.c +++ b/ges/ges.c @@ -268,7 +268,7 @@ parse_goption_arg (const gchar * s_opt, const gchar * arg, gpointer data, GError ** err) { if (g_strcmp0 (s_opt, "--ges-version") == 0) { - g_print ("GStreamer Editing Services version %s\n", PACKAGE_VERSION); + gst_print ("GStreamer Editing Services version %s\n", PACKAGE_VERSION); exit (0); } else if (g_strcmp0 (s_opt, "--ges-sample-paths") == 0) { ges_add_missing_uri_relocation_uri (arg, FALSE); diff --git a/tests/benchmarks/timeline.c b/tests/benchmarks/timeline.c index 6eac030c69..1daa8ee924 100644 --- a/tests/benchmarks/timeline.c +++ b/tests/benchmarks/timeline.c @@ -50,7 +50,7 @@ main (gint argc, gchar * argv[]) ges_layer_add_asset (layer, asset, i * 1000, 0, 1000, GES_TRACK_TYPE_UNKNOWN); end = gst_util_get_timestamp (); - g_print ("%" GST_TIME_FORMAT " - adding %d clip to the timeline\n", + gst_print ("%" GST_TIME_FORMAT " - adding %d clip to the timeline\n", GST_TIME_ARGS (end - start), i); start_ripple = gst_util_get_timestamp (); @@ -63,7 +63,7 @@ main (gint argc, gchar * argv[]) min_rippling_time = MIN (min_rippling_time, end - start); } end_ripple = gst_util_get_timestamp (); - g_print ("%" GST_TIME_FORMAT " - rippling %d times, max: %" + gst_print ("%" GST_TIME_FORMAT " - rippling %d times, max: %" GST_TIME_FORMAT " min: %" GST_TIME_FORMAT "\n", GST_TIME_ARGS (end_ripple - start_ripple), i - 1, GST_TIME_ARGS (max_rippling_time), GST_TIME_ARGS (min_rippling_time)); @@ -82,7 +82,7 @@ main (gint argc, gchar * argv[]) min_rippling_time = MIN (min_rippling_time, end - start); } end_ripple = gst_util_get_timestamp (); - g_print ("%" GST_TIME_FORMAT " - rippling %d times, max: %" + gst_print ("%" GST_TIME_FORMAT " - rippling %d times, max: %" GST_TIME_FORMAT " min: %" GST_TIME_FORMAT " (with auto-transition on)\n", GST_TIME_ARGS (end_ripple - start_ripple), i - 1, GST_TIME_ARGS (max_rippling_time), GST_TIME_ARGS (min_rippling_time)); @@ -90,7 +90,7 @@ main (gint argc, gchar * argv[]) start = gst_util_get_timestamp (); gst_object_unref (timeline); end = gst_util_get_timestamp (); - g_print ("%" GST_TIME_FORMAT " - freeing the timeline\n", + gst_print ("%" GST_TIME_FORMAT " - freeing the timeline\n", GST_TIME_ARGS (end - start)); return 0; diff --git a/tests/check/ges/test-utils.c b/tests/check/ges/test-utils.c index fb0589794b..01953e2323 100644 --- a/tests/check/ges/test-utils.c +++ b/tests/check/ges/test-utils.c @@ -264,39 +264,39 @@ print_timeline (GESTimeline * timeline) { GList *layer, *clip, *clips, *group; - g_printerr + gst_printerr ("\n\n=========================== GESTimeline: %p ==================\n", timeline); for (layer = timeline->layers; layer; layer = layer->next) { clips = ges_layer_get_clips (layer->data); - g_printerr ("layer %04d: ", ges_layer_get_priority (layer->data)); + gst_printerr ("layer %04d: ", ges_layer_get_priority (layer->data)); for (clip = clips; clip; clip = clip->next) { - g_printerr ("{ %s [ %" G_GUINT64_FORMAT "(%" G_GUINT64_FORMAT ") %" + gst_printerr ("{ %s [ %" G_GUINT64_FORMAT "(%" G_GUINT64_FORMAT ") %" G_GUINT64_FORMAT "] } ", GES_TIMELINE_ELEMENT_NAME (clip->data), GES_TIMELINE_ELEMENT_START (clip->data), GES_TIMELINE_ELEMENT_INPOINT (clip->data), GES_TIMELINE_ELEMENT_END (clip->data)); } if (layer->next) - g_printerr ("\n--------------------------------------------------\n"); + gst_printerr ("\n--------------------------------------------------\n"); g_list_free_full (clips, gst_object_unref); } if (ges_timeline_get_groups (timeline)) { - g_printerr ("\n--------------------------------------------------\n"); - g_printerr ("\nGROUPS:"); - g_printerr ("\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n"); + gst_printerr ("\n--------------------------------------------------\n"); + gst_printerr ("\nGROUPS:"); + gst_printerr ("\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n"); } for (group = ges_timeline_get_groups (timeline); group; group = group->next) { - g_printerr ("%" GES_FORMAT ": ", GES_ARGS (group->data)); + gst_printerr ("%" GES_FORMAT ": ", GES_ARGS (group->data)); for (clip = GES_CONTAINER_CHILDREN (group->data); clip; clip = clip->next) - g_printerr ("[ %s ]", GES_TIMELINE_ELEMENT_NAME (clip->data)); + gst_printerr ("[ %s ]", GES_TIMELINE_ELEMENT_NAME (clip->data)); } - g_printerr + gst_printerr ("\n=====================================================================\n"); } diff --git a/tools/ges-launcher.c b/tools/ges-launcher.c index 94f3becb7f..185828a971 100644 --- a/tools/ges-launcher.c +++ b/tools/ges-launcher.c @@ -533,16 +533,16 @@ _set_rendering_details (GESLauncher * self) return FALSE; } - g_print ("\nEncoding details:\n"); - g_print ("================\n"); + gst_print ("\nEncoding details:\n"); + gst_print ("================\n"); - g_print (" -> Output file: %s\n", opts->outputuri); - g_print (" -> Profile:%s\n", + gst_print (" -> Output file: %s\n", opts->outputuri); + gst_print (" -> Profile:%s\n", smart_profile ? " (selected from input files format for efficient smart rendering" : ""); describe_encoding_profile (prof); - g_print ("\n"); + gst_print ("\n"); ges_project_add_encoding_profile (proj, prof); } @@ -576,7 +576,7 @@ _track_set_mixing (GESTrack * track, GESLauncherParsedOptions * opts) if (opts->disable_mixing || opts->smartrender) ges_track_set_mixing (track, FALSE); if (!opts->disable_mixing && opts->smartrender && !printed_mixing_disabled) { - g_print ("**Mixing is disabled for smart rendering to work**\n"); + gst_print ("**Mixing is disabled for smart rendering to work**\n"); printed_mixing_disabled = TRUE; } } @@ -667,7 +667,7 @@ _project_loaded_cb (GESProject * project, GESTimeline * timeline, g_application_quit (G_APPLICATION (self)); } - g_print ("\nSaving project to %s\n", uri); + gst_print ("\nSaving project to %s\n", uri); ges_project_save (project, timeline, uri, NULL, TRUE, &error); g_free (uri); @@ -847,7 +847,7 @@ bus_message_cb (GstBus * bus, GstMessage * message, GESLauncher * self) static gboolean intr_handler (GESLauncher * self) { - g_print ("interrupt received.\n"); + gst_print ("interrupt received.\n"); GST_DEBUG_BIN_TO_DOT_FILE_WITH_TS (GST_BIN (self->priv->pipeline), GST_DEBUG_GRAPH_SHOW_ALL, "ges-launch.interrupted"); @@ -976,7 +976,7 @@ _create_pipeline (GESLauncher * self, const gchar * serialized_timeline) /* Timeline creation */ if (opts->load_path) { - g_printf ("Loading project from : %s\n", opts->load_path); + gst_print ("Loading project from : %s\n", opts->load_path); if (!(uri = ensure_uri (opts->load_path))) { g_error ("couldn't create uri for '%s'", opts->load_path); @@ -1339,7 +1339,7 @@ _local_command_line (GApplication * application, gchar ** arguments[], if (!opts->load_path && !opts->scenario && !opts->testfile && !opts->list_transitions && (argc <= 1)) { - g_printf ("%s", g_option_context_get_help (ctx, TRUE, NULL)); + gst_print ("%s", g_option_context_get_help (ctx, TRUE, NULL)); g_option_context_free (ctx); *exit_status = 1; goto done; diff --git a/tools/ges-validate.c b/tools/ges-validate.c index bde1c76f9f..5379bb9c35 100644 --- a/tools/ges-validate.c +++ b/tools/ges-validate.c @@ -38,7 +38,7 @@ _print_position (GstElement * pipeline) gst_element_query_duration (GST_ELEMENT (pipeline), GST_FORMAT_TIME, &duration); - g_print ("\r", GST_TIME_ARGS (position), GST_TIME_ARGS (duration)); } diff --git a/tools/utils.c b/tools/utils.c index 4171031364..9b368fe81e 100644 --- a/tools/utils.c +++ b/tools/utils.c @@ -207,7 +207,7 @@ print_enum (GType enum_type) guint i; for (i = 0; i < enum_class->n_values; i++) { - g_printf ("%s\n", enum_class->values[i].value_nick); + gst_print ("%s\n", enum_class->values[i].value_nick); } g_type_class_unref (enum_class); @@ -246,9 +246,9 @@ ges_print (GstDebugColorFlags c, gboolean err, gboolean nline, g_string_append (str, clear); if (err) - g_printerr ("%s", str->str); + gst_printerr ("%s", str->str); else - g_print ("%s", str->str); + gst_print ("%s", str->str); g_string_free (str, TRUE); } @@ -333,13 +333,13 @@ print_profile (GstEncodingProfile * profile, const gchar * prefix) capsdesc = gst_caps_to_string (format); if (GST_IS_ENCODING_CONTAINER_PROFILE (profile)) { - g_print ("%s> %s %s: %s%s%s%s\n", prefix, + gst_print ("%s> %s %s: %s%s%s%s\n", prefix, get_type_icon (profile), capsdesc, name ? name : "", desc ? " (" : "", desc ? desc : "", desc ? ")" : ""); } else { - g_print ("%s%s %s%s%s%s%s%s", prefix, get_type_icon (profile), + gst_print ("%s%s %s%s%s%s%s%s", prefix, get_type_icon (profile), name ? name : capsdesc, desc ? ": " : "", desc ? desc : "", name ? " (" : "", name ? capsdesc : "", name ? ")" : ""); @@ -353,10 +353,10 @@ print_profile (GstEncodingProfile * profile, const gchar * prefix) GstVideoInfo info; if (gst_video_info_from_caps (&info, caps)) { - g_print (" (%dx%d", info.width, info.height); + gst_print (" (%dx%d", info.width, info.height); if (info.fps_n) - g_print ("@%d/%dfps", info.fps_n, info.fps_d); - g_print (")"); + gst_print ("@%d/%dfps", info.fps_n, info.fps_d); + gst_print (")"); } gst_caps_unref (caps); } @@ -370,13 +370,13 @@ print_profile (GstEncodingProfile * profile, const gchar * prefix) GstAudioInfo info; if (gst_caps_is_fixed (caps) && gst_audio_info_from_caps (&info, caps)) - g_print (" (%d channels @ %dhz)", info.channels, info.rate); + gst_print (" (%d channels @ %dhz)", info.channels, info.rate); gst_caps_unref (caps); } } - g_print ("\n"); + gst_print ("\n"); } gst_caps_unref (format); @@ -449,17 +449,17 @@ print_timeline (GESTimeline * timeline) return; uri = ges_command_line_formatter_get_timeline_uri (timeline); - g_print ("\nTimeline description: `%s`\n", &uri[5]); + gst_print ("\nTimeline description: `%s`\n", &uri[5]); g_free (uri); - g_print ("====================\n\n"); + gst_print ("====================\n\n"); for (layer = timeline->layers; layer; layer = layer->next) { clips = ges_layer_get_clips (layer->data); if (!clips) continue; - g_printerr (" layer %d: \n", ges_layer_get_priority (layer->data)); - g_printerr (" --------\n"); + gst_printerr (" layer %d: \n", ges_layer_get_priority (layer->data)); + gst_printerr (" --------\n"); for (clip = clips; clip; clip = clip->next) { gchar *name; @@ -475,20 +475,20 @@ print_timeline (GESTimeline * timeline) } else { name = g_strdup (GES_TIMELINE_ELEMENT_NAME (clip->data)); } - g_print (" - %s\n start=%" GST_TIME_FORMAT, + gst_print (" - %s\n start=%" GST_TIME_FORMAT, name, GST_TIME_ARGS (GES_TIMELINE_ELEMENT_START (clip->data))); g_free (name); if (GES_TIMELINE_ELEMENT_INPOINT (clip->data)) - g_print (" inpoint=%" GST_TIME_FORMAT, + gst_print (" inpoint=%" GST_TIME_FORMAT, GST_TIME_ARGS (GES_TIMELINE_ELEMENT_INPOINT (clip->data))); - g_print (" duration=%" GST_TIME_FORMAT "\n", + gst_print (" duration=%" GST_TIME_FORMAT "\n", GST_TIME_ARGS (GES_TIMELINE_ELEMENT_END (clip->data))); } if (layer->next) - g_printerr ("\n"); + gst_printerr ("\n"); g_list_free_full (clips, gst_object_unref); } - g_print ("\n"); + gst_print ("\n"); }