1 /*****************************************************************************
2 * Upnp.hpp : UPnP discovery module (libupnp) header
3 *****************************************************************************
4 * Copyright (C) 2004-2010 the VideoLAN team
7 * Authors: RĂ©mi Denis-Courmont <rem # videolan.org> (original plugin)
8 * Christian Henz <henz # c-lab.de>
9 * Mirsal Ennaime <mirsal dot ennaime at gmail dot com>
11 * UPnP Plugin using the Intel SDK (libupnp) instead of CyberLink
13 * This program is free software; you can redistribute it and/or modify
14 * it under the terms of the GNU General Public License as published by
15 * the Free Software Foundation; either version 2 of the License, or
16 * (at your option) any later version.
18 * This program is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU General Public License for more details.
23 * You should have received a copy of the GNU General Public License
24 * along with this program; if not, write to the Free Software
25 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
26 *****************************************************************************/
31 #include <upnp/upnp.h>
32 #include <upnp/upnptools.h>
34 #include <vlc_common.h>
43 static void parseDeviceDescription( IXML_Document* p_doc,
44 const char* psz_location,
45 services_discovery_t* p_sd );
47 MediaServer( const char* psz_udn,
48 const char* psz_friendly_name,
49 services_discovery_t* p_sd );
53 const char* getUDN() const;
54 const char* getFriendlyName() const;
56 void setContentDirectoryEventURL( const char* psz_url );
57 const char* getContentDirectoryEventURL() const;
59 void setContentDirectoryControlURL( const char* psz_url );
60 const char* getContentDirectoryControlURL() const;
62 void subscribeToContentDirectory();
65 void setInputItem( input_item_t* p_input_item );
67 bool compareSID( const char* psz_sid );
71 bool _fetchContents( Container* p_parent );
72 void _buildPlaylist( Container* p_container, input_item_node_t *p_item_node );
74 IXML_Document* _browseAction( const char*, const char*,
75 const char*, const char*, const char*, const char* );
77 services_discovery_t* _p_sd;
79 Container* _p_contents;
80 input_item_t* _p_input_item;
83 std::string _friendly_name;
85 std::string _content_directory_event_url;
86 std::string _content_directory_control_url;
88 int _i_subscription_timeout;
89 Upnp_SID _subscription_id;
97 MediaServerList( services_discovery_t* p_sd );
100 bool addServer( MediaServer* p_server );
101 void removeServer( const char* psz_udn );
103 MediaServer* getServer( const char* psz_udn );
104 MediaServer* getServerBySID( const char* psz_sid );
108 services_discovery_t* _p_sd;
110 std::vector<MediaServer*> _list;
118 Item( Container* parent,
119 const char* objectID,
121 const char* resource );
124 const char* getObjectID() const;
125 const char* getTitle() const;
126 const char* getResource() const;
128 void setInputItem( input_item_t* p_input_item );
132 input_item_t* _p_input_item;
135 std::string _objectID;
137 std::string _resource;
145 Container( Container* parent, const char* objectID, const char* title );
148 void addItem( Item* item );
149 void addContainer( Container* container );
151 const char* getObjectID() const;
152 const char* getTitle() const;
154 unsigned int getNumItems() const;
155 unsigned int getNumContainers() const;
157 Item* getItem( unsigned int i ) const;
158 Container* getContainer( unsigned int i ) const;
159 Container* getParent();
161 void setInputItem( input_item_t* p_input_item );
162 input_item_t* getInputItem() const;
166 input_item_t* _p_input_item;
170 std::string _objectID;
172 std::vector<Item*> _items;
173 std::vector<Container*> _containers;