[vdr-plugin-softhddevice] 01/03: Imported Upstream version 0.6.0+git20150324

Tobias Grimm tiber-guest at moszumanska.debian.org
Mon Aug 31 18:03:34 UTC 2015


This is an automated email from the git hooks/post-receive script.

tiber-guest pushed a commit to branch master
in repository vdr-plugin-softhddevice.

commit 1c1092c152ebd9c6b152fc813bc1cfaf530451be
Author: etobi <git at e-tobi.net>
Date:   Tue Mar 24 19:36:30 2015 +0100

    Imported Upstream version 0.6.0+git20150324
---
 ChangeLog        | 17 +++++++++++
 Makefile         | 90 +++++++++++++++++++++++++++++---------------------------
 README.txt       |  1 +
 audio.c          | 36 ++++++++++++++---------
 codec.c          |  1 +
 po/de_DE.po      | 33 ++++++++++++++++-----
 softhddev.c      | 12 +++++++-
 softhddev.h      |  2 ++
 softhddevice.cpp | 21 +++++++++++--
 video.c          | 68 ++++++++++++++++++++++++++----------------
 video.h          |  2 +-
 11 files changed, 188 insertions(+), 95 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 6538b99..679636b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,23 @@
 User johns
 Date:
 
+    Fix bug: brightness and .. are calculated wrong.
+    Add automatic frame rate detection for older ffmpeg versions.
+    Fix bug: destroyed vdpau surfaces still used in queue.
+    Fix bug: need signed char, if compiler has unsigned chars.
+    Try smaller audio puffer, if default size fails.
+    Fix bug: center cut-out didn't use cut off pixels.
+    Fix bug #2058: support for Make.plgcfg.
+    Fix for compile with vdr 2.1.10, for older vdr versions.
+
+User jinx
+Date: Mon Feb 16 09:58:06 CET 2015
+
+    Enable toggle AC3 downmix.
+
+User johns
+Date: Thu Feb 12 10:30:50 CET 2015
+
     Compile with vdr 2.1.10.
     Fix bug: AVCodecContext.framerate not supported.
     Use video stream frame rate for A/V sync.
diff --git a/Makefile b/Makefile
index 187a917..eea795b 100644
--- a/Makefile
+++ b/Makefile
@@ -45,6 +45,52 @@ CONFIG += -DUSE_PIP			# PIP support
 CONFIG += -DUSE_VDR_SPU			# use VDR SPU decoder.
 #CONFIG += -DUSE_SOFTLIMIT		# (tobe removed) limit the buffer fill
 
+### The version number of this plugin (taken from the main source file):
+
+VERSION = $(shell grep 'static const char \*const VERSION *=' $(PLUGIN).cpp | awk '{ print $$7 }' | sed -e 's/[";]//g')
+GIT_REV = $(shell git describe --always 2>/dev/null)
+
+### The directory environment:
+
+# Use package data if installed...otherwise assume we're under the VDR source directory:
+PKGCFG = $(if $(VDRDIR),$(shell pkg-config --variable=$(1) $(VDRDIR)/vdr.pc),$(shell PKG_CONFIG_PATH="$$PKG_CONFIG_PATH:../../.." pkg-config --variable=$(1) vdr))
+LIBDIR = $(call PKGCFG,libdir)
+LOCDIR = $(call PKGCFG,locdir)
+PLGCFG = $(call PKGCFG,plgcfg)
+#
+TMPDIR ?= /tmp
+
+### The compiler options:
+
+export CFLAGS	= $(call PKGCFG,cflags)
+export CXXFLAGS = $(call PKGCFG,cxxflags)
+
+ifeq ($(CFLAGS),)
+$(warning CFLAGS not set)
+endif
+ifeq ($(CXXFLAGS),)
+$(warning CXXFLAGS not set)
+endif
+
+### The version number of VDR's plugin API:
+
+APIVERSION = $(call PKGCFG,apiversion)
+
+### Allow user defined options to overwrite defaults:
+
+-include $(PLGCFG)
+
+### The name of the distribution archive:
+
+ARCHIVE = $(PLUGIN)-$(VERSION)
+PACKAGE = vdr-$(ARCHIVE)
+
+### The name of the shared object file:
+
+SOFILE = libvdr-$(PLUGIN).so
+
+### Parse softhddevice config
+
 ifeq ($(ALSA),1)
 CONFIG += -DUSE_ALSA
 _CFLAGS += $(shell pkg-config --cflags alsa)
@@ -91,50 +137,6 @@ endif
 _CFLAGS += $(shell pkg-config --cflags libavcodec x11 x11-xcb xcb xcb-icccm)
 LIBS += -lrt $(shell pkg-config --libs libavcodec x11 x11-xcb xcb xcb-icccm)
 
-### The version number of this plugin (taken from the main source file):
-
-VERSION = $(shell grep 'static const char \*const VERSION *=' $(PLUGIN).cpp | awk '{ print $$7 }' | sed -e 's/[";]//g')
-GIT_REV = $(shell git describe --always 2>/dev/null)
-
-### The directory environment:
-
-# Use package data if installed...otherwise assume we're under the VDR source directory:
-PKGCFG = $(if $(VDRDIR),$(shell pkg-config --variable=$(1) $(VDRDIR)/vdr.pc),$(shell pkg-config --variable=$(1) vdr || pkg-config --variable=$(1) ../../../vdr.pc))
-LIBDIR = $(call PKGCFG,libdir)
-LOCDIR = $(call PKGCFG,locdir)
-PLGCFG = $(call PKGCFG,plgcfg)
-#
-TMPDIR ?= /tmp
-
-### The compiler options:
-
-export CFLAGS	= $(call PKGCFG,cflags)
-export CXXFLAGS = $(call PKGCFG,cxxflags)
-
-ifeq ($(CFLAGS),)
-$(warning CFLAGS not set)
-endif
-ifeq ($(CXXFLAGS),)
-$(warning CXXFLAGS not set)
-endif
-
-### The version number of VDR's plugin API:
-
-APIVERSION = $(call PKGCFG,apiversion)
-
-### Allow user defined options to overwrite defaults:
-
--include $(PLGCFG)
-
-### The name of the distribution archive:
-
-ARCHIVE = $(PLUGIN)-$(VERSION)
-PACKAGE = vdr-$(ARCHIVE)
-
-### The name of the shared object file:
-
-SOFILE = libvdr-$(PLUGIN).so
-
 ### Includes and Defines (add further entries here):
 
 INCLUDES +=
diff --git a/README.txt b/README.txt
index 62372e3..5267da0 100644
--- a/README.txt
+++ b/README.txt
@@ -321,6 +321,7 @@ Keymacros:
 	@softhddevice Blue 1 2		toggle pass-through
 	@softhddevice Blue 1 3		decrease audio delay by 10ms
 	@softhddevice Blue 1 4		increase audio delay by 10ms
+	@softhddevice Blue 1 5		toggle ac3 mixdown
 	@softhddevice Blue 2 0		disable fullscreen
 	@softhddevice Blue 2 1		enable fullscreen
 	@softhddevice Blue 2 2		toggle fullscreen
diff --git a/audio.c b/audio.c
index a9da207..77fa650 100644
--- a/audio.c
+++ b/audio.c
@@ -1237,21 +1237,29 @@ static int AlsaSetup(int *freq, int *channels, int passthrough)
 		    AlsaUseMmap ? SND_PCM_ACCESS_MMAP_INTERLEAVED :
 		    SND_PCM_ACCESS_RW_INTERLEAVED, *channels, *freq, 1,
 		    96 * 1000))) {
-
-	    /*
-	       if ( err == -EBADFD ) {
-	       snd_pcm_close(AlsaPCMHandle);
-	       AlsaPCMHandle = NULL;
-	       continue;
-	       }
-	     */
-
-	    if (!AudioDoingInit) {
-		Error(_("audio/alsa: set params error: %s\n"),
-		    snd_strerror(err));
+	    // try reduced buffer size (needed for sunxi)
+	    // FIXME: alternativ make this configurable
+	    if ((err =
+		    snd_pcm_set_params(AlsaPCMHandle, SND_PCM_FORMAT_S16,
+			AlsaUseMmap ? SND_PCM_ACCESS_MMAP_INTERLEAVED :
+			SND_PCM_ACCESS_RW_INTERLEAVED, *channels, *freq, 1,
+			72 * 1000))) {
+
+		/*
+		   if ( err == -EBADFD ) {
+		   snd_pcm_close(AlsaPCMHandle);
+		   AlsaPCMHandle = NULL;
+		   continue;
+		   }
+		 */
+
+		if (!AudioDoingInit) {
+		    Error(_("audio/alsa: set params error: %s\n"),
+			snd_strerror(err));
+		}
+		// FIXME: must stop sound, AudioChannels ... invalid
+		return -1;
 	    }
-	    // FIXME: must stop sound, AudioChannels ... invalid
-	    return -1;
 	}
 	break;
     }
diff --git a/codec.c b/codec.c
index d089a84..10011c3 100644
--- a/codec.c
+++ b/codec.c
@@ -1802,6 +1802,7 @@ static void CodecAudioUpdateFormat(AudioDecoder * audio_decoder)
 void CodecAudioDecode(AudioDecoder * audio_decoder, const AVPacket * avpkt)
 {
     AVCodecContext *audio_ctx;
+
 #if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(58,28,1)
     AVFrame frame[1];
 #else
diff --git a/po/de_DE.po b/po/de_DE.po
index f2a4bfc..68812a4 100644
--- a/po/de_DE.po
+++ b/po/de_DE.po
@@ -7,7 +7,7 @@ msgid ""
 msgstr ""
 "Project-Id-Version: VDR \n"
 "Report-Msgid-Bugs-To: <see README>\n"
-"POT-Creation-Date: 2014-03-20 11:50+0100\n"
+"POT-Creation-Date: 2014-10-31 12:36+0100\n"
 "PO-Revision-Date: blabla\n"
 "Last-Translator: blabla\n"
 "Language-Team: blabla\n"
@@ -229,9 +229,6 @@ msgstr ""
 msgid "audio: can't set channels %d sample-rate %dHz\n"
 msgstr ""
 
-msgid "audio: can't queue cancel play thread\n"
-msgstr ""
-
 msgid "audio: can't cancel play thread\n"
 msgstr ""
 
@@ -279,6 +276,9 @@ msgstr ""
 msgid "codec: can't allocate audio decoder\n"
 msgstr ""
 
+msgid "codec: can't allocate audio decoder frame buffer\n"
+msgstr ""
+
 msgid "codec: can't allocate audio codec context\n"
 msgstr ""
 
@@ -753,6 +753,12 @@ msgstr ""
 msgid "audio delay changed to %d"
 msgstr ""
 
+msgid "surround downmix enabled"
+msgstr ""
+
+msgid "surround downmix disabled"
+msgstr ""
+
 msgid "auto-crop disabled and freezed"
 msgstr ""
 
@@ -993,14 +999,20 @@ msgstr ""
 msgid "video: output buffer full, dropping frame (%d/%d)\n"
 msgstr ""
 
-msgid "video/vaapi: can't create a surface\n"
+#, c-format
+msgid "video/vaapi: can't create a surface: %s\n"
 msgstr ""
 
 #, c-format
-msgid "video/vaapi: vaDeriveImage failed %d\n"
+msgid "video/vaapi: can't associate subpicture: %s\n"
 msgstr ""
 
-msgid "video/vaapi: can't map the image!\n"
+#, c-format
+msgid "video/vaapi: can't create image: %s\n"
+msgstr ""
+
+#, c-format
+msgid "video/vaapi: can't map the image: %s\n"
 msgstr ""
 
 msgid "video/vaapi: can't unmap the image!\n"
@@ -1016,12 +1028,19 @@ msgid "video/vaapi: can't get source image\n"
 msgstr ""
 
 #, c-format
+msgid "video/vaapi: vaDeriveImage failed %d\n"
+msgstr ""
+
+#, c-format
 msgid "video/vaapi: can't put image: %d!\n"
 msgstr ""
 
 msgid "video/vaapi: stream <-> surface size mismatch\n"
 msgstr ""
 
+msgid "video/vaapi: can't map the image!\n"
+msgstr ""
+
 #, c-format
 msgid "video/vaapi: can't put image err:%d!\n"
 msgstr ""
diff --git a/softhddev.c b/softhddev.c
index d0e32ee..5afe3b5 100644
--- a/softhddev.c
+++ b/softhddev.c
@@ -89,7 +89,7 @@ static char VdpauDecoder = 1;		///< vdpau decoder used
 extern int ConfigAudioBufferTime;	///< config size ms of audio buffer
 extern int ConfigVideoClearOnSwitch;	//<  clear decoder on channel switch
 char ConfigStartX11Server;		///< flag start the x11 server
-static char ConfigStartSuspended;	///< flag to start in suspend mode
+static signed char ConfigStartSuspended;	///< flag to start in suspend mode
 static char ConfigFullscreen;		///< fullscreen modus
 static const char *X11ServerArguments;	///< default command arguments
 static char ConfigStillDecoder;		///< hw/sw decoder for still picture
@@ -1101,6 +1101,7 @@ int PlayAudio(const uint8_t * data, int size, uint8_t id)
     if (AudioChannelID != id) {		// id changed audio track changed
 	AudioChannelID = id;
 	AudioCodecID = AV_CODEC_ID_NONE;
+	Debug(3, "audio/demux: new channel id\n");
     }
     // Private stream + LPCM ID
     if ((id & 0xF0) == 0xA0) {
@@ -1304,6 +1305,15 @@ void SetVolumeDevice(int volume)
     AudioSetVolume((volume * 1000) / 255);
 }
 
+/**
+***	Resets channel ID (restarts audio).
+**/
+void ResetChannelId(void)
+{
+    AudioChannelID = -1;
+    Debug(3, "audio/demux: reset channel id\n");
+}
+
 //////////////////////////////////////////////////////////////////////////////
 //	Video
 //////////////////////////////////////////////////////////////////////////////
diff --git a/softhddev.h b/softhddev.h
index da16ece..a793503 100644
--- a/softhddev.h
+++ b/softhddev.h
@@ -42,6 +42,8 @@ extern "C"
     extern int PlayTsAudio(const uint8_t *, int);
     /// C plugin set audio volume
     extern void SetVolumeDevice(int);
+    /// C plugin reset channel id (restarts audio)
+    extern void ResetChannelId(void);
 
     /// C plugin play video packet
     extern int PlayVideo(const uint8_t *, int);
diff --git a/softhddevice.cpp b/softhddevice.cpp
index eb07e48..e933955 100644
--- a/softhddevice.cpp
+++ b/softhddevice.cpp
@@ -171,7 +171,7 @@ static volatile int DoMakePrimary;	///< switch primary device to this
 #define NOT_SUSPENDED		0	///< not suspend mode
 #define SUSPEND_NORMAL		1	///< normal suspend mode
 #define SUSPEND_DETACHED	2	///< detached suspend mode
-static char SuspendMode;		///< suspend mode
+static signed char SuspendMode;		///< suspend mode
 
 //////////////////////////////////////////////////////////////////////////////
 
@@ -513,7 +513,11 @@ void cSoftOsd::Flush(void)
 #endif
 	OsdDrawARGB(x, y, w, h, pm->Data());
 
+#if APIVERSNUM >= 20110
 	DestroyPixmap(pm);
+#else
+	delete pm;
+#endif
     }
     Dirty = 0;
 }
@@ -1883,6 +1887,17 @@ static void HandleHotkey(int code)
 		cString::sprintf(tr("audio delay changed to %d"),
 		    ConfigVideoAudioDelay));
 	    break;
+	case 15:
+	    ConfigAudioDownmix ^= 1;
+	    fprintf(stderr, "toggle downmix\n");
+	    CodecSetAudioDownmix(ConfigAudioDownmix);
+	    if (ConfigAudioDownmix) {
+		Skins.QueueMessage(mtInfo, tr("surround downmix enabled"));
+	    } else {
+		Skins.QueueMessage(mtInfo, tr("surround downmix disabled"));
+	    }
+	    ResetChannelId();
+	    break;
 
 	case 20:			// disable full screen
 	    VideoSetFullscreen(0);
@@ -2288,7 +2303,7 @@ int64_t cSoftHdDevice::GetSTC(void)
 #if APIVERSNUM >= 20103
 void cSoftHdDevice::TrickSpeed(int speed, bool forward)
 {
-    dsyslog("[softhddev]%s: %d $d\n", __FUNCTION__, speed, forward);
+    dsyslog("[softhddev]%s: %d %d\n", __FUNCTION__, speed, forward);
 
     ::TrickSpeed(speed);
 }
@@ -3258,7 +3273,7 @@ static const char *SVDRPHelpText[] = {
 	"    11: enable audio pass-through\n"
 	"    12: toggle audio pass-through\n"
 	"    13: decrease audio delay by 10ms\n"
-	"    14: increase audio delay by 10ms\n"
+	"    14: increase audio delay by 10ms\n" "    15: toggle ac3 mixdown\n"
 	"    20: disable fullscreen\n\040   21: enable fullscreen\n"
 	"    22: toggle fullscreen\n"
 	"    23: disable auto-crop\n\040   24: enable auto-crop\n"
diff --git a/video.c b/video.c
index 56cae36..08d0bca 100644
--- a/video.c
+++ b/video.c
@@ -332,7 +332,7 @@ static const VideoModule NoopModule;	///< forward definition of noop module
     /// selected video module
 static const VideoModule *VideoUsedModule = &NoopModule;
 
-char VideoHardwareDecoder = -1;		///< flag use hardware decoder
+signed char VideoHardwareDecoder = -1;	///< flag use hardware decoder
 
 static char VideoSurfaceModesChanged;	///< flag surface modes changed
 
@@ -457,10 +457,18 @@ static void VideoSetPts(int64_t * pts_p, int interlaced,
     //	FIXME: using framerate as workaround for av_frame_get_pkt_duration
     //
 #if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(56,13,100)
-    // FIXME: need frame rate for older versions
-    duration = interlaced ? 40 : 20;	// 50Hz -> 20ms default
+    // version for older ffmpeg without framerate
+    if (video_ctx->time_base.num && video_ctx->time_base.den) {
+	duration =
+	    (video_ctx->ticks_per_frame * 1000 * video_ctx->time_base.num) /
+	    video_ctx->time_base.den;
+    } else {
+	duration = interlaced ? 40 : 20;	// 50Hz -> 20ms default
+    }
+    Debug(4, "video: %d/%d %" PRIx64 " -> %d\n", video_ctx->time_base.den,
+	video_ctx->time_base.num, av_frame_get_pkt_duration(frame), duration);
 #else
-    if (video_ctx->framerate.num != 0 && video_ctx->framerate.den != 0) {
+    if (video_ctx->framerate.num && video_ctx->framerate.den) {
 	duration = 1000 * video_ctx->framerate.den / video_ctx->framerate.num;
     } else {
 	duration = interlaced ? 40 : 20;	// 50Hz -> 20ms default
@@ -632,27 +640,37 @@ static void VideoUpdateOutput(AVRational input_aspect_ratio, int input_width,
 
     // look which side must be cut
     if (*crop_width > video_width) {
-	*crop_height = input_height;
+	int tmp;
+
+	*crop_height = input_height - VideoCutTopBottom[resolution] * 2;
 
 	// adjust scaling
-	*crop_x = ((*crop_width - video_width) * input_width)
-	    / (2 * video_width);
-	*crop_width = input_width - *crop_x * 2;
+	tmp = ((*crop_width - video_width) * input_width) / (2 * video_width);
 	// FIXME: round failure?
+	if (tmp > *crop_x) {
+	    *crop_x = tmp;
+	}
+	*crop_width = input_width - *crop_x * 2;
     } else if (*crop_height > video_height) {
-	*crop_width = input_width;
+	int tmp;
+
+	*crop_width = input_width - VideoCutLeftRight[resolution] * 2;
 
 	// adjust scaling
-	*crop_y = ((*crop_height - video_height) * input_height)
+	tmp = ((*crop_height - video_height) * input_height)
 	    / (2 * video_height);
-	*crop_height = input_height - *crop_y * 2;
 	// FIXME: round failure?
+	if (tmp > *crop_y) {
+	    *crop_y = tmp;
+	}
+	*crop_height = input_height - *crop_y * 2;
     } else {
-	*crop_width = input_width;
-	*crop_height = input_height;
+	*crop_width = input_width - VideoCutLeftRight[resolution] * 2;
+	*crop_height = input_height - VideoCutTopBottom[resolution] * 2;
     }
     Debug(3, "video: aspect crop %dx%d%+d%+d\n", *crop_width, *crop_height,
 	*crop_x, *crop_y);
+    return;
 }
 
 //----------------------------------------------------------------------------
@@ -6638,6 +6656,14 @@ static void VdpauExitOutputQueue(void)
     int i;
     VdpStatus status;
 
+    if (VdpauQueue) {
+	VdpauPresentationQueueDestroy(VdpauQueue);
+	VdpauQueue = 0;
+    }
+    if (VdpauQueueTarget) {
+	VdpauPresentationQueueTargetDestroy(VdpauQueueTarget);
+	VdpauQueueTarget = 0;
+    }
     //
     //	destroy display output surfaces
     //
@@ -6662,14 +6688,6 @@ static void VdpauExitOutputQueue(void)
 	}
 	VdpauGrabRenderSurface = VDP_INVALID_HANDLE;
     }
-    if (VdpauQueue) {
-	VdpauPresentationQueueDestroy(VdpauQueue);
-	VdpauQueue = 0;
-    }
-    if (VdpauQueueTarget) {
-	VdpauPresentationQueueTargetDestroy(VdpauQueueTarget);
-	VdpauQueueTarget = 0;
-    }
 }
 
 ///
@@ -10843,7 +10861,7 @@ void VideoSetBrightness(int brightness)
     // FIXME: test to check if working, than make module function
 #ifdef USE_VDPAU
     if (VideoUsedModule == &VdpauModule) {
-	VdpauDecoders[0]->Procamp.brightness = brightness / 1000;
+	VdpauDecoders[0]->Procamp.brightness = (double)brightness / 1000;
     }
 #endif
     // FIXME: VA-API support
@@ -10861,7 +10879,7 @@ void VideoSetContrast(int contrast)
     // FIXME: test to check if working, than make module function
 #ifdef USE_VDPAU
     if (VideoUsedModule == &VdpauModule) {
-	VdpauDecoders[0]->Procamp.contrast = contrast / 1000;
+	VdpauDecoders[0]->Procamp.contrast = (double)contrast / 1000;
     }
 #endif
     // FIXME: VA-API support
@@ -10879,7 +10897,7 @@ void VideoSetSaturation(int saturation)
     // FIXME: test to check if working, than make module function
 #ifdef USE_VDPAU
     if (VideoUsedModule == &VdpauModule) {
-	VdpauDecoders[0]->Procamp.saturation = saturation / 1000;
+	VdpauDecoders[0]->Procamp.saturation = (double)saturation / 1000;
     }
 #endif
     // FIXME: VA-API support
@@ -10897,7 +10915,7 @@ void VideoSetHue(int hue)
     // FIXME: test to check if working, than make module function
 #ifdef USE_VDPAU
     if (VideoUsedModule == &VdpauModule) {
-	VdpauDecoders[0]->Procamp.hue = hue / 1000;
+	VdpauDecoders[0]->Procamp.hue = (double)hue / 1000;
     }
 #endif
     // FIXME: VA-API support
diff --git a/video.h b/video.h
index fa3e44f..0587393 100644
--- a/video.h
+++ b/video.h
@@ -37,7 +37,7 @@ typedef struct __video_stream__ VideoStream;
 //	Variables
 //----------------------------------------------------------------------------
 
-extern char VideoHardwareDecoder;	///< flag use hardware decoder
+extern signed char VideoHardwareDecoder;	///< flag use hardware decoder
 extern char VideoIgnoreRepeatPict;	///< disable repeat pict warning
 extern int VideoAudioDelay;		///< audio/video delay
 extern char ConfigStartX11Server;	///< flag start the x11 server

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-vdr-dvb/vdr-plugin-softhddevice.git



More information about the pkg-vdr-dvb-changes mailing list