decklink: Fix various compiler warnings with gcc
This commit is contained in:
parent
5e7782ca39
commit
d632a48d6c
@ -235,6 +235,7 @@ struct _GstDecklinkClockClass
|
|||||||
};
|
};
|
||||||
|
|
||||||
GType gst_decklink_clock_get_type (void);
|
GType gst_decklink_clock_get_type (void);
|
||||||
|
static GstClock * gst_decklink_clock_new (const gchar * name);
|
||||||
|
|
||||||
typedef struct _Device Device;
|
typedef struct _Device Device;
|
||||||
struct _Device
|
struct _Device
|
||||||
@ -419,9 +420,7 @@ init_devices (gpointer data)
|
|||||||
GST_WARNING ("selected device does not have input interface");
|
GST_WARNING ("selected device does not have input interface");
|
||||||
} else {
|
} else {
|
||||||
devices[i].input.device = decklink;
|
devices[i].input.device = decklink;
|
||||||
devices[i].input.clock =
|
devices[i].input.clock = gst_decklink_clock_new ("GstDecklinkInputClock");
|
||||||
GST_CLOCK_CAST (g_object_new (GST_TYPE_DECKLINK_CLOCK, "name",
|
|
||||||
"GstDecklinkInputClock", NULL));
|
|
||||||
GST_DECKLINK_CLOCK_CAST (devices[i].input.clock)->input =
|
GST_DECKLINK_CLOCK_CAST (devices[i].input.clock)->input =
|
||||||
devices[i].input.input;
|
devices[i].input.input;
|
||||||
devices[i].input.
|
devices[i].input.
|
||||||
@ -435,9 +434,7 @@ init_devices (gpointer data)
|
|||||||
GST_WARNING ("selected device does not have output interface");
|
GST_WARNING ("selected device does not have output interface");
|
||||||
} else {
|
} else {
|
||||||
devices[i].output.device = decklink;
|
devices[i].output.device = decklink;
|
||||||
devices[i].output.clock =
|
devices[i].output.clock = gst_decklink_clock_new ("GstDecklinkOutputClock");
|
||||||
GST_CLOCK_CAST (g_object_new (GST_TYPE_DECKLINK_CLOCK, "name",
|
|
||||||
"GstDecklinkOutputClock", NULL));
|
|
||||||
GST_DECKLINK_CLOCK_CAST (devices[i].output.clock)->output =
|
GST_DECKLINK_CLOCK_CAST (devices[i].output.clock)->output =
|
||||||
devices[i].output.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);
|
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 GstClockTime gst_decklink_clock_get_internal_time (GstClock * clock);
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@ -624,14 +618,14 @@ gst_decklink_clock_init (GstDecklinkClock * clock)
|
|||||||
GST_OBJECT_FLAG_SET (clock, GST_CLOCK_FLAG_CAN_SET_MASTER);
|
GST_OBJECT_FLAG_SET (clock, GST_CLOCK_FLAG_CAN_SET_MASTER);
|
||||||
}
|
}
|
||||||
|
|
||||||
GstDecklinkClock *
|
static GstClock *
|
||||||
gst_decklink_clock_new (const gchar * name)
|
gst_decklink_clock_new (const gchar * name)
|
||||||
{
|
{
|
||||||
GstDecklinkClock *self =
|
GstDecklinkClock *self =
|
||||||
GST_DECKLINK_CLOCK (g_object_new (GST_TYPE_DECKLINK_CLOCK, "name", name,
|
GST_DECKLINK_CLOCK (g_object_new (GST_TYPE_DECKLINK_CLOCK, "name", name,
|
||||||
"clock-type", GST_CLOCK_TYPE_OTHER, NULL));
|
"clock-type", GST_CLOCK_TYPE_OTHER, NULL));
|
||||||
|
|
||||||
return self;
|
return GST_CLOCK_CAST (self);
|
||||||
}
|
}
|
||||||
|
|
||||||
static GstClockTime
|
static GstClockTime
|
||||||
|
@ -405,12 +405,12 @@ gst_decklink_audio_src_create (GstPushSrc * bsrc, GstBuffer ** buffer)
|
|||||||
|
|
||||||
// Convert to the sample numbers
|
// Convert to the sample numbers
|
||||||
end_offset = gst_util_uint64_scale (end_time, self->info.rate, GST_SECOND);
|
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;
|
start_offset = end_offset - sample_count;
|
||||||
else
|
else
|
||||||
start_offset = 0;
|
start_offset = 0;
|
||||||
|
|
||||||
if (self->next_offset == -1) {
|
if (self->next_offset == (guint64) -1) {
|
||||||
discont = TRUE;
|
discont = TRUE;
|
||||||
} else {
|
} else {
|
||||||
guint64 diff, max_sample_diff;
|
guint64 diff, max_sample_diff;
|
||||||
@ -445,7 +445,7 @@ gst_decklink_audio_src_create (GstPushSrc * bsrc, GstBuffer ** buffer)
|
|||||||
|
|
||||||
if (discont) {
|
if (discont) {
|
||||||
// Have discont, need resync and use the capture timestamps
|
// 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 %"
|
GST_INFO_OBJECT (self, "Have discont. Expected %"
|
||||||
G_GUINT64_FORMAT ", got %" G_GUINT64_FORMAT,
|
G_GUINT64_FORMAT ", got %" G_GUINT64_FORMAT,
|
||||||
self->next_offset, start_offset);
|
self->next_offset, start_offset);
|
||||||
|
@ -66,7 +66,7 @@ struct _GstDecklinkAudioSrc
|
|||||||
GstClockTime discont_wait;
|
GstClockTime discont_wait;
|
||||||
|
|
||||||
/* counter to keep track of timestamps */
|
/* counter to keep track of timestamps */
|
||||||
gint64 next_offset;
|
guint64 next_offset;
|
||||||
|
|
||||||
/* Last time we noticed a discont */
|
/* Last time we noticed a discont */
|
||||||
GstClockTime discont_time;
|
GstClockTime discont_time;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user