Add VideoSkipPixels support.

This commit is contained in:
CafeDelMar 2012-03-26 20:49:18 +02:00 committed by Johns
parent bd4503f30b
commit 689d75b808
5 changed files with 47 additions and 14 deletions

View File

@ -1,5 +1,10 @@
User: CafeDelMar
Date: Mon Mar 26 20:45:54 CEST 2012
Add VideoSkipPixels support.
User johns
Date:
Date: Fri Mar 23 18:43:20 CET 2012
Add optional argument (display) to ATTA svdrp commmand.
Wakeup display to show OSD for remote learning mode.

View File

@ -173,6 +173,9 @@ Setup: /etc/vdr/setup.conf
softhddevice.SkipLines = 0
skip 'n' lines at top and bottom of the video picture.
softhddevice.SkipPixels = 0
skip 'n' pixels at left and right of the video picture.
softhddevice.StudioLevels = 0
0 use PC levels (0-255) with vdpau.
1 use studio levels (16-235) with vdpau.

View File

@ -36,7 +36,7 @@
extern "C"
{
#include "video.h"
extern const char *X11DisplayName; ///< x11 display name
extern const char *X11DisplayName; ///< x11 display name
extern void AudioPoller(void);
extern void CodecSetAudioPassthrough(int);
@ -78,6 +78,7 @@ static char ConfigHideMainMenuEntry; ///< config hide main menu entry
static uint32_t ConfigVideoBackground; ///< config video background color
static int ConfigVideoSkipLines; ///< config skip lines top/bottom
static int ConfigVideoSkipPixels; ///< config skip pixels left/right
static char ConfigVideoStudioLevels; ///< config use studio levels
static char ConfigVideo60HzMode; ///< config use 60Hz display mode
static char ConfigVideoSoftStartSync; ///< config use softstart sync
@ -469,6 +470,7 @@ class cMenuSetupSoft:public cMenuSetupPage
uint32_t Background;
uint32_t BackgroundAlpha;
int SkipLines;
int SkipPixels;
int StudioLevels;
int _60HzMode;
int SoftStartSync;
@ -551,6 +553,9 @@ cMenuSetupSoft::cMenuSetupSoft(void)
SkipLines = ConfigVideoSkipLines;
Add(new cMenuEditIntItem(tr("Skip lines top+bot (pixel)"), &SkipLines, 0,
64));
SkipPixels = ConfigVideoSkipPixels;
Add(new cMenuEditIntItem(tr("Skip pixels left+right (pixel)"), &SkipPixels,
0, 64));
StudioLevels = ConfigVideoStudioLevels;
Add(new cMenuEditBoolItem(tr("Use studio levels (vdpau only)"),
&StudioLevels, trVDR("no"), trVDR("yes")));
@ -635,6 +640,8 @@ void cMenuSetupSoft::Store(void)
VideoSetBackground(ConfigVideoBackground);
SetupStore("SkipLines", ConfigVideoSkipLines = SkipLines);
VideoSetSkipLines(ConfigVideoSkipLines);
SetupStore("SkipPixels", ConfigVideoSkipPixels = SkipPixels);
VideoSetSkipPixels(ConfigVideoSkipPixels);
SetupStore("StudioLevels", ConfigVideoStudioLevels = StudioLevels);
VideoSetStudioLevels(ConfigVideoStudioLevels);
SetupStore("60HzMode", ConfigVideo60HzMode = _60HzMode);
@ -1603,6 +1610,10 @@ bool cPluginSoftHdDevice::SetupParse(const char *name, const char *value)
VideoSetSkipLines(ConfigVideoSkipLines = atoi(value));
return true;
}
if (!strcasecmp(name, "SkipPixels")) {
VideoSetSkipPixels(ConfigVideoSkipPixels = atoi(value));
return true;
}
if (!strcasecmp(name, "StudioLevels")) {
VideoSetStudioLevels(ConfigVideoStudioLevels = atoi(value));
return true;
@ -1817,10 +1828,10 @@ cString cPluginSoftHdDevice::SVDRPCommand(const char *command,
if (SuspendMode != SUSPEND_DETACHED) {
return "can't attach SoftHdDevice not detached";
}
if ( !strncmp(option, "-d ", 3) ) {
if (!strncmp(option, "-d ", 3)) {
// FIXME: loose memory here
X11DisplayName = strdup(option + 3);
} else if ( !strncmp(option, "-d", 2) ) {
} else if (!strncmp(option, "-d", 2)) {
// FIXME: loose memory here
X11DisplayName = strdup(option + 2);
}

31
video.c
View File

@ -302,6 +302,7 @@ static const char VideoTransparentOsd = 1;
static uint32_t VideoBackground; ///< video background color
static int VideoSkipLines; ///< skip video lines top/bottom
static int VideoSkipPixels; ///< skip video pixels left/right
static char VideoStudioLevels; ///< flag use studio levels
/// Default deinterlace mode.
@ -457,9 +458,9 @@ static void VideoUpdateOutput(AVRational input_aspect_ratio, int input_width,
Debug(3, "video: aspect %d:%d\n", display_aspect_ratio.num,
display_aspect_ratio.den);
*crop_x = 0;
*crop_x = VideoSkipPixels;
*crop_y = VideoSkipLines;
*crop_width = input_width;
*crop_width = input_width - VideoSkipPixels * 2;
*crop_height = input_height - VideoSkipLines * 2;
// FIXME: store different positions for the ratios
@ -2850,7 +2851,7 @@ static void VaapiAutoCrop(VaapiDecoder * decoder)
decoder->AutoCrop->State = next_state;
if (next_state) {
decoder->CropX = 0;
decoder->CropX = VideoSkipPixels;
decoder->CropY = (next_state == 16 ? crop16 : crop14) + VideoSkipLines;
decoder->CropWidth = decoder->InputWidth;
decoder->CropHeight = decoder->InputHeight - decoder->CropY * 2;
@ -6417,9 +6418,9 @@ static enum PixelFormat Vdpau_get_format(VdpauDecoder * decoder,
goto slow_path;
}
// FIXME: combine this with VdpauSetupOutput and software decoder part
decoder->CropX = 0;
decoder->CropX = VideoSkipPixels;
decoder->CropY = VideoSkipLines;
decoder->CropWidth = video_ctx->width;
decoder->CropWidth = video_ctx->width - VideoSkipPixels * 2;
decoder->CropHeight = video_ctx->height - VideoSkipLines * 2;
decoder->PixFmt = *fmt_idx;
@ -6717,7 +6718,7 @@ static void VdpauAutoCrop(VdpauDecoder * decoder)
decoder->AutoCrop->State = next_state;
if (next_state) {
decoder->CropX = 0;
decoder->CropX = VideoSkipPixels;
decoder->CropY = (next_state == 16 ? crop16 : crop14) + VideoSkipLines;
decoder->CropWidth = decoder->InputWidth;
decoder->CropHeight = decoder->InputHeight - decoder->CropY * 2;
@ -6740,9 +6741,9 @@ static void VdpauAutoCrop(VdpauDecoder * decoder)
decoder->InputWidth, decoder->InputHeight, decoder->OutputWidth,
decoder->OutputHeight, decoder->OutputX, decoder->OutputY);
} else {
decoder->CropX = 0;
decoder->CropX = VideoSkipPixels;
decoder->CropY = VideoSkipLines;
decoder->CropWidth = decoder->InputWidth;
decoder->CropWidth = decoder->InputWidth - VideoSkipPixels * 2;
decoder->CropHeight = decoder->InputHeight - VideoSkipLines * 2;
// sets AutoCrop->Count
@ -6952,9 +6953,9 @@ static void VdpauRenderFrame(VdpauDecoder * decoder,
|| video_ctx->width != decoder->InputWidth
|| video_ctx->height != decoder->InputHeight) {
decoder->CropX = 0;
decoder->CropX = VideoSkipPixels;
decoder->CropY = VideoSkipLines;
decoder->CropWidth = video_ctx->width;
decoder->CropWidth = video_ctx->width - VideoSkipPixels * 2;
decoder->CropHeight = video_ctx->height - VideoSkipLines * 2;
decoder->PixFmt = video_ctx->pix_fmt;
@ -9472,6 +9473,16 @@ void VideoSetSkipLines(int lines)
VideoSkipLines = lines;
}
///
/// Set skip pixels.
///
/// @param pixels pixels in pixel
///
void VideoSetSkipPixels(int pixels)
{
VideoSkipPixels = pixels;
}
///
/// Set studio levels.
///

View File

@ -122,6 +122,9 @@ extern void VideoSetSharpen(int[]);
/// Set skip lines.
extern void VideoSetSkipLines(int);
/// Set skip pixels.
extern void VideoSetSkipPixels(int);
/// Set studio levels.
extern void VideoSetStudioLevels(int);