It's a private field, not meant to be accessed from outside lavc.
*/
int error_rate;
+#if FF_API_CODEC_PKT
/**
- * Current packet as passed into the decoder, to avoid having
- * to pass the packet into every function. Currently only valid
- * inside lavc and get/release_buffer callbacks.
- * - decoding: set by avcodec_decode_*, read by get_buffer() for setting pkt_pts
- * - encoding: unused
+ * @deprecated this field is not supposed to be accessed from outside lavc
*/
+ attribute_deprecated
AVPacket *pkt;
+#endif
/**
* VBV delay coded in the last frame (in periods of a 27 MHz clock).
FramePool *pool;
void *thread_ctx;
+
+ /**
+ * Current packet as passed into the decoder, to avoid having to pass the
+ * packet into every function.
+ */
+ AVPacket *pkt;
} AVCodecInternal;
struct AVCodecDefault {
}
*copy = *src;
- copy->pkt = &p->avpkt;
copy->internal = av_malloc(sizeof(AVCodecInternal));
if (!copy->internal) {
}
*copy->internal = *src->internal;
copy->internal->thread_ctx = p;
+ copy->internal->pkt = &p->avpkt;
if (!i) {
src = copy;
*/
#include "avcodec.h"
+#include "internal.h"
#include "raw.h"
#include "libavutil/buffer.h"
#include "libavutil/common.h"
frame->pict_type = AV_PICTURE_TYPE_I;
frame->key_frame = 1;
frame->reordered_opaque = avctx->reordered_opaque;
- frame->pkt_pts = avctx->pkt->pts;
+ frame->pkt_pts = avctx->internal->pkt->pts;
if (buf_size < context->frame_size - (avctx->pix_fmt == AV_PIX_FMT_PAL8 ?
AVPALETTE_SIZE : 0))
default: return AVERROR(EINVAL);
}
- frame->pkt_pts = avctx->pkt ? avctx->pkt->pts : AV_NOPTS_VALUE;
+ frame->pkt_pts = avctx->internal->pkt ? avctx->internal->pkt->pts : AV_NOPTS_VALUE;
frame->reordered_opaque = avctx->reordered_opaque;
#if FF_API_GET_BUFFER
if ((avctx->coded_width || avctx->coded_height) && av_image_check_size(avctx->coded_width, avctx->coded_height, 0, avctx))
return -1;
- avctx->pkt = avpkt;
+ avctx->internal->pkt = avpkt;
ret = apply_param_change(avctx, avpkt);
if (ret < 0) {
av_log(avctx, AV_LOG_ERROR, "Error applying parameter changes.\n");
*got_frame_ptr = 0;
- avctx->pkt = avpkt;
+ avctx->internal->pkt = avpkt;
if (!avpkt->data && avpkt->size) {
av_log(avctx, AV_LOG_ERROR, "invalid packet: NULL data, size != 0\n");
{
int ret;
- avctx->pkt = avpkt;
+ avctx->internal->pkt = avpkt;
*got_sub_ptr = 0;
ret = avctx->codec->decode(avctx, sub, got_sub_ptr, avpkt);
if (*got_sub_ptr)
#ifndef FF_API_THREAD_OPAQUE
#define FF_API_THREAD_OPAQUE (LIBAVCODEC_VERSION_MAJOR < 56)
#endif
+#ifndef FF_API_CODEC_PKT
+#define FF_API_CODEC_PKT (LIBAVCODEC_VERSION_MAJOR < 56)
+#endif
#endif /* AVCODEC_VERSION_H */