summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormaverick-me <>2012-10-30 16:50:31 +0100
committerJohns <johns98@gmx.net>2012-10-30 16:50:31 +0100
commit0286c434b4c0d1a746328ac79654baee4a095cda (patch)
treefb5d65f652acdb6c4f32650c2c324ec070bea6e9
parent6e9e64145360dcd6ad57ae52f56b3c3f994469de (diff)
downloadvdr-plugin-softhddevice-0286c434b4c0d1a746328ac79654baee4a095cda.tar.gz
vdr-plugin-softhddevice-0286c434b4c0d1a746328ac79654baee4a095cda.tar.bz2
Add support to change OSD for 3d SBS/TB streams.
-rw-r--r--ChangeLog9
-rw-r--r--softhddevice.cpp32
-rw-r--r--softhddevice_service.h6
-rw-r--r--video.c53
-rw-r--r--video.h3
5 files changed, 99 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index 10b55e4..188f8e9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,15 @@ User johns
Date:
Pre Release Version 0.5.2
+
+User maverick-me
+Date: Tue Oct 30 16:50:25 CET 2012
+
+ Add support to change the OSD for 3d SBS/TB streams.
+
+User johns
+Date: Tue Oct 30 12:11:25 CEST 2012
+
Use software decoder for still-pictures.
Add Feature #1103: change audio devices without vdr restart.
Fix bug #1089: Vdpau decoder used wrong number of mpeg reference frames.
diff --git a/softhddevice.cpp b/softhddevice.cpp
index 78496d0..ef76f26 100644
--- a/softhddevice.cpp
+++ b/softhddevice.cpp
@@ -134,9 +134,9 @@ static int ConfigAudioMaxCompression; ///< config max volume compression
static int ConfigAudioStereoDescent; ///< config reduce stereo loudness
int ConfigAudioBufferTime; ///< config size ms of audio buffer
-static char * ConfigX11Display; ///< config x11 display
-static char * ConfigAudioDevice; ///< config audio stereo device
-static char * ConfigAC3Device; ///< config audio passthrough device
+static char *ConfigX11Display; ///< config x11 display
+static char *ConfigAudioDevice; ///< config audio stereo device
+static char *ConfigAC3Device; ///< config audio passthrough device
static volatile int DoMakePrimary; ///< switch primary device to this
@@ -2311,6 +2311,14 @@ bool cPluginSoftHdDevice::Service(const char *id, void *data)
{
//dsyslog("[softhddev]%s: id %s\n", __FUNCTION__, id);
+ if (strcmp(id, OSD_3DMODE_SERVICE) == 0) {
+ SoftHDDevice_Osd3DModeService_v1_0_t *r;
+
+ r = (SoftHDDevice_Osd3DModeService_v1_0_t *) data;
+ VideoSetOsd3DMode(r->Mode);
+ return true;
+ }
+
if (strcmp(id, ATMO_GRAB_SERVICE) == 0) {
int width;
int height;
@@ -2374,7 +2382,7 @@ static const char *SVDRPHelpText[] = {
"ATTA <-d display> <-a audio> <-p pass>\n" " Attach plugin.\n\n"
" Attach the plugin to audio, video and DVB devices. Use:\n"
" -d display\tdisplay of x11 server (fe. :0.0)\n"
- " -a audio\taudio device (fe. alsa: hw:0,0 oss: /dev/dsp)\n"
+ " -a audio\taudio device (fe. alsa: hw:0,0 oss: /dev/dsp)\n"
" -p pass\t\taudio device for pass-through (hw:0,1 or /dev/dsp1)\n",
"PRIM <n>\n" " Make <n> the primary device.\n\n"
" <n> is the number of device. Without number softhddevice becomes\n"
@@ -2401,6 +2409,9 @@ static const char *SVDRPHelpText[] = {
" NOT_SUSPENDED == 0 (910)\n"
" SUSPEND_NORMAL == 1 (911)\n"
" SUSPEND_DETACHED == 2 (912)\n",
+ "3DOF\n" "\040 3D OSD off.\n",
+ "3DTB\n" "\040 3D OSD Top and Bottom.\n",
+ "3DSB\n" "\040 3D OSD Side by Side.\n",
NULL
};
@@ -2568,6 +2579,19 @@ cString cPluginSoftHdDevice::SVDRPCommand(const char *command,
DoMakePrimary = primary;
return "switching primary device requested";
}
+ if (!strcasecmp(command, "3DOF")) {
+ VideoSetOsd3DMode(0);
+ return "3d off";
+ }
+ if (!strcasecmp(command, "3DSB")) {
+ VideoSetOsd3DMode(1);
+ return "3d sbs";
+ }
+ if (!strcasecmp(command, "3DTB")) {
+ VideoSetOsd3DMode(2);
+ return "3d tb";
+ }
+
return NULL;
}
diff --git a/softhddevice_service.h b/softhddevice_service.h
index 737f8b0..03be695 100644
--- a/softhddevice_service.h
+++ b/softhddevice_service.h
@@ -23,6 +23,7 @@
#pragma once
#define ATMO_GRAB_SERVICE "SoftHDDevice-AtmoGrabService-v1.0"
+#define OSD_3DMODE_SERVICE "SoftHDDevice-Osd3DModeService-v1.0"
enum
{ GRAB_IMG_RGBA_FORMAT_B8G8R8A8 };
@@ -42,3 +43,8 @@ typedef struct
int height;
void *img;
} SoftHDDevice_AtmoGrabService_v1_0_t;
+
+typedef struct
+{
+ int Mode;
+} SoftHDDevice_Osd3DModeService_v1_0_t;
diff --git a/video.c b/video.c
index 768968a..3bbdeb5 100644
--- a/video.c
+++ b/video.c
@@ -374,6 +374,7 @@ static pthread_mutex_t VideoLockMutex; ///< video lock mutex
static int OsdConfigWidth; ///< osd configured width
static int OsdConfigHeight; ///< osd configured height
static char OsdShown; ///< flag show osd
+static char Osd3DMode; ///< 3D OSD mode
static int OsdWidth; ///< osd width
static int OsdHeight; ///< osd height
static int OsdDirtyX; ///< osd dirty area x
@@ -7439,6 +7440,7 @@ static void VdpauMixOsd(void)
VdpOutputSurfaceRenderBlendState blend_state;
VdpRect source_rect;
VdpRect output_rect;
+ VdpRect output_double_rect;
VdpStatus status;
//uint32_t start;
@@ -7486,6 +7488,21 @@ static void VdpauMixOsd(void)
output_rect.y1 = VideoWindowHeight;
}
+ output_double_rect = output_rect;
+
+ switch (Osd3DMode) {
+ case 1:
+ output_rect.x1 = output_rect.x1 / 2;
+ output_double_rect.x0 = output_rect.x1;
+ break;
+ case 2:
+ output_rect.y1 = output_rect.y1 / 2;
+ output_double_rect.y0 = output_rect.y1;
+ break;
+ default:
+ break;
+ }
+
//start = GetMsTicks();
// FIXME: double buffered osd disabled
@@ -7501,6 +7518,19 @@ static void VdpauMixOsd(void)
Error(_("video/vdpau: can't render bitmap surface: %s\n"),
VdpauGetErrorString(status));
}
+
+ if (Osd3DMode > 0) {
+ status =
+ VdpauOutputSurfaceRenderBitmapSurface(VdpauSurfacesRb
+ [VdpauSurfaceIndex], &output_double_rect,
+ VdpauOsdOutputSurface[!VdpauOsdSurfaceIndex], &source_rect, NULL,
+ VideoTransparentOsd ? &blend_state : NULL,
+ VDP_OUTPUT_SURFACE_RENDER_ROTATE_0);
+ if (status != VDP_STATUS_OK) {
+ Error(_("video/vdpau: can't render output surface: %s\n"),
+ VdpauGetErrorString(status));
+ }
+ }
#else
status =
VdpauOutputSurfaceRenderOutputSurface(VdpauSurfacesRb
@@ -7512,6 +7542,19 @@ static void VdpauMixOsd(void)
Error(_("video/vdpau: can't render output surface: %s\n"),
VdpauGetErrorString(status));
}
+
+ if (Osd3DMode > 0) {
+ status =
+ VdpauOutputSurfaceRenderOutputSurface(VdpauSurfacesRb
+ [VdpauSurfaceIndex], &output_double_rect,
+ VdpauOsdOutputSurface[!VdpauOsdSurfaceIndex], &source_rect, NULL,
+ VideoTransparentOsd ? &blend_state : NULL,
+ VDP_OUTPUT_SURFACE_RENDER_ROTATE_0);
+ if (status != VDP_STATUS_OK) {
+ Error(_("video/vdpau: can't render output surface: %s\n"),
+ VdpauGetErrorString(status));
+ }
+ }
#endif
//end = GetMsTicks();
/*
@@ -8836,6 +8879,16 @@ void VideoSetOsdSize(int width, int height)
}
///
+/// Set the 3d OSD mode.
+///
+/// @pram mode OSD mode (0=off, 1=SBS, 2=Top Bottom)
+///
+void VideoSetOsd3DMode(int mode)
+{
+ Osd3DMode = mode;
+}
+
+///
/// Setup osd.
///
/// FIXME: looking for BGRA, but this fourcc isn't supported by the
diff --git a/video.h b/video.h
index 99aa20a..0868169 100644
--- a/video.h
+++ b/video.h
@@ -169,6 +169,9 @@ extern void VideoGetOsdSize(int *, int *);
/// Set OSD size.
extern void VideoSetOsdSize(int, int);
+ /// Set Osd 3D Mode
+extern void VideoSetOsd3DMode(int);
+
/// Set video clock.
extern void VideoSetClock(VideoHwDecoder *, int64_t);