mirror of
https://projects.vdr-developer.org/git/vdr-plugin-softhddevice.git
synced 2023-10-10 19:16:51 +02:00
Fix bug: Can't use software decoder with VDPAU.
This commit is contained in:
parent
ecb48a5d63
commit
c07ec82e6d
@ -1,6 +1,7 @@
|
||||
User johns
|
||||
Date:
|
||||
|
||||
Fix bug: Can't use software decoder with VDPAU.
|
||||
Resume plugin, if suspend control stops.
|
||||
Removes old audio code (!USE_AUDIORING).
|
||||
Use -DOSD_DEBUG to debug OSD.
|
||||
|
16
codec.c
16
codec.c
@ -363,22 +363,6 @@ void CodecVideoOpen(VideoDecoder * decoder, const char *name, int codec_id)
|
||||
if (decoder->VideoCtx) {
|
||||
Error(_("codec: missing close\n"));
|
||||
}
|
||||
//
|
||||
// ffmpeg compatibility hack
|
||||
//
|
||||
#if 1 || (LIBAVCODEC_VERSION_INT <= AV_VERSION_INT(52,96,0))
|
||||
if (name) {
|
||||
if (!strcmp(name, "h264video_vdpau")) {
|
||||
name = "h264_vdpau";
|
||||
} else if (!strcmp(name, "mpeg4video_vdpau")) {
|
||||
name = "mpeg4_vdpau";
|
||||
} else if (!strcmp(name, "vc1video_vdpau")) {
|
||||
name = "vc1_vdpau";
|
||||
} else if (!strcmp(name, "wmv3video_vdpau")) {
|
||||
name = "wmv3_vdpau";
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
if (name && (video_codec = avcodec_find_decoder_by_name(name))) {
|
||||
Debug(3, "codec: vdpau decoder found\n");
|
||||
|
21
softhddev.c
21
softhddev.c
@ -59,9 +59,9 @@ static int H264Dump(const uint8_t * data, int size);
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifdef USE_VDPAU
|
||||
static char ConfigVdpauDecoder = 1; ///< use vdpau decoder, if possible
|
||||
static char VdpauDecoder = 1; ///< vdpau decoder used
|
||||
#else
|
||||
#define ConfigVdpauDecoder 0 ///< no vdpau decoder configured
|
||||
#define VdpauDecoder 0 ///< no vdpau decoder configured
|
||||
#endif
|
||||
|
||||
extern int ConfigAudioBufferTime; ///< config size ms of audio buffer
|
||||
@ -1533,17 +1533,16 @@ int VideoDecodeInput(void)
|
||||
case CODEC_ID_MPEG2VIDEO:
|
||||
if (last_codec_id != CODEC_ID_MPEG2VIDEO) {
|
||||
last_codec_id = CODEC_ID_MPEG2VIDEO;
|
||||
CodecVideoOpen(MyVideoDecoder,
|
||||
ConfigVdpauDecoder ? "mpegvideo_vdpau" : NULL,
|
||||
CodecVideoOpen(MyVideoDecoder, VideoHardwareDecoder < 0
|
||||
&& VdpauDecoder ? "mpeg_vdpau" : NULL,
|
||||
CODEC_ID_MPEG2VIDEO);
|
||||
}
|
||||
break;
|
||||
case CODEC_ID_H264:
|
||||
if (last_codec_id != CODEC_ID_H264) {
|
||||
last_codec_id = CODEC_ID_H264;
|
||||
CodecVideoOpen(MyVideoDecoder,
|
||||
ConfigVdpauDecoder ? "h264video_vdpau" : NULL,
|
||||
CODEC_ID_H264);
|
||||
CodecVideoOpen(MyVideoDecoder, VideoHardwareDecoder
|
||||
&& VdpauDecoder ? "h264_vdpau" : NULL, CODEC_ID_H264);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
@ -1587,6 +1586,10 @@ int VideoGetBuffers(void)
|
||||
static void StartVideo(void)
|
||||
{
|
||||
VideoInit(X11DisplayName);
|
||||
#ifdef USE_VDPAU
|
||||
VdpauDecoder = !strcasecmp(VideoGetDriverName(), "vdpau");
|
||||
#endif
|
||||
|
||||
if (ConfigFullscreen) {
|
||||
// FIXME: not good looking, mapped and then resized.
|
||||
VideoSetFullscreen(1);
|
||||
@ -2347,10 +2350,6 @@ int ProcessArgs(int argc, char *const argv[])
|
||||
continue;
|
||||
case 'v': // video driver
|
||||
VideoSetDevice(optarg);
|
||||
#ifdef USE_VDPAU
|
||||
// FIXME: this is a big hack
|
||||
ConfigVdpauDecoder = !strcasecmp(optarg, "vdpau");
|
||||
#endif
|
||||
continue;
|
||||
case 'x': // x11 server
|
||||
ConfigStartX11Server = 1;
|
||||
|
26
video.c
26
video.c
@ -5345,7 +5345,7 @@ static void VdpauCreateSurfaces(VdpauDecoder * decoder, int width, int height)
|
||||
|
||||
#ifdef DEBUG
|
||||
if (!decoder->SurfacesNeeded) {
|
||||
Error(_("video/vaapi: surface needed not set\n"));
|
||||
Error(_("video/vdpau: surface needed not set\n"));
|
||||
decoder->SurfacesNeeded = 3 + VIDEO_SURFACES_MAX;
|
||||
}
|
||||
#endif
|
||||
@ -7381,14 +7381,8 @@ static void VdpauRenderFrame(VdpauDecoder * decoder,
|
||||
decoder->InputWidth = video_ctx->width;
|
||||
decoder->InputHeight = video_ctx->height;
|
||||
|
||||
//
|
||||
// detect interlaced input
|
||||
//
|
||||
Debug(3, "video/vdpau: interlaced %d top-field-first %d\n",
|
||||
frame->interlaced_frame, frame->top_field_first);
|
||||
// FIXME: I hope this didn't change in the middle of the stream
|
||||
|
||||
VdpauCleanup(decoder);
|
||||
decoder->SurfacesNeeded = VIDEO_SURFACES_MAX + 2;
|
||||
VdpauSetupOutput(decoder);
|
||||
}
|
||||
//
|
||||
@ -7402,6 +7396,7 @@ static void VdpauRenderFrame(VdpauDecoder * decoder,
|
||||
default:
|
||||
Fatal(_("video/vdpau: pixel format %d not supported\n"),
|
||||
video_ctx->pix_fmt);
|
||||
// FIXME: no fatals!
|
||||
}
|
||||
|
||||
// convert ffmpeg order to vdpau
|
||||
@ -7421,6 +7416,8 @@ static void VdpauRenderFrame(VdpauDecoder * decoder,
|
||||
VdpauGetErrorString(status));
|
||||
}
|
||||
|
||||
Debug(4, "video/vdpau: sw render hw surface %#08x\n", surface);
|
||||
|
||||
VdpauQueueSurface(decoder, surface, 1);
|
||||
}
|
||||
|
||||
@ -9942,6 +9939,19 @@ void VideoSetDevice(const char *device)
|
||||
VideoDevice = device;
|
||||
}
|
||||
|
||||
///
|
||||
/// Get video driver name.
|
||||
///
|
||||
/// @returns name of current video driver.
|
||||
///
|
||||
const char *VideoGetDriverName(void)
|
||||
{
|
||||
if (VideoUsedModule) {
|
||||
return VideoUsedModule->Name;
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
///
|
||||
/// Set video geometry.
|
||||
///
|
||||
|
Loading…
Reference in New Issue
Block a user