xbmc
MediaCrawler.h
1 /*****************************************************************
2 |
3 | Platinum - Media Crawler
4 |
5 | Copyright (c) 2004-2010, Plutinosoft, LLC.
6 | All rights reserved.
7 | http://www.plutinosoft.com
8 |
9 | This program is free software; you can redistribute it and/or
10 | modify it under the terms of the GNU General Public License
11 | as published by the Free Software Foundation; either version 2
12 | of the License, or (at your option) any later version.
13 |
14 | OEMs, ISVs, VARs and other distributors that combine and
15 | distribute commercially licensed software with Platinum software
16 | and do not wish to distribute the source code for the commercially
17 | licensed software under version 2, or (at your option) any later
18 | version, of the GNU General Public License (the "GPL") must enter
19 | into a commercial license agreement with Plutinosoft, LLC.
20 | licensing@plutinosoft.com
21 |
22 | This program is distributed in the hope that it will be useful,
23 | but WITHOUT ANY WARRANTY; without even the implied warranty of
24 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25 | GNU General Public License for more details.
26 |
27 | You should have received a copy of the GNU General Public License
28 | along with this program; see the file LICENSE.txt. If not, write to
29 | the Free Software Foundation, Inc.,
30 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
31 | http://www.gnu.org/licenses/gpl-2.0.html
32 |
33 ****************************************************************/
34 
35 #ifndef _CRAWLER_H_
36 #define _CRAWLER_H_
37 
38 /*----------------------------------------------------------------------
39 | includes
40 +---------------------------------------------------------------------*/
41 #include "Platinum.h"
42 #include "PltMediaConnect.h"
43 #include "PltSyncMediaBrowser.h"
44 #include "StreamHandler.h"
45 
46 /*----------------------------------------------------------------------
47 | CMediaCrawler
48 +---------------------------------------------------------------------*/
50  public PLT_MediaServer
51 
52 {
53 public:
55  const char* friendly_name = "Platinum Crawler",
56  bool show_ip = false,
57  const char* udn = NULL,
58  unsigned int port = 0);
59  virtual ~CMediaCrawler();
60 
61  NPT_Result AddStreamHandler(CStreamHandler* handler);
62 
63 protected:
64  // PLT_MediaServer methods
65  NPT_Result OnBrowse(PLT_ActionReference& action,
66  const PLT_HttpRequestContext& context);
67 
68  // PLT_MediaBrowser methods
69  NPT_Result OnBrowseResponse(NPT_Result res,
70  PLT_DeviceDataReference& device,
71  PLT_ActionReference& action,
72  void* userdata);
73 
74  // File Server Listener methods
75  NPT_Result ProcessFileRequest(NPT_HttpRequest& request,
76  const NPT_HttpRequestContext& context,
77  NPT_HttpResponse& response);
78 
79 private:
80  // methods
81  NPT_Result OnBrowseRoot(PLT_ActionReference& action);
82  NPT_Result OnBrowseDevice(PLT_ActionReference& action,
83  const char* server_uuid,
84  const char* server_object_id,
85  const NPT_HttpRequestContext& context);
86 
87  NPT_Result SplitObjectId(const NPT_String& object_id,
88  NPT_String& server_uuid,
89  NPT_String& server_object_id);
90  NPT_String FormatObjectId(const NPT_String& server_uuid,
91  const NPT_String& server_object_id);
92 
93  NPT_String UpdateDidl(const char* server_uuid,
94  const NPT_String& didl,
95  const NPT_SocketAddress* req_local_address = NULL);
96 
97  // members
98  NPT_List<CStreamHandler*> m_StreamHandlers;
99 };
100 
101 /*----------------------------------------------------------------------
102 | CMediaCrawlerBrowseInfo
103 +---------------------------------------------------------------------*/
105  NPT_SharedVariable shared_var;
106  NPT_Result res;
107  int code;
108  NPT_String object_id;
109  NPT_String didl;
110  NPT_String nr;
111  NPT_String tm;
112  NPT_String uid;
113 };
114 
116 
117 #endif /* _CRAWLER_H_ */
118 
Definition: MediaCrawler.h:49
Definition: NptHttp.h:566
Definition: NptHttp.h:315
UPnP AV Media Controller synchronous implementation.
The PLT_MediaBrowser class implements a UPnP AV Media Server control point.
Definition: PltMediaBrowser.h:114
Definition: NptHttp.h:282
The PLT_MediaServer class implements the base class for a UPnP AV Media Server device.
Definition: PltMediaServer.h:108
Definition: NptThreads.h:149
Definition: NptSockets.h:77
Definition: StreamHandler.h:51
Definition: inftrees.h:24
The PLT_HttpRequestContext class holds information about the request sent, the local & remote ip addr...
Definition: PltHttp.h:111
Definition: MediaCrawler.h:104
Definition: NptStrings.h:57
Definition: NptList.h:54