summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authormethodus <methodus@web.de>2012-09-29 22:48:30 +0200
committermethodus <methodus@web.de>2012-09-29 22:48:30 +0200
commit97b083ac833ada3c18a5639ee782e575ca583acf (patch)
tree257848635d775396e86f9aeab682b2a719d2d097 /include
parent4cd5debf236f4d4315cce30c4cd11e392f00886a (diff)
downloadvdr-plugin-upnp-97b083ac833ada3c18a5639ee782e575ca583acf.tar.gz
vdr-plugin-upnp-97b083ac833ada3c18a5639ee782e575ca583acf.tar.bz2
Streamer almost completed. First tests successful. However, there are no plugins, yet.
Diffstat (limited to 'include')
-rw-r--r--include/media/mediaManager.h11
-rw-r--r--include/plugin.h14
-rw-r--r--include/pluginManager.h11
-rw-r--r--include/tools.h2
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 {