History

avcodec/libaomdec: export frame pict_type

Should fix ticket #9180

James Almer committed 5 years ago

Commit 8b954a71 parent 03e76771 file · +14 −0Browse files

Unified · Split

libavcodec/libaomdec.c+14−0
@@ -161,6 +161,7 @@ static int aom_decode(AVCodecContext *avctx, void *data, int *got_frame, · 160 unmodified lines
161 AVFrame *picture = data;161 AVFrame *picture = data;
162 const void *iter = NULL;162 const void *iter = NULL;
163 struct aom_image *img;163 struct aom_image *img;
164 aom_codec_frame_flags_t av_unused flags;
164 int ret;165 int ret;
165 166
166 if (aom_codec_decode(&ctx->decoder, avpkt->data, avpkt->size, NULL) !=167 if (aom_codec_decode(&ctx->decoder, avpkt->data, avpkt->size, NULL) !=
@@ -198,6 +199,19 @@ static int aom_decode(AVCodecContext *avctx, void *data, int *got_frame, · 31 unmodified lines
198 if ((ret = ff_get_buffer(avctx, picture, 0)) < 0)199 if ((ret = ff_get_buffer(avctx, picture, 0)) < 0)
199 return ret;200 return ret;
200 201
202#ifdef AOM_CTRL_AOMD_GET_FRAME_FLAGS
203 ret = aom_codec_control(&ctx->decoder, AOMD_GET_FRAME_FLAGS, &flags);
204 if (ret == AOM_CODEC_OK) {
205 picture->key_frame = !!(flags & AOM_FRAME_IS_KEY);
206 if (flags & (AOM_FRAME_IS_KEY | AOM_FRAME_IS_INTRAONLY))
207 picture->pict_type = AV_PICTURE_TYPE_I;
208 else if (flags & AOM_FRAME_IS_SWITCH)
209 picture->pict_type = AV_PICTURE_TYPE_SP;
210 else
211 picture->pict_type = AV_PICTURE_TYPE_P;
212 }
213#endif
214
201 av_reduce(&picture->sample_aspect_ratio.num,215 av_reduce(&picture->sample_aspect_ratio.num,
202 &picture->sample_aspect_ratio.den,216 &picture->sample_aspect_ratio.den,
203 picture->height * img->r_w,217 picture->height * img->r_w,

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t