examples/onvif-server: fix werror build with clang
authorMatthew Waters <matthew@centricular.com>
Mon, 26 Aug 2019 12:24:12 +0000 (22:24 +1000)
committerMatthew Waters <matthew@centricular.com>
Mon, 26 Aug 2019 12:42:48 +0000 (12:42 +0000)
../subprojects/gst-rtsp-server/examples/test-onvif-server.c:346:65: warning: implicit conversion from enumeration type 'const GstSegmentFlags' to different enumeration type 'GstSeekFlags' [-Wenum-conversion]
        self->incoming_segment->format, self->incoming_segment->flags,
                                        ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~
../subprojects/gst-rtsp-server/examples/test-onvif-server.c:53:1: warning: unused function 'REPLAY_IS_BIN' [-Wunused-function]
G_DECLARE_FINAL_TYPE (ReplayBin, replay_bin, REPLAY, BIN, GstBin);
^
/usr/include/glib-2.0/gobject/gtype.h:1407:26: note: expanded from macro 'G_DECLARE_FINAL_TYPE'
  static inline gboolean MODULE##_IS_##OBJ_NAME (gpointer ptr) {                                         \
                         ^
<scratch space>:77:1: note: expanded from here
REPLAY_IS_BIN
^
../subprojects/gst-rtsp-server/examples/test-onvif-server.c:525:1: warning: unused function 'ONVIF_FACTORY' [-Wunused-function]
G_DECLARE_FINAL_TYPE (OnvifFactory, onvif_factory, ONVIF, FACTORY,
^
/usr/include/glib-2.0/gobject/gtype.h:1405:33: note: expanded from macro 'G_DECLARE_FINAL_TYPE'
  static inline ModuleObjName * MODULE##_##OBJ_NAME (gpointer ptr) {                                     \
                                ^
<scratch space>:9:1: note: expanded from here
ONVIF_FACTORY
^
../subprojects/gst-rtsp-server/examples/test-onvif-server.c:525:1: warning: unused function 'ONVIF_IS_FACTORY' [-Wunused-function]
/usr/include/glib-2.0/gobject/gtype.h:1407:26: note: expanded from macro 'G_DECLARE_FINAL_TYPE'
  static inline gboolean MODULE##_IS_##OBJ_NAME (gpointer ptr) {                                         \
                         ^
<scratch space>:12:1: note: expanded from here
ONVIF_IS_FACTORY
^

examples/test-onvif-server.c
examples/test-onvif-server.h [new file with mode: 0644]

index 260456b..9504169 100644 (file)
@@ -22,6 +22,8 @@
 
 #include <gst/rtsp-server/rtsp-server.h>
 
+#include "test-onvif-server.h"
+
 GST_DEBUG_CATEGORY_STATIC (onvif_server_debug);
 #define GST_CAT_DEFAULT (onvif_server_debug)
 
@@ -49,9 +51,6 @@ G_STMT_START { \
 /* January the first, 2000 */
 #define END_DATE 3155673600 * GST_SECOND
 
-
-G_DECLARE_FINAL_TYPE (ReplayBin, replay_bin, REPLAY, BIN, GstBin);
-
 static gchar *filename;
 
 struct _ReplayBin
@@ -343,9 +342,9 @@ translate_segment (GstPad * pad, GstEvent * ievent)
     gst_segment_init (&self->segment, self->incoming_segment->format);
 
     gst_segment_do_seek (&self->segment, self->incoming_segment->rate,
-        self->incoming_segment->format, self->incoming_segment->flags,
-        GST_SEEK_TYPE_SET, (guint64) istart, GST_SEEK_TYPE_SET, (guint64) istop,
-        &update);
+        self->incoming_segment->format,
+        (GstSeekFlags) self->incoming_segment->flags, GST_SEEK_TYPE_SET,
+        (guint64) istart, GST_SEEK_TYPE_SET, (guint64) istop, &update);
 
     self->min_pts = istart;
 
@@ -522,9 +521,6 @@ fail:
 
 /* A simple factory to set up our replay bin */
 
-G_DECLARE_FINAL_TYPE (OnvifFactory, onvif_factory, ONVIF, FACTORY,
-    GstRTSPMediaFactory);
-
 struct _OnvifFactory
 {
   GstRTSPMediaFactory parent;
diff --git a/examples/test-onvif-server.h b/examples/test-onvif-server.h
new file mode 100644 (file)
index 0000000..13d5f00
--- /dev/null
@@ -0,0 +1,32 @@
+/* GStreamer
+ * Copyright (C) 2019 Mathieu Duponchelle <mathieu@centricular.com>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+
+#include <gst/gst.h>
+
+#include <gst/rtsp-server/rtsp-server.h>
+
+G_BEGIN_DECLS
+
+G_DECLARE_FINAL_TYPE (ReplayBin, replay_bin, REPLAY, BIN, GstBin);
+
+G_DECLARE_FINAL_TYPE (OnvifFactory, onvif_factory, ONVIF, FACTORY,
+    GstRTSPMediaFactory);
+
+G_END_DECLS