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
This commit is contained in:
Seungha Yang 2019-12-08 18:13:55 +09:00
parent 90bcaf5a43
commit c8ff6f82a5

View file

@ -27,6 +27,7 @@
#include <math.h> #include <math.h>
#include <gio/gio.h> #include <gio/gio.h>
#include <stdlib.h>
#define VIDEO_WIDTH 720 #define VIDEO_WIDTH 720
#define VIDEO_HEIGHT 480 #define VIDEO_HEIGHT 480
@ -256,7 +257,7 @@ main (int argc, char **argv)
OverlayState overlay_state = { 0, }; OverlayState overlay_state = { 0, };
GOptionContext *option_ctx; GOptionContext *option_ctx;
GError *error = NULL; GError *error = NULL;
const gchar *video_sink = "autovideosink"; gchar *video_sink = NULL;
gboolean ret; gboolean ret;
GOptionEntry options[] = { GOptionEntry options[] = {
{"videosink", 0, 0, G_OPTION_ARG_STRING, &video_sink, {"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); capsfilter = gst_element_factory_make ("capsfilter", NULL);
overlay = gst_element_factory_make ("overlaycomposition", NULL); overlay = gst_element_factory_make ("overlaycomposition", NULL);
conv = gst_element_factory_make ("videoconvert", NULL); conv = gst_element_factory_make ("videoconvert", NULL);
if (!video_sink)
video_sink = g_strdup ("autovideosink");
sink = gst_element_factory_make (video_sink, NULL); sink = gst_element_factory_make (video_sink, NULL);
g_free (video_sink);
if (!pipeline || !src || !capsfilter || !overlay || !conv || !sink) { if (!pipeline || !src || !capsfilter || !overlay || !conv || !sink) {
g_error ("Failed to create elements"); g_error ("Failed to create elements");