mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-01-30 11:24:17 +00:00
lavc/encode: drop EncodeSimpleContext
It has only a single member.
This commit is contained in:
parent
1c01dca144
commit
32413600e8
@ -432,7 +432,7 @@ void avcodec_flush_buffers(AVCodecContext *avctx)
|
|||||||
while (av_fifo_read(avci->pkt_props, avci->last_pkt_props, 1) >= 0)
|
while (av_fifo_read(avci->pkt_props, avci->last_pkt_props, 1) >= 0)
|
||||||
av_packet_unref(avci->last_pkt_props);
|
av_packet_unref(avci->last_pkt_props);
|
||||||
|
|
||||||
av_frame_unref(avci->es.in_frame);
|
av_frame_unref(avci->in_frame);
|
||||||
av_packet_unref(avci->in_pkt);
|
av_packet_unref(avci->in_pkt);
|
||||||
|
|
||||||
if (HAVE_THREADS && avctx->active_thread_type & FF_THREAD_FRAME)
|
if (HAVE_THREADS && avctx->active_thread_type & FF_THREAD_FRAME)
|
||||||
@ -498,7 +498,7 @@ av_cold int avcodec_close(AVCodecContext *avctx)
|
|||||||
av_packet_free(&avci->last_pkt_props);
|
av_packet_free(&avci->last_pkt_props);
|
||||||
|
|
||||||
av_packet_free(&avci->in_pkt);
|
av_packet_free(&avci->in_pkt);
|
||||||
av_frame_free(&avci->es.in_frame);
|
av_frame_free(&avci->in_frame);
|
||||||
|
|
||||||
av_buffer_unref(&avci->pool);
|
av_buffer_unref(&avci->pool);
|
||||||
|
|
||||||
|
@ -175,8 +175,7 @@ int ff_encode_get_frame(AVCodecContext *avctx, AVFrame *frame)
|
|||||||
static int encode_simple_internal(AVCodecContext *avctx, AVPacket *avpkt)
|
static int encode_simple_internal(AVCodecContext *avctx, AVPacket *avpkt)
|
||||||
{
|
{
|
||||||
AVCodecInternal *avci = avctx->internal;
|
AVCodecInternal *avci = avctx->internal;
|
||||||
EncodeSimpleContext *es = &avci->es;
|
AVFrame *frame = avci->in_frame;
|
||||||
AVFrame *frame = es->in_frame;
|
|
||||||
const FFCodec *const codec = ffcodec(avctx->codec);
|
const FFCodec *const codec = ffcodec(avctx->codec);
|
||||||
int got_packet;
|
int got_packet;
|
||||||
int ret;
|
int ret;
|
||||||
@ -565,8 +564,8 @@ FF_ENABLE_DEPRECATION_WARNINGS
|
|||||||
avctx->internal->intra_only_flag = AV_PKT_FLAG_KEY;
|
avctx->internal->intra_only_flag = AV_PKT_FLAG_KEY;
|
||||||
|
|
||||||
if (ffcodec(avctx->codec)->cb.encode) {
|
if (ffcodec(avctx->codec)->cb.encode) {
|
||||||
avci->es.in_frame = av_frame_alloc();
|
avci->in_frame = av_frame_alloc();
|
||||||
if (!avci->es.in_frame)
|
if (!avci->in_frame)
|
||||||
return AVERROR(ENOMEM);
|
return AVERROR(ENOMEM);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -47,10 +47,6 @@
|
|||||||
# define STRIDE_ALIGN 8
|
# define STRIDE_ALIGN 8
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
typedef struct EncodeSimpleContext {
|
|
||||||
AVFrame *in_frame;
|
|
||||||
} EncodeSimpleContext;
|
|
||||||
|
|
||||||
typedef struct AVCodecInternal {
|
typedef struct AVCodecInternal {
|
||||||
/**
|
/**
|
||||||
* When using frame-threaded decoding, this field is set for the first
|
* When using frame-threaded decoding, this field is set for the first
|
||||||
@ -101,7 +97,13 @@ typedef struct AVCodecInternal {
|
|||||||
|
|
||||||
void *frame_thread_encoder;
|
void *frame_thread_encoder;
|
||||||
|
|
||||||
EncodeSimpleContext es;
|
/**
|
||||||
|
* The input frame is stored here for encoders implementing the simple
|
||||||
|
* encode API.
|
||||||
|
*
|
||||||
|
* Not allocated in other cases.
|
||||||
|
*/
|
||||||
|
AVFrame *in_frame;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* If this is set, then FFCodec->close (if existing) needs to be called
|
* If this is set, then FFCodec->close (if existing) needs to be called
|
||||||
|
Loading…
Reference in New Issue
Block a user