MCPcopy Create free account
hub / github.com/FFmpeg/FFmpeg / compute_bandwidth

Function compute_bandwidth

ffserver.c:3800–3821  ·  view source on GitHub ↗

compute the bandwidth used by each stream */

Source from the content-addressed store, hash-verified

3798
3799/* compute the bandwidth used by each stream */
3800static void compute_bandwidth(void)
3801{
3802 unsigned bandwidth;
3803 int i;
3804 FFStream *stream;
3805
3806 for(stream = first_stream; stream != NULL; stream = stream->next) {
3807 bandwidth = 0;
3808 for(i=0;i<stream->nb_streams;i++) {
3809 AVStream *st = stream->streams[i];
3810 switch(st->codec->codec_type) {
3811 case AVMEDIA_TYPE_AUDIO:
3812 case AVMEDIA_TYPE_VIDEO:
3813 bandwidth += st->codec->bit_rate;
3814 break;
3815 default:
3816 break;
3817 }
3818 }
3819 stream->bandwidth = (bandwidth + 999) / 1000;
3820 }
3821}
3822
3823/* add a codec and set the default parameters */
3824static void add_codec(FFStream *stream, AVCodecContext *av)

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected