MythTV  master
Public Member Functions | Private Member Functions | Private Attributes | List of all members
RemoteEncoder Class Reference

#include <remoteencoder.h>

Collaboration diagram for RemoteEncoder:
Collaboration graph
[legend]

Public Member Functions

 RemoteEncoder (int num, const QString &host, short port)
 
 ~RemoteEncoder (void)
 
bool Setup (void)
 
bool IsValidRecorder (void) const
 
int GetRecorderNumber (void) const
 
ProgramInfoGetRecording (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 &)
 
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 &)
 
void SetChannel (const QString &channel)
 
int SetSignalMonitoringRate (int rate, bool notifyFrontend=true)
 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. More...
 
bool CheckChannelPrefix (const QString &, uint &, bool &, QString &)
 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
 
MythSocketm_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, uintm_cachedTimeout
 
MythTimer m_lastTimeCheck
 

Detailed Description

Definition at line 22 of file remoteencoder.h.

Constructor & Destructor Documentation

◆ RemoteEncoder()

RemoteEncoder::RemoteEncoder ( int  num,
const QString &  host,
short  port 
)
inline

Definition at line 25 of file remoteencoder.h.

◆ ~RemoteEncoder()

RemoteEncoder::~RemoteEncoder ( void  )

Definition at line 20 of file remoteencoder.cpp.

Member Function Documentation

◆ Setup()

bool RemoteEncoder::Setup ( void  )

Definition at line 29 of file remoteencoder.cpp.

Referenced by TV::HandleStateChange(), and TV::SwitchInputs().

◆ IsValidRecorder()

bool RemoteEncoder::IsValidRecorder ( void  ) const

◆ GetRecorderNumber()

int RemoteEncoder::GetRecorderNumber ( void  ) const

◆ GetRecording()

ProgramInfo * RemoteEncoder::GetRecording ( void  )

Definition at line 138 of file remoteencoder.cpp.

◆ IsRecording()

bool RemoteEncoder::IsRecording ( bool ok = nullptr)

Definition at line 118 of file remoteencoder.cpp.

Referenced by TV::StartRecorder().

◆ GetFrameRate()

float RemoteEncoder::GetFrameRate ( void  )

Returns recordering frame rate set by nvr.

See also
TVRec::GetFramerate(void), EncoderLink::GetFramerate(void), RecorderBase::GetFrameRate(void)
Returns
Frames per second if query succeeds -1 otherwise.

Definition at line 160 of file remoteencoder.cpp.

Referenced by MythPlayer::TranslatePositionFrameToMs().

◆ GetFramesWritten()

long long RemoteEncoder::GetFramesWritten ( void  )

Returns number of frames written to disk by TVRec's RecorderBase instance.

See also
TVRec::GetFramesWritten(void), EncoderLink::GetFramesWritten(void)
Returns
Number of frames if query succeeds, return last known value otherwise.

Definition at line 195 of file remoteencoder.cpp.

Referenced by MythPlayer::CalcMaxFFTime(), MythPlayer::FindFrame(), MythPlayer::GetCurrentFrameCount(), MythPlayer::GetStatusbarPos(), MythPlayer::IsNearEnd(), MythPlayer::TranslatePositionFrameToMs(), and MythPlayer::WaitForSeek().

◆ GetCachedFramesWritten()

long long RemoteEncoder::GetCachedFramesWritten ( void  ) const
inline

Return value last returned by GetFramesWritten().

Definition at line 38 of file remoteencoder.h.

Referenced by MythPlayer::IsNearEnd().

◆ GetFilePosition()

long long RemoteEncoder::GetFilePosition ( void  )

Returns total number of bytes written by TVRec's RingBuffer.

See also
TVRec::GetFilePosition(void), EncoderLink::GetFilePosition(void)
Returns
Bytes written if query succeeds, -1 otherwise.

Definition at line 224 of file remoteencoder.cpp.

◆ GetFreeDiskSpace()

long long RemoteEncoder::GetFreeDiskSpace ( )

◆ GetMaxBitrate()

long long RemoteEncoder::GetMaxBitrate ( void  )

Returns the maximum bits per second this recorder can produce.

See also
TVRec::GetMaxBitrate(void), EncoderLink::GetMaxBitrate(void)

Definition at line 239 of file remoteencoder.cpp.

◆ GetKeyframePosition()

int64_t RemoteEncoder::GetKeyframePosition ( uint64_t  desired)

Returns byte position in RingBuffer of a keyframe.

See also
TVRec::GetKeyframePosition(uint64_t), EncoderLink::GetKeyframePosition(uint64_t)
Returns
Byte position of keyframe if query succeeds, -1 otherwise.

Definition at line 257 of file remoteencoder.cpp.

◆ FillPositionMap()

void RemoteEncoder::FillPositionMap ( int64_t  start,
int64_t  end,
frm_pos_map_t positionMap 
)

Definition at line 269 of file remoteencoder.cpp.

Referenced by MythPlayer::PosMapFromEnc().

◆ FillDurationMap()

void RemoteEncoder::FillDurationMap ( int64_t  start,
int64_t  end,
frm_pos_map_t durationMap 
)

Definition at line 296 of file remoteencoder.cpp.

Referenced by MythPlayer::PosMapFromEnc().

◆ StopPlaying()

void RemoteEncoder::StopPlaying ( void  )

Tells TVRec to stop streaming a recording to the frontend.

See also
TVRec::StopPlaying(void), EncoderLink::StopPlaying(void)

Definition at line 344 of file remoteencoder.cpp.

◆ SpawnLiveTV()

void RemoteEncoder::SpawnLiveTV ( const QString &  chainid,
bool  pip,
const QString &  startchan 
)

◆ StopLiveTV()

void RemoteEncoder::StopLiveTV ( void  )

Tells TVRec to stop a "Live TV" recorder.

This only works on local recorders.

See also
TVRec::StopLiveTV(void), EncoderLink::StopLiveTV(void)

Definition at line 373 of file remoteencoder.cpp.

Referenced by TV::StopStuff(), and TV::SwitchInputs().

◆ PauseRecorder()

void RemoteEncoder::PauseRecorder ( void  )

Tells TVRec to pause a recorder, used for channel and input changes.

See also
TVRec::PauseRecorder(void), EncoderLink::PauseRecorder(void), RecorderBase::Pause(void)

Definition at line 386 of file remoteencoder.cpp.

Referenced by TV::PauseLiveTV().

◆ FinishRecording()

void RemoteEncoder::FinishRecording ( void  )

Definition at line 395 of file remoteencoder.cpp.

Referenced by TV::FinishRecording().

◆ FrontendReady()

void RemoteEncoder::FrontendReady ( void  )

Definition at line 332 of file remoteencoder.cpp.

Referenced by TV::HandleStateChange().

◆ CancelNextRecording()

void RemoteEncoder::CancelNextRecording ( bool  cancel)

Definition at line 323 of file remoteencoder.cpp.

Referenced by TV::HandleOSDAskAllow().

◆ SetLiveRecording()

void RemoteEncoder::SetLiveRecording ( bool  recording)

Definition at line 403 of file remoteencoder.cpp.

Referenced by TV::QuickRecord().

◆ GetInput()

QString RemoteEncoder::GetInput ( void  )

◆ SetInput()

QString RemoteEncoder::SetInput ( const QString &  input)

Definition at line 429 of file remoteencoder.cpp.

◆ GetPictureAttribute()

int RemoteEncoder::GetPictureAttribute ( PictureAttribute  attr)

Definition at line 543 of file remoteencoder.cpp.

Referenced by TV::DoTogglePictureAttribute().

◆ ChangePictureAttribute()

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.

Returns
contrast if it succeeds, -1 otherwise.

Definition at line 571 of file remoteencoder.cpp.

Referenced by TV::DoChangePictureAttribute().

◆ ChangeChannel()

void RemoteEncoder::ChangeChannel ( int  channeldirection)

Definition at line 454 of file remoteencoder.cpp.

Referenced by TV::ChangeChannel().

◆ ChangeDeinterlacer()

void RemoteEncoder::ChangeDeinterlacer ( int  deint_mode)

Definition at line 596 of file remoteencoder.cpp.

◆ ToggleChannelFavorite()

void RemoteEncoder::ToggleChannelFavorite ( const QString &  changroupname)

Definition at line 445 of file remoteencoder.cpp.

Referenced by TV::ToggleChannelFavorite().

◆ SetChannel()

void RemoteEncoder::SetChannel ( const QString &  channel)

Definition at line 467 of file remoteencoder.cpp.

Referenced by TV::ChangeChannel().

◆ SetSignalMonitoringRate()

int RemoteEncoder::SetSignalMonitoringRate ( int  rate,
bool  notifyFrontend = true 
)

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.

See also
TVRec::SetSignalMonitoringRate(int,int), EncoderLink::SetSignalMonitoringRate(int,bool)
Parameters
rateThe update rate to use in milliseconds, use 0 to disable.
notifyFrontendIf true, SIGNAL messages will be sent to the frontend using this recorder.
Returns
Previous update rate

Definition at line 496 of file remoteencoder.cpp.

Referenced by TV::ActiveHandleAction().

◆ GetSignalLockTimeout()

uint RemoteEncoder::GetSignalLockTimeout ( const QString &  input)

◆ CheckChannel()

bool RemoteEncoder::CheckChannel ( const QString &  channel)

Checks if named channel exists on current tuner.

Parameters
channelChannel to verify against current tuner.
Returns
true if it succeeds, false otherwise.
See also
TVRec::CheckChannel(QString), EncoderLink::CheckChannel(const QString&), ShouldSwitchToAnotherCard(QString)

Definition at line 614 of file remoteencoder.cpp.

Referenced by TV::ChangeChannel().

◆ ShouldSwitchToAnotherCard()

bool RemoteEncoder::ShouldSwitchToAnotherCard ( const QString &  channelid)

Checks if named channel exists on current tuner, or another tuner.

This only works on local recorders.

Parameters
channelidchannel to verify against tuners.
Returns
true if the channel on another tuner and not current tuner, false otherwise.
See also
CheckChannel(const QString&)

Definition at line 635 of file remoteencoder.cpp.

Referenced by TV::HandleStateChange().

◆ CheckChannelPrefix()

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.

See also
TVRec::CheckChannelPrefix(const QString&,uint&,bool&,QString&) for details.

Definition at line 656 of file remoteencoder.cpp.

Referenced by TV::ChangeChannel(), and TV::ProcessSmartChannel().

◆ GetNextProgram()

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".

See also
TVRec::GetNextProgram(int,QString&,QString&,QString&,QString&,QString&,QString&,QString&,QString&,QString&,QString&,QString&,QString&), EncoderLink::GetNextProgram(int,QString&,QString&,QString&,QString&,QString&,QString&,QString&,QString&,QString&,QString&,QString&,QString&)

Definition at line 696 of file remoteencoder.cpp.

Referenced by TVBrowseHelper::GetNextProgram().

◆ GetChannelInfo()

void RemoteEncoder::GetChannelInfo ( InfoMap infoMap,
uint  chanid = 0 
)

◆ SetChannelInfo()

bool RemoteEncoder::SetChannelInfo ( const InfoMap infoMap)

Definition at line 747 of file remoteencoder.cpp.

Referenced by TV::HandleOSDChannelEdit().

◆ GetErrorStatus()

bool RemoteEncoder::GetErrorStatus ( void  )
inline

Definition at line 78 of file remoteencoder.h.

Referenced by PlayerContext::IsRecorderErrored().

◆ SendReceiveStringList()

bool RemoteEncoder::SendReceiveStringList ( QStringList &  strlist,
uint  min_reply_length = 0 
)
private

Definition at line 68 of file remoteencoder.cpp.

Member Data Documentation

◆ m_recordernum

int RemoteEncoder::m_recordernum
private

Definition at line 84 of file remoteencoder.h.

◆ m_controlSock

MythSocket* RemoteEncoder::m_controlSock {nullptr}
private

Definition at line 86 of file remoteencoder.h.

◆ m_lock

QMutex RemoteEncoder::m_lock
private

Definition at line 87 of file remoteencoder.h.

◆ m_remotehost

QString RemoteEncoder::m_remotehost
private

Definition at line 89 of file remoteencoder.h.

◆ m_remoteport

short RemoteEncoder::m_remoteport
private

Definition at line 90 of file remoteencoder.h.

◆ m_lastchannel

QString RemoteEncoder::m_lastchannel
private

Definition at line 92 of file remoteencoder.h.

◆ m_lastinput

QString RemoteEncoder::m_lastinput
private

Definition at line 93 of file remoteencoder.h.

◆ m_backendError

bool RemoteEncoder::m_backendError {false}
private

Definition at line 95 of file remoteencoder.h.

◆ m_cachedFramesWritten

long long RemoteEncoder::m_cachedFramesWritten {0}
private

Definition at line 96 of file remoteencoder.h.

◆ m_cachedTimeout

QMap<QString,uint> RemoteEncoder::m_cachedTimeout
private

Definition at line 97 of file remoteencoder.h.

◆ m_lastTimeCheck

MythTimer RemoteEncoder::m_lastTimeCheck
private

Definition at line 98 of file remoteencoder.h.


The documentation for this class was generated from the following files: