| 212 | } |
| 213 | |
| 214 | static int lcevc_parse(AVCodecParserContext *s, |
| 215 | AVCodecContext *avctx, |
| 216 | const uint8_t **poutbuf, int *poutbuf_size, |
| 217 | const uint8_t *buf, int buf_size) |
| 218 | { |
| 219 | LCEVCParserContext *ctx = s->priv_data; |
| 220 | ParseContext *pc = &ctx->pc; |
| 221 | int next; |
| 222 | |
| 223 | if (!ctx->parsed_extradata && avctx->extradata_size > 4) { |
| 224 | ctx->parsed_extradata = 1; |
| 225 | ctx->is_lvcc = !!avctx->extradata[0]; |
| 226 | |
| 227 | if (ctx->is_lvcc) |
| 228 | ctx->nal_length_size = (avctx->extradata[4] >> 6) + 1; |
| 229 | } |
| 230 | |
| 231 | if (s->flags & PARSER_FLAG_COMPLETE_FRAMES) { |
| 232 | next = buf_size; |
| 233 | } else { |
| 234 | next = lcevc_find_frame_end(s, buf, buf_size); |
| 235 | if (ff_combine_frame(pc, next, &buf, &buf_size) < 0) { |
| 236 | *poutbuf = NULL; |
| 237 | *poutbuf_size = 0; |
| 238 | return buf_size; |
| 239 | } |
| 240 | } |
| 241 | |
| 242 | parse_nal_units(s, buf, buf_size, avctx); |
| 243 | |
| 244 | *poutbuf = buf; |
| 245 | *poutbuf_size = buf_size; |
| 246 | return next; |
| 247 | } |
| 248 | |
| 249 | static void lcevc_parser_close(AVCodecParserContext *s) |
| 250 | { |
nothing calls this directly
no test coverage detected