Showing the changes to libavfilter (3 of 4 files). Show all
Unified · Split
| @@ -56,6 +56,20 @@ AVFilterBufferRef *avfilter_get_video_buffer_ref_from_frame(const AVFrame *frame · 55 unmodified lines | ||
| 56 | 56 | return picref; |
| 57 | 57 | } |
| 58 | 58 | |
| 59 | +int avfilter_fill_frame_from_audio_buffer_ref(AVFrame *frame, | |
| 60 | + const AVFilterBufferRef *samplesref) | |
| 61 | +{ | |
| 62 | + if (!samplesref || !samplesref->audio || !frame) | |
| 63 | + return AVERROR(EINVAL); | |
| 64 | + | |
| 65 | + memcpy(frame->data, samplesref->data, sizeof(frame->data)); | |
| 66 | + frame->pkt_pos = samplesref->pos; | |
| 67 | + frame->format = samplesref->format; | |
| 68 | + frame->nb_samples = samplesref->audio->nb_samples; | |
| 69 | + | |
| 70 | + return 0; | |
| 71 | +} | |
| 72 | + | |
| 59 | 73 | int avfilter_fill_frame_from_video_buffer_ref(AVFrame *frame, |
| 60 | 74 | const AVFilterBufferRef *picref) |
| 61 | 75 | { |
| @@ -73,3 +87,12 @@ int avfilter_fill_frame_from_video_buffer_ref(AVFrame *frame, · 11 unmodified lines | ||
| 73 | 87 | |
| 74 | 88 | return 0; |
| 75 | 89 | } |
| 90 | + | |
| 91 | +int avfilter_fill_frame_from_buffer_ref(AVFrame *frame, | |
| 92 | + const AVFilterBufferRef *ref) | |
| 93 | +{ | |
| 94 | + if (!ref) | |
| 95 | + return AVERROR(EINVAL); | |
| 96 | + return ref->video ? avfilter_fill_frame_from_video_buffer_ref(frame, ref) | |
| 97 | + : avfilter_fill_frame_from_audio_buffer_ref(frame, ref); | |
| 98 | +} | |
| @@ -46,6 +46,17 @@ int avfilter_copy_frame_props(AVFilterBufferRef *dst, const AVFrame *src); · 45 unmodified lines | ||
| 46 | 46 | */ |
| 47 | 47 | AVFilterBufferRef *avfilter_get_video_buffer_ref_from_frame(const AVFrame *frame, int perms); |
| 48 | 48 | |
| 49 | +/** | |
| 50 | + * Fill an AVFrame with the information stored in samplesref. | |
| 51 | + * | |
| 52 | + * @param frame an already allocated AVFrame | |
| 53 | + * @param samplesref an audio buffer reference | |
| 54 | + * @return 0 in case of success, a negative AVERROR code in case of | |
| 55 | + * failure | |
| 56 | + */ | |
| 57 | +int avfilter_fill_frame_from_audio_buffer_ref(AVFrame *frame, | |
| 58 | + const AVFilterBufferRef *samplesref); | |
| 59 | + | |
| 49 | 60 | /** |
| 50 | 61 | * Fill an AVFrame with the information stored in picref. |
| 51 | 62 | * |
| @@ -57,6 +68,17 @@ AVFilterBufferRef *avfilter_get_video_buffer_ref_from_frame(const AVFrame *frame · 5 unmodified lines | ||
| 57 | 68 | int avfilter_fill_frame_from_video_buffer_ref(AVFrame *frame, |
| 58 | 69 | const AVFilterBufferRef *picref); |
| 59 | 70 | |
| 71 | +/** | |
| 72 | + * Fill an AVFrame with information stored in ref. | |
| 73 | + * | |
| 74 | + * @param frame an already allocated AVFrame | |
| 75 | + * @param ref a video or audio buffer reference | |
| 76 | + * @return 0 in case of success, a negative AVERROR code in case of | |
| 77 | + * failure | |
| 78 | + */ | |
| 79 | +int avfilter_fill_frame_from_buffer_ref(AVFrame *frame, | |
| 80 | + const AVFilterBufferRef *ref); | |
| 81 | + | |
| 60 | 82 | /** |
| 61 | 83 | * Add frame data to buffer_src. |
| 62 | 84 | * |
| @@ -29,8 +29,8 @@ · 28 unmodified lines | ||
| 29 | 29 | #include "libavutil/avutil.h" |
| 30 | 30 | |
| 31 | 31 | #define LIBAVFILTER_VERSION_MAJOR 2 |
| 32 | −#define LIBAVFILTER_VERSION_MINOR 65 | |
| 33 | −#define LIBAVFILTER_VERSION_MICRO 102 | |
| 32 | +#define LIBAVFILTER_VERSION_MINOR 66 | |
| 33 | +#define LIBAVFILTER_VERSION_MICRO 100 | |
| 34 | 34 | |
| 35 | 35 | #define LIBAVFILTER_VERSION_INT AV_VERSION_INT(LIBAVFILTER_VERSION_MAJOR, \ |
| 36 | 36 | LIBAVFILTER_VERSION_MINOR, \ |