1 /* GStreamer
2 * Copyright (C) 2013 Stefan Sauer <ensonic@users.sf.net>
3 *
4 * gsttracerfactory.c: tracing subsystem
5 *
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version.
10 *
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Library General Public License for more details.
15 *
16 * You should have received a copy of the GNU Library General Public
17 * License along with this library; if not, write to the
18 * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
19 * Boston, MA 02110-1301, USA.
20 */
21
22 /**
23 * SECTION:gsttracerfactory
24 * @title: GstTracerFactory
25 * @short_description: Information about registered tracer functions
26 *
27 * Use gst_tracer_factory_get_list() to get a list of tracer factories known to
28 * GStreamer.
29 */
30
31 #include "gst_private.h"
32 #include "gstinfo.h"
33 #include "gsttracerfactory.h"
34 #include "gstregistry.h"
35
36 GST_DEBUG_CATEGORY (tracer_debug);
37 #define GST_CAT_DEFAULT tracer_debug
38
39 #define _do_init \
40 { \
41 GST_DEBUG_CATEGORY_INIT (tracer_debug, "GST_TRACER", \
42 GST_DEBUG_FG_BLUE, "tracing subsystem"); \
43 }
44
45 #define gst_tracer_factory_parent_class parent_class
46 G_DEFINE_TYPE_WITH_CODE (GstTracerFactory, gst_tracer_factory,
47 GST_TYPE_PLUGIN_FEATURE, _do_init);
48
49 static void
gst_tracer_factory_class_init(GstTracerFactoryClass * klass)50 gst_tracer_factory_class_init (GstTracerFactoryClass * klass)
51 {
52 }
53
54 static void
gst_tracer_factory_init(GstTracerFactory * factory)55 gst_tracer_factory_init (GstTracerFactory * factory)
56 {
57 }
58
59 /**
60 * gst_tracer_factory_get_list:
61 *
62 * Gets the list of all registered tracer factories. You must free the
63 * list using gst_plugin_feature_list_free().
64 *
65 * The returned factories are sorted by factory name.
66 *
67 * Free-function: gst_plugin_feature_list_free
68 *
69 * Returns: (transfer full) (element-type Gst.TracerFactory): the list of all
70 * registered #GstTracerFactory.
71 *
72 * Since: 1.8
73 */
74 GList *
gst_tracer_factory_get_list(void)75 gst_tracer_factory_get_list (void)
76 {
77 return gst_registry_get_feature_list (gst_registry_get (),
78 GST_TYPE_TRACER_FACTORY);
79 }
80
81 /**
82 * gst_tracer_factory_get_tracer_type:
83 * @factory: factory to get managed #GType from
84 *
85 * Get the #GType for elements managed by this factory. The type can
86 * only be retrieved if the element factory is loaded, which can be
87 * assured with gst_plugin_feature_load().
88 *
89 * Returns: the #GType for tracers managed by this factory or 0 if
90 * the factory is not loaded.
91 *
92 * Since: 1.14
93 */
94 GType
gst_tracer_factory_get_tracer_type(GstTracerFactory * factory)95 gst_tracer_factory_get_tracer_type (GstTracerFactory * factory)
96 {
97 g_return_val_if_fail (GST_IS_TRACER_FACTORY (factory), 0);
98
99 return factory->type;
100 }
101