diff options
Diffstat (limited to 'coreengine/viewelement.c')
| -rw-r--r-- | coreengine/viewelement.c | 61 |
1 files changed, 57 insertions, 4 deletions
diff --git a/coreengine/viewelement.c b/coreengine/viewelement.c index 370a58f..975757c 100644 --- a/coreengine/viewelement.c +++ b/coreengine/viewelement.c @@ -596,17 +596,17 @@ bool RecordingIsHD(const cEvent* event) { int type = -1; // #1: HVEC (stream content: 9) - Component = Components->GetComponent(0, 9, 0); + Component = Components->GetComponent(0, 9, 0); // recording info: "X 9 <type>" if (Component) { isHD = true; // HVEC is always HD, type 4|5|6|7 would be even UHD (see below dedicated detection function) } else { // #2: H.264 (stream content: 5) - Component = Components->GetComponent(0, 5, 0); + Component = Components->GetComponent(0, 5, 0); // recording info: "X 5 <type>" if (Component) { type = Component->type; } else { // #3: MPEG2 (stream content: 1) - Component = Components->GetComponent(0, 1, 0); + Component = Components->GetComponent(0, 1, 0); // recording info: "X 1 <type>" if (Component) { type = Component->type; }; @@ -641,7 +641,7 @@ bool RecordingIsUHD(const cEvent* event) { int type = -1; // HVEC (stream content: 9) - Component = Components->GetComponent(0, 9, 0); + Component = Components->GetComponent(0, 9, 0); // recording info: "X 9 <type>" if (Component) { type = Component->type; }; @@ -656,3 +656,56 @@ bool RecordingIsUHD(const cEvent* event) { }; return isUHD; }; + +bool RecordingIsRadio(const cEvent* event) { + // detect Radio from 'info' + bool isRadio = false; + bool hasAudio = false; + bool hasVideo = false; + cComponents *Components = (cComponents *)event->Components(); + if (Components) { + // Stream: 1 = MPEG2-Video, 2 = MPEG2 Audio, 3 = Untertitel, 4 = AC3-Audio, 5 = H.264-Video, 6 = HEAAC-Audio, 7 = DTS/DTS HD audio, 8 = SRM/CPCM data, 9 = HEVC Video, AC4 Audio + + tComponent *Component; + + Component = Components->GetComponent(0, 2, 0); // recording info: "X 2 <type>" + if (Component) { + hasAudio = true; + }; + + Component = Components->GetComponent(0, 4, 0); // recording info: "X 4 <type>" + if (Component) { + hasAudio = true; + }; + + Component = Components->GetComponent(0, 6, 0); // recording info: "X 6 <type>" + if (Component) { + hasAudio = true; + }; + + Component = Components->GetComponent(0, 7, 0); // recording info: "X 7 <type>" + if (Component) { + hasAudio = true; + }; + + Component = Components->GetComponent(0, 1, 0); // recording info: "X 1 <type>" + if (Component) { + hasVideo = true; + }; + + Component = Components->GetComponent(0, 5, 0); // recording info: "X 5 <type>" + if (Component) { + hasVideo = true; + }; + + Component = Components->GetComponent(0, 9, 0); // recording info: "X 9 <type>" + if (Component) { + hasVideo = true; + }; + }; + + if ((hasAudio == true) && (hasVideo == false)) + isRadio = true; + + return isRadio; +}; |
