| @@ -25,6 +25,7 @@ · 24 unmodified lines |
| 25 | #include "imgutils.h" | 25 | #include "imgutils.h" |
| 26 | #include "mem.h" | 26 | #include "mem.h" |
| 27 | #include "samplefmt.h" | 27 | #include "samplefmt.h" |
| | 28 | #include "hwcontext.h" |
| 28 | | 29 | |
| 29 | #if FF_API_FRAME_GET_SET | 30 | #if FF_API_FRAME_GET_SET |
| 30 | MAKE_ACCESSORS(AVFrame, frame, int64_t, best_effort_timestamp) | 31 | MAKE_ACCESSORS(AVFrame, frame, int64_t, best_effort_timestamp) |
| @@ -626,7 +627,11 @@ int av_frame_make_writable(AVFrame *frame) · 595 unmodified lines |
| 626 | tmp.channels = frame->channels; | 627 | tmp.channels = frame->channels; |
| 627 | tmp.channel_layout = frame->channel_layout; | 628 | tmp.channel_layout = frame->channel_layout; |
| 628 | tmp.nb_samples = frame->nb_samples; | 629 | tmp.nb_samples = frame->nb_samples; |
| 629 | ret = av_frame_get_buffer(&tmp, 32); | 630 | |
| | 631 | if (frame->hw_frames_ctx) |
| | 632 | ret = av_hwframe_get_buffer(frame->hw_frames_ctx, &tmp, 0); |
| | 633 | else |
| | 634 | ret = av_frame_get_buffer(&tmp, 32); |
| 630 | if (ret < 0) | 635 | if (ret < 0) |
| 631 | return ret; | 636 | return ret; |
| 632 | | 637 | |
| @@ -752,6 +757,9 @@ static int frame_copy_video(AVFrame *dst, const AVFrame *src) · 119 unmodified lines |
| 752 | dst->height < src->height) | 757 | dst->height < src->height) |
| 753 | return AVERROR(EINVAL); | 758 | return AVERROR(EINVAL); |
| 754 | | 759 | |
| | 760 | if (src->hw_frames_ctx || dst->hw_frames_ctx) |
| | 761 | return av_hwframe_transfer_data(dst, src, 0); |
| | 762 | |
| 755 | planes = av_pix_fmt_count_planes(dst->format); | 763 | planes = av_pix_fmt_count_planes(dst->format); |
| 756 | for (i = 0; i < planes; i++) | 764 | for (i = 0; i < planes; i++) |
| 757 | if (!dst->data[i] || !src->data[i]) | 765 | if (!dst->data[i] || !src->data[i]) |