mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-18 05:16:05 +00:00
decklinkvideosrc: Add read-only "signal" property
https://bugzilla.gnome.org/show_bug.cgi?id=780367
This commit is contained in:
parent
971a481a8c
commit
7ee593e493
1 changed files with 12 additions and 1 deletions
|
@ -47,7 +47,8 @@ enum
|
||||||
PROP_TIMECODE_FORMAT,
|
PROP_TIMECODE_FORMAT,
|
||||||
PROP_OUTPUT_STREAM_TIME,
|
PROP_OUTPUT_STREAM_TIME,
|
||||||
PROP_SKIP_FIRST_TIME,
|
PROP_SKIP_FIRST_TIME,
|
||||||
PROP_DROP_NO_SIGNAL_FRAMES
|
PROP_DROP_NO_SIGNAL_FRAMES,
|
||||||
|
PROP_SIGNAL
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
|
@ -203,6 +204,11 @@ gst_decklink_video_src_class_init (GstDecklinkVideoSrcClass * klass)
|
||||||
DEFAULT_DROP_NO_SIGNAL_FRAMES,
|
DEFAULT_DROP_NO_SIGNAL_FRAMES,
|
||||||
(GParamFlags) (G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)));
|
(GParamFlags) (G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)));
|
||||||
|
|
||||||
|
g_object_class_install_property (gobject_class, PROP_SIGNAL,
|
||||||
|
g_param_spec_boolean ("signal", "Input signal available",
|
||||||
|
"True if there is a valid input signal available",
|
||||||
|
FALSE, (GParamFlags) (G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)));
|
||||||
|
|
||||||
templ_caps = gst_decklink_mode_get_template_caps (TRUE);
|
templ_caps = gst_decklink_mode_get_template_caps (TRUE);
|
||||||
gst_element_class_add_pad_template (element_class,
|
gst_element_class_add_pad_template (element_class,
|
||||||
gst_pad_template_new ("src", GST_PAD_SRC, GST_PAD_ALWAYS, templ_caps));
|
gst_pad_template_new ("src", GST_PAD_SRC, GST_PAD_ALWAYS, templ_caps));
|
||||||
|
@ -346,6 +352,9 @@ gst_decklink_video_src_get_property (GObject * object, guint property_id,
|
||||||
case PROP_DROP_NO_SIGNAL_FRAMES:
|
case PROP_DROP_NO_SIGNAL_FRAMES:
|
||||||
g_value_set_boolean (value, self->drop_no_signal_frames);
|
g_value_set_boolean (value, self->drop_no_signal_frames);
|
||||||
break;
|
break;
|
||||||
|
case PROP_SIGNAL:
|
||||||
|
g_value_set_boolean (value, !self->no_signal);
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
|
||||||
break;
|
break;
|
||||||
|
@ -801,12 +810,14 @@ gst_decklink_video_src_create (GstPushSrc * bsrc, GstBuffer ** buffer)
|
||||||
if (f->no_signal) {
|
if (f->no_signal) {
|
||||||
if (!self->no_signal) {
|
if (!self->no_signal) {
|
||||||
self->no_signal = TRUE;
|
self->no_signal = TRUE;
|
||||||
|
g_object_notify (G_OBJECT (self), "signal");
|
||||||
GST_ELEMENT_WARNING (GST_ELEMENT (self), RESOURCE, READ, ("No signal"),
|
GST_ELEMENT_WARNING (GST_ELEMENT (self), RESOURCE, READ, ("No signal"),
|
||||||
("No input source was detected - video frames invalid"));
|
("No input source was detected - video frames invalid"));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (self->no_signal) {
|
if (self->no_signal) {
|
||||||
self->no_signal = FALSE;
|
self->no_signal = FALSE;
|
||||||
|
g_object_notify (G_OBJECT (self), "signal");
|
||||||
GST_ELEMENT_INFO (GST_ELEMENT (self), RESOURCE, READ, ("Signal found"),
|
GST_ELEMENT_INFO (GST_ELEMENT (self), RESOURCE, READ, ("Signal found"),
|
||||||
("Input source detected"));
|
("Input source detected"));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue