diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/media/mediaManager.h | 11 | ||||
-rw-r--r-- | include/plugin.h | 14 | ||||
-rw-r--r-- | include/pluginManager.h | 11 | ||||
-rw-r--r-- | include/tools.h | 2 |
4 files changed, 26 insertions, 12 deletions
diff --git a/include/media/mediaManager.h b/include/media/mediaManager.h index 7e97799..09b3919 100644 --- a/include/media/mediaManager.h +++ b/include/media/mediaManager.h @@ -14,6 +14,7 @@ #include <stdint.h> #include <tntdb/connection.h> #include <tntdb/connect.h> +#include "../../include/plugin.h" #include "../../include/tools.h" namespace upnp { @@ -32,12 +33,12 @@ private: cResourceStreamer(cMediaManager* manager, cUPnPResourceProvider* provider, cMetadata::Resource* resource); public: + virtual ~cResourceStreamer(); std::string GetContentFeatures() const; size_t GetContentLength() const; std::string GetContentType() const; std::string GetTransferMode(const std::string& requestedMode ) const; - std::string GetRange() const; - std::string GetAvailableSeekRange(const std::string& seekRequest) const; + bool Seekable() const; bool Open(string uri); size_t Read(char* buf, size_t bufLen); @@ -92,9 +93,9 @@ public: int Browse(BrowseRequest& request); int Search(SearchRequest& request); - static BrowseFlag ToBrowseFlag(std::string browseFlag); + static BrowseFlag ToBrowseFlag(const std::string& browseFlag); - cResourceStreamer* GetResourceStreamer(std::string objectID); + cResourceStreamer* GetResourceStreamer(const std::string& objectID, int resourceID = 0); private: @@ -105,6 +106,8 @@ private: void OnContainerUpdate(string uri, long updateID); + cUPnPResourceProvider* CreateResourceProvider(const std::string& uri); + uint32_t mSystemUpdateID; IdList mEventedContainerUpdateIDs; StringList mScanDirectories; diff --git a/include/plugin.h b/include/plugin.h index fe2c5f6..da68ba9 100644 --- a/include/plugin.h +++ b/include/plugin.h @@ -348,6 +348,8 @@ public: */ virtual string GetHTTPUri(string uri); + virtual bool Seekable() const; + /** * Opens a resource * @@ -480,13 +482,9 @@ public: * object which contains all information about the resource. * * If the plugin is not able to fill the required information about the resource, - * it MUST return NULL. The plugin manager will then rotate through all the + * it MUST return false. The plugin manager will then rotate through all the * registered plugins until it finds a suitable one. * - * The required information MUST be set in the cMediaResource::Create function - * correctly. Otherwise the object creation might fail and a NULL pointer will - * be returned. - * * Additionally, a plugin implementor is advised to add as many as possible * metadata about a resource. Especially, information about the contents might * help the user. @@ -500,9 +498,11 @@ public: * A change of a resource is indicated by the resource provider. * * @param uri the absolute path to the resource. - * @return the media resource information. + * @param metadata the metadate object, where the information shall be saved. + * @return true, if this profiler was able to get the specific metadata, + * false, if not. */ - virtual cMetadata GetMetadata(string uri) = 0; + virtual bool GetMetadata(string uri, cMetadata& metadata) = 0; protected: }; diff --git a/include/pluginManager.h b/include/pluginManager.h index 90ee456..215f224 100644 --- a/include/pluginManager.h +++ b/include/pluginManager.h @@ -8,11 +8,22 @@ #ifndef PLUGINMANAGER_H_ #define PLUGINMANAGER_H_ +#include "../include/plugin.h" + namespace upnp { class cPluginManager { public: + cUPnPResourceProvider* CreateResourceProviderInstance(const std::string& schema); private: + void LoadPlugins(); + void UnloadPlugins(); + + typedef std::list<cUPnPResourceProvider> ProviderList; + typedef std::list<cMediaProfiler> ProfilerList; + + ProviderList providers; + ProfilerList profilers; }; } // namespace upnp diff --git a/include/tools.h b/include/tools.h index 008b74a..cf34b42 100644 --- a/include/tools.h +++ b/include/tools.h @@ -122,7 +122,7 @@ namespace tools { string GenerateUUIDFromURL(string url); string GenerateUUIDRandomly(); - void StringExplode(string str, string separator, StringVector results); + void StringExplode(string str, string separator, StringVector& results); } namespace ixml { |