mirror of
https://projects.vdr-developer.org/git/vdr-plugin-softhddevice.git
synced 2023-10-10 19:16:51 +02:00
Add missing VdpauDecoderDestroy.
This commit is contained in:
parent
baf10db48e
commit
23300b0383
2
Todo
2
Todo
@ -10,6 +10,8 @@ missing:
|
|||||||
|
|
||||||
vdpau:
|
vdpau:
|
||||||
1080i with temporal spatial too slow GT 520
|
1080i with temporal spatial too slow GT 520
|
||||||
|
VdpPreemptionCallback handling
|
||||||
|
Loose a surface
|
||||||
|
|
||||||
libva-intel-driver:
|
libva-intel-driver:
|
||||||
intel still has hangups most with 1080i
|
intel still has hangups most with 1080i
|
||||||
|
@ -274,9 +274,9 @@ static void VideoEnqueue(int64_t pts, const void *data, int size)
|
|||||||
|
|
||||||
// new + grow reserves FF_INPUT_BUFFER_PADDING_SIZE
|
// new + grow reserves FF_INPUT_BUFFER_PADDING_SIZE
|
||||||
av_grow_packet(avpkt, ((size + VIDEO_BUFFER_SIZE / 2)
|
av_grow_packet(avpkt, ((size + VIDEO_BUFFER_SIZE / 2)
|
||||||
/ (VIDEO_BUFFER_SIZE / 2)) * (VIDEO_BUFFER_SIZE / 2));
|
/ (VIDEO_BUFFER_SIZE / 2)) * (VIDEO_BUFFER_SIZE / 2));
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
if (avpkt->size <= avpkt->stream_index + size ) {
|
if (avpkt->size <= avpkt->stream_index + size) {
|
||||||
abort();
|
abort();
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@ -888,6 +888,7 @@ void Stop(void)
|
|||||||
MyAudioDecoder = NULL;
|
MyAudioDecoder = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
VideoOsdExit();
|
||||||
VideoExit();
|
VideoExit();
|
||||||
AudioExit();
|
AudioExit();
|
||||||
CodecExit();
|
CodecExit();
|
||||||
|
@ -39,7 +39,7 @@ extern "C" {
|
|||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
static const char *const VERSION = "0.1.2";
|
static const char *const VERSION = "0.1.3";
|
||||||
static const char *const DESCRIPTION =
|
static const char *const DESCRIPTION =
|
||||||
trNOOP("A software and GPU emulated HD device");
|
trNOOP("A software and GPU emulated HD device");
|
||||||
|
|
||||||
|
76
video.c
76
video.c
@ -3211,9 +3211,10 @@ static void VdpauCreateSurfaces(VdpauDecoder * decoder, int width, int height)
|
|||||||
VdpauVideoSurfaceCreate(decoder->Device, decoder->ChromaType,
|
VdpauVideoSurfaceCreate(decoder->Device, decoder->ChromaType,
|
||||||
width, height, decoder->SurfacesFree + i);
|
width, height, decoder->SurfacesFree + i);
|
||||||
if (status != VDP_STATUS_OK) {
|
if (status != VDP_STATUS_OK) {
|
||||||
Fatal(_("video/vdpau: can't create video surface: %s\n"),
|
Error(_("video/vdpau: can't create video surface: %s\n"),
|
||||||
VdpauGetErrorString(status));
|
VdpauGetErrorString(status));
|
||||||
// FIXME: no fatal
|
decoder->SurfacesFree[i] = VDP_INVALID_HANDLE;
|
||||||
|
// FIXME: better error handling
|
||||||
}
|
}
|
||||||
Debug(4, "video/vdpau: created video surface %dx%d with id 0x%08x\n",
|
Debug(4, "video/vdpau: created video surface %dx%d with id 0x%08x\n",
|
||||||
width, height, decoder->SurfacesFree[i]);
|
width, height, decoder->SurfacesFree[i]);
|
||||||
@ -3238,11 +3239,14 @@ static void VdpauDestroySurfaces(VdpauDecoder * decoder)
|
|||||||
Debug(3, "video/vdpau: invalid surface\n");
|
Debug(3, "video/vdpau: invalid surface\n");
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
Debug(4, "video/vdpau: destroy video surface with id 0x%08x\n",
|
||||||
|
decoder->SurfacesFree[i]);
|
||||||
status = VdpauVideoSurfaceDestroy(decoder->SurfacesFree[i]);
|
status = VdpauVideoSurfaceDestroy(decoder->SurfacesFree[i]);
|
||||||
if (status != VDP_STATUS_OK) {
|
if (status != VDP_STATUS_OK) {
|
||||||
Error(_("video/vdpau: can't destroy video surface: %s\n"),
|
Error(_("video/vdpau: can't destroy video surface: %s\n"),
|
||||||
VdpauGetErrorString(status));
|
VdpauGetErrorString(status));
|
||||||
}
|
}
|
||||||
|
decoder->SurfacesFree[i] = VDP_INVALID_HANDLE;
|
||||||
}
|
}
|
||||||
for (i = 0; i < decoder->SurfaceUsedN; ++i) {
|
for (i = 0; i < decoder->SurfaceUsedN; ++i) {
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
@ -3250,11 +3254,14 @@ static void VdpauDestroySurfaces(VdpauDecoder * decoder)
|
|||||||
Debug(3, "video/vdpau: invalid surface\n");
|
Debug(3, "video/vdpau: invalid surface\n");
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
Debug(4, "video/vdpau: destroy video surface with id 0x%08x\n",
|
||||||
|
decoder->SurfacesUsed[i]);
|
||||||
status = VdpauVideoSurfaceDestroy(decoder->SurfacesUsed[i]);
|
status = VdpauVideoSurfaceDestroy(decoder->SurfacesUsed[i]);
|
||||||
if (status != VDP_STATUS_OK) {
|
if (status != VDP_STATUS_OK) {
|
||||||
Error(_("video/vdpau: can't destroy video surface: %s\n"),
|
Error(_("video/vdpau: can't destroy video surface: %s\n"),
|
||||||
VdpauGetErrorString(status));
|
VdpauGetErrorString(status));
|
||||||
}
|
}
|
||||||
|
decoder->SurfacesUsed[i] = VDP_INVALID_HANDLE;
|
||||||
}
|
}
|
||||||
decoder->SurfaceFreeN = 0;
|
decoder->SurfaceFreeN = 0;
|
||||||
decoder->SurfaceUsedN = 0;
|
decoder->SurfaceUsedN = 0;
|
||||||
@ -3517,6 +3524,15 @@ static void VdpauCleanup(VdpauDecoder * decoder)
|
|||||||
VdpStatus status;
|
VdpStatus status;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
if (decoder->VideoDecoder != VDP_INVALID_HANDLE) {
|
||||||
|
status = VdpauDecoderDestroy(decoder->VideoDecoder);
|
||||||
|
if (status != VDP_STATUS_OK) {
|
||||||
|
Error(_("video/vdpau: can't destroy video decoder: %s\n"),
|
||||||
|
VdpauGetErrorString(status));
|
||||||
|
}
|
||||||
|
decoder->VideoDecoder = VDP_INVALID_HANDLE;
|
||||||
|
}
|
||||||
|
|
||||||
if (decoder->VideoMixer != VDP_INVALID_HANDLE) {
|
if (decoder->VideoMixer != VDP_INVALID_HANDLE) {
|
||||||
status = VdpauVideoMixerDestroy(decoder->VideoMixer);
|
status = VdpauVideoMixerDestroy(decoder->VideoMixer);
|
||||||
if (status != VDP_STATUS_OK) {
|
if (status != VDP_STATUS_OK) {
|
||||||
@ -3934,6 +3950,8 @@ static void VideoVdpauInit(const char *display_name)
|
|||||||
Fatal(_("video/vdpau: can't create output surface: %s\n"),
|
Fatal(_("video/vdpau: can't create output surface: %s\n"),
|
||||||
VdpauGetErrorString(status));
|
VdpauGetErrorString(status));
|
||||||
}
|
}
|
||||||
|
Debug(3, "video/vdpau: created output surface %dx%d with id 0x%08x\n",
|
||||||
|
VideoWindowWidth, VideoWindowHeight, VdpauSurfacesRb[i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3942,12 +3960,15 @@ static void VideoVdpauInit(const char *display_name)
|
|||||||
///
|
///
|
||||||
static void VideoVdpauExit(void)
|
static void VideoVdpauExit(void)
|
||||||
{
|
{
|
||||||
|
int i;
|
||||||
|
|
||||||
if (VdpauDecoders[0]) {
|
if (VdpauDecoders[0]) {
|
||||||
VdpauDelDecoder(VdpauDecoders[0]);
|
VdpauDelDecoder(VdpauDecoders[0]);
|
||||||
VdpauDecoders[0] = NULL;
|
VdpauDecoders[0] = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (VdpauDevice) {
|
if (VdpauDevice) {
|
||||||
|
|
||||||
if (VdpauQueue) {
|
if (VdpauQueue) {
|
||||||
VdpauPresentationQueueDestroy(VdpauQueue);
|
VdpauPresentationQueueDestroy(VdpauQueue);
|
||||||
VdpauQueue = 0;
|
VdpauQueue = 0;
|
||||||
@ -3956,7 +3977,24 @@ static void VideoVdpauExit(void)
|
|||||||
VdpauPresentationQueueTargetDestroy(VdpauQueueTarget);
|
VdpauPresentationQueueTargetDestroy(VdpauQueueTarget);
|
||||||
VdpauQueueTarget = 0;
|
VdpauQueueTarget = 0;
|
||||||
}
|
}
|
||||||
|
//
|
||||||
|
// destroy display output surfaces
|
||||||
|
//
|
||||||
|
for (i = 0; i < OUTPUT_SURFACES_MAX; ++i) {
|
||||||
|
VdpStatus status;
|
||||||
|
|
||||||
|
Debug(4, "video/vdpau: destroy output surface with id 0x%08x\n",
|
||||||
|
VdpauSurfacesRb[i]);
|
||||||
|
status = VdpauOutputSurfaceDestroy(VdpauSurfacesRb[i]);
|
||||||
|
if (status != VDP_STATUS_OK) {
|
||||||
|
Error(_("video/vdpau: can't destroy output surface: %s\n"),
|
||||||
|
VdpauGetErrorString(status));
|
||||||
|
}
|
||||||
|
VdpauSurfacesRb[i] = VDP_INVALID_HANDLE;
|
||||||
|
}
|
||||||
|
|
||||||
// FIXME: more VDPAU cleanups...
|
// FIXME: more VDPAU cleanups...
|
||||||
|
|
||||||
if (VdpauDeviceDestroy) {
|
if (VdpauDeviceDestroy) {
|
||||||
VdpauDeviceDestroy(VdpauDevice);
|
VdpauDeviceDestroy(VdpauDevice);
|
||||||
}
|
}
|
||||||
@ -5071,6 +5109,7 @@ static void VdpauOsdInit(int width, int height)
|
|||||||
|
|
||||||
if (!VdpauDevice) {
|
if (!VdpauDevice) {
|
||||||
Debug(3, "video/vdpau: vdpau not setup\n");
|
Debug(3, "video/vdpau: vdpau not setup\n");
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
VdpauOsdWidth = width;
|
VdpauOsdWidth = width;
|
||||||
@ -5089,6 +5128,9 @@ static void VdpauOsdInit(int width, int height)
|
|||||||
Error(_("video/vdpau: can't create bitmap surface: %s\n"),
|
Error(_("video/vdpau: can't create bitmap surface: %s\n"),
|
||||||
VdpauGetErrorString(status));
|
VdpauGetErrorString(status));
|
||||||
}
|
}
|
||||||
|
Debug(4,
|
||||||
|
"video/vdpau: created bitmap surface %dx%d with id 0x%08x\n",
|
||||||
|
width, height, VdpauOsdBitmapSurface[i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
@ -5101,6 +5143,9 @@ static void VdpauOsdInit(int width, int height)
|
|||||||
Error(_("video/vdpau: can't create output surface: %s\n"),
|
Error(_("video/vdpau: can't create output surface: %s\n"),
|
||||||
VdpauGetErrorString(status));
|
VdpauGetErrorString(status));
|
||||||
}
|
}
|
||||||
|
Debug(4,
|
||||||
|
"video/vdpau: created osd output surface %dx%d with id 0x%08x\n",
|
||||||
|
width, height, VdpauOsdOutputSurface[i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@ -5110,6 +5155,14 @@ static void VdpauOsdInit(int width, int height)
|
|||||||
VdpauOsdClear();
|
VdpauOsdClear();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
** Cleanup osd.
|
||||||
|
*/
|
||||||
|
static void VdpauOsdExit(void)
|
||||||
|
{
|
||||||
|
Debug(3, "FIXME: %s\n", __FUNCTION__);
|
||||||
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
@ -5264,6 +5317,25 @@ void VideoOsdInit(void)
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
** Cleanup OSD.
|
||||||
|
*/
|
||||||
|
void VideoOsdExit(void)
|
||||||
|
{
|
||||||
|
#ifdef USE_VAAPI
|
||||||
|
if (VideoVaapiEnabled) {
|
||||||
|
// FIXME: VaapiOsdExit();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
#ifdef USE_VDPAU
|
||||||
|
if (VideoVdpauEnabled) {
|
||||||
|
VdpauOsdExit();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
|
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
|
Loading…
Reference in New Issue
Block a user