1 /*****************************************************************
3 | Platinum - AV Media Connect Device
5 | Copyright (c) 2004-2010, Plutinosoft, LLC.
7 | http://www.plutinosoft.com
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.
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 | licensing@plutinosoft.com
23 | This program is distributed in the hope that it will be useful,
24 | but WITHOUT ANY WARRANTY; without even the implied warranty of
25 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
26 | GNU General Public License for more details.
28 | You should have received a copy of the GNU General Public License
29 | along with this program; see the file LICENSE.txt. If not, write to
30 | the Free Software Foundation, Inc.,
31 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
32 | http://www.gnu.org/licenses/gpl-2.0.html
34 ****************************************************************/
36 #ifndef _PLT_MEDIA_CONNECT_H_
37 #define _PLT_MEDIA_CONNECT_H_
39 /*----------------------------------------------------------------------
41 +---------------------------------------------------------------------*/
43 #include "PltFileMediaServer.h"
45 /*----------------------------------------------------------------------
47 +---------------------------------------------------------------------*/
48 class PLT_MediaConnect
: public PLT_MediaServer
52 static NPT_Result
GetMappedObjectId(const char* object_id
,
53 NPT_String
& mapped_object_id
);
56 PLT_MediaConnect(const char* friendly_name
,
57 bool add_hostname
= true,
58 const char* udn
= NULL
,
60 bool port_rebind
= false);
63 ~PLT_MediaConnect() override
;
65 // PLT_DeviceHost methods
66 NPT_Result
SetupServices() override
;
67 NPT_Result
OnAction(PLT_ActionReference
& action
,
68 const PLT_HttpRequestContext
& context
) override
;
69 NPT_Result
ProcessGetDescription(NPT_HttpRequest
& request
,
70 const NPT_HttpRequestContext
& context
,
71 NPT_HttpResponse
& response
) override
;
72 NPT_Result
ProcessGetSCPD(PLT_Service
* service
,
73 NPT_HttpRequest
& request
,
74 const NPT_HttpRequestContext
& context
,
75 NPT_HttpResponse
& response
) override
;
77 // X_MS_MediaReceiverRegistrar
78 virtual NPT_Result
OnIsAuthorized(PLT_ActionReference
& action
);
79 virtual NPT_Result
OnRegisterDevice(PLT_ActionReference
& action
);
80 virtual NPT_Result
OnIsValidated(PLT_ActionReference
& action
);
87 /*----------------------------------------------------------------------
88 | PLT_FileMediaConnectDelegate class
89 +---------------------------------------------------------------------*/
90 class PLT_FileMediaConnectDelegate
: public PLT_FileMediaServerDelegate
93 // constructor & destructor
94 PLT_FileMediaConnectDelegate(const char* url_root
, const char* file_root
) :
95 PLT_FileMediaServerDelegate(url_root
, file_root
) {}
96 ~PLT_FileMediaConnectDelegate() override
{}
98 // PLT_FileMediaServerDelegate methods
99 NPT_Result
GetFilePath(const char* object_id
, NPT_String
& filepath
) override
;
100 NPT_Result
OnSearchContainer(PLT_ActionReference
& action
,
101 const char* object_id
,
102 const char* search_criteria
,
104 NPT_UInt32 starting_index
,
105 NPT_UInt32 requested_count
,
106 const char* sort_criteria
,
107 const PLT_HttpRequestContext
& context
) override
;
110 #endif /* _PLT_MEDIA_CONNECT_H_ */