We want to reuse some of this functionality for the new video codec factories, but not of all it, so this CL refactors out what we want to reuse to a static function. BUG=webrtc:7925 Review-Url: https://codereview.webrtc.org/3010743002 Cr-Commit-Position: refs/heads/master@{#19628}