static void gst_type_find_element_class_init (GstTypeFindElementClass * typefind_class) { GObjectClass *gobject_class = G_OBJECT_CLASS (typefind_class); GstElementClass *gstelement_class = GST_ELEMENT_CLASS (typefind_class); gobject_class->set_property = GST_DEBUG_FUNCPTR (gst_type_find_element_set_property); gobject_class->get_property = GST_DEBUG_FUNCPTR (gst_type_find_element_get_property); gobject_class->dispose = GST_DEBUG_FUNCPTR (gst_type_find_element_dispose); typefind_class->have_type = gst_type_find_element_have_type; g_object_class_install_property (gobject_class, PROP_CAPS, g_param_spec_boxed ("caps", _("caps"), _("detected capabilities in stream"), gst_caps_get_type (), G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)); g_object_class_install_property (gobject_class, PROP_MINIMUM, g_param_spec_uint ("minimum", _("minimum"), "minimum probability required to accept caps", GST_TYPE_FIND_MINIMUM, GST_TYPE_FIND_MAXIMUM, GST_TYPE_FIND_MINIMUM, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); g_object_class_install_property (gobject_class, PROP_MAXIMUM, g_param_spec_uint ("maximum", _("maximum"), "probability to stop typefinding (deprecated; non-functional)", GST_TYPE_FIND_MINIMUM, GST_TYPE_FIND_MAXIMUM, GST_TYPE_FIND_MAXIMUM, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); g_object_class_install_property (gobject_class, PROP_FORCE_CAPS, g_param_spec_boxed ("force-caps", _("force caps"), _("force caps without doing a typefind"), gst_caps_get_type (), G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); /** * GstTypeFindElement::have-type: * @typefind: the typefind instance * @probability: the probability of the type found * @caps: the caps of the type found * * This signal gets emitted when the type and its probability has * been found. */ gst_type_find_element_signals[HAVE_TYPE] = g_signal_new ("have_type", G_TYPE_FROM_CLASS (typefind_class), G_SIGNAL_RUN_FIRST, G_STRUCT_OFFSET (GstTypeFindElementClass, have_type), NULL, NULL, gst_marshal_VOID__UINT_BOXED, G_TYPE_NONE, 2, G_TYPE_UINT, GST_TYPE_CAPS | G_SIGNAL_TYPE_STATIC_SCOPE); gstelement_class->change_state = GST_DEBUG_FUNCPTR (gst_type_find_element_change_state); }
/* * this bit handles: * - initalization of threads if we use them * - log handler * - initial output * - initializes gst_format * - registers a bunch of types for gst_objects * * - we don't have cases yet where this fails, but in the future * we might and then it's nice to be able to return that */ static gboolean init_post (GOptionContext * context, GOptionGroup * group, gpointer data, GError ** error) { GLogLevelFlags llf; #ifndef GST_DISABLE_TRACE GstTrace *gst_trace; #endif /* GST_DISABLE_TRACE */ if (gst_initialized) { GST_DEBUG ("already initialized"); return TRUE; } llf = G_LOG_LEVEL_CRITICAL | G_LOG_LEVEL_ERROR | G_LOG_FLAG_FATAL; g_log_set_handler (g_log_domain_gstreamer, llf, debug_log_handler, NULL); _priv_gst_quarks_initialize (); _gst_format_initialize (); _gst_query_initialize (); g_type_class_ref (gst_object_get_type ()); g_type_class_ref (gst_pad_get_type ()); g_type_class_ref (gst_element_factory_get_type ()); g_type_class_ref (gst_element_get_type ()); g_type_class_ref (gst_type_find_factory_get_type ()); g_type_class_ref (gst_bin_get_type ()); g_type_class_ref (gst_bus_get_type ()); g_type_class_ref (gst_task_get_type ()); g_type_class_ref (gst_clock_get_type ()); g_type_class_ref (gst_index_factory_get_type ()); gst_uri_handler_get_type (); g_type_class_ref (gst_object_flags_get_type ()); g_type_class_ref (gst_bin_flags_get_type ()); g_type_class_ref (gst_buffer_flag_get_type ()); g_type_class_ref (gst_buffer_copy_flags_get_type ()); g_type_class_ref (gst_buffer_list_item_get_type ()); g_type_class_ref (gst_bus_flags_get_type ()); g_type_class_ref (gst_bus_sync_reply_get_type ()); g_type_class_ref (gst_caps_flags_get_type ()); g_type_class_ref (gst_clock_return_get_type ()); g_type_class_ref (gst_clock_entry_type_get_type ()); g_type_class_ref (gst_clock_flags_get_type ()); g_type_class_ref (gst_clock_type_get_type ()); g_type_class_ref (gst_debug_graph_details_get_type ()); g_type_class_ref (gst_state_get_type ()); g_type_class_ref (gst_state_change_return_get_type ()); g_type_class_ref (gst_state_change_get_type ()); g_type_class_ref (gst_element_flags_get_type ()); g_type_class_ref (gst_core_error_get_type ()); g_type_class_ref (gst_library_error_get_type ()); g_type_class_ref (gst_resource_error_get_type ()); g_type_class_ref (gst_stream_error_get_type ()); g_type_class_ref (gst_event_type_flags_get_type ()); g_type_class_ref (gst_event_type_get_type ()); g_type_class_ref (gst_seek_type_get_type ()); g_type_class_ref (gst_seek_flags_get_type ()); g_type_class_ref (gst_qos_type_get_type ()); g_type_class_ref (gst_format_get_type ()); g_type_class_ref (gst_index_certainty_get_type ()); g_type_class_ref (gst_index_entry_type_get_type ()); g_type_class_ref (gst_index_lookup_method_get_type ()); g_type_class_ref (gst_assoc_flags_get_type ()); g_type_class_ref (gst_index_resolver_method_get_type ()); g_type_class_ref (gst_index_flags_get_type ()); g_type_class_ref (gst_debug_level_get_type ()); g_type_class_ref (gst_debug_color_flags_get_type ()); g_type_class_ref (gst_iterator_result_get_type ()); g_type_class_ref (gst_iterator_item_get_type ()); g_type_class_ref (gst_message_type_get_type ()); g_type_class_ref (gst_mini_object_flags_get_type ()); g_type_class_ref (gst_pad_link_return_get_type ()); g_type_class_ref (gst_pad_link_check_get_type ()); g_type_class_ref (gst_flow_return_get_type ()); g_type_class_ref (gst_activate_mode_get_type ()); g_type_class_ref (gst_pad_direction_get_type ()); g_type_class_ref (gst_pad_flags_get_type ()); g_type_class_ref (gst_pad_presence_get_type ()); g_type_class_ref (gst_pad_template_flags_get_type ()); g_type_class_ref (gst_pipeline_flags_get_type ()); g_type_class_ref (gst_plugin_error_get_type ()); g_type_class_ref (gst_plugin_flags_get_type ()); g_type_class_ref (gst_plugin_dependency_flags_get_type ()); g_type_class_ref (gst_rank_get_type ()); g_type_class_ref (gst_query_type_get_type ()); g_type_class_ref (gst_buffering_mode_get_type ()); g_type_class_ref (gst_stream_status_type_get_type ()); g_type_class_ref (gst_structure_change_type_get_type ()); g_type_class_ref (gst_tag_merge_mode_get_type ()); g_type_class_ref (gst_tag_flag_get_type ()); g_type_class_ref (gst_task_pool_get_type ()); g_type_class_ref (gst_task_state_get_type ()); g_type_class_ref (gst_alloc_trace_flags_get_type ()); g_type_class_ref (gst_type_find_probability_get_type ()); g_type_class_ref (gst_uri_type_get_type ()); g_type_class_ref (gst_parse_error_get_type ()); g_type_class_ref (gst_parse_flags_get_type ()); g_type_class_ref (gst_search_mode_get_type ()); g_type_class_ref (gst_progress_type_get_type ()); g_type_class_ref (gst_caps_intersect_mode_get_type ()); gst_structure_get_type (); _gst_value_initialize (); g_type_class_ref (gst_param_spec_fraction_get_type ()); gst_caps_get_type (); _gst_event_initialize (); _gst_buffer_initialize (); _gst_buffer_list_initialize (); gst_buffer_list_iterator_get_type (); _gst_message_initialize (); _gst_tag_initialize (); gst_parse_context_get_type (); _gst_plugin_initialize (); gst_g_error_get_type (); /* register core plugins */ gst_plugin_register_static (GST_VERSION_MAJOR, GST_VERSION_MINOR, "staticelements", "core elements linked into the GStreamer library", gst_register_core_elements, VERSION, GST_LICENSE, PACKAGE, GST_PACKAGE_NAME, GST_PACKAGE_ORIGIN); /* * Any errors happening below this point are non-fatal, we therefore mark * gstreamer as being initialized, since it is the case from a plugin point of * view. * * If anything fails, it will be put back to FALSE in gst_init_check(). * This allows some special plugins that would call gst_init() to not cause a * looping effect (i.e. initializing GStreamer twice). */ gst_initialized = TRUE; if (!gst_update_registry ()) return FALSE; #ifndef GST_DISABLE_TRACE _gst_trace_on = 0; if (_gst_trace_on) { gst_trace = gst_trace_new ("gst.trace", 1024); gst_trace_set_default (gst_trace); } #endif /* GST_DISABLE_TRACE */ GST_INFO ("GLib runtime version: %d.%d.%d", glib_major_version, glib_minor_version, glib_micro_version); GST_INFO ("GLib headers version: %d.%d.%d", GLIB_MAJOR_VERSION, GLIB_MINOR_VERSION, GLIB_MICRO_VERSION); return TRUE; }