xbmc
lib
libUPnP
Platinum
Source
Apps
MediaCrawler
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
+---------------------------------------------------------------------*/
49
class
CMediaCrawler
:
public
PLT_MediaBrowser
,
50
public
PLT_MediaServer
51
52
{
53
public
:
54
CMediaCrawler
(
PLT_CtrlPointReference
& ctrlPoint,
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
+---------------------------------------------------------------------*/
104
struct
CMediaCrawlerBrowseInfo
{
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
115
typedef
NPT_Reference<CMediaCrawlerBrowseInfo>
CMediaCrawlerBrowseInfoReference
;
116
117
#endif
/* _CRAWLER_H_ */
118
CMediaCrawler
Definition:
MediaCrawler.h:49
NPT_HttpRequestContext
Definition:
NptHttp.h:566
NPT_HttpResponse
Definition:
NptHttp.h:315
PltSyncMediaBrowser.h
UPnP AV Media Controller synchronous implementation.
PLT_MediaBrowser
The PLT_MediaBrowser class implements a UPnP AV Media Server control point.
Definition:
PltMediaBrowser.h:114
NPT_HttpRequest
Definition:
NptHttp.h:282
PLT_MediaServer
The PLT_MediaServer class implements the base class for a UPnP AV Media Server device.
Definition:
PltMediaServer.h:108
NPT_SharedVariable
Definition:
NptThreads.h:149
NPT_SocketAddress
Definition:
NptSockets.h:77
CStreamHandler
Definition:
StreamHandler.h:51
code
Definition:
inftrees.h:24
PLT_HttpRequestContext
The PLT_HttpRequestContext class holds information about the request sent, the local & remote ip addr...
Definition:
PltHttp.h:111
CMediaCrawlerBrowseInfo
Definition:
MediaCrawler.h:104
NPT_Reference< PLT_CtrlPoint >
NPT_String
Definition:
NptStrings.h:57
NPT_List
Definition:
NptList.h:54
Generated by
1.8.13