Skip to content
This repository has been archived by the owner on Mar 6, 2024. It is now read-only.

Commit

Permalink
remove FF_CODEC_CAP_CONTIGUOUS_BUFFERS since we dont use AVBuffers at
Browse files Browse the repository at this point in the history
all
  • Loading branch information
boogieeeee committed Aug 4, 2023
1 parent 6a40f6f commit e243e8d
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 29 deletions.
4 changes: 0 additions & 4 deletions libavcodec/codec_internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,6 @@
* Codec supports embedded ICC profiles (AV_FRAME_DATA_ICC_PROFILE).
*/
#define FF_CODEC_CAP_ICC_PROFILES (1 << 9)
/**
* The decoder requires contiguous buffers.
*/
#define FF_CODEC_CAP_CONTIGUOUS_BUFFERS (1 << 28)
/**
* The encoder has AV_CODEC_CAP_DELAY set, but does not actually have delay - it
* only wants to be flushed at the end to update some context variables (e.g.
Expand Down
24 changes: 0 additions & 24 deletions libavcodec/get_buffer.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@

#include "avcodec.h"
#include "internal.h"
#include "codec_internal.h"

typedef struct FramePool {
/**
Expand Down Expand Up @@ -148,14 +147,6 @@ FF_ENABLE_DEPRECATION_WARNINGS

for (i = 0; i < 4; i++) {
pool->linesize[i] = linesize[i];

if (ffcodec(avctx->codec)->caps_internal & FF_CODEC_CAP_CONTIGUOUS_BUFFERS) {
if (!i)
size[0] += size[1] + size[2] + size[3];
else
continue;
}

if (size[i]) {
if (size[i] > INT_MAX - (16 + STRIDE_ALIGN - 1)) {
ret = AVERROR(EINVAL);
Expand Down Expand Up @@ -274,21 +265,6 @@ static int video_get_buffer(AVCodecContext *s, AVFrame *pic)

pic->data[i] = pic->buf[i]->data;
}

if (ffcodec(s->codec)->caps_internal & FF_CODEC_CAP_CONTIGUOUS_BUFFERS) {
int size;

for (i = 1; i < 4; i++) {
pic->linesize[i] = pool->linesize[i];
av_buffer_unref(&pic->buf[i]);
}

size = av_image_fill_pointers(pic->data, pic->format, pic->height,
pic->buf[0]->data, pic->linesize);
if (size < 0 || size > pic->buf[0]->size)
goto fail;
}

for (; i < AV_NUM_DATA_POINTERS; i++) {
pic->data[i] = NULL;
pic->linesize[i] = 0;
Expand Down
2 changes: 1 addition & 1 deletion libavcodec/rkmpp.h
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ static const enum AVPixelFormat rkmppvepu5formats[] = {
.close = rkmpp_close_codec, \
.flush = rkmpp_flush, \
.p.priv_class = &rkmpp_##NAME##_##TYPE##_class, \
.caps_internal = FF_CODEC_CAP_NOT_INIT_THREADSAFE | FF_CODEC_CAP_CONTIGUOUS_BUFFERS, \
.caps_internal = FF_CODEC_CAP_NOT_INIT_THREADSAFE, \
.bsfs = BSFS, \
.p.wrapper_name = "rkmpp",

Expand Down

0 comments on commit e243e8d

Please sign in to comment.