Initial Submission of GUPnP-DLNA to Tizen IVI
[profile/ivi/GUPnP-DLNA.git] / libgupnp-dlna / gupnp-dlna-discoverer.h
1 /*
2  * Copyright (C) 2010 Nokia Corporation.
3  *
4  * Authors: Arun Raghavan <arun.raghavan@collabora.co.uk>
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2 of the License, or (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this library; if not, write to the
18  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
19  * Boston, MA 02111-1307, USA.
20  */
21
22 #ifndef _GUPNP_DLNA_DISCOVERER
23 #define _GUPNP_DLNA_DISCOVERER
24
25 #include <glib-object.h>
26 #include <gst/pbutils/pbutils.h>
27 #include "gupnp-dlna-information.h"
28 #include "gupnp-dlna-profile.h"
29
30 G_BEGIN_DECLS
31
32 #define GUPNP_TYPE_DLNA_DISCOVERER gupnp_dlna_discoverer_get_type()
33
34 #define GUPNP_DLNA_DISCOVERER(obj)                                      \
35         (G_TYPE_CHECK_INSTANCE_CAST ((obj),                             \
36                                      GUPNP_TYPE_DLNA_DISCOVERER,        \
37                                      GUPnPDLNADiscoverer))
38
39 #define GUPNP_DLNA_DISCOVERER_CLASS(klass)                      \
40         (G_TYPE_CHECK_CLASS_CAST ((klass),                      \
41                                   GUPNP_TYPE_DLNA_DISCOVERER,   \
42                                   GUPnPDLNADiscovererClass))
43
44 #define GUPNP_IS_DLNA_DISCOVERER(obj)                                   \
45         (G_TYPE_CHECK_INSTANCE_TYPE ((obj),                             \
46                                      GUPNP_TYPE_DLNA_DISCOVERER))
47
48 #define GUPNP_IS_DLNA_DISCOVERER_CLASS(klass)                   \
49         (G_TYPE_CHECK_CLASS_TYPE ((klass),                      \
50                                   GUPNP_TYPE_DLNA_DISCOVERER))
51
52 #define GUPNP_DLNA_DISCOVERER_GET_CLASS(obj)                    \
53         (G_TYPE_INSTANCE_GET_CLASS ((obj),                      \
54                                     GUPNP_TYPE_DLNA_DISCOVERER, \
55                                     GUPnPDLNADiscovererClass))
56
57 /**
58  * GUPnPDLNADiscoverer:
59  *
60  * The top-level object used to for metadata extraction.
61  */
62 typedef struct {
63         GstDiscoverer parent;
64 } GUPnPDLNADiscoverer;
65
66 typedef struct {
67         GstDiscovererClass parent_class;
68
69         /*< signals >*/
70         void (*done) (GUPnPDLNADiscoverer *discoverer,
71                       GUPnPDLNAInformation *dlna,
72                       GError *err);
73
74         /*< private >*/
75         GList *profiles_list[2][2];
76
77 } GUPnPDLNADiscovererClass;
78
79 GType gupnp_dlna_discoverer_get_type (void);
80
81 GUPnPDLNADiscoverer *
82 gupnp_dlna_discoverer_new (GstClockTime timeout,
83                            gboolean     relaxed_mode,
84                            gboolean     extended_mode);
85
86 /* Asynchronous API */
87 #define gupnp_dlna_discoverer_start(discoverer) \
88         gst_discoverer_start(GST_DISCOVERER((discoverer)))
89 #define gupnp_dlna_discoverer_stop(discoverer) \
90         gst_discoverer_stop(GST_DISCOVERER((discoverer)))
91 gboolean
92 gupnp_dlna_discoverer_discover_uri (GUPnPDLNADiscoverer *discoverer,
93                                     const gchar         *uri);
94
95 /* Synchronous API */
96 GUPnPDLNAInformation *
97 gupnp_dlna_discoverer_discover_uri_sync (GUPnPDLNADiscoverer *discoverer,
98                                          const gchar         *uri,
99                                          GError              **err);
100
101 /* Get a GUPnPDLNAProfile by name */
102 GUPnPDLNAProfile *
103 gupnp_dlna_discoverer_get_profile (GUPnPDLNADiscoverer *self,
104                                    const gchar         *name);
105
106 /* API to list all available profiles */
107 const GList *
108 gupnp_dlna_discoverer_list_profiles (GUPnPDLNADiscoverer *self);
109 gboolean
110 gupnp_dlna_discoverer_get_relaxed_mode (GUPnPDLNADiscoverer *self);
111 gboolean
112 gupnp_dlna_discoverer_get_extended_mode (GUPnPDLNADiscoverer *self);
113
114 G_END_DECLS
115
116 #endif /* _GUPNP_DLNA_DISCOVERER */