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.
This commit is contained in:
Stefan Seyfried
2016-10-22 12:08:57 +02:00
parent 5f33ee96fd
commit b8e44c3717
2 changed files with 35 additions and 0 deletions

View File

@@ -63,6 +63,37 @@
#include <timerdclient/timerdclient.h>
#include <cs_api.h>
extern "C" {
#include <libavformat/avformat.h>
}
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

View File

@@ -42,9 +42,11 @@
#include <OpenThreads/Mutex>
#include <OpenThreads/Thread>
#if 0
extern "C" {
#include <libavformat/avformat.h>
}
#endif
#define REC_MAX_APIDS 10
#define FILENAMEBUFFERSIZE 1024
@@ -242,6 +244,7 @@ class CRecordManager : public CMenuTarget /*, public CChangeObserver*/
#endif
};
#if 0
class CStreamRec : public CRecordInstance, OpenThreads::Thread
{
private:
@@ -268,5 +271,6 @@ class CStreamRec : public CRecordInstance, OpenThreads::Thread
bool Stop(bool remove_event = true);
static int Interrupt(void * data);
};
#endif
#endif