From: <jpg...@us...> - 2007-03-28 18:18:37
|
Revision: 913 http://svn.sourceforge.net/iaxclient/?rev=913&view=rev Author: jpgrayson Date: 2007-03-28 11:18:34 -0700 (Wed, 28 Mar 2007) Log Message: ----------- Do not decode video if the iaxclient user does not need decoded video. Modified Paths: -------------- branches/team/mihai/iaxclient/lib/video.c Modified: branches/team/mihai/iaxclient/lib/video.c =================================================================== --- branches/team/mihai/iaxclient/lib/video.c 2007-03-28 16:08:28 UTC (rev 912) +++ branches/team/mihai/iaxclient/lib/video.c 2007-03-28 18:18:34 UTC (rev 913) @@ -560,6 +560,10 @@ call->vdecoder = NULL; } + /* If the user does not need decoded video, then do not decode. */ + if ( !(iaxc_video_prefs & IAXC_VIDEO_PREF_RECV_REMOTE_RAW) ) + return 0; + /* create decoder if necessary */ if ( !call->vdecoder ) { @@ -590,23 +594,26 @@ fprintf(stderr, "ERROR: decode error\n"); return -1; } + else if ( ret_dec > 0 ) + { + /* This indicates that a complete frame cannot yet + * be decoded. This is okay. + */ + return 0; + } - // If we will move show_video_frame in pv_output, we will use a - // single call to run different functions - if ( ret_dec == 0 ) + /* Statistics */ + call->vdecoder->video_stats.inbound_frames++; + if ( time > 0 ) + call->vdecoder->video_stats.avg_inbound_fps = + call->vdecoder->video_stats.inbound_frames * + 1000.0F / time; + + if ( outsize > 0 ) { - // Statistics - call->vdecoder->video_stats.inbound_frames++; - if ( time > 0 ) - call->vdecoder->video_stats.avg_inbound_fps = - call->vdecoder->video_stats.inbound_frames * 1000.0F / time; - - if ( iaxc_video_prefs & IAXC_VIDEO_PREF_RECV_REMOTE_RAW && outsize > 0 ) - { - show_video_frame(videobuf, outsize, sel_call, - IAXC_SOURCE_REMOTE, 0, - iaxc_video_prefs & IAXC_VIDEO_PREF_RECV_RGB32); - } + show_video_frame(videobuf, outsize, sel_call, + IAXC_SOURCE_REMOTE, 0, + iaxc_video_prefs & IAXC_VIDEO_PREF_RECV_RGB32); } return 0; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |