From: gunsoo83.kim Date: Thu, 25 Sep 2014 03:54:53 +0000 (+0900) Subject: brillcodec: add DXVA plug-in probe X-Git-Tag: Tizen_Studio_1.3_Release_p2.3.2~620^2~5 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=cfaa10d56f23a33dc0a5d4276895816b34c40abb;p=sdk%2Femulator%2Fqemu.git brillcodec: add DXVA plug-in probe - DXVA2 plug-in check capability in runtime. Change-Id: Ib39e89b1dfb7b41f6e731a8c77cfc11776caedc1 Signed-off-by: gunsoo83.kim --- 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,