History

lavfi: move avfilter_copy_frame_props() definition from buffer.c to avcodec.c

The new location is more suited, as it is where the lavfi/lavc glue is defined.

Stefano Sabatini committed 14 years ago

Commit 0da9bce1 parent c5270272 files · +27 −27Browse files

Unified · Split

2 files
  1. libavfilter/avcodec.c +27 −0
  2. libavfilter/buffer.c +0 −27
libavfilter/avcodec.c+27−0
@@ -26,6 +26,33 @@ · 25 unmodified lines
2626 #include "avcodec.h"
2727 #include "libavutil/opt.h"
2828
29+int avfilter_copy_frame_props(AVFilterBufferRef *dst, const AVFrame *src)
30+{
31+ dst->pts = src->pts;
32+ dst->pos = av_frame_get_pkt_pos(src);
33+ dst->format = src->format;
34+
35+ switch (dst->type) {
36+ case AVMEDIA_TYPE_VIDEO:
37+ dst->video->w = src->width;
38+ dst->video->h = src->height;
39+ dst->video->sample_aspect_ratio = src->sample_aspect_ratio;
40+ dst->video->interlaced = src->interlaced_frame;
41+ dst->video->top_field_first = src->top_field_first;
42+ dst->video->key_frame = src->key_frame;
43+ dst->video->pict_type = src->pict_type;
44+ break;
45+ case AVMEDIA_TYPE_AUDIO:
46+ dst->audio->sample_rate = src->sample_rate;
47+ dst->audio->channel_layout = src->channel_layout;
48+ break;
49+ default:
50+ return AVERROR(EINVAL);
51+ }
52+
53+ return 0;
54+}
55+
2956 AVFilterBufferRef *avfilter_get_video_buffer_ref_from_frame(const AVFrame *frame,
3057 int perms)
3158 {
libavfilter/buffer.c+0−27
@@ -163,33 +163,6 @@ void avfilter_unref_bufferp(AVFilterBufferRef **ref) · 162 unmodified lines
163163 *ref = NULL;
164164 }
165165
166−int avfilter_copy_frame_props(AVFilterBufferRef *dst, const AVFrame *src)
167−{
168− dst->pts = src->pts;
169− dst->pos = av_frame_get_pkt_pos(src);
170− dst->format = src->format;
171−
172− switch (dst->type) {
173− case AVMEDIA_TYPE_VIDEO:
174− dst->video->w = src->width;
175− dst->video->h = src->height;
176− dst->video->sample_aspect_ratio = src->sample_aspect_ratio;
177− dst->video->interlaced = src->interlaced_frame;
178− dst->video->top_field_first = src->top_field_first;
179− dst->video->key_frame = src->key_frame;
180− dst->video->pict_type = src->pict_type;
181− break;
182− case AVMEDIA_TYPE_AUDIO:
183− dst->audio->sample_rate = src->sample_rate;
184− dst->audio->channel_layout = src->channel_layout;
185− break;
186− default:
187− return AVERROR(EINVAL);
188− }
189−
190− return 0;
191−}
192−
193166 int avfilter_copy_buf_props(AVFrame *dst, const AVFilterBufferRef *src)
194167 {
195168 int planes, nb_channels;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t