static GstStructure * kms_recorder_endpoint_stats (KmsElement * obj, gchar * selector) { KmsRecorderEndpoint *self = KMS_RECORDER_ENDPOINT (obj); GstStructure *stats, *e_stats, *l_stats; /* chain up */ stats = KMS_ELEMENT_CLASS (kms_recorder_endpoint_parent_class)->stats (obj, selector); if (!self->priv->stats.enabled) { return stats; } e_stats = kms_stats_get_element_stats (stats); if (e_stats == NULL) { return stats; } l_stats = kms_element_get_e2e_latency_stats (self, selector); /* Add end to end latency */ gst_structure_set (e_stats, "e2e-latencies", GST_TYPE_STRUCTURE, l_stats, NULL); gst_structure_free (l_stats); GST_DEBUG_OBJECT (self, "Stats: %" GST_PTR_FORMAT, stats); return stats; }
static void kms_recorder_endpoint_class_init (KmsRecorderEndpointClass * klass) { KmsUriEndpointClass *urienpoint_class = KMS_URI_ENDPOINT_CLASS (klass); KmsElementClass *kms_element_class; GObjectClass *gobject_class = G_OBJECT_CLASS (klass); gst_element_class_set_static_metadata (GST_ELEMENT_CLASS (klass), "RecorderEndpoint", "Sink/Generic", "Kurento plugin recorder end point", "Santiago Carot-Nemesio <*****@*****.**>"); gobject_class->dispose = kms_recorder_endpoint_dispose; gobject_class->finalize = kms_recorder_endpoint_finalize; urienpoint_class->stopped = kms_recorder_endpoint_stopped; urienpoint_class->started = kms_recorder_endpoint_started; urienpoint_class->paused = kms_recorder_endpoint_paused; kms_element_class = KMS_ELEMENT_CLASS (klass); kms_element_class->sink_query = GST_DEBUG_FUNCPTR (kms_recorder_endpoint_sink_query); kms_element_class->collect_media_stats = GST_DEBUG_FUNCPTR (kms_recorder_endpoint_collect_media_stats); kms_element_class->stats = GST_DEBUG_FUNCPTR (kms_recorder_endpoint_stats); kms_element_class->request_new_sink_pad = GST_DEBUG_FUNCPTR (kms_recorder_endpoint_request_new_sink_pad); kms_element_class->release_requested_sink_pad = GST_DEBUG_FUNCPTR (kms_recorder_endpoint_release_requested_sink_pad); gobject_class->set_property = GST_DEBUG_FUNCPTR (kms_recorder_endpoint_set_property); gobject_class->get_property = GST_DEBUG_FUNCPTR (kms_recorder_endpoint_get_property); obj_properties[PROP_DVR] = g_param_spec_boolean ("live-DVR", "Live digital video recorder", "Enables or disbles DVR", FALSE, G_PARAM_READWRITE); obj_properties[PROP_PROFILE] = g_param_spec_enum ("profile", "Recording profile", "The profile used for encapsulating the media", KMS_TYPE_RECORDING_PROFILE, DEFAULT_RECORDING_PROFILE, G_PARAM_READWRITE); g_object_class_install_properties (gobject_class, N_PROPERTIES, obj_properties); /* Registers a private structure for the instantiatable type */ g_type_class_add_private (klass, sizeof (KmsRecorderEndpointPrivate)); }
static void kms_recorder_endpoint_collect_media_stats (KmsElement * obj, gboolean enable) { KmsRecorderEndpoint *self = KMS_RECORDER_ENDPOINT (obj); KMS_ELEMENT_LOCK (self); self->priv->stats.enabled = enable; kms_recorder_endpoint_update_media_stats (self); KMS_ELEMENT_UNLOCK (self); KMS_ELEMENT_CLASS (kms_recorder_endpoint_parent_class)->collect_media_stats (obj, enable); }
static void kms_dummy_sink_class_init (KmsDummySinkClass * klass) { KmsElementClass *kmselement_class; GstElementClass *gstelement_class; GObjectClass *gobject_class; gobject_class = G_OBJECT_CLASS (klass); gobject_class->set_property = kms_dummy_sink_set_property; gobject_class->get_property = kms_dummy_sink_get_property; gobject_class->finalize = kms_dummy_sink_finalize; kmselement_class = KMS_ELEMENT_CLASS (klass); kmselement_class->request_new_sink_pad = GST_DEBUG_FUNCPTR (kms_dummy_sink_request_new_sink_pad); kmselement_class->release_requested_sink_pad = GST_DEBUG_FUNCPTR (kms_dummy_sink_release_requested_sink_pad); gstelement_class = GST_ELEMENT_CLASS (klass); gst_element_class_set_details_simple (gstelement_class, "KmsDummySink", "Generic", "Dummy sink element", "Santiago Carot-Nemesio <*****@*****.**>"); obj_properties[PROP_DATA] = g_param_spec_boolean ("data", "Data", "Provides data on TRUE", FALSE, (G_PARAM_CONSTRUCT | G_PARAM_READWRITE)); obj_properties[PROP_AUDIO] = g_param_spec_boolean ("audio", "Audio", "Provides audio on TRUE", FALSE, (G_PARAM_CONSTRUCT | G_PARAM_READWRITE)); obj_properties[PROP_VIDEO] = g_param_spec_boolean ("video", "Video", "Provides video on TRUE", FALSE, (G_PARAM_CONSTRUCT | G_PARAM_READWRITE)); g_object_class_install_properties (gobject_class, N_PROPERTIES, obj_properties); g_type_class_add_private (klass, sizeof (KmsDummySinkPrivate)); }
static gboolean kms_recorder_endpoint_sink_query (KmsElement * self, GstPad * pad, GstQuery * query) { gboolean ret; switch (GST_QUERY_TYPE (query)) { case GST_QUERY_CAPS: ret = kms_recorder_endpoint_query_caps (self, pad, query); break; case GST_QUERY_ACCEPT_CAPS: ret = kms_recorder_endpoint_query_accept_caps (self, pad, query); break; default: ret = KMS_ELEMENT_CLASS (kms_recorder_endpoint_parent_class)->sink_query (self, pad, query); } return ret; }
static void kms_mixer_end_point_class_init (KmsMixerEndPointClass * klass) { GObjectClass *gobject_class = G_OBJECT_CLASS (klass); GstElementClass *gstelement_class = GST_ELEMENT_CLASS (klass); KmsElementClass *kms_element_class; gst_element_class_set_static_metadata (GST_ELEMENT_CLASS (klass), "MixerEndPoint", "Generic", "Kurento plugin for mixer connection", "Jose Antonio Santos Cadenas <*****@*****.**>"); gobject_class->dispose = kms_mixer_end_point_dispose; gobject_class->finalize = kms_mixer_end_point_finalize; kms_element_class = KMS_ELEMENT_CLASS (klass); kms_element_class->audio_valve_added = GST_DEBUG_FUNCPTR (kms_mixer_endpoint_audio_valve_added); kms_element_class->video_valve_added = GST_DEBUG_FUNCPTR (kms_mixer_endpoint_video_valve_added); kms_element_class->audio_valve_removed = GST_DEBUG_FUNCPTR (kms_mixer_endpoint_audio_valve_removed); kms_element_class->video_valve_removed = GST_DEBUG_FUNCPTR (kms_mixer_endpoint_video_valve_removed); gstelement_class->request_new_pad = GST_DEBUG_FUNCPTR (kms_mixer_endpoint_request_new_pad); gst_element_class_add_pad_template (gstelement_class, gst_static_pad_template_get (&mixer_audio_src_factory)); gst_element_class_add_pad_template (gstelement_class, gst_static_pad_template_get (&mixer_video_src_factory)); gst_element_class_add_pad_template (gstelement_class, gst_static_pad_template_get (&mixer_audio_sink_factory)); gst_element_class_add_pad_template (gstelement_class, gst_static_pad_template_get (&mixer_video_sink_factory)); /* Registers a private structure for the instantiatable type */ g_type_class_add_private (klass, sizeof (KmsMixerEndPointPrivate)); }