mirror of
https://projects.vdr-developer.org/git/vdr-plugin-softhddevice.git
synced 2023-10-10 19:16:51 +02:00
Add support to change OSD for 3d SBS/TB streams.
This commit is contained in:
parent
6e9e641453
commit
0286c434b4
@ -2,6 +2,15 @@ User johns
|
|||||||
Date:
|
Date:
|
||||||
|
|
||||||
Pre Release Version 0.5.2
|
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.
|
Use software decoder for still-pictures.
|
||||||
Add Feature #1103: change audio devices without vdr restart.
|
Add Feature #1103: change audio devices without vdr restart.
|
||||||
Fix bug #1089: Vdpau decoder used wrong number of mpeg reference frames.
|
Fix bug #1089: Vdpau decoder used wrong number of mpeg reference frames.
|
||||||
|
@ -134,9 +134,9 @@ static int ConfigAudioMaxCompression; ///< config max volume compression
|
|||||||
static int ConfigAudioStereoDescent; ///< config reduce stereo loudness
|
static int ConfigAudioStereoDescent; ///< config reduce stereo loudness
|
||||||
int ConfigAudioBufferTime; ///< config size ms of audio buffer
|
int ConfigAudioBufferTime; ///< config size ms of audio buffer
|
||||||
|
|
||||||
static char * ConfigX11Display; ///< config x11 display
|
static char *ConfigX11Display; ///< config x11 display
|
||||||
static char * ConfigAudioDevice; ///< config audio stereo device
|
static char *ConfigAudioDevice; ///< config audio stereo device
|
||||||
static char * ConfigAC3Device; ///< config audio passthrough device
|
static char *ConfigAC3Device; ///< config audio passthrough device
|
||||||
|
|
||||||
static volatile int DoMakePrimary; ///< switch primary device to this
|
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);
|
//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) {
|
if (strcmp(id, ATMO_GRAB_SERVICE) == 0) {
|
||||||
int width;
|
int width;
|
||||||
int height;
|
int height;
|
||||||
@ -2401,6 +2409,9 @@ static const char *SVDRPHelpText[] = {
|
|||||||
" NOT_SUSPENDED == 0 (910)\n"
|
" NOT_SUSPENDED == 0 (910)\n"
|
||||||
" SUSPEND_NORMAL == 1 (911)\n"
|
" SUSPEND_NORMAL == 1 (911)\n"
|
||||||
" SUSPEND_DETACHED == 2 (912)\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
|
NULL
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -2568,6 +2579,19 @@ cString cPluginSoftHdDevice::SVDRPCommand(const char *command,
|
|||||||
DoMakePrimary = primary;
|
DoMakePrimary = primary;
|
||||||
return "switching primary device requested";
|
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;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -23,6 +23,7 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#define ATMO_GRAB_SERVICE "SoftHDDevice-AtmoGrabService-v1.0"
|
#define ATMO_GRAB_SERVICE "SoftHDDevice-AtmoGrabService-v1.0"
|
||||||
|
#define OSD_3DMODE_SERVICE "SoftHDDevice-Osd3DModeService-v1.0"
|
||||||
|
|
||||||
enum
|
enum
|
||||||
{ GRAB_IMG_RGBA_FORMAT_B8G8R8A8 };
|
{ GRAB_IMG_RGBA_FORMAT_B8G8R8A8 };
|
||||||
@ -42,3 +43,8 @@ typedef struct
|
|||||||
int height;
|
int height;
|
||||||
void *img;
|
void *img;
|
||||||
} SoftHDDevice_AtmoGrabService_v1_0_t;
|
} SoftHDDevice_AtmoGrabService_v1_0_t;
|
||||||
|
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
int Mode;
|
||||||
|
} SoftHDDevice_Osd3DModeService_v1_0_t;
|
||||||
|
53
video.c
53
video.c
@ -374,6 +374,7 @@ static pthread_mutex_t VideoLockMutex; ///< video lock mutex
|
|||||||
static int OsdConfigWidth; ///< osd configured width
|
static int OsdConfigWidth; ///< osd configured width
|
||||||
static int OsdConfigHeight; ///< osd configured height
|
static int OsdConfigHeight; ///< osd configured height
|
||||||
static char OsdShown; ///< flag show osd
|
static char OsdShown; ///< flag show osd
|
||||||
|
static char Osd3DMode; ///< 3D OSD mode
|
||||||
static int OsdWidth; ///< osd width
|
static int OsdWidth; ///< osd width
|
||||||
static int OsdHeight; ///< osd height
|
static int OsdHeight; ///< osd height
|
||||||
static int OsdDirtyX; ///< osd dirty area x
|
static int OsdDirtyX; ///< osd dirty area x
|
||||||
@ -7439,6 +7440,7 @@ static void VdpauMixOsd(void)
|
|||||||
VdpOutputSurfaceRenderBlendState blend_state;
|
VdpOutputSurfaceRenderBlendState blend_state;
|
||||||
VdpRect source_rect;
|
VdpRect source_rect;
|
||||||
VdpRect output_rect;
|
VdpRect output_rect;
|
||||||
|
VdpRect output_double_rect;
|
||||||
VdpStatus status;
|
VdpStatus status;
|
||||||
|
|
||||||
//uint32_t start;
|
//uint32_t start;
|
||||||
@ -7486,6 +7488,21 @@ static void VdpauMixOsd(void)
|
|||||||
output_rect.y1 = VideoWindowHeight;
|
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();
|
//start = GetMsTicks();
|
||||||
|
|
||||||
// FIXME: double buffered osd disabled
|
// FIXME: double buffered osd disabled
|
||||||
@ -7501,6 +7518,19 @@ static void VdpauMixOsd(void)
|
|||||||
Error(_("video/vdpau: can't render bitmap surface: %s\n"),
|
Error(_("video/vdpau: can't render bitmap surface: %s\n"),
|
||||||
VdpauGetErrorString(status));
|
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
|
#else
|
||||||
status =
|
status =
|
||||||
VdpauOutputSurfaceRenderOutputSurface(VdpauSurfacesRb
|
VdpauOutputSurfaceRenderOutputSurface(VdpauSurfacesRb
|
||||||
@ -7512,6 +7542,19 @@ static void VdpauMixOsd(void)
|
|||||||
Error(_("video/vdpau: can't render output surface: %s\n"),
|
Error(_("video/vdpau: can't render output surface: %s\n"),
|
||||||
VdpauGetErrorString(status));
|
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
|
#endif
|
||||||
//end = GetMsTicks();
|
//end = GetMsTicks();
|
||||||
/*
|
/*
|
||||||
@ -8835,6 +8878,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.
|
/// Setup osd.
|
||||||
///
|
///
|
||||||
|
3
video.h
3
video.h
@ -169,6 +169,9 @@ extern void VideoGetOsdSize(int *, int *);
|
|||||||
/// Set OSD size.
|
/// Set OSD size.
|
||||||
extern void VideoSetOsdSize(int, int);
|
extern void VideoSetOsdSize(int, int);
|
||||||
|
|
||||||
|
/// Set Osd 3D Mode
|
||||||
|
extern void VideoSetOsd3DMode(int);
|
||||||
|
|
||||||
/// Set video clock.
|
/// Set video clock.
|
||||||
extern void VideoSetClock(VideoHwDecoder *, int64_t);
|
extern void VideoSetClock(VideoHwDecoder *, int64_t);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user