|
vdr-plugin-drmdevice 2.0.0-46418f1
|
Output Device Implementation. More...
#include <device.h>
Public Member Functions | |
| cOutputDevice (cDeviceConfig *) | |
| Create the device. | |
| virtual | ~cOutputDevice (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. | |
| cDeviceConfig * | Config (void) |
| cVideoStream * | VideoStream (void) |
| cVideoRender * | Render (void) |
| cAudioStream * | 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 | |
| cDeviceConfig * | m_pConfig |
| pointer to cDeviceConfig object | |
| cVideoRender * | m_pRender |
| pointer to cVideoRender object | |
| cVideoStream * | m_pVideoStream |
| pointer to main video stream | |
| cAudioStream * | m_pAudio |
| pointer to cAudioStream object | |
| cAudioDecoder * | m_pAudioDecoder = nullptr |
| pointer to cAudioDecoder object | |
| cDeviceOsdProvider * | m_pOsdProvider = nullptr |
| pointer to cDeviceOsdProvider 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 | |
| cGrabber * | 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 | |
| cOutputDevice::cOutputDevice | ( | cDeviceConfig * | config | ) |
Create the device.
Initializes some member variables
| config | pointer to cDeviceConfig class |
Definition at line 54 of file device.cpp.
References m_pStateMachine.
|
virtual |
Destroy the device.
Only delete objects, if they were created in Initialize()
Definition at line 65 of file device.cpp.
References m_initialized, m_pEventHandler, m_pHardwareDevice, and m_pSpuDecoder.
Attach the device again.
Kind of a plugin restart. Inits and starts all necessary resources. Only valid after a detach.
Definition at line 1365 of file device.cpp.
References m_forceDetached, m_needsMakePrimary, MakePrimaryDevice(), and TriggerEvent().
Referenced by cDeviceMenu::HandleHotKey(), and cPluginDrmDevice::SVDRPCommand().
|
inline |
Return true if this device can currently start a replay session.
Definition at line 311 of file device.cpp.
References IsDetached(), and LOGDEBUG.
Ask the output, if it can scale video.
| rect | requested video window rectangle |
Definition at line 526 of file device.cpp.
References L_DRM, LOGDEBUG2, m_osdHeight, m_osdWidth, m_screenHeight, and m_screenWidth.
|
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 device.cpp.
Returns true, if audio playback should start without respect to a/v-sync.
This is true
Definition at line 1066 of file device.cpp.
References AV_NOPTS_VALUE, BUFFERING, cAudioStream::DropSamplesOlderThanPtsMs(), FastChannelSwitchAudioInTransferMode(), GetBufferFillLevelThresholdMs(), cAudioStream::GetInputPtsMs(), cAudioStream::GetOutputPtsMs(), cVideoRender::GetOutputPtsMs(), GetVideoAudioDelayMs(), cVideoRender::GetVideoClock(), cAudioStream::HasInputPts(), cVideoStream::HasInputPts(), cAudioStream::IsPaused(), L_AV_SYNC, LOGDEBUG2, LOGGER, m_pAudio, m_pRender, m_pStateMachine, m_pVideoStream, and Timestamp2StringMs().
Referenced by cVideoRender::DisplayFrame(), and PlayAudio().
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
Definition at line 965 of file device.cpp.
References AUDIO_ONLY, AV_NOPTS_VALUE, BUFFERING, FastChannelSwitchAudioInTransferMode(), cVideoRender::GetAudioBehindVideoStartThresholdMs(), GetBufferFillLevelThresholdMs(), GetFirstAudioPtsMsToPlay(), GetFirstVideoPtsMsToPlay(), cVideoRender::GetFramesFilled(), cAudioStream::GetInputPtsMs(), cVideoStream::GetInputPtsMs(), cAudioStream::GetOutputPtsMs(), cVideoRender::GetOutputPtsMs(), GetVideoAudioDelayMs(), cAudioStream::HasInputPts(), cVideoStream::HasInputPts(), cVideoRender::IsOutputBufferFull(), cAudioStream::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().
Clears all video and audio data from the device.
This is called by VDR via DeviceClear() in the Empty() call.
Empty() does clear all VDR internal packets.
Definition at line 658 of file device.cpp.
References AUDIO_AND_VIDEO, BUFFERING, cVideoStream::CancelFilterThread(), cVideoRender::ClearDecoderToDisplayQueue(), cVideoStream::ClearVdrCoreToDecoderQueue(), FlushAudio(), cVideoStream::FlushDecoder(), cVideoRender::Halt(), cVideoStream::Halt(), IsDetached(), LOGDEBUG, m_pAudio, m_playbackMode, m_pRender, m_pStateMachine, m_pVideoStream, m_videoReassemblyBuffer, cVideoRender::Reset(), cReassemblyBuffer::Reset(), cAudioStream::ResetHwDelayBaseline(), cVideoRender::Resume(), cVideoStream::Resume(), cVideoRender::SetDisplayOneFrameThenPause(), SetDrain(), cAudioStream::SetPaused(), and VIDEO_ONLY.
Referenced by cDrmDevicePlayer::Play().
|
inline |
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 1343 of file device.cpp.
References cPipHandler::Disable(), LOGDEBUG, m_needsMakePrimary, m_pPipHandler, MakePrimaryDevice(), and TriggerEvent().
Referenced by cDeviceMenu::HandleHotKey(), cDeviceMenu::ProcessKey(), and cPluginDrmDevice::SVDRPCommand().
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.
| state | state being entered |
Definition at line 1804 of file device.cpp.
References AUDIO_ONLY, BUFFERING, cVideoStream::CancelFilterThread(), cVideoRender::ClearDecoderToDisplayQueue(), cVideoStream::ClearVdrCoreToDecoderQueue(), cVideoStream::CloseDecoder(), DETACHED, cVideoRender::DisplayBlackFrame(), cAudioStream::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, cDeviceOsdProvider::RequestStopOpenGlThread(), cVideoRender::Reset(), cJitterTracker::Reset(), cReassemblyBuffer::Reset(), cVideoRender::ResetBufferReuseStrategy(), cVideoRender::ResetDecodingStrategy(), cAudioStream::ResetHwDelayBaseline(), cAudioStream::ResetTrickSpeedPts(), cVideoRender::Resume(), cVideoStream::Resume(), cVideoStream::SetDeinterlacerDeactivated(), cVideoRender::SetDisplayOneFrameThenPause(), cAudioStream::SetPaused(), cVideoRender::SetPlaybackPaused(), cVideoRender::SetStillpicture(), STOP, cDeviceOsdProvider::StopOpenGlThread(), TRICK_SPEED, cDeviceOsdProvider::UnlockOpenGlThread(), and VIDEO_ONLY.
Referenced by cStateMachine::ChangeState().
Definition at line 151 of file device.h.
References CHANNEL_SWITCH_FAST_AUDIO, and m_channelSwitchMode.
Referenced by CheckAudioPlaybackStartConditions(), CheckPlaybackStartConditions(), and SchedulePlaybackStart().
Definition at line 152 of file device.h.
References CHANNEL_SWITCH_AVSYNC, and m_channelSwitchMode.
Referenced by EnterState().
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.
| timeoutMs | timeout in ms to become ready |
Definition at line 776 of file device.cpp.
References AUDIO_ONLY, cVideoStream::BuffersEmpty(), cAudioStream::IsBufferEmpty(), IsDetached(), m_pAudio, m_playbackMode, and m_pVideoStream.
Clear all audio data from the decoder and ringbuffer.
Definition at line 1600 of file device.cpp.
References cAudioStream::FlushBuffers(), cAudioDecoder::FlushBuffers(), LOGDEBUG, m_audioReassemblyBuffer, m_pAudio, m_pAudioDecoder, and cReassemblyBuffer::Reset().
Referenced by Clear(), and EnterState().
Puts the device into "freeze frame" mode.
Definition at line 709 of file device.cpp.
References LOGDEBUG, and TriggerEvent().
Referenced by cDrmDeviceControl::ProcessKey().
|
private |
Returns the buffer fill level threshold in milliseconds.
Combines the minimum threshold with the user-configured additional buffer length.
Definition at line 1698 of file device.cpp.
References cDeviceConfig::ConfigAdditionalBufferLengthMs, m_pConfig, and MIN_BUFFER_FILL_LEVEL_THRESHOLD_MS.
Referenced by CheckAudioPlaybackStartConditions(), and CheckPlaybackStartConditions().
|
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.
Definition at line 1671 of file device.cpp.
References cDeviceConfig::ConfigVideoAudioDelayMs, cAudioStream::GetOutputPtsMs(), cVideoRender::GetOutputPtsMs(), m_pAudio, m_pConfig, and m_pRender.
Referenced by CheckPlaybackStartConditions(), and SchedulePlaybackStart().
|
private |
Definition at line 1684 of file device.cpp.
References cDeviceConfig::ConfigVideoAudioDelayMs, cAudioStream::GetOutputPtsMs(), cVideoRender::GetOutputPtsMs(), m_pAudio, m_pConfig, and m_pRender.
Referenced by CheckPlaybackStartConditions(), and SchedulePlaybackStart().
Definition at line 172 of file device.h.
References MIN_BUFFER_FILL_LEVEL_THRESHOLD_MS.
Referenced by cDeviceSetupMenu::Create().
Returns the width, height and aspect ratio the OSD should have.
| [out] | width | osd width |
| [out] | height | osd height |
| [out] | aspectRatio | osd aspect ratio |
Definition at line 278 of file device.cpp.
References IsDetached(), m_osdHeight, m_osdWidth, and m_sizeMutex.
Referenced by cOglOsd::cOglOsd(), and cSoftOsd::Flush().
|
virtual |
Get the device SPU decoder.
Definition at line 163 of file device.cpp.
References LOGDEBUG, and m_pSpuDecoder.
Get statistics from the renderer.
| [out] | duped | duped frames |
| [out] | dropped | dropped frames |
| [out] | count | number of total rendered frames |
Definition at line 1254 of file device.cpp.
References cVideoRender::GetStats(), and m_pRender.
Referenced by cDeviceSetupMenu::Create().
Gets the current System Time Counter, which can be used to synchronize audio, video and subtitles.
Definition at line 497 of file device.cpp.
References AUDIO_AND_VIDEO, AUDIO_ONLY, AV_NOPTS_VALUE, cAudioStream::GetHardwareOutputPtsTimebaseUnits(), cAudioStream::GetTrickSpeedPtsTimebaseUnits(), cVideoRender::GetVideoClock(), IsDetached(), cAudioStream::IsForwardTrickSpeed(), cAudioStream::IsSlowTrickSpeed(), m_pAudio, m_playbackMode, m_pRender, m_pStateMachine, NONE, TRICK_SPEED, and VIDEO_ONLY.
Definition at line 171 of file device.h.
References cDeviceConfig::ConfigVideoAudioDelayMs, and m_pConfig.
Referenced by CheckAudioPlaybackStartConditions(), CheckPlaybackStartConditions(), cVideoRender::FrameDropNecessary(), and cVideoRender::LogDroppedDuped().
Get the video size.
Return the width, height and aspect ratio of the currently displayed video material
| [out] | width | video width |
| [out] | height | video height |
| [out] | aspectRatio | video aspect ratio |
Definition at line 255 of file device.cpp.
References cVideoStream::GetVideoSize(), IsDetached(), and m_pVideoStream.
|
virtual |
Grabs the currently visible screen image.
| size | size of the returned data |
| jpeg | flag true, create JPEG data |
| quality | JPEG quality |
| width | number of horizontal pixels in the frame |
| height | number of vertical pixels in the frame |
Definition at line 181 of file device.cpp.
References cGrabber::Finish(), cGrabber::Image(), cGrabber::IsActive(), IsDetached(), L_GRAB, LOGDEBUG2, LOGWARNING, m_pGrab, m_screenHeight, m_screenWidth, cGrabber::ProcessGrab(), cGrabber::Size(), and cGrabber::Start().
Pause the OpenGL worker thread.
Definition at line 1921 of file device.cpp.
References cDeviceOsdProvider::LockOpenGlThread(), and m_pOsdProvider.
Referenced by cStateMachine::OnEventReceived().
Pause the rendering and decoder thread.
Definition at line 1902 of file device.cpp.
References cVideoRender::Halt(), cVideoStream::Halt(), m_pRender, and m_pVideoStream.
Referenced by cStateMachine::OnEventReceived().
Set the display mode.
| mode | drm mode |
Definition at line 1647 of file device.cpp.
References sDrmMode::height, sDrmMode::interlaced, LOGDEBUG, m_pConfig, m_pRender, sDrmMode::refreshRateHz, cVideoRender::ReInitDisplayMode(), cDeviceConfig::RequestedDrmMode, and sDrmMode::width.
Referenced by cStateMachine::OnEventReceived().
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.
| data | pes data of one or more frames |
| size | length of data area |
Definition at line 1615 of file device.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().
Tells whether this device has an MPEG decoder.
Definition at line 148 of file device.cpp.
References IsDetached().
Init the audio lazily.
| setVolume | if true, reset the current volume |
| 0 | if audio init succeeded |
| -1 | on error |
Definition at line 1952 of file device.cpp.
References cAudioStream::LazyInit(), m_pAudio, m_volume, and cAudioStream::SetVolume().
Referenced by cStateMachine::OnEventReceived().
Initialize the device.
Definition at line 84 of file device.cpp.
References cDeviceConfig::ConfigPipUseAlt, cDeviceConfig::ConfigVideoChannelSwitchMode, LOGDEBUG, LOGGER, m_channelSwitchMode, m_initialized, m_pConfig, m_pEventHandler, m_pHardwareDevice, m_pipUseAlt, m_pSpuDecoder, and m_pStateMachine.
Referenced by cPluginDrmDevice::Initialize().
Definition at line 156 of file device.h.
References AUDIO_ONLY, and m_playbackMode.
Referenced by cAudioStream::CyclicCall().
Returns true, if the device is detached.
Definition at line 1380 of file device.cpp.
References DETACHED, and m_pStateMachine.
Referenced by CanReplay(), Clear(), cDeviceOsdProvider::CreateOsd(), Flush(), GetOsdSize(), GetSTC(), GetVideoSize(), GrabImage(), HasDecoder(), OsdClose(), OsdDraw(), PlayAudio(), PlayVideo(), Poll(), ScaleVideo(), SetVolumeDevice(), and cPluginDrmDevice::SVDRPCommand().
Returns true, the a detached plugin start was forced.
Definition at line 1939 of file device.cpp.
References m_forceDetached.
Referenced by cStateMachine::OnEventReceived().
Definition at line 192 of file device.h.
References m_draining.
Referenced by cAudioStream::CyclicCall(), and cVideoRender::DisplayFrame().
Definition at line 190 of file device.h.
References m_pOsdProvider.
Referenced by cDeviceOsdProvider::~cDeviceOsdProvider().
Definition at line 155 of file device.h.
References m_playbackMode, and VIDEO_ONLY.
Referenced by cVideoRender::DisplayFrame().
Actions to be performed when leaving a state.
These are only executed when the state actually changes. E.g. a state transition PLAY -> PLAY does not trigger this.
| state | state being left |
Definition at line 1737 of file device.cpp.
References AV_NOPTS_VALUE, BUFFERING, cVideoStream::CancelFilterThread(), cVideoRender::ClearDecoderToDisplayQueue(), DETACHED, cVideoRender::GetMainOutputBuffer(), cVideoRender::GetPipOutputBuffer(), cHardwareDevice::GetQuirks(), cVideoRender::Init(), LOGERROR, m_forceDetached, m_pAudio, m_pAudioDecoder, m_pConfig, m_pGrab, m_pHardwareDevice, m_pPipHandler, m_pPipStream, m_pRender, m_pVideoStream, m_receivedAudio, m_receivedValidAudio, m_receivedValidVideo, m_receivedVideo, PLAY, cVideoRender::PushMainFrame(), cVideoRender::PushPipFrame(), cVideoRender::ResetBufferReuseStrategy(), cVideoStream::ResetFilterThreadNeededCheck(), cVideoRender::ResetFrameCounter(), cAudioStream::ResetHwDelayBaseline(), cVideoStream::ResetTrickSpeedFramesSentCounter(), cVideoRender::SchedulePlaybackStartAtPtsMs(), cVideoStream::SetDeinterlacerDeactivated(), cVideoRender::SetDisplayOneFrameThenPause(), cAudioStream::SetHwDelayBaseline(), cAudioStream::SetPaused(), cVideoRender::SetPlaybackPaused(), cAudioStream::SetTrickSpeed(), cVideoRender::SetTrickSpeed(), cVideoStream::StartDecoder(), STOP, and TRICK_SPEED.
Referenced by cStateMachine::ChangeState().
Informs a device that it will be the primary device.
| on | flag if becoming or loosing primary |
Definition at line 135 of file device.cpp.
References LOGDEBUG, and m_pOsdProvider.
Get the maximum GPU image cache size.
Definition at line 1125 of file device.cpp.
References cDeviceConfig::ConfigMaxSizeGPUImageCache, and m_pConfig.
Referenced by cDeviceOsdProvider::StartOpenGlThread().
Is the OpenGL/ES osd disabled?
Definition at line 1133 of file device.cpp.
References cDeviceConfig::ConfigDisableOglOsd, and m_pConfig.
Referenced by cDeviceOsdProvider::CreateOsd(), cDeviceOsdProvider::OsdSizeChanged(), cDeviceOsdProvider::StartOpenGlThread(), and cDeviceOsdProvider::~cDeviceOsdProvider().
Close the OSD.
Definition at line 1165 of file device.cpp.
References IsDetached(), m_pRender, and cVideoRender::OsdClear().
Referenced by cOglCmdCopyBufferToOutputFb::Execute(), cSoftOsd::SetActive(), and cSoftOsd::SetAreas().
| void cOutputDevice::OsdDraw | ( | int | xi, |
| int | yi, | ||
| int | height, | ||
| int | width, | ||
| int | pitch, | ||
| const uint8_t * | argb, | ||
| int | x, | ||
| int | y | ||
| ) |
Draw an OSD pixmap.
| xi | x-coordinate in argb image |
| yi | y-coordinate in argb image |
| height | height in pixel in argb image |
| width | width in pixel in argb image |
| pitch | pitch of argb image |
| argb | 32bit ARGB image data |
| x | x-coordinate on screen of argb image |
| y | y-coordinate on screen of argb image |
Definition at line 1185 of file device.cpp.
References IsDetached(), m_pRender, and cVideoRender::OsdDraw().
Referenced by cOglCmdCopyBufferToOutputFb::Execute(), and cSoftOsd::Flush().
Pause the playback.
| schedulePause | if true, pause at the current audio pts otherwise pause immediately |
Definition at line 2080 of file device.cpp.
References AUDIO_AND_VIDEO, cDeviceConfig::ConfigVideoAudioDelayMs, cAudioStream::GetOutputPtsMs(), m_pAudio, m_pConfig, m_playbackMode, m_pRender, cAudioStream::ResetHwDelayBaseline(), cVideoRender::ScheduleVideoPlaybackPauseAt(), cAudioStream::SetPaused(), and cVideoRender::SetPlaybackPaused().
Referenced by cStateMachine::OnEventReceived().
Definition at line 1452 of file device.cpp.
References cPipHandler::ChannelChange(), and m_pPipHandler.
Referenced by cDeviceMenu::HandleHotKey(), cDeviceMenu::ProcessKey(), and cPluginDrmDevice::SVDRPCommand().
Definition at line 1453 of file device.cpp.
References cPipHandler::ChannelSwap(), and m_pPipHandler.
Referenced by cDeviceMenu::HandleHotKey(), cDeviceMenu::ProcessKey(), and cPluginDrmDevice::SVDRPCommand().
Definition at line 1450 of file device.cpp.
References cPipHandler::Disable(), and m_pPipHandler.
Referenced by cPluginDrmDevice::SVDRPCommand().
Definition at line 1449 of file device.cpp.
References cPipHandler::Enable(), and m_pPipHandler.
Referenced by cPluginDrmDevice::SVDRPCommand().
Returns true, if pip is currently enabled.
Definition at line 1442 of file device.cpp.
References cPipHandler::IsEnabled(), m_pPipHandler, and m_pStateMachine.
Referenced by cPluginDrmDevice::SVDRPCommand().
Definition at line 1455 of file device.cpp.
References m_pPipHandler, and cPipHandler::SetSize().
Referenced by cDeviceSetupMenu::Store().
Definition at line 1454 of file device.cpp.
References m_pPipHandler, and cPipHandler::SwapPosition().
Referenced by cDeviceMenu::HandleHotKey(), cDeviceMenu::ProcessKey(), and cPluginDrmDevice::SVDRPCommand().
Definition at line 1451 of file device.cpp.
References m_pPipHandler, and cPipHandler::Toggle().
Referenced by cDeviceMenu::HandleHotKey(), and cDeviceMenu::ProcessKey().
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 device.cpp.
References LOGDEBUG, and TriggerEvent().
Referenced by cDrmDeviceControl::ProcessKey().
Play an audio packet.
This is the main function, which is called by VDR to play audio data
| data | data of exactly one complete PES packet |
| size | size of PES packet |
| id | PES packet type |
The caller must ensure, that PlayAudio() is not called in detached state. (CanReplay() and HasDecoder() return false in this state and we are not the primary device.)
Definition at line 382 of file device.cpp.
References cAudioStream::AdvanceTrickSpeedPts(), AUDIO_ONLY, AV_NOPTS_VALUE, CheckAudioPlaybackStartConditions(), CheckPlaybackStartConditions(), cAudioStream::ClockDriftCompensation(), cAudioDecoder::Close(), cAudioDecoder::Decode(), cReassemblyBuffer::GetCodec(), cAudioDecoder::GetCodecId(), cJitterTracker::GetLongTermMaxJitterMs(), cJitterTracker::GetShortTermMaxJitterMs(), cAudioStream::IsBufferFull(), IsDetached(), cAudioStream::IsForwardTrickSpeed(), cAudioStream::IsSlowTrickSpeed(), L_AV_SYNC, LOGDEBUG, LOGDEBUG2, LOGGER, m_audioChannelID, m_audioJitterTracker, m_audioReassemblyBuffer, m_pAudio, m_pAudioDecoder, m_pConfig, m_playbackMode, m_pStateMachine, m_receivedAudio, m_receivedValidAudio, m_receivedValidVideo, cAudioDecoder::Open(), cJitterTracker::PacketReceived(), cReassemblyBufferAudio::PopAvPacket(), cReassemblyBuffer::Push(), cReassemblyBuffer::Reset(), cAudioStream::SetPaused(), cDeviceConfig::StatMaxLongTermAudioJitterMs, cDeviceConfig::StatMaxShortTermAudioJitterMs, TRICK_SPEED, and TriggerEvent().
Play an audio packet.
| pkt | AVPacket to play |
| 0 | packet could not be player, free audio buffer too small |
| 1 | packet was sent to be decoded |
Definition at line 1300 of file device.cpp.
References cAudioDecoder::Decode(), cAudioStream::IsBufferFull(), cAudioStream::LazyInit(), LOGFATAL, m_pAudio, and m_pAudioDecoder.
Referenced by cDrmDevicePlayer::Play().
Play a video packet of the pip videostream.
| data | A complete PES packet with optionally fragmented payload |
| size | the 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 1401 of file device.cpp.
References cVideoStream::IsInputBufferFull(), m_pipReassemblyBuffer, m_pPipStream, and PlayVideoInternal().
Referenced by cPipReceiver::PlayTs().
Play a video packet of the main videostream.
This is the main function, which is called by VDR to play video data
| data | A complete PES packet with optionally fragmented payload |
| size | the 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 device.cpp.
References IsDetached(), m_pVideoStream, m_receivedVideo, m_videoReassemblyBuffer, and PlayVideoInternal().
|
private |
Play a video packet.
| stream | video stream to play to |
| buffer | reassembly buffer for this stream |
| data | A complete PES packet with optionally fragmented payload |
| size | the length of the PES packet including header |
| trackJitter | whether to track jitter for this packet |
| mainStream | this is a packet of the main stream |
Definition at line 1531 of file device.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(), cDeviceConfig::StatMaxLongTermVideoJitterMs, and cDeviceConfig::StatMaxShortTermVideoJitterMs.
Referenced by HandleStillPicture(), PlayPipVideo(), and PlayVideo().
Play a video packet.
| pkt | AVPacket to play |
| 0 | packet could not be player, free audio buffer too small |
| 1 | packet was sent to be decoded |
Definition at line 1320 of file device.cpp.
References cVideoStream::GetAvPacketsFilled(), cVideoStream::GetVideoPacketMax(), cAudioStream::LazyInit(), LOGFATAL, m_pAudio, m_pVideoStream, and cVideoStream::PushAvPacket().
Referenced by cDrmDevicePlayer::Play().
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.
| poller | file handles (unused) |
| timeoutMs | timeout in ms to become ready |
| true | if ready |
| false | if busy |
Definition at line 747 of file device.cpp.
References cAudioStream::IsBufferFull(), IsDetached(), cVideoStream::IsInputBufferFull(), m_pAudio, and m_pVideoStream.
|
inline |
|
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 device.cpp.
Reset the channel ID (restarts audio)
Definition at line 1237 of file device.cpp.
References LOGDEBUG, and m_audioChannelID.
Referenced by cDeviceSetupMenu::Store().
Definition at line 189 of file device.h.
References m_pOsdProvider.
Referenced by cDeviceOsdProvider::~cDeviceOsdProvider().
Resets pip stream and render pipeline.
Definition at line 1418 of file device.cpp.
References cVideoStream::CancelFilterThread(), cVideoRender::ClearPipDecoderToDisplayQueue(), cVideoStream::ClearVdrCoreToDecoderQueue(), cVideoStream::CloseDecoder(), cVideoRender::Halt(), cVideoStream::Halt(), m_pipReassemblyBuffer, m_pPipStream, m_pRender, m_pStateMachine, cReassemblyBuffer::Reset(), cVideoRender::ResetPipBufferReuseStrategy(), cVideoRender::ResetPipDecodingStrategy(), cVideoRender::Resume(), and cVideoStream::Resume().
Referenced by cPipReceiver::Receive(), and cPipHandler::Stop().
Reset the video deinterlace filter.
Definition at line 1966 of file device.cpp.
References m_pRender, m_pVideoStream, cVideoStream::ResetFilterThreadNeededCheck(), and cVideoRender::ResetFrameCounter().
Referenced by cStateMachine::OnEventReceived().
Resume playback from pause state.
Other than ResumePlayback() this also syncs a/v (by dropping audio)
Definition at line 2044 of file device.cpp.
References AUDIO_AND_VIDEO, AUDIO_ONLY, cDeviceConfig::ConfigVideoAudioDelayMs, cAudioStream::DropSamplesOlderThanPtsMs(), cAudioStream::GetOutputPtsMs(), cVideoRender::GetOutputPtsMs(), LOGFATAL, m_pAudio, m_pConfig, m_playbackMode, m_pRender, NONE, cAudioStream::SetHwDelayBaseline(), cAudioStream::SetPaused(), cVideoRender::SetPlaybackPaused(), cVideoRender::SetScheduleAudioResume(), cVideoRender::SetStillpicture(), and VIDEO_ONLY.
Referenced by cStateMachine::OnEventReceived().
Resume the OpenGL worker thread.
Definition at line 1929 of file device.cpp.
References m_pOsdProvider, and cDeviceOsdProvider::UnlockOpenGlThread().
Referenced by cStateMachine::OnEventReceived().
Resume playback again.
Definition at line 2094 of file device.cpp.
References m_pRender, and cVideoRender::SetPlaybackPaused().
Referenced by cStateMachine::OnEventReceived().
Resume the rendering and decoder thread.
Definition at line 1911 of file device.cpp.
References m_pRender, m_pVideoStream, cVideoRender::Resume(), and cVideoStream::Resume().
Referenced by cStateMachine::OnEventReceived().
Scale the currently shown video.
| x | video window x coordinate OSD relative |
| y | video window x coordinate OSD relative |
| width | video window width OSD relative |
| height | video window height OSD relative |
Definition at line 561 of file device.cpp.
References IsDetached(), L_OSD, LOGDEBUG2, m_pRender, and cVideoRender::SetVideoOutputPosition().
Schedules the playback start.
Drops audio data if necessary to start in sync and schedules the playback start at the common pts.
| true | playback started |
| false | playback was not started |
Definition at line 1994 of file device.cpp.
References AUDIO_AND_VIDEO, AUDIO_ONLY, cAudioStream::DropSamplesOlderThanPtsMs(), FastChannelSwitchAudioInTransferMode(), GetFirstAudioPtsMsToPlay(), GetFirstVideoPtsMsToPlay(), cAudioStream::GetOutputPtsMs(), cVideoRender::GetOutputPtsMs(), cAudioStream::HasInputPts(), cVideoStream::HasInputPts(), LOGDEBUG, m_pAudio, m_playbackMode, m_pRender, m_pVideoStream, cVideoRender::SchedulePlaybackStartAtPtsMs(), and VIDEO_ONLY.
Referenced by cStateMachine::OnEventReceived().
Schedule aa a/v resync in the render thread at the given pts.
| pts | resync, when the rendered video frame reaches this pts |
Definition at line 2034 of file device.cpp.
References m_pRender, and cVideoRender::ScheduleResyncAtPtsMs().
Referenced by cStateMachine::OnEventReceived().
| void cOutputDevice::SetAudioCodec | ( | enum AVCodecID | codecId, |
| AVCodecParameters * | par, | ||
| AVRational | timebase | ||
| ) |
Open an audio codec.
| codecId | audio codec id |
| par | audio codec parameters |
| timebase | timebase |
Definition at line 1275 of file device.cpp.
References m_pAudioDecoder, and cAudioDecoder::Open().
Referenced by cDrmDevicePlayer::Play().
|
inline |
Definition at line 149 of file device.h.
References m_channelSwitchMode.
Referenced by cDeviceSetupMenu::Store().
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 device.cpp.
References cDeviceConfig::ConfigDecoderFallbackToSwNumPkts, m_pConfig, m_pVideoStream, and cVideoStream::SetDecoderFallbackToSwNumPkts().
Referenced by cDeviceSetupMenu::Store().
Definition at line 227 of file device.h.
References m_forceDetached.
Referenced by cStateMachine::OnEventReceived().
Disables deinterlacer (called from setup menu or conf)
Definition at line 879 of file device.cpp.
References cDeviceConfig::ConfigDisableDeint, cVideoStream::DisableDeint(), m_pConfig, and m_pVideoStream.
Referenced by cDeviceSetupMenu::Store().
Disables OpenGL/ES Osd (called from setup menu or conf)
Definition at line 1141 of file device.cpp.
References cDeviceConfig::ConfigDisableOglOsd, cVideoRender::DisableOglOsd(), m_pConfig, and m_pRender.
Referenced by cDeviceOsdProvider::CreateOsd(), and cPluginDrmDevice::ProcessArgs().
Definition at line 201 of file device.h.
References m_disablePip.
Referenced by cPluginDrmDevice::ProcessArgs().
Trigger a display mode change event if the mode changed.
| idx | setup menu array index of the mode |
Definition at line 914 of file device.cpp.
References cEventHandler::AddEvent(), cDeviceConfig::AutoDetectedDrmMode, cVideoRender::CanHandleMode(), cDeviceConfig::CollectedDrmModes, cDeviceConfig::CompareCurrentMode(), CONFIG_DISPLAY_MODE_DEFAULT, CONFIG_DISPLAY_MODE_FOLLOW_VIDEO, CONFIG_DISPLAY_MODE_FOLLOW_VIDEO_INTERLACED, CONFIG_DISPLAY_MODE_MANUAL, cDeviceConfig::CurrentVideoDrmMode, sDrmMode::height, sDrmMode::interlaced, LOGDEBUG, m_pConfig, m_pEventHandler, m_pRender, sDrmMode::refreshRateHz, and sDrmMode::width.
Referenced by cVideoRender::SetDisplayMode(), and cDeviceSetupMenu::Store().
Set and log the drain state changes.
| on | true, if draining should be started false, if draining should be stopped |
Definition at line 1708 of file device.cpp.
References LOGDEBUG, and m_draining.
Referenced by Clear(), and SetPlayMode().
Definition at line 196 of file device.h.
References m_drmCanDisplayPip.
Referenced by cVideoRender::Init().
Enable HDR display mode.
Definition at line 904 of file device.cpp.
References m_pRender, and cVideoRender::SetEnableHdr().
Referenced by cDeviceSetupMenu::Store().
Enables OpenGL/ES Osd.
Definition at line 1151 of file device.cpp.
References cDeviceConfig::ConfigDisableOglOsd, cVideoRender::EnableOglOsd(), m_pConfig, and m_pRender.
Set the OSD size.
| width | osd width |
| height | osd height |
Definition at line 1200 of file device.cpp.
References m_osdHeight, m_osdWidth, and m_sizeMutex.
Referenced by cVideoRender::SetOsdSize().
Set the passthrough mask (called from setup menu or conf)
Definition at line 1227 of file device.cpp.
References m_pAudio, m_pAudioDecoder, cAudioStream::SetPassthroughMask(), and cAudioDecoder::SetPassthroughMask().
Referenced by cDeviceSetupMenu::Store().
Sets the device into the given play mode.
| play_mode | new play mode (Audio/Video/External...) |
Definition at line 325 of file device.cpp.
References cPipHandler::Disable(), L_AV_SYNC, LOGDEBUG, LOGDEBUG2, LOGERROR, LOGGER, m_externalPlayerActive, m_logPlaybackStart, m_pPipHandler, SetDrain(), and TriggerEvent().
Definition at line 1469 of file device.cpp.
References cVideoRender::Halt(), m_pRender, m_pStateMachine, cVideoRender::Resume(), and cVideoRender::SetPipActive().
Referenced by cPipHandler::HandleEnable().
Definition at line 1460 of file device.cpp.
References cVideoRender::Halt(), m_pipUseAlt, m_pRender, m_pStateMachine, cVideoRender::Resume(), and cVideoRender::SetPipSize().
Referenced by cPipHandler::SetSize(), and cPipHandler::SwapPosition().
Set the screen size.
| width | screen width |
| height | screen height |
Definition at line 1213 of file device.cpp.
References m_screenHeight, m_screenWidth, and m_sizeMutex.
Referenced by cVideoRender::SetScreenSize().
Definition at line 191 of file device.h.
References m_forceDetached.
Referenced by cPluginDrmDevice::ProcessArgs().
Set the trickspeed in the renderer.
| speed | trickspeed factor |
| active | true, if trickspeed is active |
| forward | true, if this is forward trickspeed |
Definition at line 1979 of file device.cpp.
References m_pAudio, m_pRender, cAudioStream::SetTrickSpeed(), and cVideoRender::SetTrickSpeed().
Referenced by cStateMachine::OnEventReceived().
| void cOutputDevice::SetVideoCodec | ( | enum AVCodecID | codecId, |
| AVCodecParameters * | par, | ||
| AVRational | timebase | ||
| ) |
Open a video codec.
| codecId | video codec id |
| par | video codec parameters |
| timebase | timebase |
Definition at line 1287 of file device.cpp.
References m_pVideoStream, and cVideoStream::Open().
Referenced by cDrmDevicePlayer::Play().
|
virtual |
Sets the video display format.
| videoDisplayFormat | video display format Set it to the given one (only useful if this device has an MPEG decoder). |
Definition at line 218 of file device.cpp.
References LOGDEBUG.
Referenced by SetVideoFormat().
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
| videoFormat16_9 | flag true 16:9. |
Definition at line 235 of file device.cpp.
References LOGDEBUG, and SetVideoDisplayFormat().
Sets the audio volume on this device (Volume = 0...255).
| volume | device volume |
Definition at line 298 of file device.cpp.
References IsDetached(), LOGDEBUG, m_pAudio, m_volume, and cAudioStream::SetVolume().
Called by VDR when the plugin is started.
Definition at line 108 of file device.cpp.
References LOGDEBUG, and TriggerEvent().
Referenced by cPluginDrmDevice::Start().
Display the given I-frame as a still picture.
| data | pes or ts data of a frame |
| length | length of data area |
Definition at line 723 of file device.cpp.
References LOGDEBUG, and TriggerEvent().
Called by VDR when the plugin is stopped.
Definition at line 119 of file device.cpp.
References cPipHandler::Disable(), LOGDEBUG, m_pPipHandler, and TriggerEvent().
Referenced by cPluginDrmDevice::Stop().
Definition at line 199 of file device.h.
References m_pipUseAlt.
Referenced by cPipHandler::SwapPosition().
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 device.cpp.
References LOGDEBUG, and TriggerEvent().
With this wrapper function, the device can directly act as an event reveiver.
| event | event to be executed |
Definition at line 1724 of file device.cpp.
References m_pStateMachine.
Referenced by Attach(), CheckPlaybackStartConditions(), Detach(), Freeze(), Play(), PlayAudio(), cAudioStream::ProcessEvents(), cVideoRender::ProcessEvents(), SetPlayMode(), Start(), StillPicture(), Stop(), and TrickSpeed().
Definition at line 197 of file device.h.
References m_disablePip, m_drmCanDisplayPip, and m_pPipHandler.
Referenced by cDeviceSetupMenu::Create(), cDeviceMenu::MainMenu(), cDeviceMenu::ProcessKey(), cDeviceSetupMenu::Store(), and cPluginDrmDevice::SVDRPCommand().
|
inline |
Definition at line 141 of file device.h.
References m_pVideoStream.
Referenced by cVideoRender::DisplayFrame(), and cVideoRender::LogDroppedDuped().
|
private |
current audio channel ID
Definition at line 263 of file device.h.
Referenced by PlayAudio(), and ResetChannelId().
|
private |
audio jitter tracker
Definition at line 257 of file device.h.
Referenced by EnterState(), and PlayAudio().
|
private |
audio pes reassembly buffer
Definition at line 256 of file device.h.
Referenced by FlushAudio(), and PlayAudio().
|
private |
current channel switch mode
Definition at line 259 of file device.h.
Referenced by FastChannelSwitchAudioInTransferMode(), FastChannelSwitchInTransferMode(), Initialize(), and SetChannelSwitchMode().
true, if pip was disabled by the user
Definition at line 276 of file device.h.
Referenced by SetDisablePip(), and UsePip().
true, if the device is in draining mode (waiting for empty buffers)
Definition at line 243 of file device.h.
Referenced by IsDraining(), and SetDrain().
true, if the drm device is able to display a pip video
Definition at line 275 of file device.h.
Referenced by SetDrmCanDisplayPip(), and UsePip().
|
private |
true, if we detached for an external player
Definition at line 285 of file device.h.
Referenced by SetPlayMode().
start the plugin in detached state
Definition at line 284 of file device.h.
Referenced by Attach(), EnterState(), IsDetachForced(), LeaveState(), SetDetachForced(), and SetStartDetached().
true, if the plugin had a successful Initialize()
Definition at line 242 of file device.h.
Referenced by Initialize(), and ~cOutputDevice().
Definition at line 260 of file device.h.
Referenced by CheckPlaybackStartConditions(), and SetPlayMode().
|
private |
Definition at line 280 of file device.h.
Referenced by CanScaleVideo(), GetOsdSize(), and SetOsdSize().
|
private |
Definition at line 279 of file device.h.
Referenced by CanScaleVideo(), GetOsdSize(), and SetOsdSize().
|
private |
pointer to cAudioStream object
Definition at line 250 of file device.h.
Referenced by Audio(), CheckAudioPlaybackStartConditions(), CheckPlaybackStartConditions(), Clear(), EnterState(), Flush(), FlushAudio(), GetFirstAudioPtsMsToPlay(), GetFirstVideoPtsMsToPlay(), GetSTC(), InitAudio(), LeaveState(), PausePlayback(), PlayAudio(), PlayAudioPkts(), PlayVideoPkts(), Poll(), ResumeFromPause(), SchedulePlaybackStart(), SetPassthroughMask(), SetTrickSpeed(), and SetVolumeDevice().
|
private |
pointer to cAudioDecoder object
Definition at line 251 of file device.h.
Referenced by EnterState(), FlushAudio(), LeaveState(), PlayAudio(), PlayAudioPkts(), SetAudioCodec(), and SetPassthroughMask().
|
private |
pointer to cDeviceConfig object
Definition at line 247 of file device.h.
Referenced by Config(), GetBufferFillLevelThresholdMs(), GetFirstAudioPtsMsToPlay(), GetFirstVideoPtsMsToPlay(), GetVideoAudioDelayMs(), HandleDisplayModeChange(), Initialize(), LeaveState(), MaxSizeGPUImageCache(), OglOsdIsDisabled(), PausePlayback(), PlayAudio(), PlayVideoInternal(), ResumeFromPause(), SetDecoderFallbackToSw(), SetDisableDeint(), SetDisableOglOsd(), SetDisplayMode(), and SetEnableOglOsd().
|
private |
event handler thread
Definition at line 254 of file device.h.
Referenced by Initialize(), SetDisplayMode(), and ~cOutputDevice().
|
private |
pointer to grabber object
Definition at line 264 of file device.h.
Referenced by EnterState(), GrabImage(), and LeaveState().
|
private |
pointer to hardware device description
Definition at line 253 of file device.h.
Referenced by Initialize(), LeaveState(), and ~cOutputDevice().
|
private |
pip pes reassembly buffer
Definition at line 267 of file device.h.
Referenced by PlayPipVideo(), and ResetPipStream().
|
private |
use alternative pip position
Definition at line 274 of file device.h.
Referenced by Initialize(), SetRenderPipSize(), and ToggleRenderPipPosition().
|
private |
current playback mode
Definition at line 262 of file device.h.
Referenced by CheckPlaybackStartConditions(), Clear(), EnterState(), Flush(), GetSTC(), IsAudioOnlyPlayback(), IsVideoOnlyPlayback(), PausePlayback(), PlayAudio(), ResumeFromPause(), and SchedulePlaybackStart().
|
private |
pointer to cDeviceOsdProvider object
Definition at line 252 of file device.h.
Referenced by EnterState(), HaltOpenGlThread(), IsOsdProviderSet(), MakePrimaryDevice(), ResetOsdProvider(), and ResumeOpenGlThread().
|
private |
pointer to pip handler
Definition at line 268 of file device.h.
Referenced by Detach(), EnterState(), LeaveState(), PipChannelChange(), PipChannelSwap(), PipDisable(), PipEnable(), PipIsEnabled(), PipSetSize(), PipSwapPosition(), PipToggle(), SetPlayMode(), Stop(), and UsePip().
|
private |
pointer to pip video stream
Definition at line 266 of file device.h.
Referenced by EnterState(), LeaveState(), PlayPipVideo(), and ResetPipStream().
|
private |
pointer to cVideoRender object
Definition at line 248 of file device.h.
Referenced by CheckAudioPlaybackStartConditions(), CheckPlaybackStartConditions(), Clear(), EnterState(), GetFirstAudioPtsMsToPlay(), GetFirstVideoPtsMsToPlay(), GetStats(), GetSTC(), HaltVideoThreads(), HandleDisplayModeChange(), HandleStillPicture(), LeaveState(), OsdClose(), OsdDraw(), PausePlayback(), Render(), ResetPipStream(), ResetVideoFilter(), ResumeFromPause(), ResumePlayback(), ResumeVideoThreads(), ScaleVideo(), SchedulePlaybackStart(), ScheduleResyncAtPtsMs(), SetDisableOglOsd(), SetDisplayMode(), SetEnableHdr(), SetEnableOglOsd(), SetRenderPipActive(), SetRenderPipSize(), and SetTrickSpeed().
|
private |
pointer to spu decoder
Definition at line 246 of file device.h.
Referenced by GetSpuDecoder(), Initialize(), and ~cOutputDevice().
|
private |
Definition at line 240 of file device.h.
Referenced by CheckAudioPlaybackStartConditions(), CheckPlaybackStartConditions(), Clear(), cOutputDevice(), EnterState(), GetSTC(), Initialize(), IsDetached(), PipIsEnabled(), PlayAudio(), ResetPipStream(), SetRenderPipActive(), SetRenderPipSize(), and TriggerEvent().
|
private |
pointer to main video stream
Definition at line 249 of file device.h.
Referenced by CheckAudioPlaybackStartConditions(), CheckPlaybackStartConditions(), Clear(), EnterState(), Flush(), GetVideoSize(), HaltVideoThreads(), HandleStillPicture(), LeaveState(), PlayVideo(), PlayVideoPkts(), Poll(), ResetVideoFilter(), ResumeVideoThreads(), SchedulePlaybackStart(), SetDecoderFallbackToSw(), SetDisableDeint(), SetVideoCodec(), and VideoStream().
flag if audio packets have been received
Definition at line 270 of file device.h.
Referenced by CheckPlaybackStartConditions(), LeaveState(), and PlayAudio().
flag if valid audio packets have been received
Definition at line 272 of file device.h.
Referenced by LeaveState(), PlayAudio(), and PlayVideoInternal().
flag if valid video packets have been received
Definition at line 273 of file device.h.
Referenced by LeaveState(), PlayAudio(), and PlayVideoInternal().
flag if video packets have been received
Definition at line 271 of file device.h.
Referenced by CheckPlaybackStartConditions(), LeaveState(), and PlayVideo().
|
private |
Definition at line 282 of file device.h.
Referenced by CanScaleVideo(), GrabImage(), and SetScreenSize().
|
private |
Definition at line 281 of file device.h.
Referenced by CanScaleVideo(), GrabImage(), and SetScreenSize().
|
private |
mutex to lock screen size (which is accessed by different threads)
Definition at line 269 of file device.h.
Referenced by GetOsdSize(), SetOsdSize(), and SetScreenSize().
|
private |
video jitter tracker
Definition at line 258 of file device.h.
Referenced by EnterState(), and PlayVideoInternal().
|
private |
video pes reassembly buffer
Definition at line 255 of file device.h.
Referenced by Clear(), EnterState(), HandleStillPicture(), and PlayVideo().
|
private |
track the volume in the device (for attach)
Definition at line 277 of file device.h.
Referenced by InitAudio(), and SetVolumeDevice().
min buffering threshold in ms
Definition at line 238 of file device.h.
Referenced by GetBufferFillLevelThresholdMs(), and GetMinBufferFillLevelThresholdMs().