linphone-developers
[Top][All Lists]
Advanced

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

Re: [Linphone-developers] Enchancement (Bug fix) for videostream.c


From: Simon Morlat
Subject: Re: [Linphone-developers] Enchancement (Bug fix) for videostream.c
Date: Mon, 04 Jan 2010 15:59:19 +0100

Hi Vadim,

Your change has a major drawback to me: if the new decoder can't be
created, it leaves the stream in "bad state", unconnected. It will
probably crash later at audio_stream_stop().
I can suggest another workaround:
In your decoder, check the hardware decoder availability and initialize
it  in .preprocess instead of .init .

The .preprocess of the second MSFilter decoder will be called after the
uninit() of the first one.

Simon

Le lundi 21 décembre 2009 à 15:59 +0100, Vadim Lebedev a écrit :
> Hello,
> 
> We've stumbled on a when trying to use linphone  with a ffmmeg
> integrated with hardware based
> H263 and H264 decoder.
> The problem that the interface code for the decoder does not support
> multiple decoder instances,
> so  the original code in 'video_stream_change_decoder'  which creates
> new decoder instance before
> destroing original one, caused havoc.
> 
> So we've changed the code to avoid the problem.
> I hop it will be accpted in the main  tree...
> 
> Thans
> vadim
> =================================================
> void video_stream_change_decoder(VideoStream *stream, int payload){
>     RtpSession *session=stream->session;
>     RtpProfile *prof=rtp_session_get_profile(session);
>     PayloadType *pt=rtp_profile_get_payload(prof,payload);
>     if (pt!=NULL){
>         ms_filter_unlink(stream->rtprecv, 0, stream->decoder, 0);
>         ms_filter_unlink(stream->decoder,0,stream->output,0);
>         ms_filter_postprocess(stream->decoder);
>         ms_filter_destroy(stream->decoder);
>         stream->decoder=0;
>         MSFilter *dec=ms_filter_create_decoder(pt->mime_type);
>         if (dec!=NULL){            
>             stream->decoder=dec;
>             if (pt->recv_fmtp!=NULL)
>                
> ms_filter_call_method(stream->decoder,MS_FILTER_ADD_FMTP,(void*)pt->recv_fmtp);
>             ms_filter_link (stream->rtprecv, 0, stream->decoder, 0);
>             ms_filter_link (stream->decoder,0 , stream->output, 0);
>             ms_filter_preprocess(stream->decoder,stream->ticker);
>             
>         }else{
>             ms_warning("No decoder found for %s",pt->mime_type);
>         }
>     }else{
>         ms_warning("No payload defined with number %i",payload);
>     }
> }
> 
> 
> 
> _______________________________________________
> Linphone-developers mailing list
> address@hidden
> http://lists.nongnu.org/mailman/listinfo/linphone-developers






reply via email to

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