|
vdr-plugin-softhddevice-drm-gles 1.6.2
|
Output Device Implementation. More...
#include <softhddevice.h>
Public Member Functions | |
| cSoftHdDevice (cSoftHdConfig *) | |
| Create the device. | |
| virtual | ~cSoftHdDevice (void) |
| Destroy the device. | |
| 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 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 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) |
| Flush the device output buffers. | |
| 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. | |
| virtual void | SetAudioTrackDevice (eTrackType) |
| virtual int | GetAudioChannelDevice (void) |
| virtual void | SetAudioChannelDevice (int) |
| virtual void | SetVolumeDevice (int) |
| Sets the audio volume on this device (Volume = 0...255). | |
| virtual void | SetDigitalAudioDevice (bool) |
| const char * | CommandLineHelp (void) |
| Return command line help string. | |
| int | ProcessArgs (int, char *[]) |
| Process the command line arguments. | |
| int | Start (void) |
| Called by VDR when the plugin is started. | |
| void | Stop (void) |
| Called by VDR when the plugin is stopped. | |
| cSoftHdConfig * | Config (void) |
| cVideoStream * | VideoStream (void) |
| cVideoRender * | Render (void) |
| cSoftHdAudio * | Audio (void) |
| void | SetDisableDeint (void) |
| Disables deinterlacer (called from setup menu or conf) | |
| void | SetDecoderNeedsIFrame (void) |
| Forces the h264 decoder to wait for an I-Frame to start. | |
| void | SetParseH264Dimensions (void) |
| Parse the h264 stream width and height before starting the decoder. | |
| 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. | |
| 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 | OsdDrawARGB (int, int, int, int, int, const uint8_t *, int, int) |
| Draw an OSD pixmap. | |
| void | SetScreenSize (int, int, double) |
| 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. | |
| std::chrono::steady_clock::time_point | GetChannelSwitchStartTime (void) |
| std::chrono::steady_clock::time_point | GetChannelSwitchFirstPacketTime (void) |
| 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 |
| bool | IsBufferingThresholdReached (void) |
| Check if the buffering threshold has been reached. | |
| bool | IsVideoOnlyPlayback (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) |
| Wrapper functions for cVideoRender and cPipHandler. | |
| void | SetRenderPipActive (bool) |
| 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) |
Protected Member Functions | |
| virtual void | MakePrimaryDevice (bool) |
| Informs a device that it will be the primary device. | |
| virtual void | ChannelSwitch (const cDevice *, int, bool) |
| Monitor a channel switch triggered by VDR (cStatus::ChannelSwitch()) | |
Private Member Functions | |
| int | PlayVideoInternal (cVideoStream *, cReassemblyBufferVideo *, const uchar *, int, bool) |
| Play a video packet. | |
| void | FlushAudio (void) |
| Clear all audio data from the decoder and ringbuffer. | |
| void | OnEventReceived (const Event &) |
| Event handler for playback state transitions. | |
| void | HandleStillPicture (const uchar *data, int size) |
| The still picture data received from VDR can contain multiple PES packets. | |
| 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 | SetState (State) |
| Sets the device into the given state. | |
| void | OnEnteringState (State) |
| Actions to be performed when entering a state. | |
| void | OnLeavingState (State) |
| Actions to be performed when leaving a state. | |
Private Attributes | |
| std::atomic< State > | m_state = DETACHED |
| current plugin state, normal plugin start sets detached state | |
| std::mutex | m_eventMutex |
| mutex to protect event queue | |
| bool | m_needsMakePrimary = false |
| 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 | |
| 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::chrono::steady_clock::time_point | m_channelSwitchStartTime |
| timestamp, when VDR triggered a channel switch | |
| std::chrono::steady_clock::time_point | m_dataReceivedTime |
| timestamp, when the first audio or video data after a channel switch arrives in Play*() | |
| 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_mutex |
| mutex to lock the state machine | |
| 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 | |
| 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_screenWidth |
| int | m_screenHeight |
| double | m_screenRefreshRateHz |
| bool | m_forceDetached = false |
| start the plugin in detached state | |
Static Private Attributes | |
| static constexpr int | MIN_BUFFER_FILL_LEVEL_THRESHOLD_MS = 450 |
| min buffering threshold in ms | |
Output Device Implementation.
Definition at line 106 of file softhddevice.h.
|
inline |
Definition at line 173 of file softhddevice.h.
References m_pAudio.
|
inline |
Definition at line 170 of file softhddevice.h.
References m_pConfig.
Definition at line 119 of file softhddevice.h.
|
inline |
Definition at line 201 of file softhddevice.h.
References m_dataReceivedTime.
Referenced by cVideoRender::DisplayFrame().
|
inline |
Definition at line 200 of file softhddevice.h.
References m_channelSwitchStartTime.
Referenced by cVideoRender::DisplayFrame().
Definition at line 194 of file softhddevice.h.
References MIN_BUFFER_FILL_LEVEL_THRESHOLD_MS.
Referenced by cMenuSetupSoft::Create().
Definition at line 193 of file softhddevice.h.
References cSoftHdConfig::ConfigVideoAudioDelayMs, and m_pConfig.
Referenced by cVideoRender::DisplayFrame(), and cVideoRender::LogDroppedDuped().
Definition at line 214 of file softhddevice.h.
References m_pOsdProvider.
Referenced by cSoftOsdProvider::~cSoftOsdProvider().
Definition at line 217 of file softhddevice.h.
References m_playbackMode, and VIDEO_ONLY.
Referenced by cVideoRender::DisplayFrame().
|
inline |
Definition at line 172 of file softhddevice.h.
References m_pRender.
Definition at line 213 of file softhddevice.h.
References m_pOsdProvider.
Referenced by cSoftOsdProvider::~cSoftOsdProvider().
Definition at line 233 of file softhddevice.h.
References m_drmCanDisplayPip.
Referenced by cVideoRender::Init().
Definition at line 236 of file softhddevice.h.
References m_pipUseAlt.
Referenced by cPipHandler::HandleEvent().
Definition at line 234 of file softhddevice.h.
References m_disablePip, m_drmCanDisplayPip, and m_pPipHandler.
Referenced by cMenuSetupSoft::Create(), cSoftHdMenu::MainMenu(), cSoftHdMenu::ProcessKey(), cMenuSetupSoft::Store(), and cPluginSoftHdDevice::SVDRPCommand().
|
inline |
Definition at line 171 of file softhddevice.h.
References m_pVideoStream.
Referenced by cVideoRender::DisplayFrame(), and cVideoRender::LogDroppedDuped().
|
private |
current audio channel ID
Definition at line 259 of file softhddevice.h.
Referenced by PlayAudio(), and ResetChannelId().
|
private |
audio jitter tracker
Definition at line 253 of file softhddevice.h.
Referenced by OnEnteringState(), and PlayAudio().
|
private |
audio pes reassembly buffer
Definition at line 252 of file softhddevice.h.
Referenced by FlushAudio(), and PlayAudio().
|
private |
timestamp, when VDR triggered a channel switch
Definition at line 255 of file softhddevice.h.
Referenced by ChannelSwitch(), cSoftHdDevice(), GetChannelSwitchStartTime(), PlayAudio(), and PlayVideo().
|
private |
timestamp, when the first audio or video data after a channel switch arrives in Play*()
Definition at line 256 of file softhddevice.h.
Referenced by cSoftHdDevice(), GetChannelSwitchFirstPacketTime(), PlayAudio(), and PlayVideo().
true, if pip was disabled by the user
Definition at line 271 of file softhddevice.h.
Referenced by ProcessArgs(), and UsePip().
true, if the drm device is able to display a pip video
Definition at line 270 of file softhddevice.h.
Referenced by SetDrmCanDisplayPip(), and UsePip().
|
private |
mutex to protect event queue
Definition at line 242 of file softhddevice.h.
start the plugin in detached state
Definition at line 278 of file softhddevice.h.
Referenced by Attach(), OnEventReceived(), and ProcessArgs().
|
mutableprivate |
mutex to lock the state machine
Definition at line 265 of file softhddevice.h.
Referenced by IsDetached(), OnEventReceived(), and PipIsEnabled().
Definition at line 243 of file softhddevice.h.
|
private |
pointer to cSoftHdAudio object
Definition at line 248 of file softhddevice.h.
Referenced by Audio(), Clear(), FlushAudio(), GetFirstAudioPtsMsToPlay(), GetFirstVideoPtsMsToPlay(), GetSTC(), IsBufferingThresholdReached(), OnEnteringState(), OnEventReceived(), OnLeavingState(), PlayAudio(), PlayAudioPkts(), PlayVideoPkts(), Poll(), SetPassthroughMask(), and SetVolumeDevice().
|
private |
pointer to cAudioDecoder object
Definition at line 249 of file softhddevice.h.
Referenced by FlushAudio(), OnEnteringState(), OnLeavingState(), PlayAudio(), PlayAudioPkts(), SetAudioCodec(), and SetPassthroughMask().
|
private |
pointer to cSoftHdConfig object
Definition at line 245 of file softhddevice.h.
Referenced by Config(), GetBufferFillLevelThresholdMs(), GetFirstAudioPtsMsToPlay(), GetFirstVideoPtsMsToPlay(), GetVideoAudioDelayMs(), MaxSizeGPUImageCache(), OglOsdIsDisabled(), OnEventReceived(), OnLeavingState(), PlayAudio(), PlayVideoInternal(), ProcessArgs(), SetDecoderFallbackToSw(), SetDecoderNeedsIFrame(), SetDisableDeint(), SetDisableOglOsd(), SetEnableOglOsd(), and SetParseH264Dimensions().
|
private |
pointer to grabber object
Definition at line 260 of file softhddevice.h.
Referenced by GrabImage(), OnEnteringState(), and OnLeavingState().
|
private |
pip pes reassembly buffer
Definition at line 263 of file softhddevice.h.
Referenced by PlayPipVideo(), and ResetPipStream().
|
private |
use alternative pip position
Definition at line 269 of file softhddevice.h.
Referenced by SetRenderPipSize(), and ToggleRenderPipPosition().
|
private |
current playback mode
Definition at line 258 of file softhddevice.h.
Referenced by Clear(), GetSTC(), IsVideoOnlyPlayback(), OnEnteringState(), and OnEventReceived().
|
private |
pointer to cSoftOsdProvider object
Definition at line 250 of file softhddevice.h.
Referenced by IsOsdProviderSet(), MakePrimaryDevice(), OnEnteringState(), OnEventReceived(), and ResetOsdProvider().
|
private |
pointer to pip handler
Definition at line 264 of file softhddevice.h.
Referenced by OnEnteringState(), OnEventReceived(), OnLeavingState(), PipChannelChange(), PipChannelSwap(), PipDisable(), PipEnable(), PipIsEnabled(), PipSetSize(), PipSwapPosition(), PipToggle(), and UsePip().
|
private |
pointer to pip video stream
Definition at line 262 of file softhddevice.h.
Referenced by OnEnteringState(), OnLeavingState(), PlayPipVideo(), and ResetPipStream().
|
private |
pointer to cVideoRender object
Definition at line 246 of file softhddevice.h.
Referenced by Clear(), GetFirstAudioPtsMsToPlay(), GetFirstVideoPtsMsToPlay(), GetStats(), GetSTC(), HandleStillPicture(), IsBufferingThresholdReached(), OnEnteringState(), OnEventReceived(), OnLeavingState(), OsdClose(), OsdDrawARGB(), Render(), ResetPipStream(), ScaleVideo(), SetDisableOglOsd(), SetEnableHdr(), SetEnableOglOsd(), SetRenderPipActive(), and SetRenderPipSize().
|
private |
pointer to spu decoder
Definition at line 244 of file softhddevice.h.
Referenced by GetSpuDecoder(), and ~cSoftHdDevice().
|
private |
pointer to main video stream
Definition at line 247 of file softhddevice.h.
Referenced by Clear(), Flush(), GetVideoSize(), HandleStillPicture(), IsBufferingThresholdReached(), OnEnteringState(), OnEventReceived(), OnLeavingState(), PlayVideo(), PlayVideoPkts(), Poll(), SetDecoderFallbackToSw(), SetDecoderNeedsIFrame(), SetDisableDeint(), SetParseH264Dimensions(), SetVideoCodec(), and VideoStream().
flag if audio packets have been received
Definition at line 267 of file softhddevice.h.
Referenced by IsBufferingThresholdReached(), OnLeavingState(), PlayAudio(), and PlayVideo().
flag if video packets have been received
Definition at line 268 of file softhddevice.h.
Referenced by IsBufferingThresholdReached(), OnLeavingState(), PlayAudio(), and PlayVideo().
|
private |
Definition at line 275 of file softhddevice.h.
Referenced by GetOsdSize(), and SetScreenSize().
|
private |
Definition at line 276 of file softhddevice.h.
Referenced by SetScreenSize().
|
private |
Definition at line 274 of file softhddevice.h.
Referenced by GetOsdSize(), and SetScreenSize().
|
private |
mutex to lock screen size (which is accessed by different threads)
Definition at line 266 of file softhddevice.h.
Referenced by GetOsdSize(), and SetScreenSize().
current plugin state, normal plugin start sets detached state
Definition at line 241 of file softhddevice.h.
Referenced by IsBufferingThresholdReached(), IsDetached(), OnEventReceived(), and SetState().
|
private |
video jitter tracker
Definition at line 254 of file softhddevice.h.
Referenced by OnEnteringState(), and PlayVideoInternal().
|
private |
video pes reassembly buffer
Definition at line 251 of file softhddevice.h.
Referenced by Clear(), HandleStillPicture(), OnEnteringState(), and PlayVideo().
|
private |
track the volume in the device (for attach)
Definition at line 272 of file softhddevice.h.
Referenced by OnEventReceived(), and SetVolumeDevice().
min buffering threshold in ms
Definition at line 239 of file softhddevice.h.
Referenced by GetBufferFillLevelThresholdMs(), and GetMinBufferFillLevelThresholdMs().