H264/HEVC QP bitstream parsing relocated to WebProcess
Component: WebKit WebRTC codecs | f10733e
WebKit의 GPU Process는 VideoToolbox로 하드웨어 video encode/decode를 수행합니다. 이 process는 sandbox 안에서 동작하는 WebContent process보다 높은 권한을 가집니다. 인코딩된 frame의 QP(quantization parameter)는 raw H.264/HEVC Annex B bitstream에서 읽어냅니다. 이렇게 얻은 값은 WebProcess에 있는 LibWebRTCCodecs에서 WebRTC의 rate-control/statistics로 전달됩니다. 이번 commit에서는 GPUVideoEncoderVTBH264/H265의 H264BitstreamParser/HEVCBitstreamParser 멤버와 QP 추출 호출이 제거되었습니다. 대신 QP parsing은 LibWebRTCCodecs::completedEncoding으로 옮겨졌습니다.
Significance
Bitstream parsing이 GPU Process에서 제거되고, 값이 실제로 사용되는 위치(WebProcess의 WebRTC stats)에서만 수행되도록 변경되었습니다. 동작 변화는 없다고 명시되어 있습니다. 먼저 completion callback은 raw bytes와 Encoder를 toWebKitEncodedFrameInfo()로 전달합니다. 이 함수는 webRTCWebCoreVideoCodecsEnabled가 켜져 있을 때만 parsing을 수행해 info.qp를 덮어씁니다. 한편 GPU Process는 원래부터 인코딩된 bytes를 전달하기 위해 WebProcess로 보내고 있었습니다. 결과적으로 새로운 data flow를 추가하지 않고, 더 높은 권한을 가진 process에서 기능 하나를 덜어낸 셈입니다.