diff options
author | Johns <johns98@gmx.net> | 2011-12-29 00:55:57 +0100 |
---|---|---|
committer | Johns <johns98@gmx.net> | 2011-12-29 00:55:57 +0100 |
commit | 23300b0383286bf4628f679cbf7fccc65d713d9a (patch) | |
tree | 0a3ec803bb9d9f0ceb6df169a457b9bfdf81fe21 /video.c | |
parent | baf10db48ef1b3097134fd19fc782b569e8a26a8 (diff) | |
download | vdr-plugin-softhddevice-23300b0383286bf4628f679cbf7fccc65d713d9a.tar.gz vdr-plugin-softhddevice-23300b0383286bf4628f679cbf7fccc65d713d9a.tar.bz2 |
Add missing VdpauDecoderDestroy.0.1.3
Diffstat (limited to 'video.c')
-rw-r--r-- | video.c | 76 |
1 files changed, 74 insertions, 2 deletions
@@ -3211,9 +3211,10 @@ static void VdpauCreateSurfaces(VdpauDecoder * decoder, int width, int height) VdpauVideoSurfaceCreate(decoder->Device, decoder->ChromaType, width, height, decoder->SurfacesFree + i); 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)); - // 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", width, height, decoder->SurfacesFree[i]); @@ -3238,11 +3239,14 @@ static void VdpauDestroySurfaces(VdpauDecoder * decoder) Debug(3, "video/vdpau: invalid surface\n"); } #endif + Debug(4, "video/vdpau: destroy video surface with id 0x%08x\n", + decoder->SurfacesFree[i]); status = VdpauVideoSurfaceDestroy(decoder->SurfacesFree[i]); if (status != VDP_STATUS_OK) { Error(_("video/vdpau: can't destroy video surface: %s\n"), VdpauGetErrorString(status)); } + decoder->SurfacesFree[i] = VDP_INVALID_HANDLE; } for (i = 0; i < decoder->SurfaceUsedN; ++i) { #ifdef DEBUG @@ -3250,11 +3254,14 @@ static void VdpauDestroySurfaces(VdpauDecoder * decoder) Debug(3, "video/vdpau: invalid surface\n"); } #endif + Debug(4, "video/vdpau: destroy video surface with id 0x%08x\n", + decoder->SurfacesUsed[i]); status = VdpauVideoSurfaceDestroy(decoder->SurfacesUsed[i]); if (status != VDP_STATUS_OK) { Error(_("video/vdpau: can't destroy video surface: %s\n"), VdpauGetErrorString(status)); } + decoder->SurfacesUsed[i] = VDP_INVALID_HANDLE; } decoder->SurfaceFreeN = 0; decoder->SurfaceUsedN = 0; @@ -3517,6 +3524,15 @@ static void VdpauCleanup(VdpauDecoder * decoder) VdpStatus status; 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) { status = VdpauVideoMixerDestroy(decoder->VideoMixer); 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"), 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) { + int i; + if (VdpauDecoders[0]) { VdpauDelDecoder(VdpauDecoders[0]); VdpauDecoders[0] = NULL; } if (VdpauDevice) { + if (VdpauQueue) { VdpauPresentationQueueDestroy(VdpauQueue); VdpauQueue = 0; @@ -3956,7 +3977,24 @@ static void VideoVdpauExit(void) VdpauPresentationQueueTargetDestroy(VdpauQueueTarget); 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... + if (VdpauDeviceDestroy) { VdpauDeviceDestroy(VdpauDevice); } @@ -5071,6 +5109,7 @@ static void VdpauOsdInit(int width, int height) if (!VdpauDevice) { Debug(3, "video/vdpau: vdpau not setup\n"); + return; } VdpauOsdWidth = width; @@ -5089,6 +5128,9 @@ static void VdpauOsdInit(int width, int height) Error(_("video/vdpau: can't create bitmap surface: %s\n"), VdpauGetErrorString(status)); } + Debug(4, + "video/vdpau: created bitmap surface %dx%d with id 0x%08x\n", + width, height, VdpauOsdBitmapSurface[i]); } } #else @@ -5101,6 +5143,9 @@ static void VdpauOsdInit(int width, int height) Error(_("video/vdpau: can't create output surface: %s\n"), VdpauGetErrorString(status)); } + Debug(4, + "video/vdpau: created osd output surface %dx%d with id 0x%08x\n", + width, height, VdpauOsdOutputSurface[i]); } } #endif @@ -5110,6 +5155,14 @@ static void VdpauOsdInit(int width, int height) VdpauOsdClear(); } +/** +** Cleanup osd. +*/ +static void VdpauOsdExit(void) +{ + Debug(3, "FIXME: %s\n", __FUNCTION__); +} + #endif //---------------------------------------------------------------------------- @@ -5264,6 +5317,25 @@ void VideoOsdInit(void) #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 //---------------------------------------------------------------------------- |