vdr-plugin-softhddevice-drm-gles 1.6.2
PiP

Picture-in-Picture. More...

Classes

class  cPipReceiver
 Receiver for PiP Stream. More...
 
class  cPipHandler
 PiP Stream Handler. More...
 

Macros

#define MAXRETRIES   20
 
#define RETRYWAITMS   5
 
#define ERRORDELTASEC   60
 

Functions

 cPipReceiver::cPipReceiver (const cChannel *, cSoftHdDevice *)
 Create a new receiver for the pip stream handling only video pid.
 
virtual cPipReceiver::~cPipReceiver (void)
 Detach the pip receiver.
 
virtual void cPipReceiver::Activate (bool)
 Called before the receiver gets attached or after it got detached.
 
virtual void cPipReceiver::Receive (const uchar *, int)
 Receive data from the receiver.
 
int cPipReceiver::ParseTs (const uchar *, int)
 Parse the ts stream and send it to the pes player.
 
int cPipReceiver::PlayTs (const uchar *, int)
 Get the pes payload and send it to the player.
 
 cPipHandler::cPipHandler (cSoftHdDevice *)
 
virtual cPipHandler::~cPipHandler (void)
 
void cPipHandler::HandleEvent (enum PipState)
 Handle a pip event.
 
int cPipHandler::Start (int)
 Create a new pip receiver and render the pip stream.
 
void cPipHandler::Stop (void)
 Delete the pip receiver, clear decoder and display buffers and disable rendering the pip window.
 
void cPipHandler::HandleEnable (bool)
 Enable/ disable picture-in-picture.
 
void cPipHandler::HandleChannelChange (int)
 Change the pip channel.
 
void cPipHandler::Enable (void)
 Start picture-in-picture.
 
void cPipHandler::Disable (void)
 Stop picture-in-picture.
 
void cPipHandler::Toggle (void)
 Toggle picture-in-picture.
 
void cPipHandler::ChannelChange (int)
 Change the pip channel.
 
void cPipHandler::ChannelSwap (bool)
 Swap the pip channel with main live channel.
 
void cPipHandler::SetSize (void)
 Set size and position for the pip window.
 
void cPipHandler::SwapPosition (void)
 Swap pip between normal and alternative position.
 

Detailed Description

Picture-in-Picture.

Macro Definition Documentation

◆ ERRORDELTASEC

#define ERRORDELTASEC   60

Definition at line 67 of file pipreceiver.cpp.

◆ MAXRETRIES

#define MAXRETRIES   20

Definition at line 65 of file pipreceiver.cpp.

◆ RETRYWAITMS

#define RETRYWAITMS   5

Definition at line 66 of file pipreceiver.cpp.

Function Documentation

◆ Activate()

void cPipReceiver::Activate ( bool  on)
protectedvirtual

Called before the receiver gets attached or after it got detached.

Parameters
onset on/off (unused)

Definition at line 59 of file pipreceiver.cpp.

References LOGDEBUG, and cPipReceiver::m_pTsToPesVideo.

◆ ChannelChange()

void cPipHandler::ChannelChange ( int  direction)

Change the pip channel.

Parameters
direction1: channel up, -1: channel down

Definition at line 389 of file pipreceiver.cpp.

References cPipHandler::m_active, cPipHandler::m_pEventReceiver, IEventReceiver::OnEventReceived(), PIPCHANDOWN, and PIPCHANUP.

Referenced by cSoftHdDevice::PipChannelChange().

◆ ChannelSwap()

void cPipHandler::ChannelSwap ( bool  closePip)

Swap the pip channel with main live channel.

The channel switch of the main stream must be done out of OnEventReceived() because it triggers a SetPlayMode() which end in a deadlock otherwise.

Parameters
closePipclose the pip window after the channel swap

Definition at line 408 of file pipreceiver.cpp.

References LOGDEBUG, cPipHandler::m_active, cPipHandler::m_pEventReceiver, cPipHandler::m_pPipChannel, IEventReceiver::OnEventReceived(), PIPCHANSWAP, and PIPSTOP.

Referenced by cSoftHdDevice::PipChannelSwap().

◆ cPipHandler()

cPipHandler::cPipHandler ( cSoftHdDevice device)

Definition at line 160 of file pipreceiver.cpp.

◆ cPipReceiver()

cPipReceiver::cPipReceiver ( const cChannel channel,
cSoftHdDevice device 
)

Create a new receiver for the pip stream handling only video pid.

Parameters
channelchannel to receive
devicepointer to cSoftHdDevice object

Definition at line 37 of file pipreceiver.cpp.

References LOGDEBUG.

◆ Disable()

void cPipHandler::Disable ( void  )

Stop picture-in-picture.

Definition at line 368 of file pipreceiver.cpp.

References cPipHandler::m_active, cPipHandler::m_pEventReceiver, IEventReceiver::OnEventReceived(), and PIPSTOP.

Referenced by cSoftHdDevice::PipDisable().

◆ Enable()

void cPipHandler::Enable ( void  )

Start picture-in-picture.

Definition at line 357 of file pipreceiver.cpp.

References cPipHandler::m_active, cPipHandler::m_pEventReceiver, IEventReceiver::OnEventReceived(), and PIPSTART.

Referenced by cSoftHdDevice::PipEnable().

◆ HandleChannelChange()

void cPipHandler::HandleChannelChange ( int  direction)
private

Change the pip channel.

Parameters
direction1: channel up, -1: channel down
Note
This function is called within the state change and must not trigger any new events!

Definition at line 312 of file pipreceiver.cpp.

References cPipHandler::m_active, cPipHandler::m_pPipChannel, cPipHandler::Start(), and cPipHandler::Stop().

Referenced by cPipHandler::HandleEvent().

◆ HandleEnable()

void cPipHandler::HandleEnable ( bool  on)
private

Enable/ disable picture-in-picture.

Parameters
ontrue, if pip should be enabled
Note
This function is called within the state change and must not trigger any new events!

Definition at line 288 of file pipreceiver.cpp.

References LOGDEBUG, cPipHandler::m_active, cPipHandler::m_pDevice, cPipHandler::m_pipChannelNum, cSoftHdDevice::SetRenderPipActive(), cPipHandler::Start(), and cPipHandler::Stop().

Referenced by cPipHandler::HandleEvent().

◆ HandleEvent()

◆ ParseTs()

int cPipReceiver::ParseTs ( const uchar data,
int  size 
)
private

Parse the ts stream and send it to the pes player.

This code is taken from VDRs cDevice::PlayTs()

Definition at line 93 of file pipreceiver.cpp.

References LOGWARNING, cPipReceiver::m_pTsToPesVideo, and cPipReceiver::PlayTs().

◆ PlayTs()

int cPipReceiver::PlayTs ( const uchar data,
int  size 
)
private

Get the pes payload and send it to the player.

This code is taken from VDRs cDevice::PlayTsVideo()

Definition at line 138 of file pipreceiver.cpp.

References cPipReceiver::m_pDevice, cPipReceiver::m_pTsToPesVideo, and cSoftHdDevice::PlayPipVideo().

Referenced by cPipReceiver::ParseTs().

◆ Receive()

void cPipReceiver::Receive ( const uchar data,
int  size 
)
protectedvirtual

Receive data from the receiver.

This code is taken from VDRs cTransfer::Receive()

Definition at line 73 of file pipreceiver.cpp.

References ERRORDELTASEC, LOGWARNING, MAXRETRIES, and RETRYWAITMS.

◆ SetSize()

void cPipHandler::SetSize ( void  )

Set size and position for the pip window.

Definition at line 430 of file pipreceiver.cpp.

References cPipHandler::m_pEventReceiver, IEventReceiver::OnEventReceived(), and PIPSIZECHANGE.

Referenced by cSoftHdDevice::PipSetSize().

◆ Start()

int cPipHandler::Start ( int  channelNum)
private

Create a new pip receiver and render the pip stream.

Parameters
channelNumnumber of the channel to be switched to 0 switches to the current main stream channel
Return values
0pip was enabled
-1pip wasn't enabled, no device for channel available
Note
This function is called within the state change and must not trigger any new events!

Definition at line 226 of file pipreceiver.cpp.

References LOGDEBUG, LOGERROR, cPipHandler::m_active, cPipHandler::m_pDevice, cPipHandler::m_pipChannelNum, cPipHandler::m_pPipChannel, cPipHandler::m_pPipReceiver, and cPipHandler::Stop().

Referenced by cPipHandler::HandleChannelChange(), cPipHandler::HandleEnable(), and cPipHandler::HandleEvent().

◆ Stop()

void cPipHandler::Stop ( void  )
private

Delete the pip receiver, clear decoder and display buffers and disable rendering the pip window.

We do not need to halt main stream decoder and display thread for this, so only halt the pip decoding thread here (in m_pDevice->ResetPipStream()) - not in OnEventReceived().

Note
This function is called within the state change and must not trigger any new events!

Definition at line 265 of file pipreceiver.cpp.

References LOGDEBUG, cPipHandler::m_active, cPipHandler::m_pDevice, cPipHandler::m_pPipChannel, cPipHandler::m_pPipReceiver, and cSoftHdDevice::ResetPipStream().

Referenced by cPipHandler::HandleChannelChange(), cPipHandler::HandleEnable(), cPipHandler::HandleEvent(), cPipHandler::Start(), and cPipHandler::~cPipHandler().

◆ SwapPosition()

void cPipHandler::SwapPosition ( void  )

Swap pip between normal and alternative position.

Definition at line 438 of file pipreceiver.cpp.

References cPipHandler::m_pEventReceiver, IEventReceiver::OnEventReceived(), and PIPSWAPPOSITION.

Referenced by cSoftHdDevice::PipSwapPosition().

◆ Toggle()

void cPipHandler::Toggle ( void  )

Toggle picture-in-picture.

Definition at line 379 of file pipreceiver.cpp.

References cPipHandler::m_pEventReceiver, IEventReceiver::OnEventReceived(), and PIPTOGGLE.

Referenced by cSoftHdDevice::PipToggle().

◆ ~cPipHandler()

cPipHandler::~cPipHandler ( void  )
virtual

Definition at line 166 of file pipreceiver.cpp.

References cPipHandler::Stop().

◆ ~cPipReceiver()

cPipReceiver::~cPipReceiver ( void  )
virtual

Detach the pip receiver.

Definition at line 48 of file pipreceiver.cpp.

References LOGDEBUG.