diff options
author | Johns <johns98@gmx.net> | 2012-04-20 15:40:14 +0200 |
---|---|---|
committer | Johns <johns98@gmx.net> | 2012-04-20 15:40:14 +0200 |
commit | 53f22a2ed263ba504c4b984faf886c24f66c04d3 (patch) | |
tree | 6663053ae28197fe0bfb43bface6f61d12830e1d | |
parent | 44ca71fedb800ddef183feccdb9c1a69492aa89e (diff) | |
download | vdr-plugin-softhddevice-53f22a2ed263ba504c4b984faf886c24f66c04d3.tar.gz vdr-plugin-softhddevice-53f22a2ed263ba504c4b984faf886c24f66c04d3.tar.bz2 |
Made showing black picture configurable.
-rw-r--r-- | ChangeLog | 1 | ||||
-rw-r--r-- | README.txt | 4 | ||||
-rw-r--r-- | softhddevice.cpp | 11 | ||||
-rw-r--r-- | video.c | 26 | ||||
-rw-r--r-- | video.h | 3 |
5 files changed, 39 insertions, 6 deletions
@@ -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. @@ -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 diff --git a/softhddevice.cpp b/softhddevice.cpp index 21a4996..608edac 100644 --- a/softhddevice.cpp +++ b/softhddevice.cpp @@ -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]; @@ -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; @@ -9609,6 +9613,16 @@ void VideoSetSoftStartSync(int onoff) } /// +/// Set show black picture during channel switch. +/// +/// @param onoff enable / disable black picture. +/// +void VideoSetBlackPicture(int onoff) +{ + VideoShowBlackPicture = onoff; +} + +/// /// Set video output position. /// /// @param x video output x coordinate inside the window @@ -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); |