brillcodec: check that the libav include hwaccel module. 51/32151/1
authorgunsoo83.kim <gunsoo83.kim@samsung.com>
Wed, 22 Oct 2014 10:58:03 +0000 (19:58 +0900)
committergunsoo83.kim <gunsoo83.kim@samsung.com>
Tue, 16 Dec 2014 05:56:54 +0000 (14:56 +0900)
- 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>
tizen/src/hw/pci/maru_brillcodec.c
tizen/src/hw/pci/maru_brillcodec_plugin.h

index 5b0d1e97d33beb747c6c3fa55f4ebb5acdc67be0..7c86edfc25becfcceee5ebe0adab44ecd2cf752a 100644 (file)
@@ -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;
     }
 
index cc3a485f1eef4f514376b1ad0a6addc07be88000..e8a1b1129463e76e07ae756c71b32fccda3fa212 100644 (file)
@@ -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__