- 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 <gunsoo83.kim@samsung.com>
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;
}
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__