From cfaa10d56f23a33dc0a5d4276895816b34c40abb Mon Sep 17 00:00:00 2001 From: "gunsoo83.kim" Date: Thu, 25 Sep 2014 12:54:53 +0900 Subject: [PATCH] brillcodec: add DXVA plug-in probe - DXVA2 plug-in check capability in runtime. Change-Id: Ib39e89b1dfb7b41f6e731a8c77cfc11776caedc1 Signed-off-by: gunsoo83.kim --- tizen/src/hw/pci/maru_dxva2_plugin.c | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/tizen/src/hw/pci/maru_dxva2_plugin.c b/tizen/src/hw/pci/maru_dxva2_plugin.c index 0a6f1806d4..1edd267989 100644 --- a/tizen/src/hw/pci/maru_dxva2_plugin.c +++ b/tizen/src/hw/pci/maru_dxva2_plugin.c @@ -798,7 +798,7 @@ static void maru_dxva2_close(void) //free(dxva_ctx); } -static int maru_dxva2_open(AVCodecContext *dec_ctx) +static bool probe(void) { if (hd3d9_dll == NULL || hdxva2_dll == NULL) { hd3d9_dll = LoadLibrary(TEXT("D3D9.DLL")); @@ -830,27 +830,22 @@ static int maru_dxva2_open(AVCodecContext *dec_ctx) } } - if (DxFindVideoServiceConversion(dec_ctx->codec_id)) { - ERR("DxFindVideoServiceConversion failed\n"); - goto error; - } - - dxva_ctx->thread_count = dec_ctx->thread_count; - - return 0; + return true; error: maru_dxva2_close(); - return -1; + return false; } static bool dxva_setup(AVCodecContext *dec_ctx, int width, int height) { - if(maru_dxva2_open(dec_ctx) < 0) { - ERR("DXVA initialization failed\n"); + if (DxFindVideoServiceConversion(dec_ctx->codec_id)) { + ERR("DxFindVideoServiceConversion failed\n"); return false; } + dxva_ctx->thread_count = dec_ctx->thread_count; + //TODO: destroy surface and decoder at avcontext deinit() DxDestroyVideoDecoder(); @@ -993,7 +988,7 @@ CodecPlugin dxva_plugin = { .name = "DXVA2", .pix_fmt = PIX_FMT_DXVA2_VLD, .output_pix_fmt = PIX_FMT_YUV420P, - .probe = NULL; + .probe = probe, .setup = dxva_setup, .get_buffer = dxva_get_surface, .release_buffer = dxva_release_surface, -- 2.34.1