From: gunsoo83.kim Date: Wed, 22 Oct 2014 10:58:03 +0000 (+0900) Subject: brillcodec: check that the libav include hwaccel module. X-Git-Tag: Tizen_Studio_1.3_Release_p2.3.2~614 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=71aaabdd9a2cdc2bad9efa908c584dd23ec707ea;p=sdk%2Femulator%2Fqemu.git brillcodec: check that the libav include hwaccel module. - When brillcodec is using hwaccel module(VAAPI, DXVA), should check that the libav is including hwaccel module. Change-Id: I26eab201cbbe88b440dac8aee6b78017591de63b Signed-off-by: gunsoo83.kim --- diff --git a/tizen/src/hw/pci/maru_brillcodec.c b/tizen/src/hw/pci/maru_brillcodec.c index 5b0d1e97d3..7c86edfc25 100644 --- a/tizen/src/hw/pci/maru_brillcodec.c +++ b/tizen/src/hw/pci/maru_brillcodec.c @@ -1600,7 +1600,8 @@ static enum PixelFormat get_format(AVCodecContext *avctx, CodecContext *context = (CodecContext *)avctx->opaque; MaruBrillCodecState *s = context->state; - if (!s->hwaccel_plugin) { + if (!s->hwaccel_plugin || + !check_av_hw_accel(avctx->codec_id)) { goto end; } diff --git a/tizen/src/hw/pci/maru_brillcodec_plugin.h b/tizen/src/hw/pci/maru_brillcodec_plugin.h index cc3a485f1e..e8a1b11294 100644 --- a/tizen/src/hw/pci/maru_brillcodec_plugin.h +++ b/tizen/src/hw/pci/maru_brillcodec_plugin.h @@ -81,4 +81,21 @@ static inline CodecPlugin *probe_plugin(void) { return NULL; } +static inline bool check_av_hw_accel(enum AVCodecID id) +{ + AVHWAccel *av_hw = NULL; + bool is_exist = false; + + av_hw = av_hwaccel_next(NULL); + while(av_hw) { + if (av_hw->id == id) { + is_exist = true; + break; + } + av_hw = av_hwaccel_next(av_hw); + } + + return is_exist; +} + #endif //__MARU_BRILLCODEC_PLUGIN_H__