Adds 2017 to copyrights
[src/app-framework-binder.git] / bindings / media / media-rygel.h
1 /*
2  * Copyright (C) 2016, 2017 "IoT.bzh"
3  * Author "Manuel Bachmann"
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  *   http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  */
17
18 #ifndef MEDIA_RYGEL_H
19 #define MEDIA_RYGEL_H
20
21 /* --------------- MEDIA RYGEL DEFINITIONS ------------------ */
22
23 #include <sys/time.h>
24 #include <json-c/json.h>
25 #include <libgupnp/gupnp-control-point.h>
26 #include <libgupnp-av/gupnp-av.h>
27
28 #include "media-api.h"
29
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"
34
35 typedef enum { PLAY, PAUSE, STOP, SEEK } State;
36 typedef struct dev_ctx dev_ctx_T;
37
38 struct dev_ctx {
39     GMainContext *loop;
40     GUPnPContext *context;
41     GUPnPDeviceInfo *device_info;
42     GUPnPServiceInfo *content_dir;
43     GUPnPServiceInfo *av_transport;
44     char *content_res;
45     int content_num;
46     State state;
47     State target_state;
48     char *action_args;
49     char *transfer_path;
50     unsigned char transfer_started;
51 };
52
53 unsigned char _rygel_init (mediaCtxHandleT *);
54 void _rygel_free (mediaCtxHandleT *);
55 json_object* _rygel_list (mediaCtxHandleT *);
56 unsigned char _rygel_select (mediaCtxHandleT *, unsigned int);
57 unsigned char _rygel_upload (mediaCtxHandleT *ctx, const char *path, void (*oncompletion)(void*,int), void *closure);
58 unsigned char _rygel_do (mediaCtxHandleT *, State, char *);
59
60 char* _rygel_list_raw (dev_ctx_T *, unsigned int *);
61 char* _rygel_find_upload_id (dev_ctx_T *, char *);
62 char* _rygel_find_id_for_index (dev_ctx_T *, char *, unsigned int);
63 char* _rygel_find_metadata_for_id (dev_ctx_T *, char *);
64 char* _rygel_find_uri_for_metadata (dev_ctx_T *, char *);
65 unsigned char _rygel_start_uploading (dev_ctx_T *, char *, char *);
66 unsigned char _rygel_start_doing (dev_ctx_T *, char *, char *, State, char *);
67 unsigned char _rygel_find_av_transport (dev_ctx_T *);
68 #endif /* MEDIA_RYGEL_H */