|
vdr-plugin-softhddevice-drm-gles 1.6.2
|
Output Device Implementation. More...
Classes | |
| struct | overload< Ts > |
| class | cSoftHdDevice |
| Output Device Implementation. More... | |
Enumerations | |
| enum | State { STOP , BUFFERING , PLAY , TRICK_SPEED , DETACHED } |
| enum | PlaybackMode { NONE , AUDIO_AND_VIDEO , AUDIO_ONLY , VIDEO_ONLY } |
Functions | |
| static void | PrintStreamData (const uchar *payload) |
| Print the start code, stream id, length, first three bytes (start code) of the payload, and the following 16 bytes of the codec payload. | |
| template<class... Ts> | |
| overload (Ts...) -> overload< Ts... > | |
| const char * | EventToString (const Event &e) |
| const char * | StateToString (State s) |
| cSoftHdDevice::cSoftHdDevice (cSoftHdConfig *) | |
| Create the device. | |
| virtual | cSoftHdDevice::~cSoftHdDevice (void) |
| Destroy the device. | |
| int | cSoftHdDevice::Start (void) |
| Called by VDR when the plugin is started. | |
| void | cSoftHdDevice::Stop (void) |
| Called by VDR when the plugin is stopped. | |
| void | cSoftHdDevice::FlushAudio (void) |
| Clear all audio data from the decoder and ringbuffer. | |
| virtual void | cSoftHdDevice::MakePrimaryDevice (bool) |
| Informs a device that it will be the primary device. | |
| virtual void | cSoftHdDevice::ChannelSwitch (const cDevice *, int, bool) |
| Monitor a channel switch triggered by VDR (cStatus::ChannelSwitch()) | |
| virtual cSpuDecoder * | cSoftHdDevice::GetSpuDecoder (void) |
| Get the device SPU decoder. | |
| virtual bool | cSoftHdDevice::HasDecoder (void) const |
| Tells whether this device has an MPEG decoder. | |
| virtual bool | cSoftHdDevice::CanReplay (void) const |
| Return true if this device can currently start a replay session. | |
| void | cSoftHdDevice::OnEventReceived (const Event &) |
| Event handler for playback state transitions. | |
| void | cSoftHdDevice::OnEnteringState (State) |
| Actions to be performed when entering a state. | |
| void | cSoftHdDevice::OnLeavingState (State) |
| Actions to be performed when leaving a state. | |
| void | cSoftHdDevice::SetState (State) |
| Sets the device into the given state. | |
| virtual bool | cSoftHdDevice::SetPlayMode (ePlayMode) |
| Sets the device into the given play mode. | |
| virtual int64_t | cSoftHdDevice::GetSTC (void) |
| Gets the current System Time Counter, which can be used to synchronize audio, video and subtitles. | |
| virtual void | cSoftHdDevice::TrickSpeed (int, bool) |
| Sets the device into a mode where replay is done slower. | |
| virtual void | cSoftHdDevice::Clear (void) |
| Clears all video and audio data from the device. | |
| virtual void | cSoftHdDevice::Play (void) |
| Sets the device into play mode (after a previous trick mode, or pause) | |
| virtual void | cSoftHdDevice::Freeze (void) |
| Puts the device into "freeze frame" mode. | |
| virtual void | cSoftHdDevice::StillPicture (const uchar *, int) |
| Display the given I-frame as a still picture. | |
| void | cSoftHdDevice::HandleStillPicture (const uchar *data, int size) |
| The still picture data received from VDR can contain multiple PES packets. | |
| virtual bool | cSoftHdDevice::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 | cSoftHdDevice::Flush (int=0) |
| Flush the device output buffers. | |
| virtual void | cSoftHdDevice::SetVideoDisplayFormat (eVideoDisplayFormat) |
| Sets the video display format. | |
| virtual void | cSoftHdDevice::SetVideoFormat (bool) |
| Set the video format. | |
| virtual void | cSoftHdDevice::GetVideoSize (int &, int &, double &) |
| Get the video size. | |
| virtual void | cSoftHdDevice::GetOsdSize (int &, int &, double &) |
| Returns the width, height and aspect ratio the OSD. | |
| void | cSoftHdDevice::SetScreenSize (int, int, double) |
| Set the screen size. | |
| virtual int | cSoftHdDevice::PlayAudio (const uchar *, int, uchar) |
| Play an audio packet. | |
| virtual void | cSoftHdDevice::SetAudioTrackDevice (eTrackType) |
| virtual void | cSoftHdDevice::SetDigitalAudioDevice (bool) |
| virtual void | cSoftHdDevice::SetAudioChannelDevice (int) |
| virtual int | cSoftHdDevice::GetAudioChannelDevice (void) |
| virtual void | cSoftHdDevice::SetVolumeDevice (int) |
| Sets the audio volume on this device (Volume = 0...255). | |
| virtual int | cSoftHdDevice::PlayVideo (const uchar *, int) |
| Play a video packet of the main videostream. | |
| int | cSoftHdDevice::PlayPipVideo (const uchar *, int) |
| Play a video packet of the pip videostream. | |
| int | cSoftHdDevice::PlayVideoInternal (cVideoStream *, cReassemblyBufferVideo *, const uchar *, int, bool) |
| Play a video packet. | |
| int | cSoftHdDevice::GetBufferFillLevelThresholdMs () |
| Returns the buffer fill level threshold in milliseconds. | |
| bool | cSoftHdDevice::IsBufferingThresholdReached (void) |
| Check if the buffering threshold has been reached. | |
| int64_t | cSoftHdDevice::GetFirstAudioPtsMsToPlay () |
| Calculate the first audio PTS that should be played during synchronized playback. | |
| int64_t | cSoftHdDevice::GetFirstVideoPtsMsToPlay () |
| virtual uchar * | cSoftHdDevice::GrabImage (int &, bool, int, int, int) |
| Grabs the currently visible screen image. | |
| virtual cRect | cSoftHdDevice::CanScaleVideo (const cRect &, int taCenter) |
| Ask the output, if it can scale video. | |
| virtual void | cSoftHdDevice::ScaleVideo (const cRect &=cRect::Null) |
| Scale the currently shown video. | |
| const char * | cSoftHdDevice::CommandLineHelp (void) |
| Return command line help string. | |
| int | cSoftHdDevice::ProcessArgs (int, char *[]) |
| Process the command line arguments. | |
| void | cSoftHdDevice::OsdClose (void) |
| Close the OSD. | |
| void | cSoftHdDevice::OsdDrawARGB (int, int, int, int, int, const uint8_t *, int, int) |
| Draw an OSD pixmap. | |
| int | cSoftHdDevice::MaxSizeGPUImageCache (void) |
| Get the maximum GPU image cache size. | |
| int | cSoftHdDevice::OglOsdIsDisabled (void) |
| Is the OpenGL/ES osd disabled? | |
| void | cSoftHdDevice::SetDisableOglOsd (void) |
| Disables OpenGL/ES Osd (called from setup menu or conf) | |
| void | cSoftHdDevice::SetEnableOglOsd (void) |
| Enables OpenGL/ES Osd. | |
| void | cSoftHdDevice::SetDisableDeint (void) |
| Disables deinterlacer (called from setup menu or conf) | |
| void | cSoftHdDevice::SetDecoderNeedsIFrame (void) |
| Forces the h264 decoder to wait for an I-Frame to start. | |
| void | cSoftHdDevice::SetParseH264Dimensions (void) |
| Parse the h264 stream width and height before starting the decoder. | |
| void | cSoftHdDevice::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 | cSoftHdDevice::SetPassthroughMask (int) |
| Set the passthrough mask (called from setup menu or conf) | |
| void | cSoftHdDevice::ResetChannelId (void) |
| Reset the channel ID (restarts audio) | |
| void | cSoftHdDevice::GetStats (int *, int *, int *) |
| Get statistics from the renderer. | |
| void | cSoftHdDevice::SetAudioCodec (enum AVCodecID, AVCodecParameters *, AVRational) |
| Open an audio codec. | |
| void | cSoftHdDevice::SetVideoCodec (enum AVCodecID, AVCodecParameters *, AVRational) |
| Open a video codec. | |
| int | cSoftHdDevice::PlayAudioPkts (AVPacket *) |
| Play an audio packet. | |
| int | cSoftHdDevice::PlayVideoPkts (AVPacket *) |
| Play a video packet. | |
| void | cSoftHdDevice::Detach (void) |
| Detach the device. | |
| void | cSoftHdDevice::Attach (void) |
| Attach the device again. | |
| bool | cSoftHdDevice::IsDetached (void) const |
| Returns true, if the device is detached. | |
| void | cSoftHdDevice::ResetPipStream (void) |
| Resets pip stream and render pipeline. | |
| bool | cSoftHdDevice::PipIsEnabled (void) |
| Returns true, if pip is currently enabled. | |
| void | cSoftHdDevice::SetRenderPipSize (void) |
| Wrapper functions for cVideoRender and cPipHandler. | |
| void | cSoftHdDevice::SetRenderPipActive (bool) |
| void | cSoftHdDevice::PipEnable (void) |
| void | cSoftHdDevice::PipDisable (void) |
| void | cSoftHdDevice::PipToggle (void) |
| void | cSoftHdDevice::PipChannelChange (int) |
| void | cSoftHdDevice::PipChannelSwap (bool) |
| void | cSoftHdDevice::PipSwapPosition (void) |
| void | cSoftHdDevice::PipSetSize (void) |
| void | cSoftHdDevice::SetEnableHdr (bool) |
| Enable HDR display mode. | |
Output Device Implementation.
| Enumerator | |
|---|---|
| NONE | |
| AUDIO_AND_VIDEO | |
| AUDIO_ONLY | |
| VIDEO_ONLY | |
Definition at line 96 of file softhddevice.h.
| Enumerator | |
|---|---|
| STOP | |
| BUFFERING | |
| PLAY | |
| TRICK_SPEED | |
| DETACHED | |
Definition at line 60 of file softhddevice.h.
Attach the device again.
Kind of a plugin restart. Inits and starts all necessary resources. Only valid after a detach.
Definition at line 1779 of file softhddevice.cpp.
References cSoftHdDevice::m_forceDetached, cSoftHdDevice::m_needsMakePrimary, cSoftHdDevice::MakePrimaryDevice(), and cSoftHdDevice::OnEventReceived().
Referenced by cSoftHdMenu::HandleHotKey(), and cPluginSoftHdDevice::SVDRPCommand().
Return true if this device can currently start a replay session.
Definition at line 175 of file softhddevice.cpp.
References cSoftHdDevice::IsDetached(), and LOGDEBUG.
Ask the output, if it can scale video.
| rect | requested video window rectangle |
Definition at line 1421 of file softhddevice.cpp.
|
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 133 of file softhddevice.cpp.
References cSoftHdDevice::m_channelSwitchStartTime.
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 750 of file softhddevice.cpp.
References AUDIO_AND_VIDEO, BUFFERING, cVideoStream::CancelFilterThread(), cVideoRender::ClearDecoderToDisplayQueue(), cVideoStream::ClearVdrCoreToDecoderQueue(), cSoftHdDevice::FlushAudio(), cVideoStream::FlushDecoder(), cVideoRender::Halt(), cVideoStream::Halt(), cSoftHdDevice::IsDetached(), LOGDEBUG, cSoftHdDevice::m_pAudio, cSoftHdDevice::m_playbackMode, cSoftHdDevice::m_pRender, cSoftHdDevice::m_pVideoStream, cSoftHdDevice::m_videoReassemblyBuffer, cVideoRender::Reset(), cReassemblyBuffer::Reset(), cVideoRender::Resume(), cVideoStream::Resume(), cVideoRender::SetDisplayOneFrameThenPause(), cSoftHdAudio::SetPaused(), cSoftHdDevice::SetState(), and VIDEO_ONLY.
Referenced by cSoftHdPlayer::Play().
Return command line help string.
Definition at line 1449 of file softhddevice.cpp.
Referenced by cPluginSoftHdDevice::CommandLineHelp().
| cSoftHdDevice::cSoftHdDevice | ( | cSoftHdConfig * | config | ) |
Create the device.
Initializes some member variables
| config | pointer to cSoftHdConfig class |
Definition at line 59 of file softhddevice.cpp.
References cSoftHdDevice::m_channelSwitchStartTime, and cSoftHdDevice::m_dataReceivedTime.
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 1758 of file softhddevice.cpp.
References LOGDEBUG, cSoftHdDevice::m_needsMakePrimary, cSoftHdDevice::MakePrimaryDevice(), and cSoftHdDevice::OnEventReceived().
Referenced by cSoftHdMenu::HandleHotKey(), cSoftHdMenu::ProcessKey(), and cPluginSoftHdDevice::SVDRPCommand().
Definition at line 68 of file softhddevice.h.
References AUDIO.
Referenced by cSoftHdDevice::OnEventReceived().
Flush the device output buffers.
| timeoutMs | timeout in ms to become ready |
Definition at line 888 of file softhddevice.cpp.
References cVideoStream::GetAvPacketsFilled(), cSoftHdDevice::IsDetached(), LOGDEBUG, and cSoftHdDevice::m_pVideoStream.
Clear all audio data from the decoder and ringbuffer.
Definition at line 104 of file softhddevice.cpp.
References cSoftHdAudio::FlushBuffers(), cAudioDecoder::FlushBuffers(), LOGDEBUG, cSoftHdDevice::m_audioReassemblyBuffer, cSoftHdDevice::m_pAudio, cSoftHdDevice::m_pAudioDecoder, and cReassemblyBuffer::Reset().
Referenced by cSoftHdDevice::Clear(), and cSoftHdDevice::OnEnteringState().
Puts the device into "freeze frame" mode.
Definition at line 797 of file softhddevice.cpp.
References LOGDEBUG, and cSoftHdDevice::OnEventReceived().
Referenced by cSoftHdControl::ProcessKey().
Definition at line 1133 of file softhddevice.cpp.
|
private |
Returns the buffer fill level threshold in milliseconds.
Combines the minimum threshold with the user-configured additional buffer length.
Definition at line 1274 of file softhddevice.cpp.
References cSoftHdConfig::ConfigAdditionalBufferLengthMs, cSoftHdDevice::m_pConfig, and cSoftHdDevice::MIN_BUFFER_FILL_LEVEL_THRESHOLD_MS.
Referenced by cSoftHdDevice::IsBufferingThresholdReached().
|
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 1357 of file softhddevice.cpp.
References cSoftHdConfig::ConfigVideoAudioDelayMs, cSoftHdAudio::GetOutputPtsMs(), cVideoRender::GetOutputPtsMs(), cSoftHdDevice::m_pAudio, cSoftHdDevice::m_pConfig, and cSoftHdDevice::m_pRender.
Referenced by cSoftHdDevice::IsBufferingThresholdReached(), and cSoftHdDevice::OnEventReceived().
|
private |
Definition at line 1370 of file softhddevice.cpp.
References cSoftHdConfig::ConfigVideoAudioDelayMs, cSoftHdAudio::GetOutputPtsMs(), cVideoRender::GetOutputPtsMs(), cSoftHdDevice::m_pAudio, cSoftHdDevice::m_pConfig, and cSoftHdDevice::m_pRender.
Referenced by cSoftHdDevice::IsBufferingThresholdReached(), and cSoftHdDevice::OnEventReceived().
Returns the width, height and aspect ratio the OSD.
| [out] | width | osd width |
| [out] | height | osd height |
| [out] | aspectRatio | osd aspect ratio |
Definition at line 970 of file softhddevice.cpp.
References cSoftHdDevice::IsDetached(), cSoftHdDevice::m_screenHeight, cSoftHdDevice::m_screenWidth, and cSoftHdDevice::m_sizeMutex.
Referenced by cOglOsd::cOglOsd(), cSoftOsd::Flush(), and cSoftHdDevice::GrabImage().
|
virtual |
Get the device SPU decoder.
Definition at line 151 of file softhddevice.cpp.
References LOGDEBUG, and cSoftHdDevice::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 1671 of file softhddevice.cpp.
References cVideoRender::GetStats(), and cSoftHdDevice::m_pRender.
Referenced by cMenuSetupSoft::Create().
Gets the current System Time Counter, which can be used to synchronize audio, video and subtitles.
Definition at line 647 of file softhddevice.cpp.
References AUDIO_AND_VIDEO, AUDIO_ONLY, AV_NOPTS_VALUE, cSoftHdAudio::GetHardwareOutputPtsTimebaseUnits(), cVideoRender::GetVideoClock(), cSoftHdDevice::IsDetached(), cSoftHdDevice::m_pAudio, cSoftHdDevice::m_playbackMode, cSoftHdDevice::m_pRender, NONE, and VIDEO_ONLY.
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 947 of file softhddevice.cpp.
References cVideoStream::GetVideoSize(), cSoftHdDevice::IsDetached(), and cSoftHdDevice::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 1389 of file softhddevice.cpp.
References cSoftHdGrab::Active(), cSoftHdDevice::GetOsdSize(), cSoftHdGrab::Image(), cSoftHdDevice::IsDetached(), L_GRAB, LOGDEBUG2, LOGWARNING, cSoftHdDevice::m_pGrab, cSoftHdGrab::Size(), and cSoftHdGrab::Start().
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 830 of file softhddevice.cpp.
References cVideoStream::Flush(), LOGWARNING, cSoftHdDevice::m_pRender, cSoftHdDevice::m_pVideoStream, cSoftHdDevice::m_videoReassemblyBuffer, cSoftHdDevice::PlayVideoInternal(), cReassemblyBufferVideo::PopAvPacket(), cVideoStream::PushAvPacket(), cVideoStream::ResetInputPts(), cVideoStream::SetDeinterlacerDeactivated(), cVideoRender::SetPlaybackPaused(), and cVideoRender::SetStillpicture().
Referenced by cSoftHdDevice::OnEventReceived().
Tells whether this device has an MPEG decoder.
Definition at line 163 of file softhddevice.cpp.
References cSoftHdDevice::IsDetached().
Check if the buffering threshold has been reached.
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")
| true | if playback should start (audio or video only or buffering threshold reached) |
| false | if playback should not start |
Definition at line 1304 of file softhddevice.cpp.
References AV_NOPTS_VALUE, BUFFERING, cSoftHdDevice::GetBufferFillLevelThresholdMs(), cSoftHdDevice::GetFirstAudioPtsMsToPlay(), cSoftHdDevice::GetFirstVideoPtsMsToPlay(), cSoftHdAudio::GetInputPtsMs(), cVideoStream::GetInputPtsMs(), cSoftHdAudio::GetOutputPtsMs(), cVideoRender::GetOutputPtsMs(), cSoftHdAudio::HasInputPts(), cVideoStream::HasInputPts(), cVideoRender::IsOutputBufferFull(), L_AV_SYNC, LOGDEBUG, LOGDEBUG2, cSoftHdDevice::m_pAudio, cSoftHdDevice::m_pRender, cSoftHdDevice::m_pVideoStream, cSoftHdDevice::m_receivedAudio, cSoftHdDevice::m_receivedVideo, cSoftHdDevice::m_state, and Timestamp2String().
Referenced by cVideoRender::DisplayFrame(), and cSoftHdDevice::PlayAudio().
Returns true, if the device is detached.
Definition at line 1794 of file softhddevice.cpp.
References DETACHED, cSoftHdDevice::m_mutex, and cSoftHdDevice::m_state.
Referenced by cSoftHdDevice::CanReplay(), cSoftHdDevice::Clear(), cSoftOsdProvider::CreateOsd(), cSoftHdDevice::Flush(), cSoftHdDevice::GetOsdSize(), cSoftHdDevice::GetSTC(), cSoftHdDevice::GetVideoSize(), cSoftHdDevice::GrabImage(), cSoftHdDevice::HasDecoder(), cSoftHdDevice::OsdClose(), cSoftHdDevice::OsdDrawARGB(), cSoftHdDevice::PlayAudio(), cSoftHdDevice::PlayVideo(), cSoftHdDevice::Poll(), cSoftHdDevice::ScaleVideo(), cSoftHdDevice::SetVolumeDevice(), and cPluginSoftHdDevice::SVDRPCommand().
Informs a device that it will be the primary device.
| on | flag if becoming or loosing primary |
Definition at line 117 of file softhddevice.cpp.
References LOGDEBUG, and cSoftHdDevice::m_pOsdProvider.
Referenced by cSoftHdDevice::Attach(), and cSoftHdDevice::Detach().
Get the maximum GPU image cache size.
Definition at line 1568 of file softhddevice.cpp.
References cSoftHdConfig::ConfigMaxSizeGPUImageCache, and cSoftHdDevice::m_pConfig.
Referenced by cSoftOsdProvider::StartOpenGlThread().
Is the OpenGL/ES osd disabled?
Definition at line 1576 of file softhddevice.cpp.
References cSoftHdConfig::ConfigDisableOglOsd, and cSoftHdDevice::m_pConfig.
Referenced by cSoftOsdProvider::CreateOsd(), cSoftOsdProvider::OsdSizeChanged(), cSoftOsdProvider::StartOpenGlThread(), and cSoftOsdProvider::~cSoftOsdProvider().
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 469 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(), cSoftHdDevice::FlushAudio(), cSoftHdDevice::m_audioJitterTracker, cSoftHdDevice::m_pAudio, cSoftHdDevice::m_pAudioDecoder, cSoftHdDevice::m_pGrab, cSoftHdDevice::m_playbackMode, cSoftHdDevice::m_pOsdProvider, cSoftHdDevice::m_pPipHandler, cSoftHdDevice::m_pPipStream, cSoftHdDevice::m_pRender, cSoftHdDevice::m_pVideoStream, cSoftHdDevice::m_videoJitterTracker, cSoftHdDevice::m_videoReassemblyBuffer, NONE, PLAY, cSoftOsdProvider::RequestStopOpenGlThread(), cVideoRender::Reset(), cJitterTracker::Reset(), cReassemblyBuffer::Reset(), cVideoRender::ResetBufferReuseStrategy(), cVideoRender::ResetDecodingStrategy(), cSoftHdAudio::ResetHwDelayBaseline(), cVideoRender::Resume(), cVideoStream::Resume(), cVideoStream::SetDeinterlacerDeactivated(), cSoftHdAudio::SetPaused(), cVideoRender::SetPlaybackPaused(), cVideoRender::SetStillpicture(), STOP, cSoftOsdProvider::StopOpenGlThread(), TRICK_SPEED, cSoftOsdProvider::UnlockOpenGlThread(), and VIDEO_ONLY.
Referenced by cSoftHdDevice::SetState().
Event handler for playback state transitions.
Processes events (Play, Pause, Stop, TrickSpeed, StillPicture) and performs the appropriate state transitions based on the current state. The method halts both display and decoding threads before processing the event and resumes them afterwards to ensure thread-safe state transitions.
| event | The event to process (variant type containing specific event data) |
Implements IEventReceiver.
Definition at line 194 of file softhddevice.cpp.
References AUDIO_AND_VIDEO, AUDIO_ONLY, BUFFERING, cSoftHdConfig::ConfigVideoAudioDelayMs, DETACHED, cSoftHdAudio::DropSamplesOlderThanPtsMs(), EventToString(), cSoftHdDevice::GetFirstAudioPtsMsToPlay(), cSoftHdDevice::GetFirstVideoPtsMsToPlay(), cSoftHdAudio::GetOutputPtsMs(), cVideoRender::GetOutputPtsMs(), cVideoRender::Halt(), cVideoStream::Halt(), cPipHandler::HandleEvent(), cSoftHdDevice::HandleStillPicture(), cSoftHdAudio::HasInputPts(), cVideoStream::HasInputPts(), cSoftHdAudio::LazyInit(), cSoftOsdProvider::LockOpenGlThread(), LOGDEBUG, LOGFATAL, LOGWARNING, cSoftHdDevice::m_forceDetached, cSoftHdDevice::m_mutex, cSoftHdDevice::m_pAudio, cSoftHdDevice::m_pConfig, cSoftHdDevice::m_playbackMode, cSoftHdDevice::m_pOsdProvider, cSoftHdDevice::m_pPipHandler, cSoftHdDevice::m_pRender, cSoftHdDevice::m_pVideoStream, cSoftHdDevice::m_state, cSoftHdDevice::m_volume, NONE, PIPSTOP, PLAY, cVideoStream::ResetFilterThreadNeededCheck(), cVideoRender::ResetFrameCounter(), cSoftHdAudio::ResetHwDelayBaseline(), cVideoRender::Resume(), cVideoStream::Resume(), cVideoRender::SchedulePlaybackStartAtPtsMs(), cVideoRender::ScheduleResyncAtPtsMs(), cVideoRender::ScheduleVideoPlaybackPauseAt(), cSoftHdAudio::SetHwDelayBaseline(), cSoftHdAudio::SetPaused(), cVideoRender::SetPlaybackPaused(), cVideoRender::SetScheduleAudioResume(), cSoftHdDevice::SetState(), cVideoRender::SetStillpicture(), cVideoRender::SetTrickSpeed(), cSoftHdAudio::SetVolume(), StateToString(), STOP, TRICK_SPEED, cSoftOsdProvider::UnlockOpenGlThread(), and VIDEO_ONLY.
Referenced by cSoftHdDevice::Attach(), cSoftHdDevice::Detach(), cSoftHdDevice::Freeze(), cSoftHdDevice::Play(), cSoftHdDevice::PlayAudio(), cSoftHdDevice::SetPlayMode(), cSoftHdDevice::Start(), cSoftHdDevice::StillPicture(), cSoftHdDevice::Stop(), and cSoftHdDevice::TrickSpeed().
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 554 of file softhddevice.cpp.
References AV_NOPTS_VALUE, BUFFERING, cVideoStream::CancelFilterThread(), DETACHED, cVideoRender::GetMainOutputBuffer(), cVideoRender::GetPipOutputBuffer(), cVideoRender::Init(), cSoftHdDevice::m_pAudio, cSoftHdDevice::m_pAudioDecoder, cSoftHdDevice::m_pConfig, cSoftHdDevice::m_pGrab, cSoftHdDevice::m_pPipHandler, cSoftHdDevice::m_pPipStream, cSoftHdDevice::m_pRender, cSoftHdDevice::m_pVideoStream, cSoftHdDevice::m_receivedAudio, cSoftHdDevice::m_receivedVideo, PLAY, cVideoRender::PushMainFrame(), cVideoRender::PushPipFrame(), cVideoRender::ResetBufferReuseStrategy(), cVideoStream::ResetFilterThreadNeededCheck(), cVideoRender::ResetFrameCounter(), cSoftHdAudio::ResetHwDelayBaseline(), cVideoStream::ResetTrickSpeedFramesSentCounter(), cVideoRender::SchedulePlaybackStartAtPtsMs(), cVideoStream::SetDeinterlacerDeactivated(), cVideoRender::SetDisplayOneFrameThenPause(), cSoftHdAudio::SetHwDelayBaseline(), cSoftHdAudio::SetPaused(), cVideoRender::SetPlaybackPaused(), cVideoRender::SetTrickSpeed(), cVideoStream::StartDecoder(), STOP, and TRICK_SPEED.
Referenced by cSoftHdDevice::SetState().
Close the OSD.
Definition at line 1535 of file softhddevice.cpp.
References cSoftHdDevice::IsDetached(), cSoftHdDevice::m_pRender, and cVideoRender::OsdClear().
Referenced by cOglCmdCopyBufferToOutputFb::Execute(), cSoftOsd::SetActive(), and cSoftOsd::SetAreas().
| void cSoftHdDevice::OsdDrawARGB | ( | 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 1555 of file softhddevice.cpp.
References cSoftHdDevice::IsDetached(), cSoftHdDevice::m_pRender, and cVideoRender::OsdDrawARGB().
Referenced by cOglCmdCopyBufferToOutputFb::Execute(), and cSoftOsd::Flush().
Definition at line 1839 of file softhddevice.cpp.
References cPipHandler::ChannelChange(), and cSoftHdDevice::m_pPipHandler.
Referenced by cSoftHdMenu::HandleHotKey(), cSoftHdMenu::ProcessKey(), and cPluginSoftHdDevice::SVDRPCommand().
Definition at line 1840 of file softhddevice.cpp.
References cPipHandler::ChannelSwap(), and cSoftHdDevice::m_pPipHandler.
Referenced by cSoftHdMenu::HandleHotKey(), cSoftHdMenu::ProcessKey(), and cPluginSoftHdDevice::SVDRPCommand().
Definition at line 1837 of file softhddevice.cpp.
References cPipHandler::Disable(), and cSoftHdDevice::m_pPipHandler.
Referenced by cPluginSoftHdDevice::SVDRPCommand().
Definition at line 1836 of file softhddevice.cpp.
References cPipHandler::Enable(), and cSoftHdDevice::m_pPipHandler.
Referenced by cPluginSoftHdDevice::SVDRPCommand().
Returns true, if pip is currently enabled.
Definition at line 1825 of file softhddevice.cpp.
References cPipHandler::IsEnabled(), cSoftHdDevice::m_mutex, and cSoftHdDevice::m_pPipHandler.
Referenced by cPluginSoftHdDevice::SVDRPCommand().
Definition at line 1842 of file softhddevice.cpp.
References cSoftHdDevice::m_pPipHandler, and cPipHandler::SetSize().
Referenced by cMenuSetupSoft::Store().
Definition at line 1841 of file softhddevice.cpp.
References cSoftHdDevice::m_pPipHandler, and cPipHandler::SwapPosition().
Referenced by cSoftHdMenu::HandleHotKey(), cSoftHdMenu::ProcessKey(), and cPluginSoftHdDevice::SVDRPCommand().
Definition at line 1838 of file softhddevice.cpp.
References cSoftHdDevice::m_pPipHandler, and cPipHandler::Toggle().
Referenced by cSoftHdMenu::HandleHotKey(), and cSoftHdMenu::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 787 of file softhddevice.cpp.
References cSoftHdDevice::OnEventReceived().
Referenced by cSoftHdControl::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 1050 of file softhddevice.cpp.
References cSoftHdAudio::ClockDriftCompensation(), cAudioDecoder::Close(), cAudioDecoder::Decode(), cReassemblyBuffer::GetCodec(), cAudioDecoder::GetCodecId(), cJitterTracker::GetLongTermMaxJitterMs(), cJitterTracker::GetShortTermMaxJitterMs(), cSoftHdAudio::IsBufferFull(), cSoftHdDevice::IsBufferingThresholdReached(), cSoftHdDevice::IsDetached(), LOGDEBUG, cSoftHdDevice::m_audioChannelID, cSoftHdDevice::m_audioJitterTracker, cSoftHdDevice::m_audioReassemblyBuffer, cSoftHdDevice::m_channelSwitchStartTime, cSoftHdDevice::m_dataReceivedTime, cSoftHdDevice::m_pAudio, cSoftHdDevice::m_pAudioDecoder, cSoftHdDevice::m_pConfig, cSoftHdDevice::m_receivedAudio, cSoftHdDevice::m_receivedVideo, cSoftHdDevice::OnEventReceived(), cAudioDecoder::Open(), cJitterTracker::PacketReceived(), cReassemblyBufferAudio::PopAvPacket(), cReassemblyBuffer::Push(), cReassemblyBuffer::Reset(), cSoftHdConfig::StatMaxLongTermAudioJitterMs, and cSoftHdConfig::StatMaxShortTermAudioJitterMs.
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 1717 of file softhddevice.cpp.
References cAudioDecoder::Decode(), cSoftHdAudio::IsBufferFull(), cSoftHdAudio::LazyInit(), cSoftHdDevice::m_pAudio, and cSoftHdDevice::m_pAudioDecoder.
Referenced by cSoftHdPlayer::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 1198 of file softhddevice.cpp.
References cVideoStream::IsInputBufferFull(), cSoftHdDevice::m_pipReassemblyBuffer, cSoftHdDevice::m_pPipStream, and cSoftHdDevice::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 1168 of file softhddevice.cpp.
References cSoftHdDevice::IsDetached(), LOGDEBUG, cSoftHdDevice::m_channelSwitchStartTime, cSoftHdDevice::m_dataReceivedTime, cSoftHdDevice::m_pVideoStream, cSoftHdDevice::m_receivedAudio, cSoftHdDevice::m_receivedVideo, cSoftHdDevice::m_videoReassemblyBuffer, and cSoftHdDevice::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 |
Definition at line 1221 of file softhddevice.cpp.
References cReassemblyBuffer::GetCodec(), cJitterTracker::GetLongTermMaxJitterMs(), cJitterTracker::GetShortTermMaxJitterMs(), cReassemblyBufferVideo::HasLeadingZero(), cReassemblyBuffer::IsEmpty(), cSoftHdDevice::m_pConfig, cSoftHdDevice::m_videoJitterTracker, cJitterTracker::PacketReceived(), cReassemblyBufferVideo::ParseCodecHeader(), cReassemblyBufferVideo::PopAvPacket(), PrintStreamData(), cReassemblyBuffer::Push(), cReassemblyBuffer::Reset(), cSoftHdConfig::StatMaxLongTermVideoJitterMs, and cSoftHdConfig::StatMaxShortTermVideoJitterMs.
Referenced by cSoftHdDevice::HandleStillPicture(), cSoftHdDevice::PlayPipVideo(), and cSoftHdDevice::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 1736 of file softhddevice.cpp.
References cVideoStream::GetAvPacketsFilled(), cVideoStream::GetVideoPacketMax(), cSoftHdAudio::LazyInit(), cSoftHdDevice::m_pAudio, cSoftHdDevice::m_pVideoStream, and cVideoStream::PushAvPacket().
Referenced by cSoftHdPlayer::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 869 of file softhddevice.cpp.
References cSoftHdAudio::IsBufferFull(), cSoftHdDevice::IsDetached(), cVideoStream::IsInputBufferFull(), cSoftHdDevice::m_pAudio, and cSoftHdDevice::m_pVideoStream.
Print the start code, stream id, length, first three bytes (start code) of the payload, and the following 16 bytes of the codec payload.
| data | pointer to stream data |
| offset | print from here |
Definition at line 1006 of file softhddevice.cpp.
References L_CODEC, and LOGDEBUG2.
Referenced by cSoftHdDevice::PlayVideoInternal().
Process the command line arguments.
| argc | number of arguments |
| argv | arguments vector |
Definition at line 1470 of file softhddevice.cpp.
References cSoftHdConfig::ConfigAudioMixerChannel, cSoftHdConfig::ConfigAudioPassthroughDevice, cSoftHdConfig::ConfigAudioPCMDevice, cSoftHdConfig::ConfigDisplayResolution, cSoftHdDevice::m_disablePip, cSoftHdDevice::m_forceDetached, cSoftHdDevice::m_pConfig, and cSoftHdDevice::SetDisableOglOsd().
Referenced by cPluginSoftHdDevice::ProcessArgs().
Reset the channel ID (restarts audio)
Definition at line 1658 of file softhddevice.cpp.
References LOGDEBUG, and cSoftHdDevice::m_audioChannelID.
Referenced by cMenuSetupSoft::Store().
Resets pip stream and render pipeline.
Definition at line 1807 of file softhddevice.cpp.
References cVideoStream::CancelFilterThread(), cVideoRender::ClearPipDecoderToDisplayQueue(), cVideoStream::ClearVdrCoreToDecoderQueue(), cVideoStream::CloseDecoder(), cVideoStream::Halt(), cSoftHdDevice::m_pipReassemblyBuffer, cSoftHdDevice::m_pPipStream, cSoftHdDevice::m_pRender, cReassemblyBuffer::Reset(), cVideoRender::ResetPipBufferReuseStrategy(), cVideoRender::ResetPipDecodingStrategy(), and cVideoStream::Resume().
Referenced by cPipHandler::Stop().
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 1434 of file softhddevice.cpp.
References cSoftHdDevice::IsDetached(), L_OSD, LOGDEBUG2, cSoftHdDevice::m_pRender, and cVideoRender::SetVideoOutputPosition().
Definition at line 1127 of file softhddevice.cpp.
| void cSoftHdDevice::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 1692 of file softhddevice.cpp.
References cSoftHdDevice::m_pAudioDecoder, and cAudioDecoder::Open().
Referenced by cSoftHdPlayer::Play().
|
virtual |
Definition at line 1117 of file softhddevice.cpp.
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 1634 of file softhddevice.cpp.
References cSoftHdConfig::ConfigDecoderFallbackToSwNumPkts, cSoftHdDevice::m_pConfig, cSoftHdDevice::m_pVideoStream, and cVideoStream::SetDecoderFallbackToSwNumPkts().
Referenced by cMenuSetupSoft::Store().
Forces the h264 decoder to wait for an I-Frame to start.
Definition at line 1615 of file softhddevice.cpp.
References cSoftHdConfig::ConfigDecoderNeedsIFrame, cSoftHdDevice::m_pConfig, cSoftHdDevice::m_pVideoStream, and cVideoStream::SetStartDecodingWithIFrame().
Referenced by cMenuSetupSoft::Store().
Definition at line 1122 of file softhddevice.cpp.
Disables deinterlacer (called from setup menu or conf)
Definition at line 1606 of file softhddevice.cpp.
References cSoftHdConfig::ConfigDisableDeint, cVideoStream::DisableDeint(), cSoftHdDevice::m_pConfig, and cSoftHdDevice::m_pVideoStream.
Referenced by cMenuSetupSoft::Store().
Disables OpenGL/ES Osd (called from setup menu or conf)
Definition at line 1584 of file softhddevice.cpp.
References cSoftHdConfig::ConfigDisableOglOsd, cVideoRender::DisableOglOsd(), cSoftHdDevice::m_pConfig, and cSoftHdDevice::m_pRender.
Referenced by cSoftOsdProvider::CreateOsd(), and cSoftHdDevice::ProcessArgs().
Enable HDR display mode.
Definition at line 1845 of file softhddevice.cpp.
References cSoftHdDevice::m_pRender, and cVideoRender::SetEnableHdr().
Referenced by cMenuSetupSoft::Store().
Enables OpenGL/ES Osd.
Definition at line 1594 of file softhddevice.cpp.
References cSoftHdConfig::ConfigDisableOglOsd, cVideoRender::EnableOglOsd(), cSoftHdDevice::m_pConfig, and cSoftHdDevice::m_pRender.
Parse the h264 stream width and height before starting the decoder.
Definition at line 1624 of file softhddevice.cpp.
References cSoftHdConfig::ConfigParseH264Dimensions, cSoftHdDevice::m_pConfig, cSoftHdDevice::m_pVideoStream, and cVideoStream::SetParseH264Dimensions().
Referenced by cMenuSetupSoft::Store().
Set the passthrough mask (called from setup menu or conf)
Definition at line 1648 of file softhddevice.cpp.
References cSoftHdDevice::m_pAudio, cSoftHdDevice::m_pAudioDecoder, cSoftHdAudio::SetPassthroughMask(), and cAudioDecoder::SetPassthroughMask().
Referenced by cMenuSetupSoft::Store().
Sets the device into the given play mode.
| play_mode | new play mode (Audio/Video/External...) |
Definition at line 620 of file softhddevice.cpp.
References LOGDEBUG, LOGERROR, and cSoftHdDevice::OnEventReceived().
Definition at line 1835 of file softhddevice.cpp.
References cSoftHdDevice::m_pRender, and cVideoRender::SetPipActive().
Referenced by cPipHandler::HandleEnable().
Wrapper functions for cVideoRender and cPipHandler.
Definition at line 1834 of file softhddevice.cpp.
References cSoftHdDevice::m_pipUseAlt, cSoftHdDevice::m_pRender, and cVideoRender::SetPipSize().
Referenced by cPipHandler::HandleEvent().
Set the screen size.
| width | screen width |
| height | screen height |
| refreshRateHz | screen refresh rate in Hz |
Definition at line 992 of file softhddevice.cpp.
References cSoftHdDevice::m_screenHeight, cSoftHdDevice::m_screenRefreshRateHz, cSoftHdDevice::m_screenWidth, and cSoftHdDevice::m_sizeMutex.
Referenced by cVideoRender::SetScreenSize().
Sets the device into the given state.
| newState | new state |
Definition at line 603 of file softhddevice.cpp.
References LOGDEBUG, cSoftHdDevice::m_state, cSoftHdDevice::OnEnteringState(), cSoftHdDevice::OnLeavingState(), and StateToString().
Referenced by cSoftHdDevice::Clear(), and cSoftHdDevice::OnEventReceived().
| void cSoftHdDevice::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 1704 of file softhddevice.cpp.
References cSoftHdDevice::m_pVideoStream, and cVideoStream::Open().
Referenced by cSoftHdPlayer::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 910 of file softhddevice.cpp.
References LOGDEBUG.
Referenced by cSoftHdDevice::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 927 of file softhddevice.cpp.
References LOGDEBUG, and cSoftHdDevice::SetVideoDisplayFormat().
Sets the audio volume on this device (Volume = 0...255).
| volume | device volume |
Definition at line 1144 of file softhddevice.cpp.
References cSoftHdDevice::IsDetached(), LOGDEBUG, cSoftHdDevice::m_pAudio, cSoftHdDevice::m_volume, and cSoftHdAudio::SetVolume().
Called by VDR when the plugin is started.
Definition at line 84 of file softhddevice.cpp.
References LOGDEBUG, and cSoftHdDevice::OnEventReceived().
Referenced by cPluginSoftHdDevice::Start().
Definition at line 85 of file softhddevice.h.
References BUFFERING, DETACHED, PLAY, STOP, and TRICK_SPEED.
Referenced by cSoftHdDevice::OnEventReceived(), and cSoftHdDevice::SetState().
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 811 of file softhddevice.cpp.
References LOGDEBUG, and cSoftHdDevice::OnEventReceived().
Called by VDR when the plugin is stopped.
Definition at line 95 of file softhddevice.cpp.
References LOGDEBUG, and cSoftHdDevice::OnEventReceived().
Referenced by cPluginSoftHdDevice::Stop().
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 677 of file softhddevice.cpp.
References LOGDEBUG, and cSoftHdDevice::OnEventReceived().
|
virtual |
Destroy the device.
Only deletes spu decoder, which was created in constructor
Definition at line 75 of file softhddevice.cpp.
References LOGDEBUG, and cSoftHdDevice::m_pSpuDecoder.