static void gst_stats_tracer_init (GstStatsTracer * self) { GstTracer *tracer = GST_TRACER (self); gst_tracing_register_hook (tracer, "pad-push-pre", G_CALLBACK (do_push_buffer_pre)); gst_tracing_register_hook (tracer, "pad-push-post", G_CALLBACK (do_push_buffer_post)); gst_tracing_register_hook (tracer, "pad-push-list-pre", G_CALLBACK (do_push_buffer_list_pre)); gst_tracing_register_hook (tracer, "pad-push-list-post", G_CALLBACK (do_push_buffer_list_post)); gst_tracing_register_hook (tracer, "pad-pull-range-pre", G_CALLBACK (do_pull_range_pre)); gst_tracing_register_hook (tracer, "pad-pull-range-post", G_CALLBACK (do_pull_range_post)); gst_tracing_register_hook (tracer, "pad-push-event-pre", G_CALLBACK (do_push_event_pre)); gst_tracing_register_hook (tracer, "element-new", G_CALLBACK (do_element_new)); gst_tracing_register_hook (tracer, "element-post-message-pre", G_CALLBACK (do_post_message_pre)); gst_tracing_register_hook (tracer, "element-query-pre", G_CALLBACK (do_element_query_pre)); gst_tracing_register_hook (tracer, "pad-query-pre", G_CALLBACK (do_query_pre)); gst_tracing_register_hook (tracer, "pad-query-post", G_CALLBACK (do_query_post)); }
static void gst_rusage_tracer_init (GstRUsageTracer * self) { GstTracer *tracer = GST_TRACER (self); gint i; const gchar *hooks[] = { "pad-push-pre", "pad-push-post", "pad-push-list-pre", "pad-push-list-post", "pad-pull-range-pre", "pad-pull-range-post", "pad-push-event-pre", "pad-push-event-post", "pad-query-pre", "pad-query-post", "element-post-message-pre", "element-post-message-post", "element-query-pre", "element-query-post", "element-new", "element-add-pad", "element-remove-pad", "element-change-state-pre", "element-change-state-post", "bin-add-pre", "bin-add-post", "bin-remove-pre", "bin-remove-post", "pad-link-pre", "pad-link-post", "pad-unlink-pre", "pad-unlink-post" }; for (i = 0; i < G_N_ELEMENTS (hooks); i++) { gst_tracing_register_hook (tracer, hooks[i], G_CALLBACK (do_stats)); } self->threads = g_hash_table_new_full (NULL, NULL, NULL, free_thread_stats); self->tvs_proc = make_trace_values (GST_SECOND); self->main_thread_id = g_thread_self (); GST_DEBUG ("rusage: main thread=%p", self->main_thread_id); }
static void gst_validate_runner_init (GstValidateRunner * runner) { runner->priv = G_TYPE_INSTANCE_GET_PRIVATE (runner, GST_TYPE_VALIDATE_RUNNER, GstValidateRunnerPrivate); g_mutex_init (&runner->priv->mutex); runner->priv->reports_by_type = g_hash_table_new (g_direct_hash, g_direct_equal); runner->priv->default_level = GST_VALIDATE_SHOW_DEFAULT; _init_report_levels (runner); gst_tracing_register_hook (GST_TRACER (runner), "element-new", G_CALLBACK (do_element_new)); }
static void gst_latency_tracer_init (GstLatencyTracer * self) { GstTracer *tracer = GST_TRACER (self); gst_tracing_register_hook (tracer, "pad-push-pre", G_CALLBACK (do_push_buffer_pre)); gst_tracing_register_hook (tracer, "pad-push-list-pre", G_CALLBACK (do_push_buffer_pre)); gst_tracing_register_hook (tracer, "pad-push-post", G_CALLBACK (do_push_buffer_post)); gst_tracing_register_hook (tracer, "pad-push-list-post", G_CALLBACK (do_push_buffer_post)); gst_tracing_register_hook (tracer, "pad-pull-range-pre", G_CALLBACK (do_pull_range_pre)); gst_tracing_register_hook (tracer, "pad-pull-range-post", G_CALLBACK (do_pull_range_post)); gst_tracing_register_hook (tracer, "pad-push-event-pre", G_CALLBACK (do_push_event_pre)); }
gboolean ges_validate_activate (GstPipeline * pipeline, const gchar * scenario, gboolean * needs_setting_state) { GstValidateRunner *runner = NULL; GstValidateMonitor *monitor = NULL; ges_validate_register_action_types (); ges_validate_register_issues (); if (scenario) { if (g_strcmp0 (scenario, "none")) { gchar *scenario_name = g_strconcat (scenario, "->gespipeline*", NULL); g_setenv ("GST_VALIDATE_SCENARIO", scenario_name, TRUE); g_free (scenario_name); } } runner = gst_validate_runner_new (); gst_tracing_register_hook (GST_TRACER (runner), "bin-add-post", G_CALLBACK (bin_element_added)); g_signal_connect (runner, "report-added", G_CALLBACK (_validate_report_added_cb), pipeline); monitor = gst_validate_monitor_factory_create (GST_OBJECT_CAST (pipeline), runner, NULL); gst_validate_reporter_set_handle_g_logs (GST_VALIDATE_REPORTER (monitor)); g_object_get (monitor, "handles-states", needs_setting_state, NULL); *needs_setting_state = !*needs_setting_state; g_object_set_data (G_OBJECT (pipeline), MONITOR_ON_PIPELINE, monitor); g_object_set_data (G_OBJECT (pipeline), RUNNER_ON_PIPELINE, runner); return TRUE; }
static void gst_tracer_dispose (GObject * object) { GstTracer *tracer = GST_TRACER (object); g_free (tracer->priv->params); }