From c8ff6f82a5d734304542fd46e687c64ede265cea Mon Sep 17 00:00:00 2001 From: Seungha Yang Date: Sun, 8 Dec 2019 18:13:55 +0900 Subject: [PATCH] examples: overlaycomposition: Fix implicit declaration warning overlaycomposition.c:276:5: warning: implicit declaration of function 'exit' [-Wimplicit-function-declaration] overlaycomposition.c(263): warning C4090: 'initializing': different 'const' qualifiers --- tests/examples/overlaycomposition/overlaycomposition.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tests/examples/overlaycomposition/overlaycomposition.c b/tests/examples/overlaycomposition/overlaycomposition.c index bf96ebf3e2..0586bab960 100644 --- a/tests/examples/overlaycomposition/overlaycomposition.c +++ b/tests/examples/overlaycomposition/overlaycomposition.c @@ -27,6 +27,7 @@ #include #include +#include #define VIDEO_WIDTH 720 #define VIDEO_HEIGHT 480 @@ -256,7 +257,7 @@ main (int argc, char **argv) OverlayState overlay_state = { 0, }; GOptionContext *option_ctx; GError *error = NULL; - const gchar *video_sink = "autovideosink"; + gchar *video_sink = NULL; gboolean ret; GOptionEntry options[] = { {"videosink", 0, 0, G_OPTION_ARG_STRING, &video_sink, @@ -281,7 +282,12 @@ main (int argc, char **argv) capsfilter = gst_element_factory_make ("capsfilter", NULL); overlay = gst_element_factory_make ("overlaycomposition", NULL); conv = gst_element_factory_make ("videoconvert", NULL); + + if (!video_sink) + video_sink = g_strdup ("autovideosink"); + sink = gst_element_factory_make (video_sink, NULL); + g_free (video_sink); if (!pipeline || !src || !capsfilter || !overlay || !conv || !sink) { g_error ("Failed to create elements");