- /* Override frame->pkt_pts as ff_get_buffer will override its value based
- * on the last avpacket received which is not in sync with the frame:
- * * N avpackets can be pushed before 1 frame is actually returned
- * * 0-sized avpackets are pushed to flush remaining frames at EOS */
- frame->pts = info->presentationTimeUs;
-#if FF_API_PKT_PTS
-FF_DISABLE_DEPRECATION_WARNINGS
- frame->pkt_pts = info->presentationTimeUs;
-FF_ENABLE_DEPRECATION_WARNINGS
-#endif
- frame->pkt_dts = AV_NOPTS_VALUE;
-
- av_log(avctx, AV_LOG_DEBUG,
- "Frame: width=%d stride=%d height=%d slice-height=%d "
- "crop-top=%d crop-bottom=%d crop-left=%d crop-right=%d encoder=%s\n"
- "destination linesizes=%d,%d,%d\n" ,
- avctx->width, s->stride, avctx->height, s->slice_height,
- s->crop_top, s->crop_bottom, s->crop_left, s->crop_right, s->codec_name,
- frame->linesize[0], frame->linesize[1], frame->linesize[2]);
-
- switch (s->color_format) {
- case COLOR_FormatYUV420Planar:
- ff_mediacodec_sw_buffer_copy_yuv420_planar(avctx, s, data, size, info, frame);
- break;
- case COLOR_FormatYUV420SemiPlanar:
- case COLOR_QCOM_FormatYUV420SemiPlanar:
- case COLOR_QCOM_FormatYUV420SemiPlanar32m:
- ff_mediacodec_sw_buffer_copy_yuv420_semi_planar(avctx, s, data, size, info, frame);
- break;
- case COLOR_TI_FormatYUV420PackedSemiPlanar:
- case COLOR_TI_FormatYUV420PackedSemiPlanarInterlaced:
- ff_mediacodec_sw_buffer_copy_yuv420_packed_semi_planar(avctx, s, data, size, info, frame);
- break;
- case COLOR_QCOM_FormatYUV420PackedSemiPlanar64x32Tile2m8ka:
- ff_mediacodec_sw_buffer_copy_yuv420_packed_semi_planar_64x32Tile2m8ka(avctx, s, data, size, info, frame);
- break;
- default:
- av_log(avctx, AV_LOG_ERROR, "Unsupported color format 0x%x (value=%d)\n",
- s->color_format, s->color_format);
- ret = AVERROR(EINVAL);
- goto done;