2 * Copyright (C) 2016 "IoT.bzh"
3 * Author "Manuel Bachmann"
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, either version 3 of the License, or
8 * (at your option) any later version.
10 * This program 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
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
22 /* --------------- MEDIA RYGEL DEFINITIONS ------------------ */
25 #include <libgupnp/gupnp-control-point.h>
26 #include <libgupnp-av/gupnp-av.h>
28 #include "local-def.h"
30 #define URN_MEDIA_SERVER "urn:schemas-upnp-org:device:MediaServer:1"
31 #define URN_MEDIA_RENDERER "urn:schemas-upnp-org:device:MediaRenderer:1"
32 #define URN_CONTENT_DIR "urn:schemas-upnp-org:service:ContentDirectory"
33 #define URN_AV_TRANSPORT "urn:schemas-upnp-org:service:AVTransport"
35 typedef enum { PLAY, PAUSE, STOP, SEEK } State;
36 typedef struct dev_ctx dev_ctx_T;
40 GUPnPContext *context;
41 GUPnPDeviceInfo *device_info;
42 GUPnPServiceInfo *content_dir;
43 GUPnPServiceInfo *av_transport;
50 unsigned char transfer_started;
53 STATIC char* _rygel_list_raw (dev_ctx_T *, unsigned int *);
54 STATIC char* _rygel_find_upload_id (dev_ctx_T *, char *);
55 STATIC char* _rygel_find_id_for_index (dev_ctx_T *, char *, unsigned int);
56 STATIC char* _rygel_find_metadata_for_id (dev_ctx_T *, char *);
57 STATIC char* _rygel_find_uri_for_metadata (dev_ctx_T *, char *);
58 STATIC unsigned char _rygel_start_uploading (dev_ctx_T *, char *, char *);
59 STATIC unsigned char _rygel_start_doing (dev_ctx_T *, char *, char *, State, char *);
60 STATIC unsigned char _rygel_find_av_transport (dev_ctx_T *);
61 STATIC void _rygel_device_cb (GUPnPControlPoint *, GUPnPDeviceProxy *, gpointer);
62 STATIC void _rygel_av_transport_cb (GUPnPControlPoint *, GUPnPDeviceProxy *, gpointer);
63 STATIC void _rygel_content_cb (GUPnPServiceProxy *, GUPnPServiceProxyAction *, gpointer);
64 STATIC void _rygel_metadata_cb (GUPnPServiceProxy *, GUPnPServiceProxyAction *, gpointer);
65 STATIC void _rygel_select_cb (GUPnPServiceProxy *, GUPnPServiceProxyAction *, gpointer);
66 STATIC void _rygel_upload_cb (GUPnPServiceProxy *, GUPnPServiceProxyAction *, gpointer);
67 STATIC void _rygel_transfer_cb (GUPnPServiceProxy *, GUPnPServiceProxyAction *, gpointer);
68 STATIC void _rygel_do_cb (GUPnPServiceProxy *, GUPnPServiceProxyAction *, gpointer);
70 static unsigned int client_count = 0;
71 static struct dev_ctx **dev_ctx = NULL;
73 #endif /* MEDIA_RYGEL_H */