[MPlayer-cvslog] r37453 - in trunk/libmpcodecs: vf_lavc.c vf_mcdeint.c vf_uspp.c

rtogni subversion at mplayerhq.hu
Sun Aug 23 22:32:51 CEST 2015


Author: rtogni
Date: Sun Aug 23 22:32:50 2015
New Revision: 37453

Log:
Replace deprecated av_encode_video() with av_encode_video2()

Modified:
   trunk/libmpcodecs/vf_lavc.c
   trunk/libmpcodecs/vf_mcdeint.c
   trunk/libmpcodecs/vf_uspp.c

Modified: trunk/libmpcodecs/vf_lavc.c
==============================================================================
--- trunk/libmpcodecs/vf_lavc.c	Sun Aug 23 12:40:30 2015	(r37452)
+++ trunk/libmpcodecs/vf_lavc.c	Sun Aug 23 22:32:50 2015	(r37453)
@@ -86,6 +86,8 @@ static int put_image(struct vf_instance
     mp_image_t* dmpi;
     int out_size;
     AVFrame *pic= vf->priv->pic;
+    int ret, got_pkt;
+    AVPacket pkt;
 
     pic->data[0]=mpi->planes[0];
     pic->data[1]=mpi->planes[1];
@@ -94,10 +96,14 @@ static int put_image(struct vf_instance
     pic->linesize[1]=mpi->stride[1];
     pic->linesize[2]=mpi->stride[2];
 
-    out_size = avcodec_encode_video(&lavc_venc_context,
-	vf->priv->outbuf, vf->priv->outbuf_size, pic);
+    av_init_packet(&pkt);
+    pkt.data = vf->priv->outbuf;
+    pkt.size = vf->priv->outbuf_size;
+    ret = avcodec_encode_video2(&lavc_venc_context, &pkt, pic, &got_pkt);
 
-    if(out_size<=0) return 1;
+    if(ret<=0) return 1;
+    if(!got_pkt) return 1;
+    out_size =  pkt.size;
 
     dmpi=vf_get_image(vf->next,IMGFMT_MPEGPES,
 	MP_IMGTYPE_EXPORT, 0,

Modified: trunk/libmpcodecs/vf_mcdeint.c
==============================================================================
--- trunk/libmpcodecs/vf_mcdeint.c	Sun Aug 23 12:40:30 2015	(r37452)
+++ trunk/libmpcodecs/vf_mcdeint.c	Sun Aug 23 22:32:50 2015	(r37453)
@@ -92,6 +92,8 @@ struct vf_priv_s {
 
 static void filter(struct vf_priv_s *p, uint8_t *dst[3], uint8_t *src[3], int dst_stride[3], int src_stride[3], int width, int height){
     int x, y, i;
+    int got_pkt;
+    AVPacket pkt;
 
     for(i=0; i<3; i++){
         p->frame->data[i]= src[i];
@@ -101,7 +103,10 @@ static void filter(struct vf_priv_s *p,
     p->avctx_enc->me_cmp=
     p->avctx_enc->me_sub_cmp= FF_CMP_SAD /*| (p->parity ? FF_CMP_ODD : FF_CMP_EVEN)*/;
     p->frame->quality= p->qp*FF_QP2LAMBDA;
-    avcodec_encode_video(p->avctx_enc, p->outbuf, p->outbuf_size, p->frame);
+    av_init_packet(&pkt);
+    pkt.data = p->outbuf;
+    pkt.size = p->outbuf_size;
+    avcodec_encode_video2(p->avctx_enc, &pkt, p->frame, &got_pkt);
     p->frame_dec = p->avctx_enc->coded_frame;
 
     for(i=0; i<3; i++){

Modified: trunk/libmpcodecs/vf_uspp.c
==============================================================================
--- trunk/libmpcodecs/vf_uspp.c	Sun Aug 23 12:40:30 2015	(r37452)
+++ trunk/libmpcodecs/vf_uspp.c	Sun Aug 23 22:32:50 2015	(r37453)
@@ -177,11 +177,16 @@ static void filter(struct vf_priv_s *p,
         const int x1= offset[i+count-1][0];
         const int y1= offset[i+count-1][1];
         int offset;
+        AVPacket pkt;
+        int ret, got_pkt;
         p->frame->data[0]= p->src[0] + x1 + y1 * p->frame->linesize[0];
         p->frame->data[1]= p->src[1] + x1/2 + y1/2 * p->frame->linesize[1];
         p->frame->data[2]= p->src[2] + x1/2 + y1/2 * p->frame->linesize[2];
 
-        avcodec_encode_video(p->avctx_enc[i], p->outbuf, p->outbuf_size, p->frame);
+        av_init_packet(&pkt);
+        pkt.data = p->outbuf;
+        pkt.size = p->outbuf_size;
+        avcodec_encode_video2(p->avctx_enc[i], &pkt, p->frame, &got_pkt);
         p->frame_dec = p->avctx_enc[i]->coded_frame;
 
         offset= (BLOCK-x1) + (BLOCK-y1)*p->frame_dec->linesize[0];


More information about the MPlayer-cvslog mailing list