memcpy(frame->data, picref->data, sizeof(frame->data));
memcpy(frame->linesize, picref->linesize, sizeof(frame->linesize));
+ frame->pkt_pos = picref->pos;
frame->interlaced_frame = picref->video->interlaced;
frame->top_field_first = picref->video->top_field_first;
frame->key_frame = picref->video->key_frame;
API changes, most recent first:
+2011-05-01 - xxxxxxx - lavc 53.2.0 - AVFrame
+ Add a pkt_pos field to AVFrame.
+
2011-04-xx - xxxxxxx - lavu 51.2.0 - mem.h
Add av_dynarray_add function for adding
an element to a dynamic array.
av_free_packet(&pkt);
picref->pts = pts;
- picref->pos = pkt.pos;
+ picref->pos = priv->frame->pkt_pos;
picref->video->pixel_aspect = priv->is->video_st->codec->sample_aspect_ratio;
avfilter_start_frame(link, picref);
avfilter_draw_slice(link, 0, link->h, 1);
* - decoding: set by libavcodec, read by user.\
*/\
int64_t best_effort_timestamp;\
+\
+ /**\
+ * reordered pos from the last AVPacket that has been input into the decoder\
+ * - encoding: unused\
+ * - decoding: Read by user.\
+ */\
+ int64_t pkt_pos;\
#define FF_QSCALE_TYPE_MPEG1 0
frame->top_field_first = avctx->coded_frame->top_field_first;
frame->reordered_opaque = avctx->reordered_opaque;
frame->pkt_pts = avctx->pkt->pts;
+ frame->pkt_pos = avctx->pkt->pos;
//2bpp and 4bpp raw in avi and mov (yes this is ugly ...)
if (context->buffer) {
}
s->internal_buffer_count++;
- if(s->pkt) pic->pkt_pts= s->pkt->pts;
- else pic->pkt_pts= AV_NOPTS_VALUE;
+ if (s->pkt) {
+ pic->pkt_pts = s->pkt->pts;
+ pic->pkt_pos = s->pkt->pos;
+ } else {
+ pic->pkt_pts = AV_NOPTS_VALUE;
+ pic->pkt_pos = -1;
+ }
pic->reordered_opaque= s->reordered_opaque;
if(s->debug&FF_DEBUG_BUFFERS)
memset(pic, 0, sizeof(AVFrame));
pic->pts = pic->best_effort_timestamp = AV_NOPTS_VALUE;
+ pic->pkt_pos = -1;
pic->key_frame= 1;
}
ret = avctx->codec->decode(avctx, picture, got_picture_ptr,
avpkt);
picture->pkt_dts= avpkt->dts;
+ picture->pkt_pos= avpkt->pos;
}
emms_c(); //needed to avoid an emms_c() call before every return;
#define AVCODEC_VERSION_H
#define LIBAVCODEC_VERSION_MAJOR 53
-#define LIBAVCODEC_VERSION_MINOR 1
-#define LIBAVCODEC_VERSION_MICRO 2
+#define LIBAVCODEC_VERSION_MINOR 2
+#define LIBAVCODEC_VERSION_MICRO 0
#define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
LIBAVCODEC_VERSION_MINOR, \
while ((ret = av_read_frame(movie->format_ctx, &pkt)) >= 0) {
// Is this a packet from the video stream?
if (pkt.stream_index == movie->stream_index) {
- movie->codec_ctx->reordered_opaque = pkt.pos;
avcodec_decode_video2(movie->codec_ctx, movie->frame, &frame_decoded, &pkt);
if (frame_decoded) {
movie->picref->pts = movie->frame->pkt_pts == AV_NOPTS_VALUE ?
movie->frame->pkt_dts : movie->frame->pkt_pts;
- movie->picref->pos = movie->frame->reordered_opaque;
+ movie->picref->pos = movie->frame->pkt_pos;
movie->picref->video->pixel_aspect = st->sample_aspect_ratio.num ?
st->sample_aspect_ratio : movie->codec_ctx->sample_aspect_ratio;
movie->picref->video->interlaced = movie->frame->interlaced_frame;