diff options
author | CafeDelMar <> | 2012-03-26 20:49:18 +0200 |
---|---|---|
committer | Johns <johns98@gmx.net> | 2012-03-26 20:49:18 +0200 |
commit | 689d75b808705b423955a6d5e938d8c6a322e847 (patch) | |
tree | 245d27214b645cc429b81aae03eca38fd9035a04 /video.c | |
parent | bd4503f30bd7e66e2d4c01391d8ab033f6b72e9d (diff) | |
download | vdr-plugin-softhddevice-689d75b808705b423955a6d5e938d8c6a322e847.tar.gz vdr-plugin-softhddevice-689d75b808705b423955a6d5e938d8c6a322e847.tar.bz2 |
Add VideoSkipPixels support.
Diffstat (limited to 'video.c')
-rw-r--r-- | video.c | 31 |
1 files changed, 21 insertions, 10 deletions
@@ -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; @@ -9473,6 +9474,16 @@ void VideoSetSkipLines(int lines) } /// +/// Set skip pixels. +/// +/// @param pixels pixels in pixel +/// +void VideoSetSkipPixels(int pixels) +{ + VideoSkipPixels = pixels; +} + +/// /// Set studio levels. /// /// @param onoff flag on/off |