[FFmpeg-cvslog] Merge commit '8e07c22e508b349d145b9f142aa3ee8b3ce1d3a4'
Mark Thompson
git at videolan.org
Sun Mar 12 18:03:40 EET 2017
ffmpeg | branch: master | Mark Thompson <sw at jkqxz.net> | Sun Mar 12 15:21:41 2017 +0000| [a7434ef19585f3af9ec168ec2db3db299f447285] | committer: Mark Thompson
Merge commit '8e07c22e508b349d145b9f142aa3ee8b3ce1d3a4'
* commit '8e07c22e508b349d145b9f142aa3ee8b3ce1d3a4':
qsvenc: print warnings from encode/init
Merged-by: Mark Thompson <sw at jkqxz.net>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=a7434ef19585f3af9ec168ec2db3db299f447285
---
libavcodec/qsv.c | 10 ++++++++++
libavcodec/qsv_internal.h | 3 +++
libavcodec/qsvenc.c | 6 ++++++
3 files changed, 19 insertions(+)
diff --git a/libavcodec/qsv.c b/libavcodec/qsv.c
index 76c7826..d9a041c 100644
--- a/libavcodec/qsv.c
+++ b/libavcodec/qsv.c
@@ -133,6 +133,16 @@ int ff_qsv_print_error(void *log_ctx, mfxStatus err,
return ret;
}
+int ff_qsv_print_warning(void *log_ctx, mfxStatus err,
+ const char *warning_string)
+{
+ const char *desc;
+ int ret;
+ ret = ff_qsv_map_error(err, &desc);
+ av_log(log_ctx, AV_LOG_WARNING, "%s: %s (%d)\n", warning_string, desc, err);
+ return ret;
+}
+
int ff_qsv_map_pixfmt(enum AVPixelFormat format, uint32_t *fourcc)
{
switch (format) {
diff --git a/libavcodec/qsv_internal.h b/libavcodec/qsv_internal.h
index eb8e3a5..6ccb72a 100644
--- a/libavcodec/qsv_internal.h
+++ b/libavcodec/qsv_internal.h
@@ -65,6 +65,9 @@ int ff_qsv_map_error(mfxStatus mfx_err, const char **desc);
int ff_qsv_print_error(void *log_ctx, mfxStatus err,
const char *error_string);
+int ff_qsv_print_warning(void *log_ctx, mfxStatus err,
+ const char *warning_string);
+
int ff_qsv_codec_id_to_mfx(enum AVCodecID codec_id);
int ff_qsv_profile_to_mfx(enum AVCodecID codec_id, int profile);
diff --git a/libavcodec/qsvenc.c b/libavcodec/qsvenc.c
index a0ea965..2e59150 100644
--- a/libavcodec/qsvenc.c
+++ b/libavcodec/qsvenc.c
@@ -784,6 +784,9 @@ int ff_qsv_enc_init(AVCodecContext *avctx, QSVEncContext *q)
if (ret < 0)
return ff_qsv_print_error(avctx, ret,
"Error initializing the encoder");
+ else if (ret > 0)
+ ff_qsv_print_warning(avctx, ret,
+ "Warning in encoder initialization");
ret = qsv_retrieve_enc_params(avctx, q);
if (ret < 0) {
@@ -991,6 +994,9 @@ static int encode_frame(AVCodecContext *avctx, QSVEncContext *q,
av_usleep(500);
} while (ret == MFX_WRN_DEVICE_BUSY || ret == MFX_WRN_IN_EXECUTION);
+ if (ret > 0)
+ ff_qsv_print_warning(avctx, ret, "Warning during encoding");
+
if (ret < 0) {
av_packet_unref(&new_pkt);
av_freep(&bs);
======================================================================
diff --cc libavcodec/qsv_internal.h
index eb8e3a5,41f4c3d..6ccb72a
--- a/libavcodec/qsv_internal.h
+++ b/libavcodec/qsv_internal.h
@@@ -65,8 -62,10 +65,11 @@@ int ff_qsv_map_error(mfxStatus mfx_err
int ff_qsv_print_error(void *log_ctx, mfxStatus err,
const char *error_string);
+ int ff_qsv_print_warning(void *log_ctx, mfxStatus err,
+ const char *warning_string);
+
int ff_qsv_codec_id_to_mfx(enum AVCodecID codec_id);
+int ff_qsv_profile_to_mfx(enum AVCodecID codec_id, int profile);
int ff_qsv_map_pixfmt(enum AVPixelFormat format, uint32_t *fourcc);
diff --cc libavcodec/qsvenc.c
index a0ea965,ba07db6..2e59150
--- a/libavcodec/qsvenc.c
+++ b/libavcodec/qsvenc.c
@@@ -986,11 -972,14 +989,14 @@@ static int encode_frame(AVCodecContext
}
do {
- ret = MFXVideoENCODE_EncodeFrameAsync(q->session, NULL, surf, bs, sync);
+ ret = MFXVideoENCODE_EncodeFrameAsync(q->session, enc_ctrl, surf, bs, sync);
if (ret == MFX_WRN_DEVICE_BUSY)
- av_usleep(1);
+ av_usleep(500);
} while (ret == MFX_WRN_DEVICE_BUSY || ret == MFX_WRN_IN_EXECUTION);
+ if (ret > 0)
+ ff_qsv_print_warning(avctx, ret, "Warning during encoding");
+
if (ret < 0) {
av_packet_unref(&new_pkt);
av_freep(&bs);
More information about the ffmpeg-cvslog
mailing list