跳到主要内容

4. 流方向 (Stream Orientation)

在某些情况下, 尤其是涉及 mobile devices 的情况下, camera 的 orientation 可能与 encoder 使用的 orientation 不匹配. 更重要的是, orientation 可能在 call 过程中发生变化, 要求 receiver 更改其渲染 stream 的 orientation.

虽然 sender 可以选择简单地更改 frames 的 pre-encoding orientation, 但这可能不实际或效率不高 (特别是在 camera interface 返回 pre-compressed video frames 的情况下). 注意, 除 Section 3.2 中提到的情况外, 这种行为的可能性又增加了一组 screen resolution 可能在 video stream 中途发生变化的情况.

为适应这些情况, 能够生成非默认 orientations 的 media 的 WebRTC implementations MUST 支持生成 [TS26.114] Section 7.4.5 中描述的 Coordination of Video Orientation (CVO) mechanism 的 R0 和 R1 bits, 并且当 peer 指示支持该机制时, MUST 针对所有 orientations 发送它们. 它们 MAY 支持发送 CVO extension 中的其他 bits, 包括更高分辨率的 rotation bits. 所有 implementations SHOULD 支持解释 R0 和 R1 bits, 并 MAY 支持其他 CVO bits.

此外, 某些 codecs 支持 orientation 的 in-band signaling (例如 H.264 和 H.265 [H265] 中的 SEI "Display Orientation" messages). 如果已经协商 CVO, 则 sender MUST NOT 使用这类 codec-specific mechanisms. 但是, 当 SDP 中未发信号表示支持 CVO 时, 这类 implementations MAY 改用 codec-specific mechanisms.