Kodi Documentation 22.0
Kodi is an open source media player and entertainment hub.
Loading...
Searching...
No Matches
UPNP Namespace Reference

Classes

class  CCtrlPointReferenceHolder
 
class  CDeviceHostReferenceHolder
 
class  CMediaBrowser
 
class  CMediaController
 
class  CRendererReferenceHolder
 
class  CResourceFinder
 
class  CUPnP
 
class  CUPnPCleaner
 
class  CUPnPPlayer
 
class  CUPnPPlayerController
 
class  CUPnPRenderer
 
class  CUPnPServer
 
struct  ResourcePrioritySort
 

Enumerations

enum  UPnPService {
  UPnPServiceNone = 0 , UPnPClient , UPnPContentDirectory , UPnPPlayer ,
  UPnPRenderer
}
 
enum  EClientQuirks { ECLIENTQUIRKS_NONE = 0x0 , ECLIENTQUIRKS_ONLYSTORAGEFOLDER = 0x01 , ECLIENTQUIRKS_BASICVIDEOCLASS = 0x02 , ECLIENTQUIRKS_UNKNOWNSERIES = 0x04 }
 
enum  EMediaControllerQuirks { EMEDIACONTROLLERQUIRKS_NONE = 0x00 , EMEDIACONTROLLERQUIRKS_X_MKV = 0x01 }
 

Functions

EClientQuirks GetClientQuirks (const PLT_HttpRequestContext *context)
 
EMediaControllerQuirks GetMediaControllerQuirks (const PLT_DeviceData *device)
 
NPT_String GetMimeType (const char *filename, const PLT_HttpRequestContext *context)
 
NPT_String GetMimeType (const CFileItem &item, const PLT_HttpRequestContext *context)
 
const NPT_String GetProtocolInfo (const CFileItem &item, const char *protocol, const PLT_HttpRequestContext *context)
 
NPT_Result PopulateObjectFromTag (CMusicInfoTag &tag, PLT_MediaObject &object, NPT_String *file_path, PLT_MediaItemResource *resource, EClientQuirks quirks, UPnPService service)
 
NPT_Result PopulateObjectFromTag (CVideoInfoTag &tag, PLT_MediaObject &object, NPT_String *file_path, PLT_MediaItemResource *resource, EClientQuirks quirks, UPnPService service)
 
PLT_MediaObject * BuildObject (CFileItem &item, NPT_String &file_path, bool with_count, NPT_Reference< CThumbLoader > &thumb_loader, const PLT_HttpRequestContext *context, CUPnPServer *upnp_server, UPnPService upnp_service)
 
const std::string & CorrectAllItemsSortHack (const std::string &item)
 
int PopulateTagFromObject (CMusicInfoTag &tag, PLT_MediaObject &object, PLT_MediaItemResource *resource, UPnPService service)
 
int PopulateTagFromObject (CVideoInfoTag &tag, PLT_MediaObject &object, PLT_MediaItemResource *resource, UPnPService service)
 
std::shared_ptr< CFileItemBuildObject (PLT_MediaObject *entry, UPnPService upnp_service)
 
bool GetResource (const PLT_MediaObject *entry, CFileItem &item)
 
std::shared_ptr< CFileItemGetFileItem (const NPT_String &uri, const NPT_String &meta)
 
NPT_String EncodeObjectId (const std::string &id)
 Provided a given object id, encode it into a safe format to provide to UPnP clients @Note base64 is currently used as the safe format.
 
NPT_String DecodeObjectId (const std::string &id)
 Provided a given encoded object id, decode it into a format known by the application @Note base64 is currently used as the expected input format.
 
const char * GetMimeTypeFromExtension (const char *extension, const PLT_HttpRequestContext *context=NULL)
 
NPT_Result ObjectIDValidate (const NPT_String &id)
 

Variables

constexpr std::array< std::string_view, 9 > SupportedSubFormats
 
constexpr NPT_HttpFileRequestHandler_DefaultFileTypeMapEntry kodiPlatinumMimeTypeExtensions []
 
const char * audio_containers []
 
const char * video_containers []
 

Enumeration Type Documentation

◆ EClientQuirks

Enumerator
ECLIENTQUIRKS_NONE 
ECLIENTQUIRKS_ONLYSTORAGEFOLDER 
ECLIENTQUIRKS_BASICVIDEOCLASS 
ECLIENTQUIRKS_UNKNOWNSERIES 

◆ EMediaControllerQuirks

Enumerator
EMEDIACONTROLLERQUIRKS_NONE 
EMEDIACONTROLLERQUIRKS_X_MKV 

◆ UPnPService

Enumerator
UPnPServiceNone 
UPnPClient 
UPnPContentDirectory 
UPnPPlayer 
UPnPRenderer 

Function Documentation

◆ BuildObject() [1/2]

PLT_MediaObject * UPNP::BuildObject ( CFileItem & item,
NPT_String & file_path,
bool with_count,
NPT_Reference< CThumbLoader > & thumb_loader,
const PLT_HttpRequestContext * context,
CUPnPServer * upnp_server,
UPnPService upnp_service )
Todo
  • get file count of this directory

◆ BuildObject() [2/2]

std::shared_ptr< CFileItem > UPNP::BuildObject ( PLT_MediaObject * entry,
UPnPService upnp_service )
Todo
fill pictureinfotag?

◆ CorrectAllItemsSortHack()

const std::string & UPNP::CorrectAllItemsSortHack ( const std::string & item)

◆ DecodeObjectId()

NPT_String UPNP::DecodeObjectId ( const std::string & id)

Provided a given encoded object id, decode it into a format known by the application @Note base64 is currently used as the expected input format.

Parameters
idthe object it to decode
Returns
the decoded object id
Todo
all other items except upnproot and -1 (the parent of upnproot) seem to only be enabled

◆ EncodeObjectId()

NPT_String UPNP::EncodeObjectId ( const std::string & id)

Provided a given object id, encode it into a safe format to provide to UPnP clients @Note base64 is currently used as the safe format.

Parameters
idthe object it to encode
Returns
the encoded object id
Todo
all other items except upnproot and -1 (the parent of upnproot) seem to only be enabled

◆ GetClientQuirks()

EClientQuirks UPNP::GetClientQuirks ( const PLT_HttpRequestContext * context)

◆ GetFileItem()

std::shared_ptr< CFileItem > UPNP::GetFileItem ( const NPT_String & uri,
const NPT_String & meta )

◆ GetMediaControllerQuirks()

EMediaControllerQuirks UPNP::GetMediaControllerQuirks ( const PLT_DeviceData * device)

◆ GetMimeType() [1/2]

NPT_String UPNP::GetMimeType ( const CFileItem & item,
const PLT_HttpRequestContext * context )

◆ GetMimeType() [2/2]

NPT_String UPNP::GetMimeType ( const char * filename,
const PLT_HttpRequestContext * context )

◆ GetMimeTypeFromExtension()

const char * UPNP::GetMimeTypeFromExtension ( const char * extension,
const PLT_HttpRequestContext * context = NULL )

◆ GetProtocolInfo()

const NPT_String UPNP::GetProtocolInfo ( const CFileItem & item,
const char * protocol,
const PLT_HttpRequestContext * context )
Todo
fixup the protocol just in case nothing was passed

map protocol to right prefix and use xbmc-get for unsupported UPnP protocols for other xbmc clients

Todo
add rtsp ?

◆ GetResource()

bool UPNP::GetResource ( const PLT_MediaObject * entry,
CFileItem & item )

◆ ObjectIDValidate()

NPT_Result UPNP::ObjectIDValidate ( const NPT_String & id)

◆ PopulateObjectFromTag() [1/2]

NPT_Result UPNP::PopulateObjectFromTag ( CMusicInfoTag & tag,
PLT_MediaObject & object,
NPT_String * file_path,
PLT_MediaItemResource * resource,
EClientQuirks quirks,
UPnPService service )

◆ PopulateObjectFromTag() [2/2]

NPT_Result UPNP::PopulateObjectFromTag ( CVideoInfoTag & tag,
PLT_MediaObject & object,
NPT_String * file_path,
PLT_MediaItemResource * resource,
EClientQuirks quirks,
UPnPService service )

◆ PopulateTagFromObject() [1/2]

NPT_Result UPNP::PopulateTagFromObject ( CMusicInfoTag & tag,
PLT_MediaObject & object,
PLT_MediaItemResource * resource,
UPnPService service )

◆ PopulateTagFromObject() [2/2]

NPT_Result UPNP::PopulateTagFromObject ( CVideoInfoTag & tag,
PLT_MediaObject & object,
PLT_MediaItemResource * resource,
UPnPService service )

Variable Documentation

◆ audio_containers

const char* UPNP::audio_containers[]
Initial value:
= {"musicdb://genres/",
"musicdb://artists/",
"musicdb://albums/",
"musicdb://songs/",
"musicdb://recentlyaddedalbums/",
"musicdb://years/",
"musicdb://singles/"}

◆ kodiPlatinumMimeTypeExtensions

NPT_HttpFileRequestHandler_DefaultFileTypeMapEntry UPNP::kodiPlatinumMimeTypeExtensions[]
constexpr
Initial value:
= {
{"m2ts", "video/vnd.dlna.mpeg-tts"}}

◆ SupportedSubFormats

std::array<std::string_view, 9> UPNP::SupportedSubFormats
constexpr
Initial value:
= {
"txt", "srt", "ssa", "ass", "sub", "smi", "vtt",
"sup", "idx"}

◆ video_containers

const char* UPNP::video_containers[]
Initial value:
= {
"library://video/movies/titles.xml/", "library://video/tvshows/titles.xml/",
"videodb://recentlyaddedmovies/", "videodb://recentlyaddedepisodes/"}