diff options
-rw-r--r-- | Makefile | 3 | ||||
-rw-r--r-- | common/codec.cpp | 65 | ||||
-rw-r--r-- | include/tools/codec.h | 53 | ||||
-rw-r--r-- | media/profile.cpp | 12 | ||||
-rw-r--r-- | plugins/profiler/vdrDVBProfiler/dvbProfiler.cpp | 2 |
5 files changed, 14 insertions, 121 deletions
@@ -73,13 +73,12 @@ OBJS = $(PLUGIN).o \ common/parser.o \ common/setup.o \ common/ixml.o \ - common/codec.o \ media/profile.o \ media/mediaManager.o \ media/pluginManager.o \ $(TNTOBJ) -LIBS += -lupnp -lcxxtools -ltntnet -ltntdb -ldl -lavformat -lavcodec +LIBS += -lupnp -lcxxtools -ltntnet -ltntdb -ldl ### The main target: diff --git a/common/codec.cpp b/common/codec.cpp deleted file mode 100644 index d38a8e5..0000000 --- a/common/codec.cpp +++ /dev/null @@ -1,65 +0,0 @@ -/* - * codec.cpp - * - * Created on: 13.10.2012 - * Author: savop - */ - -#include "../include/tools/codec.h" - -namespace upnp { - -namespace codec { - -cFormatContext::cFormatContext() -: formatCtx(NULL) -{ - av_register_all(); -} - -cFormatContext::~cFormatContext(){ - av_free(formatCtx); -} - -bool cFormatContext::Open(const string& file){ - if(avformat_open_input(&formatCtx, file.c_str(), NULL, NULL) == 0){ - if(avformat_find_stream_info(formatCtx, NULL) == 0){ - return true; - } - } - - return false; -} - -const AVCodec* cFormatContext::GetCodec(AVMediaType Type) const { - return avcodec_find_decoder(GetCodecContext(Type)->codec_id); -} - -const AVCodecContext* cFormatContext::GetCodecContext(AVMediaType Type) const { - const AVStream* strm = GetStream(Type); - return strm?strm->codec:NULL; -} - -const AVStream* cFormatContext::GetStream(AVMediaType Type) const { - if(!formatCtx) return NULL; - int Stream = -1; unsigned int i; - for(i = 0; i < formatCtx->nb_streams; i++){ - if(formatCtx->streams[i]->codec->codec_type == Type){ - Stream = i; - break; - } - } - if(Stream == -1){ - return NULL; - } - - return formatCtx->streams[Stream]; -} - -AVFormatContext* cFormatContext::operator*() const { - return formatCtx; -} - -} // namespace codec - -} // namespace upnp diff --git a/include/tools/codec.h b/include/tools/codec.h deleted file mode 100644 index 768fa15..0000000 --- a/include/tools/codec.h +++ /dev/null @@ -1,53 +0,0 @@ -/* - * codec.h - * - * Created on: 12.10.2012 - * Author: savop - */ - -#ifndef CODEC_H_ -#define CODEC_H_ - -#ifdef __cplusplus - #define __STDC_CONSTANT_MACROS - #ifdef _STDINT_H - #undef _STDINT_H - #endif - #include <stdint.h> -#endif - -extern "C" { -#include <libavcodec/avcodec.h> -#include <libavformat/avformat.h> -} - -#include <string> - -using namespace std; - -namespace upnp { - -namespace codec { - -class cFormatContext { -public: - cFormatContext(); - virtual ~cFormatContext(); - - bool Open(const string& file); - - const AVCodec* GetCodec(AVMediaType Type) const; - const AVCodecContext* GetCodecContext(AVMediaType Type) const; - const AVStream* GetStream(AVMediaType Type) const; - - AVFormatContext* operator*() const; -private: - AVFormatContext* formatCtx; -}; - -} - -} - - -#endif /* CODEC_H_ */ diff --git a/media/profile.cpp b/media/profile.cpp index 8c9df6f..9e80449 100644 --- a/media/profile.cpp +++ b/media/profile.cpp @@ -74,7 +74,17 @@ string DLNA4thField::ToString(){ if(primaryFlags){ ss << ";"; - ss << "DLNA.ORG_OP=" << bitset<2>(operations) << ";"; +#ifdef DLNA_STRICT + // If the any of the flags lop-npt, lop-bytes or lop-cleartextbytes are set + // the OP param must be omitted. + if( !(primaryFlags & DLNA_FLAG_BYTE_BASED_SEEK) && + !(primaryFlags & DLNA_FLAG_TIME_BASED_SEEK) && + !(primaryFlags & DLNA_FLAG_CLEARTEXT_LIMITED_SEEK)){ +#endif + ss << "DLNA.ORG_OP=" << bitset<2>(operations) << ";"; +#ifdef DLNA_STRICT + } +#endif ss << "DLNA.ORG_CI=" << bitset<1>(conversionIndicator) << ";"; diff --git a/plugins/profiler/vdrDVBProfiler/dvbProfiler.cpp b/plugins/profiler/vdrDVBProfiler/dvbProfiler.cpp index b24a334..57fe9e3 100644 --- a/plugins/profiler/vdrDVBProfiler/dvbProfiler.cpp +++ b/plugins/profiler/vdrDVBProfiler/dvbProfiler.cpp @@ -124,12 +124,14 @@ private: fourthfield = DLNA4thField("MPEG_TS_SD_EU_ISO", DLNA_OPERATION_RANGE, DLNA_PLAYSPEEDS_NONE, DLNA_CONVERSION_NONE, DLNA_FLAG_STREAMING_TRANSFER | + DLNA_FLAG_BYTE_BASED_SEEK | DLNA_FLAG_VERSION_1_5 ); break; case 0x1B: fourthfield = DLNA4thField("AVC_TS_HD_EU_ISO", DLNA_OPERATION_RANGE, DLNA_PLAYSPEEDS_NONE, DLNA_CONVERSION_NONE, DLNA_FLAG_STREAMING_TRANSFER | + DLNA_FLAG_BYTE_BASED_SEEK | DLNA_FLAG_VERSION_1_5 ); break; default: |