1 /*****************************************************************************
2 * Upnp_intel.hpp : UPnP discovery module (Intel SDK) header
3 *****************************************************************************
4 * Copyright (C) 2004-2008 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>
46 vlc_mutex_init( &_mutex );
51 vlc_mutex_destroy( &_mutex );
54 void lock() { vlc_mutex_lock( &_mutex ); }
55 void unlock() { vlc_mutex_unlock( &_mutex ); }
86 static void parseDeviceDescription( IXML_Document* doc,
88 services_discovery_t* p_sd );
90 MediaServer( const char* UDN,
91 const char* friendlyName,
92 services_discovery_t* p_sd );
96 const char* getUDN() const;
97 const char* getFriendlyName() const;
99 void setContentDirectoryEventURL( const char* url );
100 const char* getContentDirectoryEventURL() const;
102 void setContentDirectoryControlURL( const char* url );
103 const char* getContentDirectoryControlURL() const;
105 void subscribeToContentDirectory();
106 void fetchContents();
108 void setInputItem( input_item_t* p_input_item );
110 bool compareSID( const char* sid );
114 bool _fetchContents( Container* parent );
115 void _buildPlaylist( Container* container );
117 IXML_Document* _browseAction( const char*, const char*,
118 const char*, const char*, const char*, const char* );
120 services_discovery_t* _p_sd;
122 Container* _contents;
123 input_item_t* _inputItem;
126 std::string _friendlyName;
128 std::string _contentDirectoryEventURL;
129 std::string _contentDirectoryControlURL;
131 int _subscriptionTimeOut;
132 Upnp_SID _subscriptionID;
136 class MediaServerList
140 MediaServerList( services_discovery_t* p_sd );
143 bool addServer( MediaServer* s );
144 void removeServer( const char* UDN );
146 MediaServer* getServer( const char* UDN );
147 MediaServer* getServerBySID( const char* );
151 services_discovery_t* _p_sd;
153 std::vector<MediaServer*> _list;
161 Item( Container* parent,
162 const char* objectID,
164 const char* resource );
167 const char* getObjectID() const;
168 const char* getTitle() const;
169 const char* getResource() const;
171 void setInputItem( input_item_t* p_input_item );
172 input_item_t* getInputItem() const ;
176 input_item_t* _inputItem;
179 std::string _objectID;
181 std::string _resource;
189 Container( Container* parent, const char* objectID, const char* title );
192 void addItem( Item* item );
193 void addContainer( Container* container );
195 const char* getObjectID() const;
196 const char* getTitle() const;
198 unsigned int getNumItems() const;
199 unsigned int getNumContainers() const;
201 Item* getItem( unsigned int i ) const;
202 Container* getContainer( unsigned int i ) const;
203 Container* getParent();
205 void setInputItem( input_item_t* p_input_item );
206 input_item_t* getInputItem() const;
210 input_item_t* _inputItem;
214 std::string _objectID;
216 std::vector<Item*> _items;
217 std::vector<Container*> _containers;