vdr-plugin-softhddevice-drm-gles 1.7.3-98a2ef7
cSoftHdDevice Class Reference

Output Device Implementation. More...

#include <softhddevice.h>

Public Member Functions

 cSoftHdDevice (cSoftHdConfig *)
 Create the device.
 
virtual ~cSoftHdDevice (void)
 Destroy the device.
 
bool Initialize (void)
 Initialize the device.
 
int Start (void)
 Called by VDR when the plugin is started.
 
void Stop (void)
 Called by VDR when the plugin is stopped.
 
virtual cString DeviceName (void) const
 
virtual bool HasDecoder (void) const
 Tells whether this device has an MPEG decoder.
 
virtual cSpuDecoder * GetSpuDecoder (void)
 Get the device SPU decoder.
 
virtual uchar * GrabImage (int &, bool, int, int, int)
 Grabs the currently visible screen image.
 
virtual void SetVideoDisplayFormat (eVideoDisplayFormat)
 Sets the video display format.
 
virtual void SetVideoFormat (bool)
 Set the video format.
 
virtual void GetVideoSize (int &, int &, double &)
 Get the video size.
 
virtual void GetOsdSize (int &, int &, double &)
 Returns the width, height and aspect ratio the OSD should have.
 
virtual int64_t GetSTC (void)
 Gets the current System Time Counter, which can be used to synchronize audio, video and subtitles.
 
virtual cRect CanScaleVideo (const cRect &, int taCenter)
 Ask the output, if it can scale video.
 
virtual void ScaleVideo (const cRect &=cRect::Null)
 Scale the currently shown video.
 
virtual void TrickSpeed (int, bool)
 Sets the device into a mode where replay is done slower.
 
virtual void Clear (void)
 Clears all video and audio data from the device.
 
virtual void Play (void)
 Sets the device into play mode (after a previous trick mode, or pause)
 
virtual void Freeze (void)
 Puts the device into "freeze frame" mode.
 
virtual void StillPicture (const uchar *, int)
 Display the given I-frame as a still picture.
 
virtual bool Poll (cPoller &, int=0)
 Return true if the device itself or any of the file handles in poller is ready for further action.
 
virtual bool Flush (int=0)
 Return true, if the output buffers are empty, false otherwise.
 
cSoftHdConfig * Config (void)
 
cVideoStream * VideoStream (void)
 
cVideoRender * Render (void)
 
cSoftHdAudio * Audio (void)
 
void SetDisableDeint (void)
 Disables deinterlacer (called from setup menu or conf)
 
void SetDecoderFallbackToSw (bool)
 Force the decoder to fallback to software if the hardware decoder fails after the configured amount of packets were sent and no frame was received.
 
void SetEnableHdr (bool)
 Enable HDR display mode.
 
void SetChannelSwitchMode (ChannelSwitchMode mode)
 
void SetDisplayMode (int)
 Trigger a display mode change event if the mode changed.
 
bool FastChannelSwitchAudioInTransferMode (void)
 
bool FastChannelSwitchInTransferMode (void)
 
bool CheckPlaybackStartConditions (void)
 Check, if all conditions are met to start the playback.
 
bool CheckAudioPlaybackStartConditions (void)
 Returns true, if audio playback should start without respect to a/v-sync.
 
bool IsVideoOnlyPlayback (void)
 
bool IsAudioOnlyPlayback (void)
 
int MaxSizeGPUImageCache (void)
 Get the maximum GPU image cache size.
 
int OglOsdIsDisabled (void)
 Is the OpenGL/ES osd disabled?
 
void SetDisableOglOsd (void)
 Disables OpenGL/ES Osd (called from setup menu or conf)
 
void SetEnableOglOsd (void)
 Enables OpenGL/ES Osd.
 
void OsdClose (void)
 Close the OSD.
 
void OsdDraw (int, int, int, int, int, const uint8_t *, int, int)
 Draw an OSD pixmap.
 
void SetOsdSize (int, int)
 Set the OSD size.
 
void SetScreenSize (int, int)
 Set the screen size.
 
int GetVideoAudioDelayMs (void)
 
int GetMinBufferFillLevelThresholdMs (void)
 
void SetPassthroughMask (int)
 Set the passthrough mask (called from setup menu or conf)
 
void ResetChannelId (void)
 Reset the channel ID (restarts audio)
 
void GetStats (int *, int *, int *)
 Get statistics from the renderer.
 
void SetAudioCodec (enum AVCodecID, AVCodecParameters *, AVRational)
 Open an audio codec.
 
void SetVideoCodec (enum AVCodecID, AVCodecParameters *, AVRational)
 Open a video codec.
 
int PlayAudioPkts (AVPacket *)
 Play an audio packet.
 
int PlayVideoPkts (AVPacket *)
 Play a video packet.
 
void Detach (void)
 Detach the device.
 
void Attach (void)
 Attach the device again.
 
bool IsDetached (void) const
 Returns true, if the device is detached.
 
void ResetOsdProvider (void)
 
bool IsOsdProviderSet (void) const
 
void SetStartDetached (void)
 
bool IsDraining (void)
 
int PlayPipVideo (const uchar *, int)
 Play a video packet of the pip videostream.
 
void SetDrmCanDisplayPip (bool canDisplay)
 
bool UsePip (void)
 
void ResetPipStream (void)
 Resets pip stream and render pipeline.
 
void ToggleRenderPipPosition (void)
 
void SetDisablePip (void)
 
bool PipIsEnabled (void)
 Returns true, if pip is currently enabled.
 
void PipEnable (void)
 
void PipDisable (void)
 
void PipToggle (void)
 
void PipChannelChange (int)
 
void PipChannelSwap (bool)
 
void PipSwapPosition (void)
 
void PipSetSize (void)
 
void SetRenderPipSize (void)
 
void SetRenderPipActive (bool)
 
void TriggerEvent (const Event &)
 With this wrapper function, the device can directly act as an event reveiver.
 
void LeaveState (State)
 Actions to be performed when leaving a state.
 
void EnterState (State)
 Actions to be performed when entering a state.
 
void HandleStillPicture (const uchar *data, int size)
 The still picture data received from VDR can contain multiple PES packets.
 
void HandleDisplayModeChange (const sDrmMode &)
 Set the display mode.
 
void HaltVideoThreads (void)
 Pause the rendering and decoder thread.
 
void ResumeVideoThreads (void)
 Resume the rendering and decoder thread.
 
bool HaltOpenGlThread (void)
 Pause the OpenGL worker thread.
 
void ResumeOpenGlThread (void)
 Resume the OpenGL worker thread.
 
bool IsDetachForced (void)
 Returns true, the a detached plugin start was forced.
 
void SetDetachForced (void)
 
int InitAudio (bool)
 Init the audio lazily.
 
void ResetVideoFilter (void)
 Reset the video deinterlace filter.
 
void SetTrickSpeed (double, bool, bool)
 Set the trickspeed in the renderer.
 
bool SchedulePlaybackStart (void)
 Schedules the playback start.
 
void ScheduleResyncAtPtsMs (int64_t)
 Schedule aa a/v resync in the render thread at the given pts.
 
void ResumeFromPause (void)
 Resume playback from pause state.
 
void PausePlayback (bool)
 Pause the playback.
 
void ResumePlayback (void)
 Resume playback again.
 

Protected Member Functions

virtual void MakePrimaryDevice (bool)
 Informs a device that it will be the primary device.
 
virtual void SetVolumeDevice (int)
 Sets the audio volume on this device (Volume = 0...255).
 
virtual bool CanReplay (void) const
 Return true if this device can currently start a replay session.
 
virtual bool SetPlayMode (ePlayMode)
 Sets the device into the given play mode.
 
virtual int PlayVideo (const uchar *, int)
 Play a video packet of the main videostream.
 
virtual int PlayAudio (const uchar *, int, uchar)
 Play an audio packet.
 
virtual void ChannelSwitch (const cDevice *, int, bool)
 Monitor a channel switch triggered by VDR (cStatus::ChannelSwitch())
 
virtual void Replaying (const cControl *, const char *, const char *, bool)
 Monitor a replay start or end.
 

Private Member Functions

int PlayVideoInternal (cVideoStream *, cReassemblyBufferVideo *, const uchar *, int, bool, bool)
 Play a video packet.
 
void FlushAudio (void)
 Clear all audio data from the decoder and ringbuffer.
 
int64_t GetFirstAudioPtsMsToPlay ()
 Calculate the first audio PTS that should be played during synchronized playback.
 
int64_t GetFirstVideoPtsMsToPlay ()
 
int GetBufferFillLevelThresholdMs ()
 Returns the buffer fill level threshold in milliseconds.
 
void SetDrain (bool)
 Set and log the drain state changes.
 

Private Attributes

std::unique_ptr< cStateMachine > m_pStateMachine
 
bool m_initialized = false
 true, if the plugin had a successful Initialize()
 
std::atomic< bool > m_draining = false
 true, if the device is in draining mode (waiting for empty buffers)
 
std::mutex m_eventMutex
 mutex to protect event queue
 
bool m_needsMakePrimary = false
 true, if device should be made a primary device after attach
 
cDvbSpuDecoder * m_pSpuDecoder
 pointer to spu decoder
 
cSoftHdConfig * m_pConfig
 pointer to cSoftHdConfig object
 
cVideoRender * m_pRender
 pointer to cVideoRender object
 
cVideoStream * m_pVideoStream
 pointer to main video stream
 
cSoftHdAudio * m_pAudio
 pointer to cSoftHdAudio object
 
cAudioDecoder * m_pAudioDecoder = nullptr
 pointer to cAudioDecoder object
 
cSoftOsdProvider * m_pOsdProvider = nullptr
 pointer to cSoftOsdProvider object
 
cHardwareDevice * m_pHardwareDevice
 pointer to hardware device description
 
cEventHandler * m_pEventHandler
 event handler thread
 
cReassemblyBufferVideo m_videoReassemblyBuffer
 video pes reassembly buffer
 
cReassemblyBufferAudio m_audioReassemblyBuffer
 audio pes reassembly buffer
 
cJitterTracker m_audioJitterTracker {"audio"}
 audio jitter tracker
 
cJitterTracker m_videoJitterTracker {"video"}
 video jitter tracker
 
std::atomic< ChannelSwitchMode > m_channelSwitchMode = CHANNEL_SWITCH_AVSYNC
 current channel switch mode
 
bool m_logPlaybackStart = true
 
std::atomic< PlaybackMode > m_playbackMode = NONE
 current playback mode
 
int m_audioChannelID = -1
 current audio channel ID
 
cSoftHdGrab * m_pGrab
 pointer to grabber object
 
cVideoStream * m_pPipStream
 pointer to pip video stream
 
cReassemblyBufferVideo m_pipReassemblyBuffer
 pip pes reassembly buffer
 
cPipHandler * m_pPipHandler = nullptr
 pointer to pip handler
 
std::mutex m_sizeMutex
 mutex to lock screen size (which is accessed by different threads)
 
std::atomic< bool > m_receivedAudio = false
 flag if audio packets have been received
 
std::atomic< bool > m_receivedVideo = false
 flag if video packets have been received
 
std::atomic< bool > m_receivedValidAudio = false
 flag if valid audio packets have been received
 
std::atomic< bool > m_receivedValidVideo = false
 flag if valid video packets have been received
 
bool m_pipUseAlt
 use alternative pip position
 
bool m_drmCanDisplayPip = true
 true, if the drm device is able to display a pip video
 
bool m_disablePip = false
 true, if pip was disabled by the user
 
int m_volume = 0
 track the volume in the device (for attach)
 
int m_osdWidth
 
int m_osdHeight
 
int m_screenWidth
 
int m_screenHeight
 
bool m_forceDetached = false
 start the plugin in detached state
 
bool m_externalPlayerActive = false
 true, if we detached for an external player
 

Static Private Attributes

static constexpr int MIN_BUFFER_FILL_LEVEL_THRESHOLD_MS = 450
 min buffering threshold in ms
 

Detailed Description

Output Device Implementation.

Definition at line 72 of file softhddevice.h.

Constructor & Destructor Documentation

◆ cSoftHdDevice()

cSoftHdDevice::cSoftHdDevice ( cSoftHdConfig *  config)

Create the device.

Initializes some member variables

Parameters
configpointer to cSoftHdConfig class

Definition at line 54 of file softhddevice.cpp.

References m_pStateMachine.

◆ ~cSoftHdDevice()

cSoftHdDevice::~cSoftHdDevice ( void  )
virtual

Destroy the device.

Only delete objects, if they were created in Initialize()

Definition at line 65 of file softhddevice.cpp.

References m_initialized, m_pEventHandler, m_pHardwareDevice, and m_pSpuDecoder.

Member Function Documentation

◆ Attach()

void cSoftHdDevice::Attach ( void  )

Attach the device again.

Kind of a plugin restart. Inits and starts all necessary resources. Only valid after a detach.

Definition at line 1358 of file softhddevice.cpp.

References m_forceDetached, m_needsMakePrimary, MakePrimaryDevice(), and TriggerEvent().

Referenced by cSoftHdMenu::HandleHotKey(), and cPluginSoftHdDevice::SVDRPCommand().

◆ Audio()

cSoftHdAudio * cSoftHdDevice::Audio ( void  )
inline

Definition at line 143 of file softhddevice.h.

References m_pAudio.

◆ CanReplay()

bool cSoftHdDevice::CanReplay ( void  ) const
protectedvirtual

Return true if this device can currently start a replay session.

Definition at line 311 of file softhddevice.cpp.

References IsDetached(), and LOGDEBUG.

◆ CanScaleVideo()

cRect cSoftHdDevice::CanScaleVideo ( const cRect &  ,
int  taCenter 
)
virtual

Ask the output, if it can scale video.

Parameters
rectrequested video window rectangle
Returns
the real rectangle or cRect::NULL if invalid

Definition at line 526 of file softhddevice.cpp.

References L_DRM, LOGDEBUG2, m_osdHeight, m_osdWidth, m_screenHeight, and m_screenWidth.

◆ ChannelSwitch()

void cSoftHdDevice::ChannelSwitch ( const cDevice *  device,
int  channelNum,
bool  liveView 
)
protectedvirtual

Monitor a channel switch triggered by VDR (cStatus::ChannelSwitch())

Save the timestamp when a channel switch is initiated (channelNum == 0) for later time measurement.

Definition at line 844 of file softhddevice.cpp.

References L_AV_SYNC, LOGDEBUG2, and LOGGER.

◆ CheckAudioPlaybackStartConditions()

bool cSoftHdDevice::CheckAudioPlaybackStartConditions ( void  )

Returns true, if audio playback should start without respect to a/v-sync.

This is true

  • if we are in live tv mode
  • if channel switch mode is CHANNEL_SWITCH_FAST_AUDIO
  • if audio wasn't started already
  • audio buffer is filled enough to start audio playback
  • if the device already received video data
Returns
true, if all conditions are met to start audio playback
Note
Used for fast channel switch

Definition at line 1063 of file softhddevice.cpp.

References AV_NOPTS_VALUE, BUFFERING, cSoftHdAudio::DropSamplesOlderThanPtsMs(), FastChannelSwitchAudioInTransferMode(), GetBufferFillLevelThresholdMs(), cSoftHdAudio::GetInputPtsMs(), cSoftHdAudio::GetOutputPtsMs(), cVideoRender::GetOutputPtsMs(), cVideoRender::GetVideoClock(), cSoftHdAudio::HasInputPts(), cVideoStream::HasInputPts(), cSoftHdAudio::IsPaused(), L_AV_SYNC, LOGDEBUG2, LOGGER, m_pAudio, m_pRender, m_pStateMachine, m_pVideoStream, and Timestamp2StringMs().

Referenced by cVideoRender::DisplayFrame(), and PlayAudio().

◆ CheckPlaybackStartConditions()

bool cSoftHdDevice::CheckPlaybackStartConditions ( void  )

Check, if all conditions are met to start the playback.

During the BUFFERING state, this method determines when sufficient audio/video data has been buffered to start playback.

ThresholdReached (Sync-Ability) is signalled 1) in audio only mode: -> PlayAudio() was called -> audio input has a valid pts -> enough audio data is buffered 2) in video only mode: -> PlayVideo() was called -> video input has a valid pts -> enough video data is buffered (which implies "a video frame reached the renderer") 3) in audio/video mode: -> audio input has a valid pts -> video input has a valid pts -> video and audio has enough data buffered (calculated from the first output pts to play) -> the render output buffer queue is completely filled once (which implies "a video frame reached the renderer") 4) if CHANNEL_SWITCH_FAST_AUDIO mode is selected: -> if audio playback has already started, the audio pts must have reached the video pts

Returns
true, if all conditions for a playback start are met, false otherwise
Note
In order to signal ThresholdReached, both (audio and video) need to have a valid pts in audio + video mode!

Definition at line 965 of file softhddevice.cpp.

References AUDIO_ONLY, AV_NOPTS_VALUE, BUFFERING, FastChannelSwitchAudioInTransferMode(), cVideoRender::GetAudioBehindVideoThresholdMs(), GetBufferFillLevelThresholdMs(), GetFirstAudioPtsMsToPlay(), GetFirstVideoPtsMsToPlay(), cSoftHdAudio::GetInputPtsMs(), cVideoStream::GetInputPtsMs(), cSoftHdAudio::GetOutputPtsMs(), cVideoRender::GetOutputPtsMs(), GetVideoAudioDelayMs(), cSoftHdAudio::HasInputPts(), cVideoStream::HasInputPts(), cVideoRender::IsOutputBufferFull(), cSoftHdAudio::IsPaused(), L_AV_SYNC, LOGDEBUG, LOGDEBUG2, LOGGER, m_logPlaybackStart, m_pAudio, m_playbackMode, m_pRender, m_pStateMachine, m_pVideoStream, m_receivedAudio, m_receivedVideo, PLAY, Timestamp2StringMs(), and TriggerEvent().

Referenced by cVideoRender::DisplayFrame(), and PlayAudio().

◆ Clear()

◆ Config()

cSoftHdConfig * cSoftHdDevice::Config ( void  )
inline

Definition at line 140 of file softhddevice.h.

References m_pConfig.

◆ Detach()

void cSoftHdDevice::Detach ( void  )

Detach the device.

Clears audio and video, stops all threads and releases drm/alsa. A detached state can only be exited (restarted) with an AttachEvent.

Definition at line 1336 of file softhddevice.cpp.

References cPipHandler::Disable(), LOGDEBUG, m_needsMakePrimary, m_pPipHandler, MakePrimaryDevice(), and TriggerEvent().

Referenced by cSoftHdMenu::HandleHotKey(), cSoftHdMenu::ProcessKey(), and cPluginSoftHdDevice::SVDRPCommand().

◆ DeviceName()

virtual cString cSoftHdDevice::DeviceName ( void  ) const
inlinevirtual

Definition at line 90 of file softhddevice.h.

◆ EnterState()

void cSoftHdDevice::EnterState ( State  state)

Actions to be performed when entering a state.

These are only executed when the state actually changes. E.g. a state transition PLAY -> PLAY does not trigger this.

Parameters
statestate being entered

Definition at line 1797 of file softhddevice.cpp.

References AUDIO_ONLY, BUFFERING, cVideoStream::CancelFilterThread(), cVideoRender::ClearDecoderToDisplayQueue(), cVideoStream::ClearVdrCoreToDecoderQueue(), cVideoStream::CloseDecoder(), DETACHED, cVideoRender::DisplayBlackFrame(), cSoftHdAudio::Exit(), cVideoRender::Exit(), cVideoStream::Exit(), FastChannelSwitchInTransferMode(), FlushAudio(), m_audioJitterTracker, m_forceDetached, m_pAudio, m_pAudioDecoder, m_pGrab, m_playbackMode, m_pOsdProvider, m_pPipHandler, m_pPipStream, m_pRender, m_pStateMachine, m_pVideoStream, m_videoJitterTracker, m_videoReassemblyBuffer, NONE, PLAY, cSoftOsdProvider::RequestStopOpenGlThread(), cVideoRender::Reset(), cJitterTracker::Reset(), cReassemblyBuffer::Reset(), cVideoRender::ResetBufferReuseStrategy(), cVideoRender::ResetDecodingStrategy(), cSoftHdAudio::ResetHwDelayBaseline(), cSoftHdAudio::ResetTrickSpeedPts(), cVideoRender::Resume(), cVideoStream::Resume(), cVideoStream::SetDeinterlacerDeactivated(), cVideoRender::SetDisplayOneFrameThenPause(), cSoftHdAudio::SetPaused(), cVideoRender::SetPlaybackPaused(), cVideoRender::SetStillpicture(), STOP, cSoftOsdProvider::StopOpenGlThread(), TRICK_SPEED, cSoftOsdProvider::UnlockOpenGlThread(), and VIDEO_ONLY.

Referenced by cStateMachine::ChangeState().

◆ FastChannelSwitchAudioInTransferMode()

bool cSoftHdDevice::FastChannelSwitchAudioInTransferMode ( void  )
inline

◆ FastChannelSwitchInTransferMode()

bool cSoftHdDevice::FastChannelSwitchInTransferMode ( void  )
inline

Definition at line 152 of file softhddevice.h.

References CHANNEL_SWITCH_AVSYNC, and m_channelSwitchMode.

Referenced by EnterState().

◆ Flush()

bool cSoftHdDevice::Flush ( int  timeoutMs = 0)
virtual

Return true, if the output buffers are empty, false otherwise.

Wait max. up to timeoutMs in case the buffers are not empty.

This function does not initiate a decoder drain like DrainDevice() so some data may stay unprocessed in the decoder, while the other buffers are already emtpy. Therefore, players should use the DrainDevice() function instead.

Parameters
timeoutMstimeout in ms to become ready
Returns
true, if the buffers are empty, false otherwise
Note
Flush() is marked DEPRECATED since APIVERSION 14

Definition at line 776 of file softhddevice.cpp.

References AUDIO_ONLY, cVideoStream::BuffersEmpty(), cSoftHdAudio::IsBufferEmpty(), IsDetached(), m_pAudio, m_playbackMode, and m_pVideoStream.

◆ FlushAudio()

void cSoftHdDevice::FlushAudio ( void  )
private

Clear all audio data from the decoder and ringbuffer.

Definition at line 1593 of file softhddevice.cpp.

References cSoftHdAudio::FlushBuffers(), cAudioDecoder::FlushBuffers(), LOGDEBUG, m_audioReassemblyBuffer, m_pAudio, m_pAudioDecoder, and cReassemblyBuffer::Reset().

Referenced by Clear(), and EnterState().

◆ Freeze()

void cSoftHdDevice::Freeze ( void  )
virtual

Puts the device into "freeze frame" mode.

Definition at line 709 of file softhddevice.cpp.

References LOGDEBUG, and TriggerEvent().

Referenced by cSoftHdControl::ProcessKey().

◆ GetBufferFillLevelThresholdMs()

int cSoftHdDevice::GetBufferFillLevelThresholdMs ( )
private

Returns the buffer fill level threshold in milliseconds.

Combines the minimum threshold with the user-configured additional buffer length.

Definition at line 1691 of file softhddevice.cpp.

References cSoftHdConfig::ConfigAdditionalBufferLengthMs, m_pConfig, and MIN_BUFFER_FILL_LEVEL_THRESHOLD_MS.

Referenced by CheckAudioPlaybackStartConditions(), and CheckPlaybackStartConditions().

◆ GetFirstAudioPtsMsToPlay()

int64_t cSoftHdDevice::GetFirstAudioPtsMsToPlay ( )
private

Calculate the first audio PTS that should be played during synchronized playback.

This method determines the starting audio presentation timestamp when transitioning from BUFFERING to PLAY state. It synchronizes audio with video by taking the maximum of both output PTSes, then adjusts for user-configured audio/video delay.

Returns
the first audio PTS in milliseconds that should be played
Note
Positive ConfigVideoAudioDelayMs means audio is intentionally delayed (video ahead)
Negative ConfigVideoAudioDelayMs means video is intentionally delayed (audio ahead)

Definition at line 1664 of file softhddevice.cpp.

References cSoftHdConfig::ConfigVideoAudioDelayMs, cSoftHdAudio::GetOutputPtsMs(), cVideoRender::GetOutputPtsMs(), m_pAudio, m_pConfig, and m_pRender.

Referenced by CheckPlaybackStartConditions(), and SchedulePlaybackStart().

◆ GetFirstVideoPtsMsToPlay()

◆ GetMinBufferFillLevelThresholdMs()

int cSoftHdDevice::GetMinBufferFillLevelThresholdMs ( void  )
inline

Definition at line 172 of file softhddevice.h.

References MIN_BUFFER_FILL_LEVEL_THRESHOLD_MS.

Referenced by cMenuSetupSoft::Create().

◆ GetOsdSize()

void cSoftHdDevice::GetOsdSize ( int &  width,
int &  height,
double &  aspectRatio 
)
virtual

Returns the width, height and aspect ratio the OSD should have.

Parameters
[out]widthosd width
[out]heightosd height
[out]aspectRatioosd aspect ratio
Todo:
: Called every second, for nothing (no OSD displayed)?

Definition at line 278 of file softhddevice.cpp.

References IsDetached(), m_osdHeight, m_osdWidth, and m_sizeMutex.

Referenced by cOglOsd::cOglOsd(), and cSoftOsd::Flush().

◆ GetSpuDecoder()

cSpuDecoder * cSoftHdDevice::GetSpuDecoder ( void  )
virtual

Get the device SPU decoder.

Returns
a pointer to the device's SPU decoder (or NULL, if this device doesn't have an SPU decoder)

Definition at line 163 of file softhddevice.cpp.

References LOGDEBUG, and m_pSpuDecoder.

◆ GetStats()

void cSoftHdDevice::GetStats ( int *  duped,
int *  dropped,
int *  counter 
)

Get statistics from the renderer.

Parameters
[out]dupedduped frames
[out]droppeddropped frames
[out]countnumber of total rendered frames

Definition at line 1247 of file softhddevice.cpp.

References cVideoRender::GetStats(), and m_pRender.

Referenced by cMenuSetupSoft::Create().

◆ GetSTC()

◆ GetVideoAudioDelayMs()

int cSoftHdDevice::GetVideoAudioDelayMs ( void  )
inline

◆ GetVideoSize()

void cSoftHdDevice::GetVideoSize ( int &  width,
int &  height,
double &  aspectRatio 
)
virtual

Get the video size.

Return the width, height and aspect ratio of the currently displayed video material

Parameters
[out]widthvideo width
[out]heightvideo height
[out]aspectRatiovideo aspect ratio
Note
the video_aspect is used to scale the subtitle.

Definition at line 255 of file softhddevice.cpp.

References cVideoStream::GetVideoSize(), IsDetached(), and m_pVideoStream.

◆ GrabImage()

uchar * cSoftHdDevice::GrabImage ( int &  size,
bool  jpeg,
int  quality,
int  width,
int  height 
)
virtual

Grabs the currently visible screen image.

Parameters
sizesize of the returned data
jpegflag true, create JPEG data
qualityJPEG quality
widthnumber of horizontal pixels in the frame
heightnumber of vertical pixels in the frame

Definition at line 181 of file softhddevice.cpp.

References cSoftHdGrab::Finish(), cSoftHdGrab::Image(), cSoftHdGrab::IsActive(), IsDetached(), L_GRAB, LOGDEBUG2, LOGWARNING, m_pGrab, m_screenHeight, m_screenWidth, cSoftHdGrab::ProcessGrab(), cSoftHdGrab::Size(), and cSoftHdGrab::Start().

◆ HaltOpenGlThread()

bool cSoftHdDevice::HaltOpenGlThread ( void  )

Pause the OpenGL worker thread.

Definition at line 1914 of file softhddevice.cpp.

References cSoftOsdProvider::LockOpenGlThread(), and m_pOsdProvider.

Referenced by cStateMachine::OnEventReceived().

◆ HaltVideoThreads()

void cSoftHdDevice::HaltVideoThreads ( void  )

Pause the rendering and decoder thread.

Definition at line 1895 of file softhddevice.cpp.

References cVideoRender::Halt(), cVideoStream::Halt(), m_pRender, and m_pVideoStream.

Referenced by cStateMachine::OnEventReceived().

◆ HandleDisplayModeChange()

void cSoftHdDevice::HandleDisplayModeChange ( const sDrmMode &  mode)

◆ HandleStillPicture()

void cSoftHdDevice::HandleStillPicture ( const uchar *  data,
int  size 
)

The still picture data received from VDR can contain multiple PES packets.

This sends each PES packet's raw data separately to PlayVideo(), and does a flush to display the frame immediately.

Parameters
datapes data of one or more frames
sizelength of data area

Definition at line 1608 of file softhddevice.cpp.

References cVideoStream::Drain(), LOGWARNING, m_pRender, m_pVideoStream, m_videoReassemblyBuffer, PlayVideoInternal(), cReassemblyBufferVideo::PopAvPacket(), cVideoStream::PushAvPacket(), cVideoStream::ResetInputPts(), cVideoStream::SetDeinterlacerDeactivated(), cVideoRender::SetPlaybackPaused(), and cVideoRender::SetStillpicture().

Referenced by cStateMachine::OnEventReceived().

◆ HasDecoder()

bool cSoftHdDevice::HasDecoder ( void  ) const
virtual

Tells whether this device has an MPEG decoder.

Definition at line 148 of file softhddevice.cpp.

References IsDetached().

◆ InitAudio()

int cSoftHdDevice::InitAudio ( bool  setVolume)

Init the audio lazily.

Parameters
setVolumeif true, reset the current volume
Return values
0if audio init succeeded
-1on error

Definition at line 1945 of file softhddevice.cpp.

References cSoftHdAudio::LazyInit(), m_pAudio, m_volume, and cSoftHdAudio::SetVolume().

Referenced by cStateMachine::OnEventReceived().

◆ Initialize()

◆ IsAudioOnlyPlayback()

bool cSoftHdDevice::IsAudioOnlyPlayback ( void  )
inline

Definition at line 156 of file softhddevice.h.

References AUDIO_ONLY, and m_playbackMode.

Referenced by cSoftHdAudio::CyclicCall().

◆ IsDetached()

bool cSoftHdDevice::IsDetached ( void  ) const

◆ IsDetachForced()

bool cSoftHdDevice::IsDetachForced ( void  )

Returns true, the a detached plugin start was forced.

Definition at line 1932 of file softhddevice.cpp.

References m_forceDetached.

Referenced by cStateMachine::OnEventReceived().

◆ IsDraining()

bool cSoftHdDevice::IsDraining ( void  )
inline

Definition at line 192 of file softhddevice.h.

References m_draining.

Referenced by cSoftHdAudio::CyclicCall(), and cVideoRender::DisplayFrame().

◆ IsOsdProviderSet()

bool cSoftHdDevice::IsOsdProviderSet ( void  ) const
inline

Definition at line 190 of file softhddevice.h.

References m_pOsdProvider.

Referenced by cSoftOsdProvider::~cSoftOsdProvider().

◆ IsVideoOnlyPlayback()

bool cSoftHdDevice::IsVideoOnlyPlayback ( void  )
inline

Definition at line 155 of file softhddevice.h.

References m_playbackMode, and VIDEO_ONLY.

Referenced by cVideoRender::DisplayFrame().

◆ LeaveState()

◆ MakePrimaryDevice()

void cSoftHdDevice::MakePrimaryDevice ( bool  on)
protectedvirtual

Informs a device that it will be the primary device.

Parameters
onflag if becoming or loosing primary

Definition at line 135 of file softhddevice.cpp.

References LOGDEBUG, and m_pOsdProvider.

Referenced by Attach(), and Detach().

◆ MaxSizeGPUImageCache()

int cSoftHdDevice::MaxSizeGPUImageCache ( void  )

Get the maximum GPU image cache size.

Definition at line 1118 of file softhddevice.cpp.

References cSoftHdConfig::ConfigMaxSizeGPUImageCache, and m_pConfig.

Referenced by cSoftOsdProvider::StartOpenGlThread().

◆ OglOsdIsDisabled()

int cSoftHdDevice::OglOsdIsDisabled ( void  )

◆ OsdClose()

void cSoftHdDevice::OsdClose ( void  )

Close the OSD.

Note
Don't rename this function to OsdClear(), because this would be the implementation of cStatus::OsdClear()!

Definition at line 1158 of file softhddevice.cpp.

References IsDetached(), m_pRender, and cVideoRender::OsdClear().

Referenced by cOglCmdCopyBufferToOutputFb::Execute(), cSoftOsd::SetActive(), and cSoftOsd::SetAreas().

◆ OsdDraw()

void cSoftHdDevice::OsdDraw ( int  xi,
int  yi,
int  height,
int  width,
int  pitch,
const uint8_t *  argb,
int  x,
int  y 
)

Draw an OSD pixmap.

Parameters
xix-coordinate in argb image
yiy-coordinate in argb image
heightheight in pixel in argb image
widthwidth in pixel in argb image
pitchpitch of argb image
argb32bit ARGB image data
xx-coordinate on screen of argb image
yy-coordinate on screen of argb image

Definition at line 1178 of file softhddevice.cpp.

References IsDetached(), m_pRender, and cVideoRender::OsdDraw().

Referenced by cOglCmdCopyBufferToOutputFb::Execute(), and cSoftOsd::Flush().

◆ PausePlayback()

void cSoftHdDevice::PausePlayback ( bool  schedulePause)

◆ PipChannelChange()

void cSoftHdDevice::PipChannelChange ( int  dir)

◆ PipChannelSwap()

void cSoftHdDevice::PipChannelSwap ( bool  closePip)

◆ PipDisable()

void cSoftHdDevice::PipDisable ( void  )

Definition at line 1443 of file softhddevice.cpp.

References cPipHandler::Disable(), and m_pPipHandler.

Referenced by cPluginSoftHdDevice::SVDRPCommand().

◆ PipEnable()

void cSoftHdDevice::PipEnable ( void  )

Definition at line 1442 of file softhddevice.cpp.

References cPipHandler::Enable(), and m_pPipHandler.

Referenced by cPluginSoftHdDevice::SVDRPCommand().

◆ PipIsEnabled()

bool cSoftHdDevice::PipIsEnabled ( void  )

Returns true, if pip is currently enabled.

Definition at line 1435 of file softhddevice.cpp.

References cPipHandler::IsEnabled(), m_pPipHandler, and m_pStateMachine.

Referenced by cPluginSoftHdDevice::SVDRPCommand().

◆ PipSetSize()

void cSoftHdDevice::PipSetSize ( void  )

Definition at line 1448 of file softhddevice.cpp.

References m_pPipHandler, and cPipHandler::SetSize().

Referenced by cMenuSetupSoft::Store().

◆ PipSwapPosition()

void cSoftHdDevice::PipSwapPosition ( void  )

◆ PipToggle()

void cSoftHdDevice::PipToggle ( void  )

Definition at line 1444 of file softhddevice.cpp.

References m_pPipHandler, and cPipHandler::Toggle().

Referenced by cSoftHdMenu::HandleHotKey(), and cSoftHdMenu::ProcessKey().

◆ Play()

void cSoftHdDevice::Play ( void  )
virtual

Sets the device into play mode (after a previous trick mode, or pause)

This is called by VDR via DevicePlay() in the Play() and Goto() call

Definition at line 698 of file softhddevice.cpp.

References LOGDEBUG, and TriggerEvent().

Referenced by cSoftHdControl::ProcessKey().

◆ PlayAudio()

int cSoftHdDevice::PlayAudio ( const uchar *  data,
int  size,
uchar  id 
)
protectedvirtual

◆ PlayAudioPkts()

int cSoftHdDevice::PlayAudioPkts ( AVPacket *  pkt)

Play an audio packet.

Parameters
pktAVPacket to play
Return values
0packet could not be player, free audio buffer too small
1packet was sent to be decoded

Definition at line 1293 of file softhddevice.cpp.

References cAudioDecoder::Decode(), cSoftHdAudio::IsBufferFull(), cSoftHdAudio::LazyInit(), LOGFATAL, m_pAudio, and m_pAudioDecoder.

Referenced by cSoftHdPlayer::Play().

◆ PlayPipVideo()

int cSoftHdDevice::PlayPipVideo ( const uchar *  data,
int  size 
)

Play a video packet of the pip videostream.

Parameters
dataA complete PES packet with optionally fragmented payload
sizethe length of the PES packet including header

The caller must ensure, that PlayPipVideo() is not called in detached state. (CanReplay() and HasDecoder() return false in this state and we are not the primary device.)

Definition at line 1394 of file softhddevice.cpp.

References cVideoStream::IsInputBufferFull(), m_pipReassemblyBuffer, m_pPipStream, and PlayVideoInternal().

Referenced by cPipReceiver::PlayTs().

◆ PlayVideo()

int cSoftHdDevice::PlayVideo ( const uchar *  data,
int  size 
)
protectedvirtual

Play a video packet of the main videostream.

This is the main function, which is called by VDR to play video data

Parameters
dataA complete PES packet with optionally fragmented payload
sizethe length of the PES packet including header

This is called directly from VDR

The caller must ensure, that PlayVideo() is not called in detached state. (CanReplay() and HasDecoder() return false in this state and we are not the primary device.)

Definition at line 482 of file softhddevice.cpp.

References IsDetached(), m_pVideoStream, m_receivedVideo, m_videoReassemblyBuffer, and PlayVideoInternal().

◆ PlayVideoInternal()

int cSoftHdDevice::PlayVideoInternal ( cVideoStream *  stream,
cReassemblyBufferVideo *  buffer,
const uchar *  data,
int  size,
bool  trackJitter,
bool  mainStream 
)
private

Play a video packet.

Parameters
streamvideo stream to play to
bufferreassembly buffer for this stream
dataA complete PES packet with optionally fragmented payload
sizethe length of the PES packet including header
trackJitterwhether to track jitter for this packet
mainStreamthis is a packet of the main stream

Definition at line 1524 of file softhddevice.cpp.

References cReassemblyBuffer::GetCodec(), cJitterTracker::GetLongTermMaxJitterMs(), cJitterTracker::GetShortTermMaxJitterMs(), cReassemblyBufferVideo::HasLeadingZero(), cReassemblyBuffer::IsEmpty(), L_AV_SYNC, LOGDEBUG2, LOGGER, m_pConfig, m_receivedValidAudio, m_receivedValidVideo, m_videoJitterTracker, cJitterTracker::PacketReceived(), cReassemblyBufferVideo::ParseCodecHeader(), cReassemblyBufferVideo::PopAvPacket(), PrintStreamData(), cReassemblyBuffer::Push(), cReassemblyBuffer::Reset(), cSoftHdConfig::StatMaxLongTermVideoJitterMs, and cSoftHdConfig::StatMaxShortTermVideoJitterMs.

Referenced by HandleStillPicture(), PlayPipVideo(), and PlayVideo().

◆ PlayVideoPkts()

int cSoftHdDevice::PlayVideoPkts ( AVPacket *  pkt)

Play a video packet.

Parameters
pktAVPacket to play
Return values
0packet could not be player, free audio buffer too small
1packet was sent to be decoded

Definition at line 1313 of file softhddevice.cpp.

References cVideoStream::GetAvPacketsFilled(), cVideoStream::GetVideoPacketMax(), cSoftHdAudio::LazyInit(), LOGFATAL, m_pAudio, m_pVideoStream, and cVideoStream::PushAvPacket().

Referenced by cSoftHdPlayer::Play().

◆ Poll()

bool cSoftHdDevice::Poll ( cPoller &  ,
int  = 0 
)
virtual

Return true if the device itself or any of the file handles in poller is ready for further action.

If TimeoutMs is not zero, the device will wait up to the given number of milliseconds before returning in case it can't accept any data.

Parameters
pollerfile handles (unused)
timeoutMstimeout in ms to become ready
Return values
trueif ready
falseif busy

Definition at line 747 of file softhddevice.cpp.

References cSoftHdAudio::IsBufferFull(), IsDetached(), cVideoStream::IsInputBufferFull(), m_pAudio, and m_pVideoStream.

◆ Render()

cVideoRender * cSoftHdDevice::Render ( void  )
inline

Definition at line 142 of file softhddevice.h.

References m_pRender.

◆ Replaying()

void cSoftHdDevice::Replaying ( const cControl *  control,
const char *  name,
const char *  filenameDevice,
bool  on 
)
protectedvirtual

Monitor a replay start or end.

Save the timestamp when a replay is started for later time measurement.

Definition at line 859 of file softhddevice.cpp.

References L_AV_SYNC, LOGDEBUG2, and LOGGER.

◆ ResetChannelId()

void cSoftHdDevice::ResetChannelId ( void  )

Reset the channel ID (restarts audio)

Definition at line 1230 of file softhddevice.cpp.

References LOGDEBUG, and m_audioChannelID.

Referenced by cMenuSetupSoft::Store().

◆ ResetOsdProvider()

void cSoftHdDevice::ResetOsdProvider ( void  )
inline

Definition at line 189 of file softhddevice.h.

References m_pOsdProvider.

Referenced by cSoftOsdProvider::~cSoftOsdProvider().

◆ ResetPipStream()

◆ ResetVideoFilter()

void cSoftHdDevice::ResetVideoFilter ( void  )

Reset the video deinterlace filter.

Definition at line 1959 of file softhddevice.cpp.

References m_pRender, m_pVideoStream, cVideoStream::ResetFilterThreadNeededCheck(), and cVideoRender::ResetFrameCounter().

Referenced by cStateMachine::OnEventReceived().

◆ ResumeFromPause()

◆ ResumeOpenGlThread()

void cSoftHdDevice::ResumeOpenGlThread ( void  )

Resume the OpenGL worker thread.

Definition at line 1922 of file softhddevice.cpp.

References m_pOsdProvider, and cSoftOsdProvider::UnlockOpenGlThread().

Referenced by cStateMachine::OnEventReceived().

◆ ResumePlayback()

void cSoftHdDevice::ResumePlayback ( void  )

Resume playback again.

Definition at line 2087 of file softhddevice.cpp.

References m_pRender, and cVideoRender::SetPlaybackPaused().

Referenced by cStateMachine::OnEventReceived().

◆ ResumeVideoThreads()

void cSoftHdDevice::ResumeVideoThreads ( void  )

Resume the rendering and decoder thread.

Definition at line 1904 of file softhddevice.cpp.

References m_pRender, m_pVideoStream, cVideoRender::Resume(), and cVideoStream::Resume().

Referenced by cStateMachine::OnEventReceived().

◆ ScaleVideo()

void cSoftHdDevice::ScaleVideo ( const cRect &  rect = cRect::Null)
virtual

Scale the currently shown video.

Parameters
xvideo window x coordinate OSD relative
yvideo window x coordinate OSD relative
widthvideo window width OSD relative
heightvideo window height OSD relative

Definition at line 561 of file softhddevice.cpp.

References IsDetached(), L_OSD, LOGDEBUG2, m_pRender, and cVideoRender::SetVideoOutputPosition().

◆ SchedulePlaybackStart()

bool cSoftHdDevice::SchedulePlaybackStart ( void  )

Schedules the playback start.

Drops audio data if necessary to start in sync and schedules the playback start at the common pts.

Return values
trueplayback started
falseplayback was not started

Definition at line 1987 of file softhddevice.cpp.

References AUDIO_AND_VIDEO, AUDIO_ONLY, cSoftHdAudio::DropSamplesOlderThanPtsMs(), FastChannelSwitchAudioInTransferMode(), GetFirstAudioPtsMsToPlay(), GetFirstVideoPtsMsToPlay(), cSoftHdAudio::GetOutputPtsMs(), cVideoRender::GetOutputPtsMs(), cSoftHdAudio::HasInputPts(), cVideoStream::HasInputPts(), LOGDEBUG, m_pAudio, m_playbackMode, m_pRender, m_pVideoStream, cVideoRender::SchedulePlaybackStartAtPtsMs(), and VIDEO_ONLY.

Referenced by cStateMachine::OnEventReceived().

◆ ScheduleResyncAtPtsMs()

void cSoftHdDevice::ScheduleResyncAtPtsMs ( int64_t  pts)

Schedule aa a/v resync in the render thread at the given pts.

Parameters
ptsresync, when the rendered video frame reaches this pts

Definition at line 2027 of file softhddevice.cpp.

References m_pRender, and cVideoRender::ScheduleResyncAtPtsMs().

Referenced by cStateMachine::OnEventReceived().

◆ SetAudioCodec()

void cSoftHdDevice::SetAudioCodec ( enum AVCodecID  codecId,
AVCodecParameters *  par,
AVRational  timebase 
)

Open an audio codec.

Parameters
codecIdaudio codec id
paraudio codec parameters
timebasetimebase

Definition at line 1268 of file softhddevice.cpp.

References m_pAudioDecoder, and cAudioDecoder::Open().

Referenced by cSoftHdPlayer::Play().

◆ SetChannelSwitchMode()

void cSoftHdDevice::SetChannelSwitchMode ( ChannelSwitchMode  mode)
inline

Definition at line 149 of file softhddevice.h.

References m_channelSwitchMode.

Referenced by cMenuSetupSoft::Store().

◆ SetDecoderFallbackToSw()

void cSoftHdDevice::SetDecoderFallbackToSw ( bool  enable)

Force the decoder to fallback to software if the hardware decoder fails after the configured amount of packets were sent and no frame was received.

Definition at line 890 of file softhddevice.cpp.

References cSoftHdConfig::ConfigDecoderFallbackToSwNumPkts, m_pConfig, m_pVideoStream, and cVideoStream::SetDecoderFallbackToSwNumPkts().

Referenced by cMenuSetupSoft::Store().

◆ SetDetachForced()

void cSoftHdDevice::SetDetachForced ( void  )
inline

Definition at line 227 of file softhddevice.h.

References m_forceDetached.

Referenced by cStateMachine::OnEventReceived().

◆ SetDisableDeint()

void cSoftHdDevice::SetDisableDeint ( void  )

Disables deinterlacer (called from setup menu or conf)

Definition at line 879 of file softhddevice.cpp.

References cSoftHdConfig::ConfigDisableDeint, cVideoStream::DisableDeint(), m_pConfig, and m_pVideoStream.

Referenced by cMenuSetupSoft::Store().

◆ SetDisableOglOsd()

void cSoftHdDevice::SetDisableOglOsd ( void  )

Disables OpenGL/ES Osd (called from setup menu or conf)

Definition at line 1134 of file softhddevice.cpp.

References cSoftHdConfig::ConfigDisableOglOsd, cVideoRender::DisableOglOsd(), m_pConfig, and m_pRender.

Referenced by cSoftOsdProvider::CreateOsd(), and cPluginSoftHdDevice::ProcessArgs().

◆ SetDisablePip()

void cSoftHdDevice::SetDisablePip ( void  )
inline

Definition at line 201 of file softhddevice.h.

References m_disablePip.

Referenced by cPluginSoftHdDevice::ProcessArgs().

◆ SetDisplayMode()

◆ SetDrain()

void cSoftHdDevice::SetDrain ( bool  on)
private

Set and log the drain state changes.

Parameters
ontrue, if draining should be started false, if draining should be stopped

Definition at line 1701 of file softhddevice.cpp.

References LOGDEBUG, and m_draining.

Referenced by Clear(), and SetPlayMode().

◆ SetDrmCanDisplayPip()

void cSoftHdDevice::SetDrmCanDisplayPip ( bool  canDisplay)
inline

Definition at line 196 of file softhddevice.h.

References m_drmCanDisplayPip.

Referenced by cVideoRender::Init().

◆ SetEnableHdr()

void cSoftHdDevice::SetEnableHdr ( bool  enable)

Enable HDR display mode.

Definition at line 904 of file softhddevice.cpp.

References m_pRender, and cVideoRender::SetEnableHdr().

Referenced by cMenuSetupSoft::Store().

◆ SetEnableOglOsd()

void cSoftHdDevice::SetEnableOglOsd ( void  )

Enables OpenGL/ES Osd.

Definition at line 1144 of file softhddevice.cpp.

References cSoftHdConfig::ConfigDisableOglOsd, cVideoRender::EnableOglOsd(), m_pConfig, and m_pRender.

◆ SetOsdSize()

void cSoftHdDevice::SetOsdSize ( int  width,
int  height 
)

Set the OSD size.

Parameters
widthosd width
heightosd height

Definition at line 1193 of file softhddevice.cpp.

References m_osdHeight, m_osdWidth, and m_sizeMutex.

Referenced by cVideoRender::SetOsdSize().

◆ SetPassthroughMask()

void cSoftHdDevice::SetPassthroughMask ( int  mask)

Set the passthrough mask (called from setup menu or conf)

Definition at line 1220 of file softhddevice.cpp.

References m_pAudio, m_pAudioDecoder, cSoftHdAudio::SetPassthroughMask(), and cAudioDecoder::SetPassthroughMask().

Referenced by cMenuSetupSoft::Store().

◆ SetPlayMode()

bool cSoftHdDevice::SetPlayMode ( ePlayMode  play_mode)
protectedvirtual

Sets the device into the given play mode.

Parameters
play_modenew play mode (Audio/Video/External...)

Definition at line 325 of file softhddevice.cpp.

References cPipHandler::Disable(), L_AV_SYNC, LOGDEBUG, LOGDEBUG2, LOGERROR, LOGGER, m_externalPlayerActive, m_logPlaybackStart, m_pPipHandler, SetDrain(), and TriggerEvent().

◆ SetRenderPipActive()

void cSoftHdDevice::SetRenderPipActive ( bool  active)

◆ SetRenderPipSize()

void cSoftHdDevice::SetRenderPipSize ( void  )

◆ SetScreenSize()

void cSoftHdDevice::SetScreenSize ( int  width,
int  height 
)

Set the screen size.

Parameters
widthscreen width
heightscreen height

Definition at line 1206 of file softhddevice.cpp.

References m_screenHeight, m_screenWidth, and m_sizeMutex.

Referenced by cVideoRender::SetScreenSize().

◆ SetStartDetached()

void cSoftHdDevice::SetStartDetached ( void  )
inline

Definition at line 191 of file softhddevice.h.

References m_forceDetached.

Referenced by cPluginSoftHdDevice::ProcessArgs().

◆ SetTrickSpeed()

void cSoftHdDevice::SetTrickSpeed ( double  speed,
bool  active,
bool  forward 
)

Set the trickspeed in the renderer.

Parameters
speedtrickspeed factor
activetrue, if trickspeed is active
forwardtrue, if this is forward trickspeed

Definition at line 1972 of file softhddevice.cpp.

References m_pAudio, m_pRender, cSoftHdAudio::SetTrickSpeed(), and cVideoRender::SetTrickSpeed().

Referenced by cStateMachine::OnEventReceived().

◆ SetVideoCodec()

void cSoftHdDevice::SetVideoCodec ( enum AVCodecID  codecId,
AVCodecParameters *  par,
AVRational  timebase 
)

Open a video codec.

Parameters
codecIdvideo codec id
parvideo codec parameters
timebasetimebase

Definition at line 1280 of file softhddevice.cpp.

References m_pVideoStream, and cVideoStream::Open().

Referenced by cSoftHdPlayer::Play().

◆ SetVideoDisplayFormat()

void cSoftHdDevice::SetVideoDisplayFormat ( eVideoDisplayFormat  videoDisplayFormat)
virtual

Sets the video display format.

Parameters
videoDisplayFormatvideo display format Set it to the given one (only useful if this device has an MPEG decoder).

Definition at line 218 of file softhddevice.cpp.

References LOGDEBUG.

Referenced by SetVideoFormat().

◆ SetVideoFormat()

void cSoftHdDevice::SetVideoFormat ( bool  videoFormat16_9)
virtual

Set the video format.

Sets the output video format to either 16:9 or 4:3 (only useful if this device has an MPEG decoder).

Should call SetVideoDisplayFormat

Parameters
videoFormat16_9flag true 16:9.

Definition at line 235 of file softhddevice.cpp.

References LOGDEBUG, and SetVideoDisplayFormat().

◆ SetVolumeDevice()

void cSoftHdDevice::SetVolumeDevice ( int  volume)
protectedvirtual

Sets the audio volume on this device (Volume = 0...255).

Parameters
volumedevice volume

Definition at line 298 of file softhddevice.cpp.

References IsDetached(), LOGDEBUG, m_pAudio, m_volume, and cSoftHdAudio::SetVolume().

◆ Start()

int cSoftHdDevice::Start ( void  )

Called by VDR when the plugin is started.

Definition at line 108 of file softhddevice.cpp.

References LOGDEBUG, and TriggerEvent().

Referenced by cPluginSoftHdDevice::Start().

◆ StillPicture()

void cSoftHdDevice::StillPicture ( const uchar *  data,
int  size 
)
virtual

Display the given I-frame as a still picture.

Parameters
datapes or ts data of a frame
lengthlength of data area

Definition at line 723 of file softhddevice.cpp.

References LOGDEBUG, and TriggerEvent().

◆ Stop()

void cSoftHdDevice::Stop ( void  )

Called by VDR when the plugin is stopped.

Definition at line 119 of file softhddevice.cpp.

References cPipHandler::Disable(), LOGDEBUG, m_pPipHandler, and TriggerEvent().

Referenced by cPluginSoftHdDevice::Stop().

◆ ToggleRenderPipPosition()

void cSoftHdDevice::ToggleRenderPipPosition ( void  )
inline

Definition at line 199 of file softhddevice.h.

References m_pipUseAlt.

Referenced by cPipHandler::SwapPosition().

◆ TrickSpeed()

void cSoftHdDevice::TrickSpeed ( int  speed,
bool  forward 
)
virtual

Sets the device into a mode where replay is done slower.

Every single frame shall then be displayed the given number of times. Forward is true if replay is done in the normal (forward) direction, false if it is done reverse. The cDvbPlayer uses the following values for the various speeds: 1x 2x 3x Fast Forward 6 3 1 Fast Reverse 6 3 1 Slow Forward 8 4 2 Slow Reverse 63 48 24

Definition at line 585 of file softhddevice.cpp.

References LOGDEBUG, and TriggerEvent().

◆ TriggerEvent()

void cSoftHdDevice::TriggerEvent ( const Event &  event)

With this wrapper function, the device can directly act as an event reveiver.

Parameters
eventevent to be executed

Definition at line 1717 of file softhddevice.cpp.

References m_pStateMachine.

Referenced by Attach(), CheckPlaybackStartConditions(), Detach(), Freeze(), Play(), PlayAudio(), cSoftHdAudio::ProcessEvents(), cVideoRender::ProcessEvents(), SetPlayMode(), Start(), StillPicture(), Stop(), and TrickSpeed().

◆ UsePip()

◆ VideoStream()

cVideoStream * cSoftHdDevice::VideoStream ( void  )
inline

Definition at line 141 of file softhddevice.h.

References m_pVideoStream.

Referenced by cVideoRender::DisplayFrame(), and cVideoRender::LogDroppedDuped().

Member Data Documentation

◆ m_audioChannelID

int cSoftHdDevice::m_audioChannelID = -1
private

current audio channel ID

Definition at line 263 of file softhddevice.h.

Referenced by PlayAudio(), and ResetChannelId().

◆ m_audioJitterTracker

cJitterTracker cSoftHdDevice::m_audioJitterTracker {"audio"}
private

audio jitter tracker

Definition at line 257 of file softhddevice.h.

Referenced by EnterState(), and PlayAudio().

◆ m_audioReassemblyBuffer

cReassemblyBufferAudio cSoftHdDevice::m_audioReassemblyBuffer
private

audio pes reassembly buffer

Definition at line 256 of file softhddevice.h.

Referenced by FlushAudio(), and PlayAudio().

◆ m_channelSwitchMode

std::atomic<ChannelSwitchMode> cSoftHdDevice::m_channelSwitchMode = CHANNEL_SWITCH_AVSYNC
private

current channel switch mode

Definition at line 259 of file softhddevice.h.

Referenced by FastChannelSwitchAudioInTransferMode(), FastChannelSwitchInTransferMode(), Initialize(), and SetChannelSwitchMode().

◆ m_disablePip

bool cSoftHdDevice::m_disablePip = false
private

true, if pip was disabled by the user

Definition at line 276 of file softhddevice.h.

Referenced by SetDisablePip(), and UsePip().

◆ m_draining

std::atomic<bool> cSoftHdDevice::m_draining = false
private

true, if the device is in draining mode (waiting for empty buffers)

Definition at line 243 of file softhddevice.h.

Referenced by IsDraining(), and SetDrain().

◆ m_drmCanDisplayPip

bool cSoftHdDevice::m_drmCanDisplayPip = true
private

true, if the drm device is able to display a pip video

Definition at line 275 of file softhddevice.h.

Referenced by SetDrmCanDisplayPip(), and UsePip().

◆ m_eventMutex

std::mutex cSoftHdDevice::m_eventMutex
private

mutex to protect event queue

Definition at line 244 of file softhddevice.h.

◆ m_externalPlayerActive

bool cSoftHdDevice::m_externalPlayerActive = false
private

true, if we detached for an external player

Definition at line 285 of file softhddevice.h.

Referenced by SetPlayMode().

◆ m_forceDetached

bool cSoftHdDevice::m_forceDetached = false
private

start the plugin in detached state

Definition at line 284 of file softhddevice.h.

Referenced by Attach(), EnterState(), IsDetachForced(), LeaveState(), SetDetachForced(), and SetStartDetached().

◆ m_initialized

bool cSoftHdDevice::m_initialized = false
private

true, if the plugin had a successful Initialize()

Definition at line 242 of file softhddevice.h.

Referenced by Initialize(), and ~cSoftHdDevice().

◆ m_logPlaybackStart

bool cSoftHdDevice::m_logPlaybackStart = true
private

Definition at line 260 of file softhddevice.h.

Referenced by CheckPlaybackStartConditions(), and SetPlayMode().

◆ m_needsMakePrimary

bool cSoftHdDevice::m_needsMakePrimary = false
private

true, if device should be made a primary device after attach

Definition at line 245 of file softhddevice.h.

Referenced by Attach(), and Detach().

◆ m_osdHeight

int cSoftHdDevice::m_osdHeight
private

Definition at line 280 of file softhddevice.h.

Referenced by CanScaleVideo(), GetOsdSize(), and SetOsdSize().

◆ m_osdWidth

int cSoftHdDevice::m_osdWidth
private

Definition at line 279 of file softhddevice.h.

Referenced by CanScaleVideo(), GetOsdSize(), and SetOsdSize().

◆ m_pAudio

◆ m_pAudioDecoder

cAudioDecoder* cSoftHdDevice::m_pAudioDecoder = nullptr
private

◆ m_pConfig

◆ m_pEventHandler

cEventHandler* cSoftHdDevice::m_pEventHandler
private

event handler thread

Definition at line 254 of file softhddevice.h.

Referenced by Initialize(), SetDisplayMode(), and ~cSoftHdDevice().

◆ m_pGrab

cSoftHdGrab* cSoftHdDevice::m_pGrab
private

pointer to grabber object

Definition at line 264 of file softhddevice.h.

Referenced by EnterState(), GrabImage(), and LeaveState().

◆ m_pHardwareDevice

cHardwareDevice* cSoftHdDevice::m_pHardwareDevice
private

pointer to hardware device description

Definition at line 253 of file softhddevice.h.

Referenced by Initialize(), LeaveState(), and ~cSoftHdDevice().

◆ m_pipReassemblyBuffer

cReassemblyBufferVideo cSoftHdDevice::m_pipReassemblyBuffer
private

pip pes reassembly buffer

Definition at line 267 of file softhddevice.h.

Referenced by PlayPipVideo(), and ResetPipStream().

◆ m_pipUseAlt

bool cSoftHdDevice::m_pipUseAlt
private

use alternative pip position

Definition at line 274 of file softhddevice.h.

Referenced by Initialize(), SetRenderPipSize(), and ToggleRenderPipPosition().

◆ m_playbackMode

std::atomic<PlaybackMode> cSoftHdDevice::m_playbackMode = NONE
private

◆ m_pOsdProvider

cSoftOsdProvider* cSoftHdDevice::m_pOsdProvider = nullptr
private

◆ m_pPipHandler

cPipHandler* cSoftHdDevice::m_pPipHandler = nullptr
private

◆ m_pPipStream

cVideoStream* cSoftHdDevice::m_pPipStream
private

pointer to pip video stream

Definition at line 266 of file softhddevice.h.

Referenced by EnterState(), LeaveState(), PlayPipVideo(), and ResetPipStream().

◆ m_pRender

◆ m_pSpuDecoder

cDvbSpuDecoder* cSoftHdDevice::m_pSpuDecoder
private

pointer to spu decoder

Definition at line 246 of file softhddevice.h.

Referenced by GetSpuDecoder(), Initialize(), and ~cSoftHdDevice().

◆ m_pStateMachine

◆ m_pVideoStream

◆ m_receivedAudio

std::atomic<bool> cSoftHdDevice::m_receivedAudio = false
private

flag if audio packets have been received

Definition at line 270 of file softhddevice.h.

Referenced by CheckPlaybackStartConditions(), LeaveState(), and PlayAudio().

◆ m_receivedValidAudio

std::atomic<bool> cSoftHdDevice::m_receivedValidAudio = false
private

flag if valid audio packets have been received

Definition at line 272 of file softhddevice.h.

Referenced by LeaveState(), PlayAudio(), and PlayVideoInternal().

◆ m_receivedValidVideo

std::atomic<bool> cSoftHdDevice::m_receivedValidVideo = false
private

flag if valid video packets have been received

Definition at line 273 of file softhddevice.h.

Referenced by LeaveState(), PlayAudio(), and PlayVideoInternal().

◆ m_receivedVideo

std::atomic<bool> cSoftHdDevice::m_receivedVideo = false
private

flag if video packets have been received

Definition at line 271 of file softhddevice.h.

Referenced by CheckPlaybackStartConditions(), LeaveState(), and PlayVideo().

◆ m_screenHeight

int cSoftHdDevice::m_screenHeight
private

Definition at line 282 of file softhddevice.h.

Referenced by CanScaleVideo(), GrabImage(), and SetScreenSize().

◆ m_screenWidth

int cSoftHdDevice::m_screenWidth
private

Definition at line 281 of file softhddevice.h.

Referenced by CanScaleVideo(), GrabImage(), and SetScreenSize().

◆ m_sizeMutex

std::mutex cSoftHdDevice::m_sizeMutex
private

mutex to lock screen size (which is accessed by different threads)

Definition at line 269 of file softhddevice.h.

Referenced by GetOsdSize(), SetOsdSize(), and SetScreenSize().

◆ m_videoJitterTracker

cJitterTracker cSoftHdDevice::m_videoJitterTracker {"video"}
private

video jitter tracker

Definition at line 258 of file softhddevice.h.

Referenced by EnterState(), and PlayVideoInternal().

◆ m_videoReassemblyBuffer

cReassemblyBufferVideo cSoftHdDevice::m_videoReassemblyBuffer
private

video pes reassembly buffer

Definition at line 255 of file softhddevice.h.

Referenced by Clear(), EnterState(), HandleStillPicture(), and PlayVideo().

◆ m_volume

int cSoftHdDevice::m_volume = 0
private

track the volume in the device (for attach)

Definition at line 277 of file softhddevice.h.

Referenced by InitAudio(), and SetVolumeDevice().

◆ MIN_BUFFER_FILL_LEVEL_THRESHOLD_MS

constexpr int cSoftHdDevice::MIN_BUFFER_FILL_LEVEL_THRESHOLD_MS = 450
staticconstexprprivate

min buffering threshold in ms

Definition at line 238 of file softhddevice.h.

Referenced by GetBufferFillLevelThresholdMs(), and GetMinBufferFillLevelThresholdMs().


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