summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog1
-rw-r--r--README.txt7
-rw-r--r--Todo2
-rw-r--r--softhddevice.cpp5
-rw-r--r--video.c40
-rw-r--r--video.h3
6 files changed, 42 insertions, 16 deletions
diff --git a/ChangeLog b/ChangeLog
index 4a07c47..4053327 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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.
diff --git a/README.txt b/README.txt
index b80cb6f..09ca6de 100644
--- a/README.txt
+++ b/README.txt
@@ -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)
diff --git a/Todo b/Todo
index 09a8bd9..640aebb 100644
--- a/Todo
+++ b/Todo
@@ -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;
diff --git a/video.c b/video.c
index 349ad92..7bc5234 100644
--- a/video.c
+++ b/video.c
@@ -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
diff --git a/video.h b/video.h
index d544455..e33dca5 100644
--- a/video.h
+++ b/video.h
@@ -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);