vdr-plugin-softhddevice-drm-gles 1.5.9-20e15de
cPipHandler Class Reference

cPipHandler - class for pip More...

#include <pipreceiver.h>

Public Member Functions

 cPipHandler (cSoftHdDevice *)
 cPipHandler constructor
 
virtual ~cPipHandler (void)
 
bool IsEnabled (void)
 
void Enable (void)
 Start picture-in-picture.
 
void Disable (void)
 Stop picture-in-picture.
 
void Toggle (void)
 Toggle picture-in-picture.
 
void ChannelChange (int)
 Change the pip channel.
 
void ChannelSwap (bool)
 Swap the pip channel with main live channel.
 
void SetSize (void)
 Set size and position for the pip window.
 
void SwapPosition (void)
 Swap pip between normal and alternative position.
 
void HandleEvent (enum PipState)
 Handle the pip event.
 

Private Member Functions

int Start (int)
 Create a new pip receiver and render the pip stream.
 
void Stop (void)
 Delete the pip receiver, clear decoder and display buffers and disable rendering the pip window.
 
void HandleEnable (bool)
 Enable/ disable picture-in-picture.
 
void HandleChannelChange (int)
 Change the pip channel.
 

Private Attributes

cSoftHdDevicem_pDevice
 pointer to device
 
IEventReceiverm_pEventReceiver
 pointer to event receiver
 
cPipReceiverm_pPipReceiver = nullptr
 pointer to pip receiver
 
int m_pipChannelNum
 current pip channel number
 
const cChannel * m_pPipChannel
 current pip channel
 
bool m_active = false
 true, if pip is active
 

Detailed Description

cPipHandler - class for pip

Definition at line 55 of file pipreceiver.h.

Constructor & Destructor Documentation

◆ cPipHandler()

cPipHandler::cPipHandler ( cSoftHdDevice device)

cPipHandler constructor

Definition at line 159 of file pipreceiver.cpp.

◆ ~cPipHandler()

cPipHandler::~cPipHandler ( void  )
virtual

Definition at line 165 of file pipreceiver.cpp.

References Stop().

Member Function Documentation

◆ ChannelChange()

void cPipHandler::ChannelChange ( int  direction)

Change the pip channel.

Parameters
direction1: channel up, -1: channel down

Definition at line 388 of file pipreceiver.cpp.

References m_active, 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 407 of file pipreceiver.cpp.

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

Referenced by cSoftHdDevice::PipChannelSwap().

◆ Disable()

void cPipHandler::Disable ( void  )

Stop picture-in-picture.

Definition at line 367 of file pipreceiver.cpp.

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

Referenced by cSoftHdDevice::PipDisable().

◆ Enable()

void cPipHandler::Enable ( void  )

Start picture-in-picture.

Definition at line 356 of file pipreceiver.cpp.

References m_active, 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 311 of file pipreceiver.cpp.

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

Referenced by 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 287 of file pipreceiver.cpp.

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

Referenced by HandleEvent().

◆ HandleEvent()

◆ IsEnabled()

bool cPipHandler::IsEnabled ( void  )
inline

Definition at line 61 of file pipreceiver.h.

References m_active.

Referenced by cSoftHdDevice::PipIsEnabled().

◆ SetSize()

void cPipHandler::SetSize ( void  )

Set size and position for the pip window.

Definition at line 429 of file pipreceiver.cpp.

References 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 225 of file pipreceiver.cpp.

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

Referenced by HandleChannelChange(), HandleEnable(), and 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 264 of file pipreceiver.cpp.

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

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

◆ SwapPosition()

void cPipHandler::SwapPosition ( void  )

Swap pip between normal and alternative position.

Definition at line 437 of file pipreceiver.cpp.

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

Referenced by cSoftHdDevice::PipSwapPosition().

◆ Toggle()

void cPipHandler::Toggle ( void  )

Toggle picture-in-picture.

Definition at line 378 of file pipreceiver.cpp.

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

Referenced by cSoftHdDevice::PipToggle().

Member Data Documentation

◆ m_active

bool cPipHandler::m_active = false
private

true, if pip is active

Definition at line 77 of file pipreceiver.h.

Referenced by ChannelChange(), ChannelSwap(), Disable(), Enable(), HandleChannelChange(), HandleEnable(), HandleEvent(), IsEnabled(), Start(), and Stop().

◆ m_pDevice

cSoftHdDevice* cPipHandler::m_pDevice
private

pointer to device

Definition at line 72 of file pipreceiver.h.

Referenced by HandleEnable(), HandleEvent(), Start(), and Stop().

◆ m_pEventReceiver

IEventReceiver* cPipHandler::m_pEventReceiver
private

pointer to event receiver

Definition at line 73 of file pipreceiver.h.

Referenced by ChannelChange(), ChannelSwap(), Disable(), Enable(), SetSize(), SwapPosition(), and Toggle().

◆ m_pipChannelNum

int cPipHandler::m_pipChannelNum
private

current pip channel number

Definition at line 75 of file pipreceiver.h.

Referenced by HandleEnable(), and Start().

◆ m_pPipChannel

const cChannel* cPipHandler::m_pPipChannel
private

current pip channel

Definition at line 76 of file pipreceiver.h.

Referenced by ChannelSwap(), HandleChannelChange(), Start(), and Stop().

◆ m_pPipReceiver

cPipReceiver* cPipHandler::m_pPipReceiver = nullptr
private

pointer to pip receiver

Definition at line 74 of file pipreceiver.h.

Referenced by Start(), and Stop().


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