Merge remote-tracking branch 'uncool/cst-next'

This need buildfixes and some functional updates...


Origin commit data
------------------
Branch: ni/coolstream
Commit: eeee5bacab
Author: Stefan Seyfried <seife@tuxbox-git.slipkontur.de>
Date: 2015-12-13 (Sun, 13 Dec 2015)



------------------
This commit was generated by Migit
This commit is contained in:
Stefan Seyfried
2015-12-13 17:41:55 +01:00
320 changed files with 21291 additions and 13199 deletions

View File

@@ -40,6 +40,11 @@
#endif
#include <OpenThreads/Mutex>
#include <OpenThreads/Thread>
extern "C" {
#include <libavformat/avformat.h>
}
#define REC_MAX_APIDS 10
#define FILENAMEBUFFERSIZE 1024
@@ -69,7 +74,7 @@ enum record_error_msg_t
class CRecordInstance
{
private:
protected:
typedef struct {
uint32_t apid;
unsigned int index;//FIXME not used ?
@@ -101,22 +106,22 @@ class CRecordInstance
MI_MOVIE_INFO * recMovieInfo;
cRecord * record;
void GetPids(CZapitChannel * channel);
virtual void GetPids(CZapitChannel * channel);
virtual void FillMovieInfo(CZapitChannel * channel, APIDList & apid_list);
record_error_msg_t Start(CZapitChannel * channel);
void ProcessAPIDnames();
void FilterPids(APIDList & apid_list);
void FillMovieInfo(CZapitChannel * channel, APIDList & apid_lis);
record_error_msg_t MakeFileName(CZapitChannel * channel);
bool SaveXml();
record_error_msg_t Start(CZapitChannel * channel);
void WaitRecMsg(time_t StartTime, time_t WaitTime);
void MakeExtFileName(CZapitChannel * channel, std::string &FilenameTemplate);
void StringReplace(std::string &str, const std::string search, const std::string rstr);
public:
CRecordInstance(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);
~CRecordInstance();
virtual ~CRecordInstance();
record_error_msg_t Record();
bool Stop(bool remove_event = true);
virtual record_error_msg_t Record();
virtual bool Stop(bool remove_event = true);
bool Update();
void SetRecordingId(int id) { recording_id = id; };
@@ -200,6 +205,7 @@ class CRecordManager : public CMenuTarget /*, public CChangeObserver*/
bool StartAutoRecord();
bool StopAutoRecord(bool lock = true);
void StopAutoTimer();
bool CheckRecordingId_if_Timeshift(int recid);
MI_MOVIE_INFO * GetMovieInfo(const t_channel_id channel_id, bool timeshift = true);
const std::string GetFileName(const t_channel_id channel_id, bool timeshift = true);
@@ -235,4 +241,31 @@ class CRecordManager : public CMenuTarget /*, public CChangeObserver*/
bool changeNotify(const neutrino_locale_t OptionName, void * /*data*/);
#endif
};
class CStreamRec : public CRecordInstance, OpenThreads::Thread
{
private:
AVFormatContext *ifcx;
AVFormatContext *ofcx;
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);
};
#endif