diff options
author | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2007-12-03 15:21:55 +0000 |
---|---|---|
committer | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2007-12-03 15:21:55 +0000 |
commit | d64841422414fb8e8f2b64cd279e9ad9a92aae05 (patch) | |
tree | 0aaed07ccc2fdde86ab886db9d2588f2618b3bd5 /telepathy-glib/media-interfaces.c | |
parent | 27201fd88037234905c2207164ab8b05bc5f50c7 (diff) | |
download | telepathy-glib-d64841422414fb8e8f2b64cd279e9ad9a92aae05.tar.gz |
Add convenience constructors for TpMediaStreamHandler and TpMediaSessionHandler
20071203152155-53eee-bac764cf882d9ad9115490ceab1371d283f61349.gz
Diffstat (limited to 'telepathy-glib/media-interfaces.c')
-rw-r--r-- | telepathy-glib/media-interfaces.c | 74 |
1 files changed, 74 insertions, 0 deletions
diff --git a/telepathy-glib/media-interfaces.c b/telepathy-glib/media-interfaces.c index d4fc35b74..451d83aca 100644 --- a/telepathy-glib/media-interfaces.c +++ b/telepathy-glib/media-interfaces.c @@ -72,6 +72,43 @@ tp_media_stream_handler_class_init (TpMediaStreamHandlerClass *klass) } /** + * tp_media_stream_handler_new: + * @dbus: a D-Bus daemon; may not be %NULL + * @unique_name: the unique name of the connection process; may not be %NULL + * or a well-known name + * @object_path: the object path of the media stream handler; may not be %NULL + * @error: used to indicate the error if %NULL is returned + * + * <!-- --> + * + * Returns: a new media stream handler proxy, or %NULL on invalid arguments + */ +TpMediaStreamHandler * +tp_media_stream_handler_new (TpDBusDaemon *dbus, + const gchar *unique_name, + const gchar *object_path, + GError **error) +{ + TpMediaStreamHandler *ret = NULL; + + if (!tp_dbus_check_valid_bus_name (bus_name, + TP_DBUS_NAME_TYPE_UNIQUE, error)) + goto finally; + + if (!tp_dbus_check_valid_object_path (object_path, error)) + goto finally; + + ret = TP_MEDIA_STREAM_HANDLER (g_object_new (TP_TYPE_MEDIA_STREAM_HANDLER, + "dbus-daemon", dbus, + "bus-name", bus_name, + "object-path", object_path, + NULL)); + +finally: + return ret; +} + +/** * TpMediaSessionHandlerClass: * * The class of a #TpMediaSessionHandler. @@ -108,3 +145,40 @@ tp_media_session_handler_class_init (TpMediaSessionHandlerClass *klass) proxy_class->must_have_unique_name = TRUE; proxy_class->interface = TP_IFACE_QUARK_MEDIA_SESSION_HANDLER; } + +/** + * tp_media_session_handler_new: + * @dbus: a D-Bus daemon; may not be %NULL + * @unique_name: the unique name of the connection process; may not be %NULL + * or a well-known name + * @object_path: the object path of the media session handler; may not be %NULL + * @error: used to indicate the error if %NULL is returned + * + * <!-- --> + * + * Returns: a new media session handler proxy, or %NULL on invalid arguments + */ +TpMediaSessionHandler * +tp_media_session_handler_new (TpDBusDaemon *dbus, + const gchar *unique_name, + const gchar *object_path + GError **error) +{ + TpMediaSessionHandler *ret = NULL; + + if (!tp_dbus_check_valid_bus_name (bus_name, + TP_DBUS_NAME_TYPE_UNIQUE, error)) + goto finally; + + if (!tp_dbus_check_valid_object_path (object_path, error)) + goto finally; + + ret = TP_MEDIA_SESSION_HANDLER (g_object_new (TP_TYPE_MEDIA_SESSION_HANDLER, + "dbus-daemon", dbus, + "bus-name", bus_name, + "object-path", object_path, + NULL)); + +finally: + return ret; +} |