]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/libdavs2.c
vaapi_encode: Add flag to mark encoders supporting only constant-quality
[ffmpeg] / libavcodec / libdavs2.c
index 70aae3e5eb02884df732c58e34bdf0a5cd638ca9..aa1478290abfdc31e8afe075f2fdb9b0b013934f 100644 (file)
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
-#include "libavutil/avassert.h"
-#include "libavutil/common.h"
-#include "libavutil/avutil.h"
 #include "avcodec.h"
-#include "libavutil/imgutils.h"
-#include "internal.h"
-
 #include "davs2.h"
 
 typedef struct DAVS2Context {
@@ -56,7 +50,7 @@ static av_cold int davs2_init(AVCodecContext *avctx)
 
     if (!cad->decoder) {
         av_log(avctx, AV_LOG_ERROR, "decoder created error.");
-        return AVERROR(EINVAL);
+        return AVERROR_EXTERNAL;
     }
 
     av_log(avctx, AV_LOG_VERBOSE, "decoder created. %p\n", cad->decoder);
@@ -90,7 +84,7 @@ static int davs2_dump_frames(AVCodecContext *avctx, davs2_picture_t *pic,
 
         if (!frame->buf[plane]){
             av_log(avctx, AV_LOG_ERROR, "dump error: alloc failed.\n");
-            return AVERROR(EINVAL);
+            return AVERROR(ENOMEM);
         }
 
         frame->data[plane]     = frame->buf[plane]->data;
@@ -148,7 +142,7 @@ static int davs2_decode_frame(AVCodecContext *avctx, void *data,
 
     if (ret == DAVS2_ERROR) {
         av_log(avctx, AV_LOG_ERROR, "Decoder error: can't read packet\n");
-        return AVERROR(EINVAL);
+        return AVERROR_EXTERNAL;
     }
 
     ret = davs2_decoder_recv_frame(cad->decoder, &cad->headerset, &cad->out_frame);