2 * renderer-service-upnp
4 * Copyright (C) 2012 Intel Corporation. All rights reserved.
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms and conditions of the GNU Lesser General Public License,
8 * version 2.1, as published by the Free Software Foundation.
10 * This program is distributed in the hope it will be useful, but WITHOUT
11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
15 * You should have received a copy of the GNU Lesser General Public License
16 * along with this program; if not, write to the Free Software Foundation, Inc.,
17 * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
19 * Mark Ryan <mark.d.ryan@intel.com>
23 #ifndef RSU_DEVICE_H__
24 #define RSU_DEVICE_H__
29 #include "host-service.h"
32 typedef struct rsu_device_t_ rsu_device_t;
34 typedef struct rsu_service_proxies_t_ rsu_service_proxies_t;
35 struct rsu_service_proxies_t_ {
36 GUPnPServiceProxy *cm_proxy;
37 GUPnPServiceProxy *av_proxy;
38 GUPnPServiceProxy *rc_proxy;
41 typedef struct rsu_device_context_t_ rsu_device_context_t;
42 struct rsu_device_context_t_ {
44 GUPnPDeviceProxy *device_proxy;
45 rsu_service_proxies_t service_proxies;
47 gboolean subscribed_av;
48 gboolean subscribed_cm;
49 gboolean subscribed_rc;
55 typedef struct rsu_props_t_ rsu_props_t;
57 GHashTable *root_props;
58 GHashTable *player_props;
62 struct rsu_device_t_ {
63 GDBusConnection *connection;
64 guint ids[RSU_INTERFACE_INFO_MAX];
67 gpointer current_task;
72 gboolean rsu_device_new(GDBusConnection *connection,
73 GUPnPDeviceProxy *proxy,
74 const gchar *ip_address,
76 rsu_interface_info_t *interface_info,
78 rsu_device_t **device);
80 void rsu_device_delete(void *device);
82 void rsu_device_append_new_context(rsu_device_t *device,
83 const gchar *ip_address,
84 GUPnPDeviceProxy *proxy);
85 rsu_device_t *rsu_device_from_path(const gchar *path, GHashTable *device_list);
86 rsu_device_context_t *rsu_device_get_context(rsu_device_t *device);
87 void rsu_device_subscribe_to_service_changes(rsu_device_t *device);
89 void rsu_device_get_prop(rsu_device_t *device, rsu_task_t *task,
90 GCancellable *cancellable,
91 rsu_upnp_task_complete_t cb,
93 void rsu_device_get_all_props(rsu_device_t *device, rsu_task_t *task,
94 GCancellable *cancellable,
95 rsu_upnp_task_complete_t cb,
97 void rsu_device_play(rsu_device_t *device, rsu_task_t *task,
98 GCancellable *cancellable,
99 rsu_upnp_task_complete_t cb,
101 void rsu_device_pause(rsu_device_t *device, rsu_task_t *task,
102 GCancellable *cancellable,
103 rsu_upnp_task_complete_t cb,
105 void rsu_device_play_pause(rsu_device_t *device, rsu_task_t *task,
106 GCancellable *cancellable,
107 rsu_upnp_task_complete_t cb,
109 void rsu_device_stop(rsu_device_t *device, rsu_task_t *task,
110 GCancellable *cancellable,
111 rsu_upnp_task_complete_t cb,
113 void rsu_device_next(rsu_device_t *device, rsu_task_t *task,
114 GCancellable *cancellable,
115 rsu_upnp_task_complete_t cb,
117 void rsu_device_previous(rsu_device_t *device, rsu_task_t *task,
118 GCancellable *cancellable,
119 rsu_upnp_task_complete_t cb,
121 void rsu_device_open_uri(rsu_device_t *device, rsu_task_t *task,
122 GCancellable *cancellable,
123 rsu_upnp_task_complete_t cb,
125 void rsu_device_seek(rsu_device_t *device, rsu_task_t *task,
126 GCancellable *cancellable,
127 rsu_upnp_task_complete_t cb,
129 void rsu_device_set_position(rsu_device_t *device, rsu_task_t *task,
130 GCancellable *cancellable,
131 rsu_upnp_task_complete_t cb,
133 void rsu_device_host_uri(rsu_device_t *device, rsu_task_t *task,
134 rsu_host_service_t *host_service,
135 GCancellable *cancellable,
136 rsu_upnp_task_complete_t cb,
138 void rsu_device_remove_uri(rsu_device_t *device, rsu_task_t *task,
139 rsu_host_service_t *host_service,
140 GCancellable *cancellable,
141 rsu_upnp_task_complete_t cb,