vdr-plugin-drmdevice 2.0.0-46418f1
pip.h
Go to the documentation of this file.
1// SPDX-License-Identifier: AGPL-3.0-or-later
2
12#ifndef __DRMDEVICE_PIP_RECEIVER_H
13#define __DRMDEVICE_PIP_RECEIVER_H
14
15#include <atomic>
16
17#include <vdr/receiver.h>
18
19class cOutputDevice;
20
31class cPipReceiver : public cReceiver {
32public:
34 virtual ~cPipReceiver(void);
35
36protected:
37 virtual void Activate(bool);
38 virtual void Receive(const uchar *, int);
39
40private:
45
46 int ParseTs(const uchar *, int);
47 int PlayTs(const uchar *, int);
48};
49
56public:
58 virtual ~cPipHandler(void);
59
60 void Enable(void);
61 void Disable(void);
62 void Toggle(void);
63 void ChannelChange(int);
64 void ChannelSwap(bool);
65 void SetSize(void);
66 void SwapPosition(void);
67
68 bool IsEnabled(void) { return m_active; };
69
70private:
75 std::atomic<bool> m_active = false;
76
77 int Start(int);
78 void Stop(void);
79 void HandleEnable(bool);
80 void HandleChannelChange(int);
81};
82
83#endif
Output Device Implementation.
Definition device.h:72
PiP Stream Handler.
Definition pip.h:55
void ChannelChange(int)
Change the pip channel.
Definition pip.cpp:338
void SwapPosition(void)
Swap pip between normal and alternative position.
Definition pip.cpp:385
cOutputDevice * m_pDevice
pointer to device
Definition pip.h:71
void HandleEnable(bool)
Enable/ disable picture-in-picture.
Definition pip.cpp:241
cPipReceiver * m_pPipReceiver
pointer to pip receiver
Definition pip.h:72
void Toggle(void)
Toggle picture-in-picture.
Definition pip.cpp:328
std::atomic< bool > m_active
true, if pip is active
Definition pip.h:75
void HandleChannelChange(int)
Change the pip channel.
Definition pip.cpp:263
const cChannel * m_pPipChannel
current pip channel
Definition pip.h:74
virtual ~cPipHandler(void)
Definition pip.cpp:163
int Start(int)
Create a new pip receiver and render the pip stream.
Definition pip.cpp:177
void Disable(void)
Stop picture-in-picture.
Definition pip.cpp:317
void ChannelSwap(bool)
Swap the pip channel with main live channel.
Definition pip.cpp:354
bool IsEnabled(void)
Definition pip.h:68
int m_pipChannelNum
current pip channel number
Definition pip.h:73
void Stop(void)
Delete the pip receiver, clear decoder and display buffers and disable rendering the pip window.
Definition pip.cpp:219
void Enable(void)
Start picture-in-picture.
Definition pip.cpp:306
void SetSize(void)
Set size and position for the pip window.
Definition pip.cpp:377
Receiver for PiP Stream.
Definition pip.h:31
cTsToPes m_pTsToPesVideo
TS to PES converter.
Definition pip.h:42
virtual ~cPipReceiver(void)
Detach the pip receiver.
Definition pip.cpp:42
int PlayTs(const uchar *, int)
Get the pes payload and send it to the player.
Definition pip.cpp:136
uint64_t m_lastErrorReport
tracks time since last error report
Definition pip.h:43
virtual void Activate(bool)
Called before the receiver gets attached or after it got detached.
Definition pip.cpp:53
int ParseTs(const uchar *, int)
Parse the ts stream and send it to the pes player.
Definition pip.cpp:91
virtual void Receive(const uchar *, int)
Receive data from the receiver.
Definition pip.cpp:66
cOutputDevice * m_pDevice
pointer to device
Definition pip.h:41
int m_numLostPackets
tracks lost packets
Definition pip.h:44