On 27/02/2018 16:13, Vittorio Giovara wrote:
On Tue, Feb 27, 2018 at 5:25 AM, Luca Barbato <lu_z...@gentoo.org> wrote:

On 26/02/2018 18:21, Vittorio Giovara wrote:

On Mon, Feb 26, 2018 at 12:10 AM, Luca Barbato <lu_z...@gentoo.org>
wrote:

---

+
+    if (avctx->qmin > 0)
+        enccfg.rc_min_quantizer = avctx->qmin;
+    if (avctx->qmax > 0)
+        enccfg.rc_max_quantizer = avctx->qmax;
+
+#if FF_API_PRIVATE_OPT
+FF_DISABLE_DEPRECATION_WARNINGS
+    if (avctx->frame_skip_threshold)
+        ctx->drop_threshold = avctx->frame_skip_threshold;
+FF_ENABLE_DEPRECATION_WARNINGS
+#endif
+    enccfg.rc_dropframe_thresh = ctx->drop_threshold;
+



+static int storeframe(AVCodecContext *avctx, struct FrameListData
*cx_frame,
+                      AVPacket *pkt)
+{
+    int ret = ff_alloc_packet(pkt, cx_frame->sz);
+    if (ret >= 0) {
+        memcpy(pkt->data, cx_frame->buf, pkt->size);
+        pkt->pts = pkt->dts = cx_frame->pts;
+#if FF_API_CODED_FRAME
+FF_DISABLE_DEPRECATION_WARNINGS
+        avctx->coded_frame->pts       = cx_frame->pts;
+        avctx->coded_frame->key_frame = !!(cx_frame->flags &
AOM_FRAME_IS_KEY);
+FF_ENABLE_DEPRECATION_WARNINGS
+#endif
+
+        if (!!(cx_frame->flags & AOM_FRAME_IS_KEY)) {
+#if FF_API_CODED_FRAME
+FF_DISABLE_DEPRECATION_WARNINGS
+            avctx->coded_frame->pict_type = AV_PICTURE_TYPE_I;
+FF_ENABLE_DEPRECATION_WARNINGS
+#endif
+            pkt->flags |= AV_PKT_FLAG_KEY;
+        } else {
+#if FF_API_CODED_FRAME
+FF_DISABLE_DEPRECATION_WARNINGS
+            avctx->coded_frame->pict_type = AV_PICTURE_TYPE_P;
+FF_ENABLE_DEPRECATION_WARNINGS
+#endif
+        }
+    } else {


I don't think we should add deprecated code.


We have to if we want to keep compatibility.


No, compatibility is not needed for new APIs and new codecs.
If you want to implement this functionality, you should add the proper side
data, see 40cf1bbacc6220a0aa6bed5c331871d43f9ce370.


Then I'd drop that and have less code to care about :)

lu

_______________________________________________
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to