Unified · Split
| @@ -25,6 +25,7 @@ · 24 unmodified lines | ||
| 25 | 25 | #include "imgutils.h" |
| 26 | 26 | #include "mem.h" |
| 27 | 27 | #include "samplefmt.h" |
| 28 | +#include "hwcontext.h" | |
| 28 | 29 | |
| 29 | 30 | #if FF_API_FRAME_GET_SET |
| 30 | 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 | 627 | tmp.channels = frame->channels; |
| 627 | 628 | tmp.channel_layout = frame->channel_layout; |
| 628 | 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 | 635 | if (ret < 0) |
| 631 | 636 | return ret; |
| 632 | 637 | |
| @@ -752,6 +757,9 @@ static int frame_copy_video(AVFrame *dst, const AVFrame *src) · 119 unmodified lines | ||
| 752 | 757 | dst->height < src->height) |
| 753 | 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 | 763 | planes = av_pix_fmt_count_planes(dst->format); |
| 756 | 764 | for (i = 0; i < planes; i++) |
| 757 | 765 | if (!dst->data[i] || !src->data[i]) |
| @@ -80,7 +80,7 @@ · 79 unmodified lines | ||
| 80 | 80 | |
| 81 | 81 | #define LIBAVUTIL_VERSION_MAJOR 56 |
| 82 | 82 | #define LIBAVUTIL_VERSION_MINOR 42 |
| 83 | −#define LIBAVUTIL_VERSION_MICRO 101 | |
| 83 | +#define LIBAVUTIL_VERSION_MICRO 102 | |
| 84 | 84 | |
| 85 | 85 | #define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \ |
| 86 | 86 | LIBAVUTIL_VERSION_MINOR, \ |