This class is responsible for handling the DIDL-Lite res tags. More...
#include <cds_resource_manager.h>
Data Structures | |
| class | UrlBase |
Public Member Functions | |
| CdsResourceManager () | |
| Constructor, currently empty. | |
| void | retain () |
| void | release () |
| int | getRefCount () |
Static Public Member Functions | |
| static void | addResources (zmm::Ref< CdsItem > item, zmm::Ref< mxml::Element > element) |
| Adds a resource tag to the item. | |
| static zmm::String | getFirstResource (zmm::Ref< CdsItem > item) |
| Gets the URL of the first resource of the CfsItem. | |
| static void * | operator new (size_t size) |
| static void | operator delete (void *ptr) |
Static Protected Member Functions | |
| static zmm::Ref< UrlBase > | addResources_getUrlBase (zmm::Ref< CdsItem > item, bool forceLocal=false) |
| Gets the baseUrl for a CdsItem. | |
| static zmm::String | renderExtension (zmm::String contentType, zmm::String location) |
| renders an ext=.extension string, where the extension is determined either from content type or from the filename | |
Protected Attributes | |
| mt_atomic_t | _ref_count |
| pthread_mutex_t | mutex |
This class is responsible for handling the DIDL-Lite res tags.
Definition at line 42 of file cds_resource_manager.h.
| CdsResourceManager::CdsResourceManager | ( | ) |
Constructor, currently empty.
Definition at line 47 of file cds_resource_manager.cc.
| void CdsResourceManager::addResources | ( | zmm::Ref< CdsItem > | item, | |
| zmm::Ref< mxml::Element > | element | |||
| ) | [static] |
Adds a resource tag to the item.
| item | Item for which the resources should be added. | |
| element | Element in the XML to which the resource should be appended. |
This function figures out what resources should be added to what files. It looks at the server configuration to find out what it needs. For example, if you want to add another mime/type alias for an existing mime/type, this function would do it. Also, when transcoding will be implemented, the various transcoded streams will be identified here.
Definition at line 81 of file cds_resource_manager.cc.
References _, _Exception, _URL_PARAM_SEPARATOR, addResources_getUrlBase(), zmm::String::c_str(), CFG_IMPORT_MAPPINGS_MIMETYPE_TO_CONTENTTYPE_LIST, CH_EXTURL, CH_FFTH, CH_ID3, CH_LIBEXIF, CH_MP4, CH_TRANSCODE, check_resolution(), CONTENT_TYPE_AVI, CONTENT_TYPE_JPG, CONTENT_TYPE_MP3, CONTENT_TYPE_OGG, CONTENT_TYPE_PCM, EXIF_THUMBNAIL, Singleton< ConfigManager >::getInstance(), MetadataHandler::getMetaFieldName(), getMTFromProtocolInfo(), MetadataHandler::getResAttrName(), ID3_ALBUM_ART, IS_CDS_ITEM_EXTERNAL_URL, IS_CDS_ITEM_INTERNAL_URL, log_debug, M_ALBUMARTURI, nil, OBJECT_FLAG_DVD_IMAGE, OBJECT_FLAG_OGG_THEORA, OBJECT_FLAG_PROXY_URL, R_DURATION, R_NRAUDIOCHANNELS, R_PROTOCOLINFO, R_RESOLUTION, R_SAMPLEFREQUENCY, renderExtension(), renderProtocolInfo(), RESOURCE_CONTENT_TYPE, RESOURCE_HANDLER, RESOURCE_OPTION_FOURCC, RESOURCE_OPTION_URL, zmm::String::rindex(), zmm::String::startsWith(), string_ok(), zmm::String::substring(), THUMBNAIL, and UpnpXML_DIDLRenderResource().
Referenced by UpnpXML_DIDLRenderObject().
| Ref< CdsResourceManager::UrlBase > CdsResourceManager::addResources_getUrlBase | ( | zmm::Ref< CdsItem > | item, | |
| bool | forceLocal = false | |||
| ) | [static, protected] |
Gets the baseUrl for a CdsItem.
| item | Item for which the baseUrl should be built. |
This function gets the baseUrl for the CdsItem and sets addResID to true if the resource id needs to be added to the URL.
Definition at line 496 of file cds_resource_manager.cc.
References _, _URL_PARAM_SEPARATOR, CONTENT_DVD_IMAGE_HANDLER, CONTENT_MEDIA_HANDLER, CONTENT_ONLINE_HANDLER, CONTENT_SERVE_HANDLER, Singleton< Server >::getInstance(), IS_CDS_ITEM, IS_CDS_ITEM_EXTERNAL_URL, IS_CDS_ITEM_INTERNAL_URL, OBJECT_FLAG_DVD_IMAGE, OBJECT_FLAG_ONLINE_SERVICE, OBJECT_FLAG_PROXY_URL, URL_OBJECT_ID, and URL_RESOURCE_ID.
Referenced by addResources(), and getFirstResource().
Gets the URL of the first resource of the CfsItem.
| item | Item for which the resources should be built. |
Definition at line 562 of file cds_resource_manager.cc.
References addResources_getUrlBase().
Referenced by web::items::process().
| int Object::getRefCount | ( | ) | [inherited] |
Definition at line 78 of file object.cc.
References zmm::Object::_ref_count, and atomic_get().
| void Object::operator delete | ( | void * | ptr | ) | [static, inherited] |
| void * Object::operator new | ( | size_t | size | ) | [static, inherited] |
| void Object::release | ( | ) | [inherited] |
Definition at line 66 of file object.cc.
References zmm::Object::_ref_count, atomic_dec(), and zmm::Object::mutex.
Referenced by zmm::ArrayBase::clear(), zmm::String::operator=(), DSOHash< zmm::Array< CacheObject > >::releaseData(), DSBHash< VT >::releaseData(), DSOHash< zmm::Array< CacheObject > >::remove(), zmm::ArrayBase::remove(), zmm::ArrayBase::removeUnordered(), zmm::ArrayBase::set(), zmm::ArrayBase::~ArrayBase(), DSOHash< zmm::Array< CacheObject > >::~DSOHash(), zmm::ObjectQueue< AutoscanDirectory >::~ObjectQueue(), zmm::ObjectStack< Element >::~ObjectStack(), and zmm::String::~String().
| String CdsResourceManager::renderExtension | ( | zmm::String | contentType, | |
| zmm::String | location | |||
| ) | [static, protected] |
renders an ext=.extension string, where the extension is determined either from content type or from the filename
Definition at line 51 of file cds_resource_manager.cc.
References _, _URL_PARAM_SEPARATOR, CONTENT_TYPE_PLAYLIST, zmm::String::index(), nil, zmm::String::rindex(), string_ok(), zmm::String::substring(), URL_FILE_EXTENSION, and URL_PARAM_SEPARATOR.
Referenced by addResources().
| void Object::retain | ( | ) | [inherited] |
Definition at line 58 of file object.cc.
References zmm::Object::_ref_count, atomic_inc(), and zmm::Object::mutex.
Referenced by zmm::ArrayBase::append(), zmm::ObjectQueue< AutoscanDirectory >::enqueue(), zmm::ArrayBase::insert(), zmm::String::operator=(), zmm::ObjectStack< Element >::push(), DSOHash< zmm::Array< CacheObject > >::put(), DSBHash< VT >::put(), zmm::ArrayBase::set(), and zmm::String::String().
mt_atomic_t zmm::Object::_ref_count [protected, inherited] |
Definition at line 54 of file object.h.
Referenced by zmm::Object::getRefCount(), zmm::Object::Object(), zmm::Object::release(), and zmm::Object::retain().
pthread_mutex_t zmm::Object::mutex [protected, inherited] |
Reimplemented in AutoscanList, AutoscanInotify, CachedURL, Dictionary_r, DVDNavReader, IOHandlerBufferHelper, ReentrantArray< T >, SingletonManager, Singleton< T >, StorageCache, MutexAutolock, Cond, ThreadExecutor, Singleton< UpdateManager >, Singleton< Timer >, Singleton< ContentDirectoryService >, Singleton< ConfigManager >, Singleton< Server >, Singleton< Runtime >, Singleton< ContentManager >, Singleton< ConnectionManagerService >, Singleton< PlayHook >, Singleton< Storage >, and Singleton< SessionManager >.
Definition at line 56 of file object.h.
Referenced by zmm::Object::Object(), zmm::Object::release(), zmm::Object::retain(), and zmm::Object::~Object().
1.6.1