summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Dröge <sebastian@centricular.com>2014-12-19 15:05:58 +0100
committerSebastian Dröge <sebastian@centricular.com>2014-12-19 15:05:58 +0100
commitd632a48d6c1fd94754c76c3bdd48d3e27c289e7c (patch)
tree9091830d62f644bd39b07def93399a84c6900226
parent5e7782ca3988b043c49d22d3136963dcadb821ee (diff)
decklink: Fix various compiler warnings with gccdecklink-rewrite
-rw-r--r--sys/decklink/gstdecklink.cpp16
-rw-r--r--sys/decklink/gstdecklinkaudiosrc.cpp6
-rw-r--r--sys/decklink/gstdecklinkaudiosrc.h2
3 files changed, 9 insertions, 15 deletions
diff --git a/sys/decklink/gstdecklink.cpp b/sys/decklink/gstdecklink.cpp
index b51f64ba2..3f3b0a77d 100644
--- a/sys/decklink/gstdecklink.cpp
+++ b/sys/decklink/gstdecklink.cpp
@@ -235,6 +235,7 @@ struct _GstDecklinkClockClass
};
GType gst_decklink_clock_get_type (void);
+static GstClock * gst_decklink_clock_new (const gchar * name);
typedef struct _Device Device;
struct _Device
@@ -419,9 +420,7 @@ init_devices (gpointer data)
GST_WARNING ("selected device does not have input interface");
} else {
devices[i].input.device = decklink;
- devices[i].input.clock =
- GST_CLOCK_CAST (g_object_new (GST_TYPE_DECKLINK_CLOCK, "name",
- "GstDecklinkInputClock", NULL));
+ devices[i].input.clock = gst_decklink_clock_new ("GstDecklinkInputClock");
GST_DECKLINK_CLOCK_CAST (devices[i].input.clock)->input =
devices[i].input.input;
devices[i].input.
@@ -435,9 +434,7 @@ init_devices (gpointer data)
GST_WARNING ("selected device does not have output interface");
} else {
devices[i].output.device = decklink;
- devices[i].output.clock =
- GST_CLOCK_CAST (g_object_new (GST_TYPE_DECKLINK_CLOCK, "name",
- "GstDecklinkOutputClock", NULL));
+ devices[i].output.clock = gst_decklink_clock_new ("GstDecklinkOutputClock");
GST_DECKLINK_CLOCK_CAST (devices[i].output.clock)->output =
devices[i].output.output;
}
@@ -605,9 +602,6 @@ gst_decklink_release_nth_input (gint n, GstElement * src, gboolean is_audio)
G_DEFINE_TYPE (GstDecklinkClock, gst_decklink_clock, GST_TYPE_SYSTEM_CLOCK);
-static void gst_decklink_clock_class_init (GstDecklinkClockClass * klass);
-static void gst_decklink_clock_init (GstDecklinkClock * clock);
-
static GstClockTime gst_decklink_clock_get_internal_time (GstClock * clock);
static void
@@ -624,14 +618,14 @@ gst_decklink_clock_init (GstDecklinkClock * clock)
GST_OBJECT_FLAG_SET (clock, GST_CLOCK_FLAG_CAN_SET_MASTER);
}
-GstDecklinkClock *
+static GstClock *
gst_decklink_clock_new (const gchar * name)
{
GstDecklinkClock *self =
GST_DECKLINK_CLOCK (g_object_new (GST_TYPE_DECKLINK_CLOCK, "name", name,
"clock-type", GST_CLOCK_TYPE_OTHER, NULL));
- return self;
+ return GST_CLOCK_CAST (self);
}
static GstClockTime
diff --git a/sys/decklink/gstdecklinkaudiosrc.cpp b/sys/decklink/gstdecklinkaudiosrc.cpp
index 766189250..4cfc2475a 100644
--- a/sys/decklink/gstdecklinkaudiosrc.cpp
+++ b/sys/decklink/gstdecklinkaudiosrc.cpp
@@ -405,12 +405,12 @@ gst_decklink_audio_src_create (GstPushSrc * bsrc, GstBuffer ** buffer)
// Convert to the sample numbers
end_offset = gst_util_uint64_scale (end_time, self->info.rate, GST_SECOND);
- if (end_offset >= sample_count)
+ if (end_offset >= (guint64) sample_count)
start_offset = end_offset - sample_count;
else
start_offset = 0;
- if (self->next_offset == -1) {
+ if (self->next_offset == (guint64) -1) {
discont = TRUE;
} else {
guint64 diff, max_sample_diff;
@@ -445,7 +445,7 @@ gst_decklink_audio_src_create (GstPushSrc * bsrc, GstBuffer ** buffer)
if (discont) {
// Have discont, need resync and use the capture timestamps
- if (self->next_offset != -1)
+ if (self->next_offset != (guint64) -1)
GST_INFO_OBJECT (self, "Have discont. Expected %"
G_GUINT64_FORMAT ", got %" G_GUINT64_FORMAT,
self->next_offset, start_offset);
diff --git a/sys/decklink/gstdecklinkaudiosrc.h b/sys/decklink/gstdecklinkaudiosrc.h
index 55248b55e..2391a10fe 100644
--- a/sys/decklink/gstdecklinkaudiosrc.h
+++ b/sys/decklink/gstdecklinkaudiosrc.h
@@ -66,7 +66,7 @@ struct _GstDecklinkAudioSrc
GstClockTime discont_wait;
/* counter to keep track of timestamps */
- gint64 next_offset;
+ guint64 next_offset;
/* Last time we noticed a discont */
GstClockTime discont_time;