Made showing black picture configurable.

This commit is contained in:
Johns 2012-04-20 15:40:14 +02:00
parent 44ca71fedb
commit 53f22a2ed2
5 changed files with 39 additions and 6 deletions

View File

@ -1,6 +1,7 @@
User johns
Date:
Made showing black picture configurable.
Show black picture, if no video stream is available.
Setup split into foldable sections.
Adds show cursor on pointer move and hide after 200ms.

View File

@ -219,6 +219,10 @@ Setup: /etc/vdr/setup.conf
0 disable soft start of audio/video sync
1 enable soft start of audio/video sync
softhddevice.BlackPicture = 0
0 disable black picture during channel switch
1 enable black picture during channel switch
VideoDisplayFormat = ?
0 pan and scan
1 letter box

View File

@ -82,6 +82,7 @@ static uint32_t ConfigVideoBackground; ///< config video background color
static char ConfigVideoStudioLevels; ///< config use studio levels
static char ConfigVideo60HzMode; ///< config use 60Hz display mode
static char ConfigVideoSoftStartSync; ///< config use softstart sync
static char ConfigVideoBlackPicture; ///< config enable black picture mode
/// config deinterlace
static int ConfigVideoDeinterlace[RESOLUTIONS];
@ -490,6 +491,7 @@ class cMenuSetupSoft:public cMenuSetupPage
int StudioLevels;
int _60HzMode;
int SoftStartSync;
int BlackPicture;
int ResolutionShown[RESOLUTIONS];
int Scaling[RESOLUTIONS];
@ -639,6 +641,8 @@ void cMenuSetupSoft::Create(void)
trVDR("no"), trVDR("yes")));
Add(new cMenuEditBoolItem(tr("Soft start a/v sync"), &SoftStartSync,
trVDR("no"), trVDR("yes")));
Add(new cMenuEditBoolItem(tr("Black during channel switch"),
&BlackPicture, trVDR("no"), trVDR("yes")));
for (i = 0; i < RESOLUTIONS; ++i) {
Add(CollapsedItem(resolution[i], ResolutionShown[i]));
@ -779,6 +783,7 @@ cMenuSetupSoft::cMenuSetupSoft(void)
StudioLevels = ConfigVideoStudioLevels;
_60HzMode = ConfigVideo60HzMode;
SoftStartSync = ConfigVideoSoftStartSync;
BlackPicture = ConfigVideoBlackPicture;
for (i = 0; i < RESOLUTIONS; ++i) {
ResolutionShown[i] = 0;
@ -853,6 +858,8 @@ void cMenuSetupSoft::Store(void)
VideoSet60HzMode(ConfigVideo60HzMode);
SetupStore("SoftStartSync", ConfigVideoSoftStartSync = SoftStartSync);
VideoSetSoftStartSync(ConfigVideoSoftStartSync);
SetupStore("BlackPicture", ConfigVideoBlackPicture = BlackPicture);
VideoSetBlackPicture(ConfigVideoBlackPicture);
for (i = 0; i < RESOLUTIONS; ++i) {
char buf[128];
@ -1923,6 +1930,10 @@ bool cPluginSoftHdDevice::SetupParse(const char *name, const char *value)
VideoSetSoftStartSync(ConfigVideoSoftStartSync = atoi(value));
return true;
}
if (!strcasecmp(name, "BlackPicture")) {
VideoSetBlackPicture(ConfigVideoBlackPicture = atoi(value));
return true;
}
for (i = 0; i < RESOLUTIONS; ++i) {
char buf[128];

26
video.c
View File

@ -348,6 +348,8 @@ static VideoZoomModes Video4to3ZoomMode;
static char Video60HzMode; ///< handle 60hz displays
static char VideoSoftStartSync; ///< soft start sync audio/video
static const int VideoSoftStartFrames = 120; ///< soft start frames
static char VideoShowBlackPicture; ///< flag show black picture
static xcb_atom_t WmDeleteWindowAtom; ///< WM delete message atom
static xcb_atom_t NetWmState; ///< wm-state message atom
@ -4459,7 +4461,7 @@ static void VaapiSyncDecoder(VaapiDecoder * decoder)
decoder->TrickCounter = decoder->TrickSpeed;
}
// at start of new video stream, soft or hard sync video to audio
if (!VideoSoftStartSync && decoder->FramesDisplayed < 60
if (!VideoSoftStartSync && decoder->FramesDisplayed < VideoSoftStartFrames
&& (audio_clock == (int64_t) AV_NOPTS_VALUE
|| video_clock > audio_clock + VideoAudioDelay + 120 * 90)) {
err =
@ -4510,7 +4512,7 @@ static void VaapiSyncDecoder(VaapiDecoder * decoder)
"duping frame (%d/%d) %d v-buf\n"), decoder->FramesDuped,
decoder->FrameCounter, VideoGetBuffers());
if (decoder->Closing < -300) {
atomic_set(&decoder->SurfacesFilled, 0);
atomic_set(&decoder->SurfacesFilled, 1);
}
}
goto out;
@ -7545,8 +7547,10 @@ static void VdpauDisplayFrame(void)
// need 1 frame for progressive, 3 frames for interlaced
if (filled < 1 + 2 * decoder->Interlaced) {
// FIXME: rewrite MixVideo to support less surfaces
VdpauBlackSurface(decoder);
VdpauMessage(3, "video/vdpau: black surface displayed\n");
if (VideoShowBlackPicture || decoder->Closing < -300) {
VdpauBlackSurface(decoder);
VdpauMessage(3, "video/vdpau: black surface displayed\n");
}
continue;
}
@ -7681,7 +7685,7 @@ static void VdpauSyncDecoder(VdpauDecoder * decoder)
decoder->TrickCounter = decoder->TrickSpeed;
}
// at start of new video stream, soft or hard sync video to audio
if (!VideoSoftStartSync && decoder->FramesDisplayed < 60
if (!VideoSoftStartSync && decoder->FramesDisplayed < VideoSoftStartFrames
&& (audio_clock == (int64_t) AV_NOPTS_VALUE
|| video_clock > audio_clock + VideoAudioDelay + 120 * 90)) {
err =
@ -7732,7 +7736,7 @@ static void VdpauSyncDecoder(VdpauDecoder * decoder)
"duping frame (%d/%d) %d v-buf\n"), decoder->FramesDuped,
decoder->FrameCounter, VideoGetBuffers());
if (decoder->Closing < -300) {
atomic_set(&decoder->SurfacesFilled, 0);
atomic_set(&decoder->SurfacesFilled, 1);
}
}
goto out;
@ -9608,6 +9612,16 @@ void VideoSetSoftStartSync(int onoff)
VideoSoftStartSync = onoff;
}
///
/// Set show black picture during channel switch.
///
/// @param onoff enable / disable black picture.
///
void VideoSetBlackPicture(int onoff)
{
VideoShowBlackPicture = onoff;
}
///
/// Set video output position.
///

View File

@ -90,6 +90,9 @@ extern void VideoSet60HzMode(int);
/// Set soft start audio/video sync.
extern void VideoSetSoftStartSync(int);
/// Set show black picture during channel switch.
extern void VideoSetBlackPicture(int);
/// Set video output position.
extern void VideoSetOutputPosition(int, int, int, int);