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>
43 static void parseDeviceDescription( IXML_Document* doc,
45 services_discovery_t* p_sd );
47 MediaServer( const char* UDN,
48 const char* friendlyName,
49 services_discovery_t* p_sd );
53 const char* getUDN() const;
54 const char* getFriendlyName() const;
56 void setContentDirectoryEventURL( const char* url );
57 const char* getContentDirectoryEventURL() const;
59 void setContentDirectoryControlURL( const char* url );
60 const char* getContentDirectoryControlURL() const;
62 void subscribeToContentDirectory();
65 void setInputItem( input_item_t* p_input_item );
67 bool compareSID( const char* sid );
71 bool _fetchContents( Container* parent );
72 void _buildPlaylist( Container* container, input_item_node_t * );
74 IXML_Document* _browseAction( const char*, const char*,
75 const char*, const char*, const char*, const char* );
77 services_discovery_t* _p_sd;
80 input_item_t* _inputItem;
83 std::string _friendlyName;
85 std::string _contentDirectoryEventURL;
86 std::string _contentDirectoryControlURL;
88 int _subscriptionTimeOut;
89 Upnp_SID _subscriptionID;
97 MediaServerList( services_discovery_t* p_sd );
100 bool addServer( MediaServer* s );
101 void removeServer( const char* UDN );
103 MediaServer* getServer( const char* UDN );
104 MediaServer* getServerBySID( const char* );
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 );
129 input_item_t* getInputItem() const ;
133 input_item_t* _inputItem;
136 std::string _objectID;
138 std::string _resource;
146 Container( Container* parent, const char* objectID, const char* title );
149 void addItem( Item* item );
150 void addContainer( Container* container );
152 const char* getObjectID() const;
153 const char* getTitle() const;
155 unsigned int getNumItems() const;
156 unsigned int getNumContainers() const;
158 Item* getItem( unsigned int i ) const;
159 Container* getContainer( unsigned int i ) const;
160 Container* getParent();
162 void setInputItem( input_item_t* p_input_item );
163 input_item_t* getInputItem() const;
167 input_item_t* _inputItem;
171 std::string _objectID;
173 std::vector<Item*> _items;
174 std::vector<Container*> _containers;