diff options
-rw-r--r-- | ChangeLog | 1 | ||||
-rw-r--r-- | README.txt | 7 | ||||
-rw-r--r-- | Todo | 2 | ||||
-rw-r--r-- | softhddevice.cpp | 5 | ||||
-rw-r--r-- | video.c | 40 | ||||
-rw-r--r-- | video.h | 3 |
6 files changed, 42 insertions, 16 deletions
@@ -1,6 +1,7 @@ User johns Date: + Add configurable skip lines at video top and bottom. Add auto-crop tolerance configuration. Reduces audio latency, increases audio buffer time. Made video_test working again. @@ -139,9 +139,14 @@ Setup: /etc/vdr/setup.conf n each 'n' frames auto-crop is checked. softhddevice.AutoCrop.Delay = 0 - if auto-crop is over after 'n' intervals the same, the cropping is + if auto-crop is over 'n' intervals the same, the cropping is used. + softhddevice.AutoCrop.Tolerance = 0 + if detected crop area is too small, cut max 'n' pixels at top and + bottom. + + softhddevice.Suspend.Close = 0 1 suspend closes x11 window, connection and audio device. (use svdrpsend plug softhddevice RESU to resume, if you have no lirc) @@ -37,8 +37,8 @@ video: grab image with hardware and better scaling support suspendoutput didn't show logo or black pictures (must detect video format to show image) - incomplete mpeg packets creates artefacts after channel switch hard channel switch + skip line not configurable from setup menu. vdpau: diff --git a/softhddevice.cpp b/softhddevice.cpp index d882ce3..67cb13a 100644 --- a/softhddevice.cpp +++ b/softhddevice.cpp @@ -77,6 +77,7 @@ static int ConfigVideoSharpen[RESOLUTIONS]; static int ConfigVideoScaling[RESOLUTIONS]; static int ConfigVideoAudioDelay; ///< config audio delay +static int ConfigVideoSkipLines; ///< config skip lines top/bottom static int ConfigAudioPassthrough; ///< config audio pass-through static int ConfigAutoCropInterval; ///< auto crop detection interval @@ -1203,6 +1204,10 @@ bool cPluginSoftHdDevice::SetupParse(const char *name, const char *value) } } + if (!strcmp(name, "SkipLines")) { + VideoSetSkipLines(ConfigVideoSkipLines = atoi(value)); + return true; + } if (!strcmp(name, "AudioDelay")) { VideoSetAudioDelay(ConfigVideoAudioDelay = atoi(value)); return true; @@ -259,6 +259,8 @@ static char VideoSurfaceModesChanged; ///< flag surface modes changed /// flag use transparent OSD. static const char VideoTransparentOsd = 1; +static int VideoSkipLines; ///< skip video lines top/bottom + /// Default deinterlace mode. static VideoDeinterlaceModes VideoDeinterlace[VideoResolutionMax]; @@ -2006,9 +2008,9 @@ static enum PixelFormat Vaapi_get_format(VaapiDecoder * decoder, } decoder->CropX = 0; - decoder->CropY = 0; + decoder->CropY = VideoSkipLines; decoder->CropWidth = video_ctx->width; - decoder->CropHeight = video_ctx->height; + decoder->CropHeight = video_ctx->height - VideoSkipLines * 2; decoder->PixFmt = video_ctx->pix_fmt; decoder->InputWidth = video_ctx->width; @@ -2486,7 +2488,7 @@ static void VaapiAutoCrop(VaapiDecoder * decoder) if (next_state) { decoder->CropX = 0; - decoder->CropY = next_state == 16 ? crop16 : crop14; + decoder->CropY = (next_state == 16 ? crop16 : crop14) + VideoSkipLines; decoder->CropWidth = decoder->InputWidth; decoder->CropHeight = decoder->InputHeight - decoder->CropY * 2; @@ -2508,9 +2510,9 @@ static void VaapiAutoCrop(VaapiDecoder * decoder) decoder->OutputHeight, decoder->OutputX, decoder->OutputY); } else { decoder->CropX = 0; - decoder->CropY = 0; + decoder->CropY = VideoSkipLines; decoder->CropWidth = decoder->InputWidth; - decoder->CropHeight = decoder->InputHeight; + decoder->CropHeight = decoder->InputHeight - VideoSkipLines * 2; VaapiUpdateOutput(decoder); } @@ -3337,9 +3339,9 @@ static void VaapiRenderFrame(VaapiDecoder * decoder, || height != decoder->InputHeight) { decoder->CropX = 0; - decoder->CropY = 0; + decoder->CropY = VideoSkipLines; decoder->CropWidth = video_ctx->width; - decoder->CropHeight = video_ctx->height; + decoder->CropHeight = video_ctx->height - VideoSkipLines * 2; decoder->PixFmt = video_ctx->pix_fmt; decoder->InputWidth = width; @@ -5538,9 +5540,9 @@ static enum PixelFormat Vdpau_get_format(VdpauDecoder * decoder, } // FIXME: combine this with VdpauSetupOutput and software decoder part decoder->CropX = 0; - decoder->CropY = 0; + decoder->CropY = VideoSkipLines; decoder->CropWidth = video_ctx->width; - decoder->CropHeight = video_ctx->height; + decoder->CropHeight = video_ctx->height - VideoSkipLines * 2; decoder->PixFmt = video_ctx->pix_fmt; decoder->InputWidth = video_ctx->width; @@ -5836,7 +5838,7 @@ static void VdpauAutoCrop(VdpauDecoder * decoder) if (next_state) { decoder->CropX = 0; - decoder->CropY = next_state == 16 ? crop16 : crop14; + decoder->CropY = (next_state == 16 ? crop16 : crop14) + VideoSkipLines; decoder->CropWidth = decoder->InputWidth; decoder->CropHeight = decoder->InputHeight - decoder->CropY * 2; @@ -5858,9 +5860,9 @@ static void VdpauAutoCrop(VdpauDecoder * decoder) decoder->OutputHeight, decoder->OutputX, decoder->OutputY); } else { decoder->CropX = 0; - decoder->CropY = 0; + decoder->CropY = VideoSkipLines; decoder->CropWidth = decoder->InputWidth; - decoder->CropHeight = decoder->InputHeight; + decoder->CropHeight = decoder->InputHeight - VideoSkipLines * 2; VdpauUpdateOutput(decoder); } @@ -6069,9 +6071,9 @@ static void VdpauRenderFrame(VdpauDecoder * decoder, || video_ctx->height != decoder->InputHeight) { decoder->CropX = 0; - decoder->CropY = 0; + decoder->CropY = VideoSkipLines; decoder->CropWidth = video_ctx->width; - decoder->CropHeight = video_ctx->height; + decoder->CropHeight = video_ctx->height - VideoSkipLines * 2; decoder->PixFmt = video_ctx->pix_fmt; decoder->InputWidth = video_ctx->width; @@ -8353,6 +8355,16 @@ void VideoSetScaling(int mode[VideoResolutionMax]) } /// +/// Set skip lines. +/// +/// @param lines lines in pixel +/// +void VideoSetSkipLines(int lines) +{ + VideoSkipLines = lines; +} + +/// /// Set audio delay. /// /// @param ms delay in ms @@ -97,6 +97,9 @@ extern void VideoSetDenoise(int[]); /// Set sharpen. extern void VideoSetSharpen(int[]); + /// Set skip lines. +extern void VideoSetSkipLines(int); + /// Set audio delay. extern void VideoSetAudioDelay(int); |