diff options
Diffstat (limited to 'database/resources.cpp')
-rw-r--r-- | database/resources.cpp | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/database/resources.cpp b/database/resources.cpp index df2b354..bc4c185 100644 --- a/database/resources.cpp +++ b/database/resources.cpp @@ -10,6 +10,7 @@ #include "../upnpcomponents/dlna.h" #include <vdr/tools.h> #include "resources.h" +#include "../misc/avdetector.h" cUPnPResources* cUPnPResources::mInstance = NULL; @@ -94,6 +95,31 @@ cUPnPResource* cUPnPResources::getResource(unsigned int ResourceID){ } } +int cUPnPResources::createFromRecording(cUPnPClassVideoItem* Object, cRecording* Recording){ + cString VideoFile = cString::sprintf(VDR_RECORDFILE_PATTERN_TS, Recording->FileName(), 1); + + cAudioVideoDetector* Detector = new cAudioVideoDetector(); + + cString ContentType = "video/mpeg"; + cString ProtocolInfo = "http-get:*:video/mpeg:*"; + + cUPnPResource* Resource = this->mMediator->newResource(Object, UPNP_RESOURCE_RECORDING, Recording->FileName(), ContentType, ProtocolInfo); + + if(Detector->detectVideoProperties(Resource, VideoFile)){ + ERROR("Error while detecting video properties"); + return -1; + } + + delete Detector; + MESSAGE("To be done"); + return -1; +} + +int cUPnPResources::createFromFile(cUPnPClassItem* , cString ){ + MESSAGE("To be done"); + return -1; +} + int cUPnPResources::createFromChannel(cUPnPClassVideoBroadcast* Object, cChannel* Channel){ if(!Object || !Channel){ ERROR("Invalid input arguments"); |