forked from zillevdr/vdr-plugin-softhddevice-drm
-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathpipreceiver.h
More file actions
83 lines (67 loc) · 1.76 KB
/
Copy pathpipreceiver.h
File metadata and controls
83 lines (67 loc) · 1.76 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
// SPDX-License-Identifier: AGPL-3.0-or-later
/**
* @file pipreceiver.h
* PiP (Picture-in-Picture) Interface Header File
*
* @copyright 2025 - 2026 by Andreas Baierl. All Rights Reserved.
*
* @license{AGPL-3.0-or-later}
*/
#ifndef __PIPRECEIVER_H
#define __PIPRECEIVER_H
#include <atomic>
#include <vdr/receiver.h>
class cSoftHdDevice;
/**
* Picture-in-Picture
* @defgroup pip PiP Handler
*/
/**
* Receiver for PiP Stream
*
* @ingroup pip
*/
class cPipReceiver : public cReceiver {
public:
cPipReceiver(const cChannel *, cSoftHdDevice *);
virtual ~cPipReceiver(void);
protected:
virtual void Activate(bool);
virtual void Receive(const uchar *, int);
private:
cSoftHdDevice *m_pDevice; ///< pointer to device
cTsToPes m_pTsToPesVideo; ///< TS to PES converter
uint64_t m_lastErrorReport = 0; ///< tracks time since last error report
int m_numLostPackets = 0; ///< tracks lost packets
int ParseTs(const uchar *, int);
int PlayTs(const uchar *, int);
};
/**
* PiP Stream Handler
*
* @ingroup pip
*/
class cPipHandler {
public:
cPipHandler(cSoftHdDevice *);
virtual ~cPipHandler(void);
void Enable(void);
void Disable(void);
void Toggle(void);
void ChannelChange(int);
void ChannelSwap(bool);
void SetSize(void);
void SwapPosition(void);
bool IsEnabled(void) { return m_active; };
private:
cSoftHdDevice *m_pDevice; ///< pointer to device
cPipReceiver *m_pPipReceiver = nullptr; ///< pointer to pip receiver
int m_pipChannelNum = 0; ///< current pip channel number
const cChannel *m_pPipChannel; ///< current pip channel
std::atomic<bool> m_active = false; ///< true, if pip is active
int Start(int);
void Stop(void);
void HandleEnable(bool);
void HandleChannelChange(int);
};
#endif