MythTV
master
|
#include <libmythtv/remoteencoder.h>
Public Member Functions | |
RemoteEncoder (int num, QString host, short port) | |
~RemoteEncoder (void) | |
bool | Setup (void) |
bool | IsValidRecorder (void) const |
int | GetRecorderNumber (void) const |
ProgramInfo * | GetRecording (void) |
bool | IsRecording (bool *ok=nullptr) |
float | GetFrameRate (void) |
Returns recordering frame rate set by nvr. More... | |
long long | GetFramesWritten (void) |
Returns number of frames written to disk by TVRec's RecorderBase instance. More... | |
long long | GetCachedFramesWritten (void) const |
Return value last returned by GetFramesWritten(). More... | |
long long | GetFilePosition (void) |
Returns total number of bytes written by TVRec's RingBuffer. More... | |
long long | GetFreeDiskSpace () |
long long | GetMaxBitrate () |
Returns the maximum bits per second this recorder can produce. More... | |
int64_t | GetKeyframePosition (uint64_t desired) |
Returns byte position in RingBuffer of a keyframe. More... | |
void | FillPositionMap (int64_t start, int64_t end, frm_pos_map_t &positionMap) |
void | FillDurationMap (int64_t start, int64_t end, frm_pos_map_t &durationMap) |
void | StopPlaying (void) |
Tells TVRec to stop streaming a recording to the frontend. More... | |
void | SpawnLiveTV (const QString &chainid, bool pip, const QString &startchan) |
Tells TVRec to Spawn a "Live TV" recorder. More... | |
void | StopLiveTV (void) |
Tells TVRec to stop a "Live TV" recorder. More... | |
void | PauseRecorder (void) |
Tells TVRec to pause a recorder, used for channel and input changes. More... | |
void | FinishRecording (void) |
void | FrontendReady (void) |
void | CancelNextRecording (bool cancel) |
void | SetLiveRecording (bool recording) |
QString | GetInput (void) |
QString | SetInput (const QString &input) |
int | GetPictureAttribute (PictureAttribute attr) |
int | ChangePictureAttribute (PictureAdjustType type, PictureAttribute attr, bool up) |
Changes brightness/contrast/colour/hue of a recording. More... | |
void | ChangeChannel (int channeldirection) |
void | ChangeDeinterlacer (int deint_mode) |
void | ToggleChannelFavorite (const QString &changroupname) |
void | SetChannel (const QString &channel) |
std::chrono::milliseconds | SetSignalMonitoringRate (std::chrono::milliseconds rate, int notifyFrontend=1) |
Sets the signal monitoring rate. More... | |
uint | GetSignalLockTimeout (const QString &input) |
bool | CheckChannel (const QString &channel) |
Checks if named channel exists on current tuner. More... | |
bool | ShouldSwitchToAnotherCard (const QString &channelid) |
Checks if named channel exists on current tuner, or another tuner. This only works on local recorders. More... | |
bool | CheckChannelPrefix (const QString &prefix, uint &complete_valid_channel_on_rec, bool &is_extra_char_useful, QString &needed_spacer) |
Checks a prefix against the channels in the DB. More... | |
void | GetNextProgram (int direction, QString &title, QString &subtitle, QString &desc, QString &category, QString &starttime, QString &endtime, QString &callsign, QString &iconpath, QString &channelname, QString &chanid, QString &seriesid, QString &programid) |
Returns information about the program that would be seen if we changed the channel using ChangeChannel(int) with "direction". More... | |
void | GetChannelInfo (InfoMap &infoMap, uint chanid=0) |
bool | SetChannelInfo (const InfoMap &infoMap) |
bool | GetErrorStatus (void) |
Private Member Functions | |
bool | SendReceiveStringList (QStringList &strlist, uint min_reply_length=0) |
Private Attributes | |
int | m_recordernum |
MythSocket * | m_controlSock {nullptr} |
QMutex | m_lock |
QString | m_remotehost |
short | m_remoteport |
QString | m_lastchannel |
QString | m_lastinput |
bool | m_backendError {false} |
long long | m_cachedFramesWritten {0} |
QMap< QString, uint > | m_cachedTimeout |
MythTimer | m_lastTimeCheck |
Definition at line 24 of file remoteencoder.h.
|
inline |
Definition at line 27 of file remoteencoder.h.
RemoteEncoder::~RemoteEncoder | ( | void | ) |
Definition at line 19 of file remoteencoder.cpp.
bool RemoteEncoder::Setup | ( | void | ) |
Definition at line 28 of file remoteencoder.cpp.
Referenced by TV::HandleStateChange(), SendReceiveStringList(), and TV::SwitchInputs().
bool RemoteEncoder::IsValidRecorder | ( | void | ) | const |
Definition at line 57 of file remoteencoder.cpp.
Referenced by TV::ChangeChannel(), TV::HandleStateChange(), MythPlayer::IsWatchingInprogress(), MythPlayer::OpenFile(), MythPlayer::PosMapFromEnc(), TV::RequestNextRecorder(), TV::SwitchInputs(), and MythPlayer::TranslatePositionFrameToMs().
int RemoteEncoder::GetRecorderNumber | ( | void | ) | const |
Definition at line 62 of file remoteencoder.cpp.
Referenced by TV::ChangeChannel(), FlagCommercials(), MythPlayer::OpenFile(), PlayerContext::SetRecorder(), and TV::SwitchInputs().
ProgramInfo * RemoteEncoder::GetRecording | ( | void | ) |
Definition at line 137 of file remoteencoder.cpp.
Definition at line 117 of file remoteencoder.cpp.
Referenced by TV::StartRecorder().
float RemoteEncoder::GetFrameRate | ( | void | ) |
Returns recordering frame rate set by nvr.
Definition at line 159 of file remoteencoder.cpp.
Referenced by MythPlayer::TranslatePositionFrameToMs().
long long RemoteEncoder::GetFramesWritten | ( | void | ) |
Returns number of frames written to disk by TVRec's RecorderBase instance.
Definition at line 194 of file remoteencoder.cpp.
Referenced by MythPlayer::CalcMaxFFTime(), MythPlayer::FindFrame(), MythPlayer::GetCurrentFrameCount(), MythPlayer::IsNearEnd(), MythPlayer::TranslatePositionFrameToMs(), and MythPlayer::WaitForSeek().
|
inline |
Return value last returned by GetFramesWritten().
Definition at line 40 of file remoteencoder.h.
Referenced by MythPlayer::IsNearEnd().
long long RemoteEncoder::GetFilePosition | ( | void | ) |
Returns total number of bytes written by TVRec's RingBuffer.
Definition at line 223 of file remoteencoder.cpp.
long long RemoteEncoder::GetFreeDiskSpace | ( | ) |
long long RemoteEncoder::GetMaxBitrate | ( | ) |
Returns the maximum bits per second this recorder can produce.
Definition at line 238 of file remoteencoder.cpp.
int64_t RemoteEncoder::GetKeyframePosition | ( | uint64_t | desired | ) |
Returns byte position in RingBuffer of a keyframe.
Definition at line 256 of file remoteencoder.cpp.
void RemoteEncoder::FillPositionMap | ( | int64_t | start, |
int64_t | end, | ||
frm_pos_map_t & | positionMap | ||
) |
Definition at line 268 of file remoteencoder.cpp.
Referenced by MythPlayer::PosMapFromEnc().
void RemoteEncoder::FillDurationMap | ( | int64_t | start, |
int64_t | end, | ||
frm_pos_map_t & | durationMap | ||
) |
Definition at line 294 of file remoteencoder.cpp.
Referenced by MythPlayer::PosMapFromEnc().
void RemoteEncoder::StopPlaying | ( | void | ) |
Tells TVRec to stop streaming a recording to the frontend.
Definition at line 341 of file remoteencoder.cpp.
void RemoteEncoder::SpawnLiveTV | ( | const QString & | chainid, |
bool | pip, | ||
const QString & | startchan | ||
) |
Tells TVRec to Spawn a "Live TV" recorder.
Definition at line 354 of file remoteencoder.cpp.
Referenced by TV::HandleStateChange(), and TV::SwitchInputs().
void RemoteEncoder::StopLiveTV | ( | void | ) |
Tells TVRec to stop a "Live TV" recorder.
This only works on local recorders.
Definition at line 370 of file remoteencoder.cpp.
Referenced by TV::StopStuff(), and TV::SwitchInputs().
void RemoteEncoder::PauseRecorder | ( | void | ) |
Tells TVRec to pause a recorder, used for channel and input changes.
Definition at line 383 of file remoteencoder.cpp.
Referenced by TV::PauseLiveTV().
void RemoteEncoder::FinishRecording | ( | void | ) |
Definition at line 392 of file remoteencoder.cpp.
void RemoteEncoder::FrontendReady | ( | void | ) |
Definition at line 329 of file remoteencoder.cpp.
Referenced by TV::HandleStateChange().
void RemoteEncoder::CancelNextRecording | ( | bool | cancel | ) |
Definition at line 320 of file remoteencoder.cpp.
Referenced by TV::HandleOSDAskAllow().
void RemoteEncoder::SetLiveRecording | ( | bool | recording | ) |
Definition at line 400 of file remoteencoder.cpp.
Referenced by TV::QuickRecord().
QString RemoteEncoder::GetInput | ( | void | ) |
Definition at line 409 of file remoteencoder.cpp.
Referenced by TV::ActiveHandleAction(), TV::ChangeChannel(), TV::PauseLiveTV(), and TV::UpdateOSDTimeoutMessage().
QString RemoteEncoder::SetInput | ( | const QString & | input | ) |
Definition at line 426 of file remoteencoder.cpp.
int RemoteEncoder::GetPictureAttribute | ( | PictureAttribute | attr | ) |
Definition at line 540 of file remoteencoder.cpp.
Referenced by TV::DoTogglePictureAttribute().
int RemoteEncoder::ChangePictureAttribute | ( | PictureAdjustType | type, |
PictureAttribute | attr, | ||
bool | up | ||
) |
Changes brightness/contrast/colour/hue of a recording.
Note: In practice this only works with frame grabbing recorders.
Definition at line 568 of file remoteencoder.cpp.
Referenced by TV::PictureAttributeHandleAction().
void RemoteEncoder::ChangeChannel | ( | int | channeldirection | ) |
Definition at line 451 of file remoteencoder.cpp.
Referenced by TV::ChangeChannel().
void RemoteEncoder::ChangeDeinterlacer | ( | int | deint_mode | ) |
Definition at line 593 of file remoteencoder.cpp.
void RemoteEncoder::ToggleChannelFavorite | ( | const QString & | changroupname | ) |
Definition at line 442 of file remoteencoder.cpp.
Referenced by TV::ToggleChannelFavorite().
void RemoteEncoder::SetChannel | ( | const QString & | channel | ) |
Definition at line 464 of file remoteencoder.cpp.
Referenced by TV::ChangeChannel().
std::chrono::milliseconds RemoteEncoder::SetSignalMonitoringRate | ( | std::chrono::milliseconds | rate, |
int | notifyFrontend = 1 |
||
) |
Sets the signal monitoring rate.
This will actually call SetupSignalMonitor() and TeardownSignalMonitor(bool) as needed, so it can be used directly, without worrying about the SignalMonitor instance.
rate | The update rate to use in milliseconds, use 0 to disable. |
notifyFrontend | If true, SIGNAL messages will be sent to the frontend using this recorder. |
Definition at line 493 of file remoteencoder.cpp.
Referenced by TV::ActiveHandleAction().
uint RemoteEncoder::GetSignalLockTimeout | ( | const QString & | input | ) |
Definition at line 506 of file remoteencoder.cpp.
Referenced by TV::ActiveHandleAction(), TV::PauseLiveTV(), and TV::UpdateOSDTimeoutMessage().
bool RemoteEncoder::CheckChannel | ( | const QString & | channel | ) |
Checks if named channel exists on current tuner.
channel | Channel to verify against current tuner. |
Definition at line 611 of file remoteencoder.cpp.
Referenced by TV::ChangeChannel().
bool RemoteEncoder::ShouldSwitchToAnotherCard | ( | const QString & | channelid | ) |
Checks if named channel exists on current tuner, or another tuner. This only works on local recorders.
channelid | channel to verify against tuners. |
Definition at line 632 of file remoteencoder.cpp.
Referenced by TV::HandleStateChange().
bool RemoteEncoder::CheckChannelPrefix | ( | const QString & | prefix, |
uint & | complete_valid_channel_on_rec, | ||
bool & | is_extra_char_useful, | ||
QString & | needed_spacer | ||
) |
Checks a prefix against the channels in the DB.
Definition at line 653 of file remoteencoder.cpp.
Referenced by TV::ChangeChannel(), and TV::ProcessSmartChannel().
void RemoteEncoder::GetNextProgram | ( | int | direction, |
QString & | title, | ||
QString & | subtitle, | ||
QString & | desc, | ||
QString & | category, | ||
QString & | starttime, | ||
QString & | endtime, | ||
QString & | callsign, | ||
QString & | iconpath, | ||
QString & | channelname, | ||
QString & | chanid, | ||
QString & | seriesid, | ||
QString & | programid | ||
) |
Returns information about the program that would be seen if we changed the channel using ChangeChannel(int) with "direction".
Definition at line 693 of file remoteencoder.cpp.
Referenced by TVBrowseHelper::GetNextProgram().
Definition at line 725 of file remoteencoder.cpp.
Referenced by TV::MenuItemDisplayPlayback(), TV::StartChannelEditMode(), and TV::SwitchSource().
Definition at line 744 of file remoteencoder.cpp.
Referenced by TV::HandleOSDChannelEdit().
|
inline |
Definition at line 81 of file remoteencoder.h.
Referenced by PlayerContext::IsRecorderErrored().
|
private |
Definition at line 67 of file remoteencoder.cpp.
Referenced by CancelNextRecording(), ChangeChannel(), ChangeDeinterlacer(), ChangePictureAttribute(), CheckChannel(), CheckChannelPrefix(), FillDurationMap(), FillPositionMap(), FinishRecording(), FrontendReady(), GetChannelInfo(), GetFilePosition(), GetFrameRate(), GetFramesWritten(), GetInput(), GetKeyframePosition(), GetMaxBitrate(), GetNextProgram(), GetPictureAttribute(), GetRecording(), IsRecording(), PauseRecorder(), SetChannel(), SetChannelInfo(), SetInput(), SetLiveRecording(), SetSignalMonitoringRate(), ShouldSwitchToAnotherCard(), SpawnLiveTV(), StopLiveTV(), StopPlaying(), and ToggleChannelFavorite().
|
private |
Definition at line 87 of file remoteencoder.h.
Referenced by CancelNextRecording(), ChangeChannel(), ChangeDeinterlacer(), ChangePictureAttribute(), CheckChannel(), CheckChannelPrefix(), FillDurationMap(), FillPositionMap(), FinishRecording(), FrontendReady(), GetChannelInfo(), GetFilePosition(), GetFrameRate(), GetFramesWritten(), GetInput(), GetKeyframePosition(), GetMaxBitrate(), GetNextProgram(), GetPictureAttribute(), GetRecorderNumber(), GetRecording(), GetSignalLockTimeout(), IsRecording(), IsValidRecorder(), PauseRecorder(), SetChannel(), SetInput(), SetLiveRecording(), SetSignalMonitoringRate(), ShouldSwitchToAnotherCard(), SpawnLiveTV(), StopLiveTV(), StopPlaying(), and ToggleChannelFavorite().
|
private |
Definition at line 89 of file remoteencoder.h.
Referenced by SendReceiveStringList(), Setup(), and ~RemoteEncoder().
|
private |
Definition at line 90 of file remoteencoder.h.
Referenced by GetSignalLockTimeout(), and SendReceiveStringList().
|
private |
Definition at line 92 of file remoteencoder.h.
Referenced by Setup().
|
private |
Definition at line 93 of file remoteencoder.h.
Referenced by Setup().
|
private |
Definition at line 95 of file remoteencoder.h.
Referenced by ChangeChannel(), SetChannel(), and SetInput().
|
private |
Definition at line 96 of file remoteencoder.h.
Referenced by ChangeChannel(), GetInput(), PauseRecorder(), SetChannel(), and SetInput().
Definition at line 98 of file remoteencoder.h.
Referenced by SendReceiveStringList().
|
private |
Definition at line 99 of file remoteencoder.h.
Referenced by GetFramesWritten().
|
private |
Definition at line 100 of file remoteencoder.h.
Referenced by GetSignalLockTimeout().
|
private |
Definition at line 101 of file remoteencoder.h.
Referenced by GetFramesWritten().