Note that the pos field is added *non* at the end of the
AVFilterPicRef struct, thus breaking ABI compatibility, which is
allowed as the API is still considered non-stable.
Originally committed as revision 22506 to svn://svn.ffmpeg.org/ffmpeg/trunk
| ... | ... |
@@ -171,11 +171,12 @@ int avfilter_config_links(AVFilterContext *filter) |
| 171 | 171 |
static void dprintf_picref(void *ctx, AVFilterPicRef *picref, int end) |
| 172 | 172 |
{
|
| 173 | 173 |
dprintf(ctx, |
| 174 |
- "picref[%p data[%p, %p, %p, %p] linesize[%d, %d, %d, %d] pts:%"PRId64" a:%d/%d s:%dx%d]%s", |
|
| 174 |
+ "picref[%p data[%p, %p, %p, %p] linesize[%d, %d, %d, %d] pts:%"PRId64" pos:%"PRId64" a:%d/%d s:%dx%d]%s", |
|
| 175 | 175 |
picref, |
| 176 | 176 |
picref->data [0], picref->data [1], picref->data [2], picref->data [3], |
| 177 | 177 |
picref->linesize[0], picref->linesize[1], picref->linesize[2], picref->linesize[3], |
| 178 |
- picref->pts, picref->pixel_aspect.num, picref->pixel_aspect.den, picref->w, picref->h, |
|
| 178 |
+ picref->pts, picref->pos, |
|
| 179 |
+ picref->pixel_aspect.num, picref->pixel_aspect.den, picref->w, picref->h, |
|
| 179 | 180 |
end ? "\n" : ""); |
| 180 | 181 |
} |
| 181 | 182 |
|
| ... | ... |
@@ -263,6 +264,7 @@ void avfilter_start_frame(AVFilterLink *link, AVFilterPicRef *picref) |
| 263 | 263 |
link->cur_pic = avfilter_default_get_video_buffer(link, dst->min_perms, link->w, link->h); |
| 264 | 264 |
link->srcpic = picref; |
| 265 | 265 |
link->cur_pic->pts = link->srcpic->pts; |
| 266 |
+ link->cur_pic->pos = link->srcpic->pos; |
|
| 266 | 267 |
link->cur_pic->pixel_aspect = link->srcpic->pixel_aspect; |
| 267 | 268 |
} |
| 268 | 269 |
else |
| ... | ... |
@@ -105,6 +105,7 @@ typedef struct AVFilterPicRef |
| 105 | 105 |
int h; ///< image height |
| 106 | 106 |
|
| 107 | 107 |
int64_t pts; ///< presentation timestamp in units of 1/AV_TIME_BASE |
| 108 |
+ int64_t pos; ///< byte position in stream, -1 if unknown |
|
| 108 | 109 |
|
| 109 | 110 |
AVRational pixel_aspect; ///< pixel aspect ratio |
| 110 | 111 |
|
| ... | ... |
@@ -74,6 +74,7 @@ void avfilter_default_start_frame(AVFilterLink *link, AVFilterPicRef *picref) |
| 74 | 74 |
if(out) {
|
| 75 | 75 |
out->outpic = avfilter_get_video_buffer(out, AV_PERM_WRITE, out->w, out->h); |
| 76 | 76 |
out->outpic->pts = picref->pts; |
| 77 |
+ out->outpic->pos = picref->pos; |
|
| 77 | 78 |
out->outpic->pixel_aspect = picref->pixel_aspect; |
| 78 | 79 |
avfilter_start_frame(out, avfilter_ref_pic(out->outpic, ~0)); |
| 79 | 80 |
} |