1
0
mirror of https://github.com/jojo61/vdr-plugin-softhdcuvid.git synced 2023-10-10 13:37:41 +02:00

More info in Menue

This commit is contained in:
jojo61 2020-02-02 13:26:51 +01:00
parent 9d0417045e
commit 7ce842b989
5 changed files with 44 additions and 12 deletions

View File

@ -2153,6 +2153,10 @@ void cSoftHdMenu::Create(void)
int dropped;
int counter;
float frametime;
int width,height;
int color;
int eotf;
char *colorstr, *eotfstr;
current = Current(); // get current menu item index
Clear(); // clear the menu
@ -2187,10 +2191,30 @@ void cSoftHdMenu::Create(void)
#endif
Add(new cOsdItem(NULL, osUnknown, false));
Add(new cOsdItem(NULL, osUnknown, false));
GetStats(&missed, &duped, &dropped, &counter, &frametime);
GetStats(&missed, &duped, &dropped, &counter, &frametime, &width, &height, &color,&eotf);
switch (color) {
case AVCOL_SPC_RGB:
colorstr = strdup("BT 601");
eotfstr = strdup("BT 1886");
break;
case AVCOL_SPC_BT709:
case AVCOL_SPC_UNSPECIFIED: // comes with UHD
colorstr = strdup("BT 709");
eotfstr = strdup("BT 1886");
break;
case AVCOL_SPC_BT2020_NCL:
colorstr = strdup("BT 2020");
eotfstr = strdup("HDR-HLG");
break;
default: // fallback
colorstr = strdup("Fallback BT 709");
eotfstr = strdup("BT 1886");
break;
}
Add(new cOsdItem(cString::sprintf(tr(" Frames missed(%d) duped(%d) dropped(%d) total(%d)"), missed, duped, dropped,
counter), osUnknown, false));
Add(new cOsdItem(cString::sprintf(tr(" Frame Process time %2.2fms"), frametime), osUnknown, false));
Add(new cOsdItem(cString::sprintf(tr(" Video %dx%d Color: %s Gamma: %s"), width, height, colorstr, eotfstr), osUnknown, false));
// Add(new cOsdItem(cString::sprintf(tr(" Frame Process time %2.2fms"), frametime), osUnknown, false));
SetCurrent(Get(current)); // restore selected menu entry
Display(); // display build menu
}

View File

@ -3370,15 +3370,19 @@ void Resume(void)
** @param[out] dropped dropped frames
** @param[out] count number of decoded frames
*/
void GetStats(int *missed, int *duped, int *dropped, int *counter, float *frametime)
void GetStats(int *missed, int *duped, int *dropped, int *counter, float *frametime, int *width, int *height, int *color, int *eotf)
{
*missed = 0;
*duped = 0;
*dropped = 0;
*counter = 0;
*frametime = 0.0f;
*width = 0;
*height = 0;
*color = NULL;
*eotf = NULL;
if (MyVideoStream->HwDecoder) {
VideoGetStats(MyVideoStream->HwDecoder, missed, duped, dropped, counter, frametime);
VideoGetStats(MyVideoStream->HwDecoder, missed, duped, dropped, counter, frametime, width, height, color, eotf);
}
}

View File

@ -96,7 +96,7 @@ extern "C"
extern void Resume(void);
/// Get decoder statistics
extern void GetStats(int *, int *, int *, int *, float *);
extern void GetStats(int *, int *, int *, int *, float *, int *, int *, int *, int *);
/// C plugin scale video
extern void ScaleVideo(int, int, int, int);

16
video.c
View File

@ -297,7 +297,7 @@ typedef struct _video_module_
void (*const ResetStart)(const VideoHwDecoder *);
void (*const SetTrickSpeed)(const VideoHwDecoder *, int);
uint8_t *(*const GrabOutput)(int *, int *, int *, int);
void (*const GetStats)(VideoHwDecoder *, int *, int *, int *, int *, float *);
void (*const GetStats)(VideoHwDecoder *, int *, int *, int *, int *, float *, int *, int *, int *, int *);
void (*const SetBackground)(uint32_t);
void (*const SetVideoMode)(void);
@ -4254,13 +4254,17 @@ static void CuvidSetTrickSpeed(CuvidDecoder * decoder, int speed)
/// @param[out] dropped dropped frames
/// @param[out] count number of decoded frames
///
void CuvidGetStats(CuvidDecoder * decoder, int *missed, int *duped, int *dropped, int *counter, float *frametime)
void CuvidGetStats(CuvidDecoder * decoder, int *missed, int *duped, int *dropped, int *counter, float *frametime, int *width, int *height, int *color, int * eotf)
{
*missed = decoder->FramesMissed;
*duped = decoder->FramesDuped;
*dropped = decoder->FramesDropped;
*counter = decoder->FrameCounter;
*frametime = decoder->Frameproc;
*width = decoder->InputWidth;
*height = decoder->InputHeight;
*color = decoder->ColorSpace;
*eotf = 0;
}
///
@ -4651,7 +4655,7 @@ static const VideoModule CuvidModule = {
.SetTrickSpeed = (void (*const)(const VideoHwDecoder *, int))CuvidSetTrickSpeed,
.GrabOutput = CuvidGrabOutputSurface,
.GetStats = (void (*const)(VideoHwDecoder *, int *, int *, int *,
int *, float *))CuvidGetStats,
int *, float *, int *, int *, int * , int *))CuvidGetStats,
.SetBackground = CuvidSetBackground,
.SetVideoMode = CuvidSetVideoMode,
@ -4819,7 +4823,7 @@ static const VideoModule NoopModule = {
.SetTrickSpeed =(void (*const)(const VideoHwDecoder *, int))NoopSetTrickSpeed,
.GrabOutput = NoopGrabOutputSurface,
.GetStats = (void (*const)(VideoHwDecoder *, int *, int *, int *,
int *, float *))NoopGetStats,
int *, float *, int *, int *, int * , int *))NoopGetStats,
#endif
.SetBackground = NoopSetBackground,
.SetVideoMode = NoopVoid,
@ -5846,9 +5850,9 @@ uint8_t *VideoGrabService(int *size, int *width, int *height)
/// @param[out] dropped dropped frames
/// @param[out] count number of decoded frames
///
void VideoGetStats(VideoHwDecoder * hw_decoder, int *missed, int *duped, int *dropped, int *counter, float *frametime)
void VideoGetStats(VideoHwDecoder * hw_decoder, int *missed, int *duped, int *dropped, int *counter, float *frametime, int *width, int *height, int *color, int *eotf)
{
VideoUsedModule->GetStats(hw_decoder, missed, duped, dropped, counter, frametime);
VideoUsedModule->GetStats(hw_decoder, missed, duped, dropped, counter, frametime, width, height , color, eotf);
}
///

View File

@ -219,7 +219,7 @@ extern uint8_t *VideoGrab(int *, int *, int *, int);
extern uint8_t *VideoGrabService(int *, int *, int *);
/// Get decoder statistics.
extern void VideoGetStats(VideoHwDecoder *, int *, int *, int *, int *, float *);
extern void VideoGetStats(VideoHwDecoder *, int *, int *, int *, int *, float *, int *, int *, int *, int *);
/// Get video stream size
extern void VideoGetVideoSize(VideoHwDecoder *, int *, int *, int *, int *);