mirror of
https://github.com/vdr-projects/vdr.git
synced 2025-03-01 10:50:46 +00:00
Now distinguishing between frames with errors and completely missing frames
This commit is contained in:
parent
6f6b05ffcb
commit
52c4816c9c
1
HISTORY
1
HISTORY
@ -9999,3 +9999,4 @@ Video Disk Recorder Revision History
|
|||||||
- Updated the Italian OSD texts (thanks to Diego Pierotto).
|
- Updated the Italian OSD texts (thanks to Diego Pierotto).
|
||||||
- Moved error checking from recorder.c to remux.c.
|
- Moved error checking from recorder.c to remux.c.
|
||||||
- The number of errors in a recording now represents the number of broken frames.
|
- The number of errors in a recording now represents the number of broken frames.
|
||||||
|
- Now distinguishing between frames with errors and completely missing frames.
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
* See the main source file 'vdr.c' for copyright information and
|
* See the main source file 'vdr.c' for copyright information and
|
||||||
* how to reach the author.
|
* how to reach the author.
|
||||||
*
|
*
|
||||||
* $Id: recorder.c 5.8 2024/09/17 09:39:50 kls Exp $
|
* $Id: recorder.c 5.9 2024/09/17 11:30:28 kls Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "recorder.h"
|
#include "recorder.h"
|
||||||
@ -195,11 +195,14 @@ void cRecorder::Action(void)
|
|||||||
if (!NextFile())
|
if (!NextFile())
|
||||||
break;
|
break;
|
||||||
int PreviousErrors = 0;
|
int PreviousErrors = 0;
|
||||||
if (frameDetector->NewFrame(&PreviousErrors)) {
|
int MissingFrames = 0;
|
||||||
|
if (frameDetector->NewFrame(&PreviousErrors, &MissingFrames)) {
|
||||||
if (index)
|
if (index)
|
||||||
index->Write(frameDetector->IndependentFrame(), fileName->Number(), fileSize);
|
index->Write(frameDetector->IndependentFrame(), fileName->Number(), fileSize);
|
||||||
if (PreviousErrors)
|
if (PreviousErrors)
|
||||||
errors++;
|
errors++;
|
||||||
|
if (MissingFrames)
|
||||||
|
errors++;
|
||||||
}
|
}
|
||||||
if (frameDetector->IndependentFrame()) {
|
if (frameDetector->IndependentFrame()) {
|
||||||
recordFile->Write(patPmtGenerator.GetPat(), TS_SIZE);
|
recordFile->Write(patPmtGenerator.GetPat(), TS_SIZE);
|
||||||
|
12
remux.c
12
remux.c
@ -4,7 +4,7 @@
|
|||||||
* See the main source file 'vdr.c' for copyright information and
|
* See the main source file 'vdr.c' for copyright information and
|
||||||
* how to reach the author.
|
* how to reach the author.
|
||||||
*
|
*
|
||||||
* $Id: remux.c 5.9 2024/09/16 19:56:37 kls Exp $
|
* $Id: remux.c 5.10 2024/09/17 11:30:28 kls Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "remux.h"
|
#include "remux.h"
|
||||||
@ -2007,6 +2007,7 @@ private:
|
|||||||
int lastFwdRef;
|
int lastFwdRef;
|
||||||
int errors;
|
int errors;
|
||||||
int previousErrors;
|
int previousErrors;
|
||||||
|
int missingFrames;
|
||||||
void Report(const char *Message, int NumErrors = 1);
|
void Report(const char *Message, int NumErrors = 1);
|
||||||
public:
|
public:
|
||||||
cFrameChecker(void);
|
cFrameChecker(void);
|
||||||
@ -2014,6 +2015,7 @@ public:
|
|||||||
void CheckTs(const uchar *Data, int Length);
|
void CheckTs(const uchar *Data, int Length);
|
||||||
void CheckFrame(const uchar *Data, int Length);
|
void CheckFrame(const uchar *Data, int Length);
|
||||||
int PreviousErrors(void) { return previousErrors; }
|
int PreviousErrors(void) { return previousErrors; }
|
||||||
|
int MissingFrames(void) { return missingFrames; }
|
||||||
};
|
};
|
||||||
|
|
||||||
cFrameChecker::cFrameChecker(void)
|
cFrameChecker::cFrameChecker(void)
|
||||||
@ -2024,6 +2026,7 @@ cFrameChecker::cFrameChecker(void)
|
|||||||
lastFwdRef = 0;
|
lastFwdRef = 0;
|
||||||
errors = 0;
|
errors = 0;
|
||||||
previousErrors = 0;
|
previousErrors = 0;
|
||||||
|
missingFrames = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void cFrameChecker::Report(const char *Message, int NumErrors)
|
void cFrameChecker::Report(const char *Message, int NumErrors)
|
||||||
@ -2040,7 +2043,8 @@ void cFrameChecker::CheckTs(const uchar *Data, int Length)
|
|||||||
|
|
||||||
void cFrameChecker::CheckFrame(const uchar *Data, int Length)
|
void cFrameChecker::CheckFrame(const uchar *Data, int Length)
|
||||||
{
|
{
|
||||||
previousErrors = tsChecker.Errors() + errors;
|
previousErrors = tsChecker.Errors();
|
||||||
|
missingFrames = errors;
|
||||||
errors = 0;
|
errors = 0;
|
||||||
tsChecker.Clear();
|
tsChecker.Clear();
|
||||||
int64_t Pts = TsGetPts(Data, Length);
|
int64_t Pts = TsGetPts(Data, Length);
|
||||||
@ -2143,11 +2147,13 @@ void cFrameDetector::SetPid(int Pid, int Type)
|
|||||||
esyslog("ERROR: unknown stream type %d (PID %d) in frame detector", type, pid);
|
esyslog("ERROR: unknown stream type %d (PID %d) in frame detector", type, pid);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool cFrameDetector::NewFrame(int *PreviousErrors)
|
bool cFrameDetector::NewFrame(int *PreviousErrors, int * MissingFrames)
|
||||||
{
|
{
|
||||||
if (newFrame) {
|
if (newFrame) {
|
||||||
if (PreviousErrors)
|
if (PreviousErrors)
|
||||||
*PreviousErrors = frameChecker->PreviousErrors();
|
*PreviousErrors = frameChecker->PreviousErrors();
|
||||||
|
if (MissingFrames)
|
||||||
|
*MissingFrames = frameChecker->MissingFrames();
|
||||||
}
|
}
|
||||||
return newFrame;
|
return newFrame;
|
||||||
}
|
}
|
||||||
|
10
remux.h
10
remux.h
@ -4,7 +4,7 @@
|
|||||||
* See the main source file 'vdr.c' for copyright information and
|
* See the main source file 'vdr.c' for copyright information and
|
||||||
* how to reach the author.
|
* how to reach the author.
|
||||||
*
|
*
|
||||||
* $Id: remux.h 5.4 2024/09/16 19:56:37 kls Exp $
|
* $Id: remux.h 5.5 2024/09/17 11:30:28 kls Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef __REMUX_H
|
#ifndef __REMUX_H
|
||||||
@ -565,11 +565,13 @@ public:
|
|||||||
///< Analyze() needs to be called again with more actual data.
|
///< Analyze() needs to be called again with more actual data.
|
||||||
bool Synced(void) { return synced; }
|
bool Synced(void) { return synced; }
|
||||||
///< Returns true if the frame detector has synced on the data stream.
|
///< Returns true if the frame detector has synced on the data stream.
|
||||||
bool NewFrame(int *PreviousErrors = NULL);
|
bool NewFrame(int *PreviousErrors = NULL, int * MissingFrames = NULL);
|
||||||
///< Returns true if the data given to the last call to Analyze() started a
|
///< Returns true if the data given to the last call to Analyze() started a
|
||||||
///< new frame. If PreviousErrors is given, it will be set to the number of errors in
|
///< new frame. If PreviousErrors is given, it will be set to the number of errors in
|
||||||
///< the previous frame.
|
///< the previous frame. If MissingFrames is given, it will be set to the number of
|
||||||
///< The result returned in PreviousErrors is only valid if the function returns true.
|
///< missing frames between the previous frame and this one.
|
||||||
|
///< The results returned in PreviousErrors and MissingFrames are only valid if the
|
||||||
|
///< function returns true.
|
||||||
bool IndependentFrame(void) { return independentFrame; }
|
bool IndependentFrame(void) { return independentFrame; }
|
||||||
///< Returns true if a new frame was detected and this is an independent frame
|
///< Returns true if a new frame was detected and this is an independent frame
|
||||||
///< (i.e. one that can be displayed by itself, without using data from any
|
///< (i.e. one that can be displayed by itself, without using data from any
|
||||||
|
Loading…
x
Reference in New Issue
Block a user