|
|
|
|
@ -119,6 +119,11 @@ unsigned call_video_dpb_limit(int codec, unsigned level, unsigned width, unsigne
|
|
|
|
|
unsigned frames = dpb_mbs[l - avc_levels] / (((width + 15) / 16) * ((height + 15) / 16)); |
|
|
|
|
return frames < 16 ? frames : 16; |
|
|
|
|
} |
|
|
|
|
int call_video_hrd_valid(int codec, unsigned level, int nal, uint64_t bitrate, uint64_t cpb) { |
|
|
|
|
const struct video_level *l = level <= 255 ? level_find(codec, level) : NULL; |
|
|
|
|
unsigned factor = nal ? (codec == CALL_VIDEO_H264 ? 1200 : 1100) : 1000; |
|
|
|
|
return l && bitrate && cpb && bitrate <= (uint64_t)l->kbps * factor && cpb <= (uint64_t)l->cpb_kbits * factor; |
|
|
|
|
} |
|
|
|
|
int call_video_format_supported(const struct call_video_caps *sender, const struct call_video_caps *receiver, |
|
|
|
|
const struct call_video_format *f) { |
|
|
|
|
return call_video_caps_valid(sender) && call_video_caps_valid(receiver) && call_video_format_valid(f) |
|
|
|
|
|