Dump iopattern mode and the SDK error/warning desciptions for qsv based filters and iopattern mode for qsvenc
Showing the changes to libavfilter (3 of 4 files). Show all
Unified · Split
| @@ -609,15 +609,19 @@ static int init_vpp_session(AVFilterContext *avctx, QSVVPPContext *s) · 608 unmodified lines | ||
| 609 | 609 | } |
| 610 | 610 | } |
| 611 | 611 | |
| 612 | − if (ret != MFX_ERR_NONE) { | |
| 613 | − av_log(avctx, AV_LOG_ERROR, "Error getting the session handle\n"); | |
| 612 | + if (ret < 0) | |
| 613 | + return ff_qsvvpp_print_error(avctx, ret, "Error getting the session handle"); | |
| 614 | + else if (ret > 0) { | |
| 615 | + ff_qsvvpp_print_warning(avctx, ret, "Warning in getting the session handle"); | |
| 614 | 616 | return AVERROR_UNKNOWN; |
| 615 | 617 | } |
| 616 | 618 | |
| 617 | 619 | /* create a "slave" session with those same properties, to be used for vpp */ |
| 618 | 620 | ret = MFXInit(impl, &ver, &s->session); |
| 619 | − if (ret != MFX_ERR_NONE) { | |
| 620 | − av_log(avctx, AV_LOG_ERROR, "Error initializing a session for scaling\n"); | |
| 621 | + if (ret < 0) | |
| 622 | + return ff_qsvvpp_print_error(avctx, ret, "Error initializing a session"); | |
| 623 | + else if (ret > 0) { | |
| 624 | + ff_qsvvpp_print_warning(avctx, ret, "Warning in session initialization"); | |
| 621 | 625 | return AVERROR_UNKNOWN; |
| 622 | 626 | } |
| 623 | 627 | |
| @@ -750,11 +754,16 @@ int ff_qsvvpp_create(AVFilterContext *avctx, QSVVPPContext **vpp, QSVVPPParam *p · 126 unmodified lines | ||
| 750 | 754 | else if (IS_OPAQUE_MEMORY(s->out_mem_mode)) |
| 751 | 755 | s->vpp_param.IOPattern |= MFX_IOPATTERN_OUT_OPAQUE_MEMORY; |
| 752 | 756 | |
| 757 | + /* Print input memory mode */ | |
| 758 | + ff_qsvvpp_print_iopattern(avctx, s->vpp_param.IOPattern & 0x0F, "VPP"); | |
| 759 | + /* Print output memory mode */ | |
| 760 | + ff_qsvvpp_print_iopattern(avctx, s->vpp_param.IOPattern & 0xF0, "VPP"); | |
| 753 | 761 | ret = MFXVideoVPP_Init(s->session, &s->vpp_param); |
| 754 | 762 | if (ret < 0) { |
| 755 | − av_log(avctx, AV_LOG_ERROR, "Failed to create a qsvvpp, ret = %d.\n", ret); | |
| 763 | + ret = ff_qsvvpp_print_error(avctx, ret, "Failed to create a qsvvpp"); | |
| 756 | 764 | goto failed; |
| 757 | − } | |
| 765 | + } else if (ret > 0) | |
| 766 | + ff_qsvvpp_print_warning(avctx, ret, "Warning When creating qsvvpp"); | |
| 758 | 767 | |
| 759 | 768 | *vpp = s; |
| 760 | 769 | return 0; |
| @@ -202,16 +202,20 @@ static int init_out_session(AVFilterContext *ctx) · 201 unmodified lines | ||
| 202 | 202 | } |
| 203 | 203 | } |
| 204 | 204 | |
| 205 | − if (err != MFX_ERR_NONE) { | |
| 206 | − av_log(ctx, AV_LOG_ERROR, "Error getting the session handle\n"); | |
| 205 | + if (err < 0) | |
| 206 | + return ff_qsvvpp_print_error(ctx, err, "Error getting the session handle"); | |
| 207 | + else if (err > 0) { | |
| 208 | + ff_qsvvpp_print_warning(ctx, err, "Warning in getting the session handle"); | |
| 207 | 209 | return AVERROR_UNKNOWN; |
| 208 | 210 | } |
| 209 | 211 | |
| 210 | 212 | /* create a "slave" session with those same properties, to be used for |
| 211 | 213 | * actual deinterlacing */ |
| 212 | 214 | err = MFXInit(impl, &ver, &s->session); |
| 213 | − if (err != MFX_ERR_NONE) { | |
| 214 | − av_log(ctx, AV_LOG_ERROR, "Error initializing a session for deinterlacing\n"); | |
| 215 | + if (err < 0) | |
| 216 | + return ff_qsvvpp_print_error(ctx, err, "Error initializing a session for deinterlacing"); | |
| 217 | + else if (err > 0) { | |
| 218 | + ff_qsvvpp_print_warning(ctx, err, "Warning in session initialization"); | |
| 215 | 219 | return AVERROR_UNKNOWN; |
| 216 | 220 | } |
| 217 | 221 | |
| @@ -309,9 +313,17 @@ static int init_out_session(AVFilterContext *ctx) · 91 unmodified lines | ||
| 309 | 313 | par.vpp.Out.FrameRateExtD = ctx->outputs[0]->time_base.den; |
| 310 | 314 | } |
| 311 | 315 | |
| 316 | + /* Print input memory mode */ | |
| 317 | + ff_qsvvpp_print_iopattern(ctx, par.IOPattern & 0x0F, "VPP"); | |
| 318 | + /* Print output memory mode */ | |
| 319 | + ff_qsvvpp_print_iopattern(ctx, par.IOPattern & 0xF0, "VPP"); | |
| 312 | 320 | err = MFXVideoVPP_Init(s->session, &par); |
| 313 | − if (err != MFX_ERR_NONE) { | |
| 314 | − av_log(ctx, AV_LOG_ERROR, "Error opening the VPP for deinterlacing: %d\n", err); | |
| 321 | + if (err < 0) | |
| 322 | + return ff_qsvvpp_print_error(ctx, err, | |
| 323 | + "Error opening the VPP for deinterlacing"); | |
| 324 | + else if (err > 0) { | |
| 325 | + ff_qsvvpp_print_warning(ctx, err, | |
| 326 | + "Warning in VPP initialization"); | |
| 315 | 327 | return AVERROR_UNKNOWN; |
| 316 | 328 | } |
| 317 | 329 | |
| @@ -482,8 +494,13 @@ static int process_frame(AVFilterContext *ctx, const AVFrame *in, · 164 unmodified lines | ||
| 482 | 494 | return QSVDEINT_MORE_INPUT; |
| 483 | 495 | } |
| 484 | 496 | |
| 485 | − if ((err < 0 && err != MFX_ERR_MORE_SURFACE) || !sync) { | |
| 486 | − av_log(ctx, AV_LOG_ERROR, "Error during deinterlacing: %d\n", err); | |
| 497 | + if (err < 0 && err != MFX_ERR_MORE_SURFACE) { | |
| 498 | + ret = ff_qsvvpp_print_error(ctx, err, "Error during deinterlacing"); | |
| 499 | + goto fail; | |
| 500 | + } | |
| 501 | + | |
| 502 | + if (!sync) { | |
| 503 | + av_log(ctx, AV_LOG_ERROR, "No sync during deinterlacing\n"); | |
| 487 | 504 | ret = AVERROR_UNKNOWN; |
| 488 | 505 | goto fail; |
| 489 | 506 | } |
| @@ -494,8 +511,7 @@ static int process_frame(AVFilterContext *ctx, const AVFrame *in, · 4 unmodified lines | ||
| 494 | 511 | err = MFXVideoCORE_SyncOperation(s->session, sync, 1000); |
| 495 | 512 | } while (err == MFX_WRN_IN_EXECUTION); |
| 496 | 513 | if (err < 0) { |
| 497 | − av_log(ctx, AV_LOG_ERROR, "Error synchronizing the operation: %d\n", err); | |
| 498 | − ret = AVERROR_UNKNOWN; | |
| 514 | + ret = ff_qsvvpp_print_error(ctx, err, "Error synchronizing the operation"); | |
| 499 | 515 | goto fail; |
| 500 | 516 | } |
| 501 | 517 | |
| @@ -313,8 +313,10 @@ static int init_out_session(AVFilterContext *ctx) · 312 unmodified lines | ||
| 313 | 313 | } |
| 314 | 314 | } |
| 315 | 315 | |
| 316 | − if (err != MFX_ERR_NONE) { | |
| 317 | − av_log(ctx, AV_LOG_ERROR, "Error getting the session handle\n"); | |
| 316 | + if (err < 0) | |
| 317 | + return ff_qsvvpp_print_error(ctx, err, "Error getting the session handle"); | |
| 318 | + else if (err > 0) { | |
| 319 | + ff_qsvvpp_print_warning(ctx, err, "Warning in getting the session handle"); | |
| 318 | 320 | return AVERROR_UNKNOWN; |
| 319 | 321 | } |
| 320 | 322 | |
| @@ -430,9 +432,17 @@ static int init_out_session(AVFilterContext *ctx) · 109 unmodified lines | ||
| 430 | 432 | par.vpp.Out.FrameRateExtN = 25; |
| 431 | 433 | par.vpp.Out.FrameRateExtD = 1; |
| 432 | 434 | |
| 435 | + /* Print input memory mode */ | |
| 436 | + ff_qsvvpp_print_iopattern(ctx, par.IOPattern & 0x0F, "VPP"); | |
| 437 | + /* Print output memory mode */ | |
| 438 | + ff_qsvvpp_print_iopattern(ctx, par.IOPattern & 0xF0, "VPP"); | |
| 433 | 439 | err = MFXVideoVPP_Init(s->session, &par); |
| 434 | − if (err != MFX_ERR_NONE) { | |
| 435 | − av_log(ctx, AV_LOG_ERROR, "Error opening the VPP for scaling\n"); | |
| 440 | + if (err < 0) | |
| 441 | + return ff_qsvvpp_print_error(ctx, err, | |
| 442 | + "Error opening the VPP for scaling"); | |
| 443 | + else if (err > 0) { | |
| 444 | + ff_qsvvpp_print_warning(ctx, err, | |
| 445 | + "Warning in VPP initialization"); | |
| 436 | 446 | return AVERROR_UNKNOWN; |
| 437 | 447 | } |
| 438 | 448 | |
| @@ -573,8 +583,13 @@ static int qsvscale_filter_frame(AVFilterLink *link, AVFrame *in) · 134 unmodified lines | ||
| 573 | 583 | av_usleep(1); |
| 574 | 584 | } while (err == MFX_WRN_DEVICE_BUSY); |
| 575 | 585 | |
| 576 | − if (err < 0 || !sync) { | |
| 577 | − av_log(ctx, AV_LOG_ERROR, "Error during scaling\n"); | |
| 586 | + if (err < 0) { | |
| 587 | + ret = ff_qsvvpp_print_error(ctx, err, "Error during scaling"); | |
| 588 | + goto fail; | |
| 589 | + } | |
| 590 | + | |
| 591 | + if (!sync) { | |
| 592 | + av_log(ctx, AV_LOG_ERROR, "No sync during scaling\n"); | |
| 578 | 593 | ret = AVERROR_UNKNOWN; |
| 579 | 594 | goto fail; |
| 580 | 595 | } |
| @@ -583,8 +598,7 @@ static int qsvscale_filter_frame(AVFilterLink *link, AVFrame *in) · 2 unmodified lines | ||
| 583 | 598 | err = MFXVideoCORE_SyncOperation(s->session, sync, 1000); |
| 584 | 599 | } while (err == MFX_WRN_IN_EXECUTION); |
| 585 | 600 | if (err < 0) { |
| 586 | − av_log(ctx, AV_LOG_ERROR, "Error synchronizing the operation: %d\n", err); | |
| 587 | − ret = AVERROR_UNKNOWN; | |
| 601 | + ret = ff_qsvvpp_print_error(ctx, err, "Error synchronizing the operation"); | |
| 588 | 602 | goto fail; |
| 589 | 603 | } |
| 590 | 604 | |