From 1df6d63abcb87054aab6983d261d5ba9ac9aa480 Mon Sep 17 00:00:00 2001 From: Stefan Seyfried Date: Sat, 22 Oct 2016 12:02:10 +0200 Subject: [PATCH 1/5] record, streamts: use modern AV_CODEC_ID enums this allows to build with current ffmpeg Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/5bf115db805842b5ec55374b379d267d4b3fe15a Author: Stefan Seyfried Date: 2016-10-22 (Sat, 22 Oct 2016) ------------------ This commit was generated by Migit --- src/driver/record.cpp | 2 +- src/driver/streamts.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/driver/record.cpp b/src/driver/record.cpp index 07887096c..158476132 100644 --- a/src/driver/record.cpp +++ b/src/driver/record.cpp @@ -2172,7 +2172,7 @@ void CStreamRec::run() continue; AVCodecContext *codec = ifcx->streams[pkt.stream_index]->codec; - if (bsfc && codec->codec_id == CODEC_ID_H264) { + if (bsfc && codec->codec_id == AV_CODEC_ID_H264) { AVPacket newpkt = pkt; if (av_bitstream_filter_filter(bsfc, codec, NULL, &newpkt.data, &newpkt.size, pkt.data, pkt.size, pkt.flags & AV_PKT_FLAG_KEY) >= 0) { diff --git a/src/driver/streamts.cpp b/src/driver/streamts.cpp index a917d2352..f293f0e7e 100644 --- a/src/driver/streamts.cpp +++ b/src/driver/streamts.cpp @@ -896,7 +896,7 @@ void CStreamStream::run() continue; AVCodecContext *codec = ifcx->streams[pkt.stream_index]->codec; - if (bsfc && codec->codec_id == CODEC_ID_H264 ) { + if (bsfc && codec->codec_id == AV_CODEC_ID_H264 ) { AVPacket newpkt = pkt; if (av_bitstream_filter_filter(bsfc, codec, NULL, &newpkt.data, &newpkt.size, pkt.data, pkt.size, pkt.flags & AV_PKT_FLAG_KEY) >= 0) { From 74b278d191ff0174c0ba8d8a1bc864c95459bb9b Mon Sep 17 00:00:00 2001 From: Stefan Seyfried Date: Sat, 22 Oct 2016 12:08:57 +0200 Subject: [PATCH 2/5] driver/record: make CStreamRec non-public CStreamRec is only used inside CRecordManager::Record, so it can be implemented completely inside record.cpp. The positive side effect is that avformat.h is not included everywhere (e.g. from moviebrowser/mb.h) and thus AVFORMAT_CFLAGS does not need to be added everywhere to fix build failures. Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/b5cb683048e474864473704a4ed69265a2977c53 Author: Stefan Seyfried Date: 2016-10-22 (Sat, 22 Oct 2016) ------------------ This commit was generated by Migit --- src/driver/record.cpp | 31 +++++++++++++++++++++++++++++++ src/driver/record.h | 4 ++++ 2 files changed, 35 insertions(+) diff --git a/src/driver/record.cpp b/src/driver/record.cpp index 158476132..7dd3183ab 100644 --- a/src/driver/record.cpp +++ b/src/driver/record.cpp @@ -64,6 +64,37 @@ #include #include +extern "C" { +#include +} + +class CStreamRec : public CRecordInstance, OpenThreads::Thread +{ + private: + AVFormatContext *ifcx; + AVFormatContext *ofcx; + AVBitStreamFilterContext *bsfc; + bool stopped; + bool interrupt; + time_t time_started; + int stream_index; + + void GetPids(CZapitChannel * channel); + void FillMovieInfo(CZapitChannel * channel, APIDList & apid_list); + bool Start(); + + void Close(); + bool Open(CZapitChannel * channel); + void run(); + void WriteHeader(uint32_t duration); + public: + CStreamRec(const CTimerd::RecordingInfo * const eventinfo, std::string &dir, bool timeshift = false, bool stream_vtxt_pid = false, bool stream_pmt_pid = false, bool stream_subtitle_pids = false); + ~CStreamRec(); + record_error_msg_t Record(); + bool Stop(bool remove_event = true); + static int Interrupt(void * data); +}; + /* TODO: * nextRecording / pending recordings - needs testing * check/fix askUserOnTimerConflict gui/timerlist.cpp -> getOverlappingTimers lib/timerdclient/timerdclient.cpp diff --git a/src/driver/record.h b/src/driver/record.h index d5d5c4495..476f92de8 100644 --- a/src/driver/record.h +++ b/src/driver/record.h @@ -42,9 +42,11 @@ #include #include +#if 0 extern "C" { #include } +#endif #define REC_MAX_APIDS 10 #define FILENAMEBUFFERSIZE 1024 @@ -237,6 +239,7 @@ class CRecordManager : public CMenuTarget /*, public CChangeObserver*/ #endif }; +#if 0 class CStreamRec : public CRecordInstance, OpenThreads::Thread { private: @@ -263,5 +266,6 @@ class CStreamRec : public CRecordInstance, OpenThreads::Thread bool Stop(bool remove_event = true); static int Interrupt(void * data); }; +#endif #endif From 0ed93d8edb3536ff34bf49f92093cbda581fd4b3 Mon Sep 17 00:00:00 2001 From: Stefan Seyfried Date: Sat, 22 Oct 2016 12:22:06 +0200 Subject: [PATCH 3/5] helpers.cpp: include fontrenderer.h if Font class is used, the header should be included, too :-) Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/645da6483981dccbccb80e54ea09a3120a9f9060 Author: Stefan Seyfried Date: 2016-10-22 (Sat, 22 Oct 2016) ------------------ This commit was generated by Migit --- src/system/helpers.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/system/helpers.cpp b/src/system/helpers.cpp index 009dd1249..59176bc70 100644 --- a/src/system/helpers.cpp +++ b/src/system/helpers.cpp @@ -45,6 +45,7 @@ #include #include "debug.h" #include +#include #include #include using namespace std; From f3c729bab315ff73a7530bf7f16aecdf71a4685c Mon Sep 17 00:00:00 2001 From: Stefan Seyfried Date: Sat, 22 Oct 2016 12:23:09 +0200 Subject: [PATCH 4/5] system/helpers: allow to build with c++11 compilers Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/ae345d11d30779acb9877643919507d1bcb07c9a Author: Stefan Seyfried Date: 2016-10-22 (Sat, 22 Oct 2016) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/system/helpers.cpp | 2 ++ src/system/helpers.h | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/src/system/helpers.cpp b/src/system/helpers.cpp index 59176bc70..3f894ed5b 100644 --- a/src/system/helpers.cpp +++ b/src/system/helpers.cpp @@ -1125,6 +1125,7 @@ std::vector split(const std::string &s, char delim) return vec; } +#if __cplusplus <= 201103L std::string to_string(int i) { std::stringstream s; @@ -1166,6 +1167,7 @@ std::string to_string(unsigned long long i) s << i; return s.str(); } +#endif /** * C++ version 0.4 std::string style "itoa": diff --git a/src/system/helpers.h b/src/system/helpers.h index e9b860d04..0011c72eb 100644 --- a/src/system/helpers.h +++ b/src/system/helpers.h @@ -117,12 +117,17 @@ class CFileHelpers uint32_t GetWidth4FB_HW_ACC(const uint32_t _x, const uint32_t _w, const bool max=true); +#if __cplusplus <= 201103L std::string to_string(int); std::string to_string(unsigned int); std::string to_string(long); std::string to_string(unsigned long); std::string to_string(long long); std::string to_string(unsigned long long); +#else +/* hack... */ +#define to_string(x) std::to_string(x) +#endif std::string itoa(int value, int base); From 07f447e0f9aba183fd3dc95f91b529a01456d07e Mon Sep 17 00:00:00 2001 From: Stefan Seyfried Date: Thu, 20 Oct 2016 09:11:39 +0200 Subject: [PATCH 5/5] configure: fix short-filename logic if configure was not called from absolute path, detection would fail and huge filenames would be included in binary (noticed in yocto krogoth release) Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/b8cf8167f4cd540c7b4077a0359ddc534767abce Author: Stefan Seyfried Date: 2016-10-20 (Thu, 20 Oct 2016) ------------------ This commit was generated by Migit --- configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index bac79fa15..1f553e6e0 100644 --- a/configure.ac +++ b/configure.ac @@ -234,7 +234,7 @@ fi fi # hack to define a short filename also for out-of-tree build -if test `dirname $0` = `pwd`; then +if test `dirname $0` = `pwd` || test "$0" = ./configure; then HWLIB_CFLAGS="$HWLIB_CFLAGS "'-D__file__=__FILE__' HWLIB_CFLAGS="$HWLIB_CFLAGS "'-D__path_file__=__FILE__' else