diff options
author | Denis Loh <denis.loh@web.de> | 2012-09-13 20:01:49 +0200 |
---|---|---|
committer | Denis Loh <denis.loh@web.de> | 2012-09-13 20:01:49 +0200 |
commit | 4d808c7f57e7de856154c7d13b6d2dc6501bb6fc (patch) | |
tree | fac25d52dae381703533f417cd7f400bc74317e9 /include/media | |
download | vdr-plugin-upnp-4d808c7f57e7de856154c7d13b6d2dc6501bb6fc.tar.gz vdr-plugin-upnp-4d808c7f57e7de856154c7d13b6d2dc6501bb6fc.tar.bz2 |
Initial commit
Diffstat (limited to 'include/media')
-rw-r--r-- | include/media/mediaManager.h | 87 | ||||
-rw-r--r-- | include/media/profile.h | 50 |
2 files changed, 137 insertions, 0 deletions
diff --git a/include/media/mediaManager.h b/include/media/mediaManager.h new file mode 100644 index 0000000..7b3bf83 --- /dev/null +++ b/include/media/mediaManager.h @@ -0,0 +1,87 @@ +/* + * mediaManager.h + * + * Created on: 31.08.2012 + * Author: savop + */ + +#ifndef MEDIAMANAGER_H_ +#define MEDIAMANAGER_H_ + +#include <vdr/thread.h> +#include <list> +#include <string> +#include <stdint.h> +#include <tntdb/connection.h> +#include <tntdb/connect.h> +#include "../../include/tools.h" + +namespace upnp { + +class cMediaManager : public cThread { +private: + + struct MediaRequest { + int64_t objectID; + std::string filter; + uint32_t startIndex; + uint32_t requestCount; + std::string sortCriteria; + std::string result; + uint32_t numberReturned; + uint32_t totalMatches; + uint32_t updateID; + }; + +public: + + enum BrowseFlag { + CD_BROWSE_METADATA, + CD_BROWSE_DIRECT_CHILDREN, + NumBrowseFlags + }; + + struct BrowseRequest : public MediaRequest { + BrowseFlag browseMetadata; + }; + + struct SearchRequest : public MediaRequest { + std::string searchCriteria; + }; + + cMediaManager(); + virtual ~cMediaManager(); + + void SetDatabaseFile(string file); + + bool Initialise(); + + uint32_t GetSystemUpdateID() const; + IdList GetContainerUpdateIDs(bool unevented = false); + StringList GetSearchCapabilities() const; + StringList GetSortCapabilities() const; + StringList GetSupportedProtocolInfos() const; + + int Browse(BrowseRequest& request); + int Search(SearchRequest& request); + + static BrowseFlag ToBrowseFlag(std::string browseFlag); + +private: + + void Action(); + bool CheckIntegrity(); + + void OnContainerUpdate(string containerID, long updateID); + + uint32_t mSystemUpdateID; + IdList mEventedContainerUpdateIDs; + string mDatabaseFile; + tntdb::Connection mConnection; + +}; + +} // namespace upnp + + +#endif /* MEDIAMANAGER_H_ */ diff --git a/include/media/profile.h b/include/media/profile.h new file mode 100644 index 0000000..867de66 --- /dev/null +++ b/include/media/profile.h @@ -0,0 +1,50 @@ +/* + * profile.h + * + * Created on: 05.08.2012 + * Author: savop + */ + +#ifndef PROFILE_H_ +#define PROFILE_H_ + +#include <string> +#include <stdint.h> + +using namespace std; + +namespace upnp { + +namespace video { + +} + +namespace audio { + +} + +namespace image { + +struct cIcon { + const char* mime; ///< the mime type of the image + uint16_t width; ///< image width in pixel + uint16_t height; ///< image height in pixel + uint8_t bitDepth; ///< bit depth in bits per pixel +}; + +/* JPEG Icons */ +//extern cIcon DLNA_ICON_JEPG_TN; ///< DLNA jpeg thumbnail profile of images +extern cIcon DLNA_ICON_JPEG_SM_24; ///< DLNA icon profile of small jpeg images +extern cIcon DLNA_ICON_JPEG_LRG_24; ///< DLNA icon profile of large jpeg images + +/* PNG Icons */ +extern cIcon DLNA_ICON_PNG_SM_24A; ///< DLNA icon profile of small png images +extern cIcon DLNA_ICON_PNG_LRG_24A; ///< DLNA icon profile of large png images +//extern cIcon DLNA_ICON_PNG_TN; ///< DLNA png thumbnail profile of images + +} /* NS:image */ + +} /* NS:upnp */ + + +#endif /* PROFILE_H_ */ |