git.videolan.org
/
ffmpeg.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
avcodec/rkmpp : Fix broken build due to missing control operation
[ffmpeg.git]
/
libavcodec
/
rkmppdec.c
diff --git
a/libavcodec/rkmppdec.c
b/libavcodec/rkmppdec.c
index
fa522ce
..
946b827
100644
(file)
--- a/
libavcodec/rkmppdec.c
+++ b/
libavcodec/rkmppdec.c
@@
-40,6
+40,7
@@
#define RECEIVE_FRAME_TIMEOUT 100
#define FRAMEGROUP_MAX_FRAMES 16
#define RECEIVE_FRAME_TIMEOUT 100
#define FRAMEGROUP_MAX_FRAMES 16
+#define INPUT_MAX_PACKETS 4
typedef struct {
MppCtx ctx;
typedef struct {
MppCtx ctx;
@@
-515,16
+516,17
@@
static int rkmpp_receive_frame(AVCodecContext *avctx, AVFrame *frame)
RKMPPDecoder *decoder = (RKMPPDecoder *)rk_context->decoder_ref->data;
int ret = MPP_NOK;
AVPacket pkt = {0};
RKMPPDecoder *decoder = (RKMPPDecoder *)rk_context->decoder_ref->data;
int ret = MPP_NOK;
AVPacket pkt = {0};
- RK_S32 freeslots;
+ RK_S32
usedslots,
freeslots;
if (!decoder->eos_reached) {
// we get the available slots in decoder
if (!decoder->eos_reached) {
// we get the available slots in decoder
- ret = decoder->mpi->control(decoder->ctx, MPP_DEC_GET_
FREE_PACKET_SLOT_COUNT, &free
slots);
+ ret = decoder->mpi->control(decoder->ctx, MPP_DEC_GET_
STREAM_COUNT, &used
slots);
if (ret != MPP_OK) {
if (ret != MPP_OK) {
- av_log(avctx, AV_LOG_ERROR, "Failed to get decoder
free
slots (code = %d).\n", ret);
+ av_log(avctx, AV_LOG_ERROR, "Failed to get decoder
used
slots (code = %d).\n", ret);
return ret;
}
return ret;
}
+ freeslots = INPUT_MAX_PACKETS - usedslots;
if (freeslots > 0) {
ret = ff_decode_get_packet(avctx, &pkt);
if (ret < 0 && ret != AVERROR_EOF) {
if (freeslots > 0) {
ret = ff_decode_get_packet(avctx, &pkt);
if (ret < 0 && ret != AVERROR_EOF) {
@@
-541,7
+543,7
@@
static int rkmpp_receive_frame(AVCodecContext *avctx, AVFrame *frame)
}
// make sure we keep decoder full
}
// make sure we keep decoder full
- if (freeslots > 1
&& decoder->first_frame
)
+ if (freeslots > 1)
return AVERROR(EAGAIN);
}
return AVERROR(EAGAIN);
}
@@
-588,8
+590,7
@@
static const AVCodecHWConfigInternal *rkmpp_hw_configs[] = {
.receive_frame = rkmpp_receive_frame, \
.flush = rkmpp_flush, \
.priv_class = &rkmpp_##NAME##_dec_class, \
.receive_frame = rkmpp_receive_frame, \
.flush = rkmpp_flush, \
.priv_class = &rkmpp_##NAME##_dec_class, \
- .capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_HARDWARE, \
- .caps_internal = AV_CODEC_CAP_AVOID_PROBING, \
+ .capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_AVOID_PROBING | AV_CODEC_CAP_HARDWARE, \
.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_DRM_PRIME, \
AV_PIX_FMT_NONE}, \
.hw_configs = rkmpp_hw_configs, \
.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_DRM_PRIME, \
AV_PIX_FMT_NONE}, \
.hw_configs = rkmpp_hw_configs, \