Merge pull request #12534 from iwubcode/custom-pipeline-refactor VideoCommon: refactor the custom pipeline logic to be reusable