1
0
mirror of https://github.com/jojo61/vdr-plugin-softhdcuvid.git synced 2023-10-10 13:37:41 +02:00

Fix Placebo for AMD

This commit is contained in:
jojo61 2021-12-05 17:44:45 +01:00
parent 3ca2a06e9d
commit 1878eaec88
2 changed files with 11 additions and 4 deletions

View File

@ -63,7 +63,7 @@ extern void ToggleLUT();
/// vdr-plugin version number. /// vdr-plugin version number.
/// Makefile extracts the version number for generating the file name /// Makefile extracts the version number for generating the file name
/// for the distribution archive. /// for the distribution archive.
static const char *const VERSION = "3.5.3" static const char *const VERSION = "3.5.4"
#ifdef GIT_REV #ifdef GIT_REV
"-GIT" GIT_REV "-GIT" GIT_REV
#endif #endif

11
video.c
View File

@ -2409,6 +2409,7 @@ void generateVAAPIImage(CuvidDecoder * decoder, int index, const AVFrame * frame
uint64_t first_time; uint64_t first_time;
VADRMPRIMESurfaceDescriptor desc; VADRMPRIMESurfaceDescriptor desc;
vaSyncSurface(decoder->VaDisplay, (unsigned int)frame->data[3]);
status = status =
vaExportSurfaceHandle(decoder->VaDisplay, (unsigned int)frame->data[3], VA_SURFACE_ATTRIB_MEM_TYPE_DRM_PRIME_2, vaExportSurfaceHandle(decoder->VaDisplay, (unsigned int)frame->data[3], VA_SURFACE_ATTRIB_MEM_TYPE_DRM_PRIME_2,
VA_EXPORT_SURFACE_READ_ONLY | VA_EXPORT_SURFACE_SEPARATE_LAYERS, &desc); VA_EXPORT_SURFACE_READ_ONLY | VA_EXPORT_SURFACE_SEPARATE_LAYERS, &desc);
@ -2417,7 +2418,7 @@ void generateVAAPIImage(CuvidDecoder * decoder, int index, const AVFrame * frame
printf("Fehler beim export VAAPI Handle\n"); printf("Fehler beim export VAAPI Handle\n");
return; return;
} }
vaSyncSurface(decoder->VaDisplay, (unsigned int)frame->data[3]); //vaSyncSurface(decoder->VaDisplay, (unsigned int)frame->data[3]);
Lock_and_SharedContext; Lock_and_SharedContext;
for (n = 0; n < 2; n++) { // Set DMA_BUF from VAAPI decoder to Textures for (n = 0; n < 2; n++) { // Set DMA_BUF from VAAPI decoder to Textures
int id = desc.layers[n].object_index[0]; int id = desc.layers[n].object_index[0];
@ -2431,6 +2432,11 @@ void generateVAAPIImage(CuvidDecoder * decoder, int index, const AVFrame * frame
return; return;
} }
if (!size) {
size = n==0 ? desc.width * desc.height: desc.width * desc.height /2 ;
}
// fmt = pl_find_fourcc(p->gpu,desc.layers[n].drm_format); // fmt = pl_find_fourcc(p->gpu,desc.layers[n].drm_format);
#if 1 #if 1
if (decoder->PixFmt == AV_PIX_FMT_NV12) { if (decoder->PixFmt == AV_PIX_FMT_NV12) {
@ -2592,6 +2598,7 @@ void generateVAAPIImage(CuvidDecoder * decoder, VASurfaceID index, const AVFrame
#if defined (VAAPI) && !defined (RASPI) #if defined (VAAPI) && !defined (RASPI)
VADRMPRIMESurfaceDescriptor desc; VADRMPRIMESurfaceDescriptor desc;
vaSyncSurface(decoder->VaDisplay, (VASurfaceID) (uintptr_t) frame->data[3]);
status = status =
vaExportSurfaceHandle(decoder->VaDisplay, (VASurfaceID) (uintptr_t) frame->data[3], vaExportSurfaceHandle(decoder->VaDisplay, (VASurfaceID) (uintptr_t) frame->data[3],
VA_SURFACE_ATTRIB_MEM_TYPE_DRM_PRIME_2, VA_EXPORT_SURFACE_READ_ONLY | VA_EXPORT_SURFACE_SEPARATE_LAYERS, VA_SURFACE_ATTRIB_MEM_TYPE_DRM_PRIME_2, VA_EXPORT_SURFACE_READ_ONLY | VA_EXPORT_SURFACE_SEPARATE_LAYERS,
@ -2601,7 +2608,7 @@ void generateVAAPIImage(CuvidDecoder * decoder, VASurfaceID index, const AVFrame
printf("Fehler beim export VAAPI Handle\n"); printf("Fehler beim export VAAPI Handle\n");
return; return;
} }
vaSyncSurface(decoder->VaDisplay, (VASurfaceID) (uintptr_t) frame->data[3]); //vaSyncSurface(decoder->VaDisplay, (VASurfaceID) (uintptr_t) frame->data[3]);
#endif #endif
#ifdef RASPI #ifdef RASPI
AVDRMFrameDescriptor desc; AVDRMFrameDescriptor desc;