linphone-developers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Linphone-developers] mediastreamer2 video decoding


From: Vadim Lebedev
Subject: [Linphone-developers] mediastreamer2 video decoding
Date: Thu, 29 Nov 2007 17:41:53 +0100
User-agent: Thunderbird 1.5.0.14pre (X11/20071023)

Hello,

I'm looking into:
static mblk_t *get_as_yuvmsg(MSFilter *f, DecState *s, AVFrame *orig){
   AVCodecContext *ctx=&s->av_context;

   if (s->outbuf.w!=ctx->width || s->outbuf.h!=ctx->height){
       if (s->sws_ctx!=NULL){
           sws_freeContext(s->sws_ctx);
           s->sws_ctx=NULL;
       }
       s->yuv_msg=yuv_buf_alloc(&s->outbuf,ctx->width,ctx->height);
       s->outbuf.w=ctx->width;
       s->outbuf.h=ctx->height;
       s->sws_ctx=sws_getContext(ctx->width,ctx->height,ctx->pix_fmt,
           ctx->width,ctx->height,s->output_pix_fmt,SWS_FAST_BILINEAR,
                   NULL, NULL, NULL);
   }
   if (sws_scale(s->sws_ctx,orig->data,orig->linesize, 0,
                   0, s->outbuf.planes, s->outbuf.strides)!=0){
       ms_error("%s: error in sws_scale().",f->desc->name);
   }
   return dupmsg(s->yuv_msg);
}

Am i right to think that call to swsScale could be scrapped out
in case when (ctx->(width,height) == s->outbuf.(w,h) && s->output_pix_fmt == ctx->fmt)


?


Thanks
Vadim




reply via email to

[Prev in Thread] Current Thread [Next in Thread]