提交 4ae0efb3 authored 作者: Iñaki Baz Castillo's avatar Iñaki Baz Castillo

Workaround to detect H264 key frames when Chrome uses external encoder.

- Related issue in libwebrtc: https://bugs.chromium.org/p/webrtc/issues/detail?id=10746
- Fixes #313
上级 2c69a39d
...@@ -50,8 +50,14 @@ namespace RTC ...@@ -50,8 +50,14 @@ namespace RTC
if (frameMarking->start && frameMarking->independent) if (frameMarking->start && frameMarking->independent)
payloadDescriptor->isKeyFrame = true; payloadDescriptor->isKeyFrame = true;
} }
else
// Parse payload otherwise. // NOTE: Unfortunately libwebrtc produces wrong Frame-Marking (without i=1 in
// keyframes) when it uses H264 hardware encoder (at least in Mac):
// https://bugs.chromium.org/p/webrtc/issues/detail?id=10746
//
// As a temporal workaround, always do payload parsing to detect keyframes if
// there is no frame-marking or if there is but keyframe was not detected above.
if (!frameMarking || !payloadDescriptor->isKeyFrame)
{ {
uint8_t nal = *data & 0x1F; uint8_t nal = *data & 0x1F;
......
Markdown 格式
0% 或
您添加了 0 人 到此讨论。请谨慎行事。
请先完成此评论的编辑!
请 注册 或者 后发表评论