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:
parent
9d0417045e
commit
7ce842b989
@ -2153,6 +2153,10 @@ void cSoftHdMenu::Create(void)
|
|||||||
int dropped;
|
int dropped;
|
||||||
int counter;
|
int counter;
|
||||||
float frametime;
|
float frametime;
|
||||||
|
int width,height;
|
||||||
|
int color;
|
||||||
|
int eotf;
|
||||||
|
char *colorstr, *eotfstr;
|
||||||
|
|
||||||
current = Current(); // get current menu item index
|
current = Current(); // get current menu item index
|
||||||
Clear(); // clear the menu
|
Clear(); // clear the menu
|
||||||
@ -2187,10 +2191,30 @@ void cSoftHdMenu::Create(void)
|
|||||||
#endif
|
#endif
|
||||||
Add(new cOsdItem(NULL, osUnknown, false));
|
Add(new cOsdItem(NULL, osUnknown, false));
|
||||||
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,
|
Add(new cOsdItem(cString::sprintf(tr(" Frames missed(%d) duped(%d) dropped(%d) total(%d)"), missed, duped, dropped,
|
||||||
counter), osUnknown, false));
|
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
|
SetCurrent(Get(current)); // restore selected menu entry
|
||||||
Display(); // display build menu
|
Display(); // display build menu
|
||||||
}
|
}
|
||||||
|
@ -3370,15 +3370,19 @@ void Resume(void)
|
|||||||
** @param[out] dropped dropped frames
|
** @param[out] dropped dropped frames
|
||||||
** @param[out] count number of decoded 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;
|
*missed = 0;
|
||||||
*duped = 0;
|
*duped = 0;
|
||||||
*dropped = 0;
|
*dropped = 0;
|
||||||
*counter = 0;
|
*counter = 0;
|
||||||
*frametime = 0.0f;
|
*frametime = 0.0f;
|
||||||
|
*width = 0;
|
||||||
|
*height = 0;
|
||||||
|
*color = NULL;
|
||||||
|
*eotf = NULL;
|
||||||
if (MyVideoStream->HwDecoder) {
|
if (MyVideoStream->HwDecoder) {
|
||||||
VideoGetStats(MyVideoStream->HwDecoder, missed, duped, dropped, counter, frametime);
|
VideoGetStats(MyVideoStream->HwDecoder, missed, duped, dropped, counter, frametime, width, height, color, eotf);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -96,7 +96,7 @@ extern "C"
|
|||||||
extern void Resume(void);
|
extern void Resume(void);
|
||||||
|
|
||||||
/// Get decoder statistics
|
/// 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
|
/// C plugin scale video
|
||||||
extern void ScaleVideo(int, int, int, int);
|
extern void ScaleVideo(int, int, int, int);
|
||||||
|
|
||||||
|
16
video.c
16
video.c
@ -297,7 +297,7 @@ typedef struct _video_module_
|
|||||||
void (*const ResetStart)(const VideoHwDecoder *);
|
void (*const ResetStart)(const VideoHwDecoder *);
|
||||||
void (*const SetTrickSpeed)(const VideoHwDecoder *, int);
|
void (*const SetTrickSpeed)(const VideoHwDecoder *, int);
|
||||||
uint8_t *(*const GrabOutput)(int *, int *, int *, 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 SetBackground)(uint32_t);
|
||||||
void (*const SetVideoMode)(void);
|
void (*const SetVideoMode)(void);
|
||||||
|
|
||||||
@ -4254,13 +4254,17 @@ static void CuvidSetTrickSpeed(CuvidDecoder * decoder, int speed)
|
|||||||
/// @param[out] dropped dropped frames
|
/// @param[out] dropped dropped frames
|
||||||
/// @param[out] count number of decoded 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;
|
*missed = decoder->FramesMissed;
|
||||||
*duped = decoder->FramesDuped;
|
*duped = decoder->FramesDuped;
|
||||||
*dropped = decoder->FramesDropped;
|
*dropped = decoder->FramesDropped;
|
||||||
*counter = decoder->FrameCounter;
|
*counter = decoder->FrameCounter;
|
||||||
*frametime = decoder->Frameproc;
|
*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,
|
.SetTrickSpeed = (void (*const)(const VideoHwDecoder *, int))CuvidSetTrickSpeed,
|
||||||
.GrabOutput = CuvidGrabOutputSurface,
|
.GrabOutput = CuvidGrabOutputSurface,
|
||||||
.GetStats = (void (*const)(VideoHwDecoder *, int *, int *, int *,
|
.GetStats = (void (*const)(VideoHwDecoder *, int *, int *, int *,
|
||||||
int *, float *))CuvidGetStats,
|
int *, float *, int *, int *, int * , int *))CuvidGetStats,
|
||||||
.SetBackground = CuvidSetBackground,
|
.SetBackground = CuvidSetBackground,
|
||||||
.SetVideoMode = CuvidSetVideoMode,
|
.SetVideoMode = CuvidSetVideoMode,
|
||||||
|
|
||||||
@ -4819,7 +4823,7 @@ static const VideoModule NoopModule = {
|
|||||||
.SetTrickSpeed =(void (*const)(const VideoHwDecoder *, int))NoopSetTrickSpeed,
|
.SetTrickSpeed =(void (*const)(const VideoHwDecoder *, int))NoopSetTrickSpeed,
|
||||||
.GrabOutput = NoopGrabOutputSurface,
|
.GrabOutput = NoopGrabOutputSurface,
|
||||||
.GetStats = (void (*const)(VideoHwDecoder *, int *, int *, int *,
|
.GetStats = (void (*const)(VideoHwDecoder *, int *, int *, int *,
|
||||||
int *, float *))NoopGetStats,
|
int *, float *, int *, int *, int * , int *))NoopGetStats,
|
||||||
#endif
|
#endif
|
||||||
.SetBackground = NoopSetBackground,
|
.SetBackground = NoopSetBackground,
|
||||||
.SetVideoMode = NoopVoid,
|
.SetVideoMode = NoopVoid,
|
||||||
@ -5846,9 +5850,9 @@ uint8_t *VideoGrabService(int *size, int *width, int *height)
|
|||||||
/// @param[out] dropped dropped frames
|
/// @param[out] dropped dropped frames
|
||||||
/// @param[out] count number of decoded 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);
|
||||||
}
|
}
|
||||||
|
|
||||||
///
|
///
|
||||||
|
2
video.h
2
video.h
@ -219,7 +219,7 @@ extern uint8_t *VideoGrab(int *, int *, int *, int);
|
|||||||
extern uint8_t *VideoGrabService(int *, int *, int *);
|
extern uint8_t *VideoGrabService(int *, int *, int *);
|
||||||
|
|
||||||
/// Get decoder statistics.
|
/// 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
|
/// Get video stream size
|
||||||
extern void VideoGetVideoSize(VideoHwDecoder *, int *, int *, int *, int *);
|
extern void VideoGetVideoSize(VideoHwDecoder *, int *, int *, int *, int *);
|
||||||
|
Loading…
Reference in New Issue
Block a user