forked from rofafor/vdr-plugin-iptv
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpidscanner.h
53 lines (42 loc) · 1.2 KB
/
pidscanner.h
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
/*
* pidscanner.h: IPTV plugin for the Video Disk Recorder
*
* See the README file for copyright information and how to reach the author.
*
*/
#pragma once
#include <vdr/tools.h>
#include <vdr/channels.h>
#include "log.h"
class cPidScanner {
private:
enum {
PIDSCANNER_APID_COUNT = 5, /* minimum count of audio pid samples for pid detection */
PIDSCANNER_VPID_COUNT = 5, /* minimum count of video pid samples for pid detection */
PIDSCANNER_PID_DELTA_COUNT = 100, /* minimum count of pid samples for audio/video only pid detection */
PIDSCANNER_TIMEOUT_IN_MS = 15000 /* 15s timeout for detection */
};
cTimeMs timeoutM;
tChannelID channelIdM;
bool processM;
int vPidM;
int aPidM;
int numVpidsM;
int numApidsM;
std::set<int> audioPids;
public:
cPidScanner();
~cPidScanner();
void SetChannel(const tChannelID &channelIdP);
void Process(const uint8_t *bufP);
void Open() {
debug1("%s", __PRETTY_FUNCTION__);
audioPids.clear();
timeoutM.Set(PIDSCANNER_TIMEOUT_IN_MS);
}
void Close() {
debug1("%s", __PRETTY_FUNCTION__);
audioPids.clear();
timeoutM.Set(0);
}
};