1 /* GStreamer
2  *
3  * Copyright (C) 2014-2015 Sebastian Dröge <sebastian@centricular.com>
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Library General Public
7  * License as published by the Free Software Foundation; either
8  * version 2 of the License, or (at your option) any later version.
9  *
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13  * Library General Public License for more details.
14  *
15  * You should have received a copy of the GNU Library General Public
16  * License along with this library; if not, write to the
17  * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
18  * Boston, MA 02110-1301, USA.
19  */
20 
21 #ifdef HAVE_CONFIG_H
22 #include "config.h"
23 #endif
24 
25 #include "gstplayer-signal-dispatcher.h"
26 #include "gstplayer-signal-dispatcher-private.h"
27 
28 G_DEFINE_INTERFACE (GstPlayerSignalDispatcher, gst_player_signal_dispatcher,
29     G_TYPE_OBJECT);
30 
31 static void
gst_player_signal_dispatcher_default_init(G_GNUC_UNUSED GstPlayerSignalDispatcherInterface * iface)32 gst_player_signal_dispatcher_default_init (G_GNUC_UNUSED
33     GstPlayerSignalDispatcherInterface * iface)
34 {
35 
36 }
37 
38 void
gst_player_signal_dispatcher_dispatch(GstPlayerSignalDispatcher * self,GstPlayer * player,GstPlayerSignalDispatcherFunc emitter,gpointer data,GDestroyNotify destroy)39 gst_player_signal_dispatcher_dispatch (GstPlayerSignalDispatcher * self,
40     GstPlayer * player, GstPlayerSignalDispatcherFunc emitter, gpointer data,
41     GDestroyNotify destroy)
42 {
43   GstPlayerSignalDispatcherInterface *iface;
44 
45   if (!self) {
46     emitter (data);
47     if (destroy)
48       destroy (data);
49     return;
50   }
51 
52   g_return_if_fail (GST_IS_PLAYER_SIGNAL_DISPATCHER (self));
53   iface = GST_PLAYER_SIGNAL_DISPATCHER_GET_INTERFACE (self);
54   g_return_if_fail (iface->dispatch != NULL);
55 
56   iface->dispatch (self, player, emitter, data, destroy);
57 }
58