mirror of
https://github.com/mollyim/webrtc.git
synced 2025-05-16 07:10:38 +01:00
![]() The H264 encoder defaults to using the kCVPixelFormatType_420YpCbCr8BiPlanarFullRange pixel format. If the frames coming into the encoder is RTCCVPixelBuffer frames, we check the pixel format in the contained CVPixelBuffer and send the same format to the encoder when possible, by switching the encoder's pixel format. When we receive frames with buffers conforming to the RTCI420Buffer protocol, we copy the frame contents to the target pixel buffer, hardcoded to be the default NV12. This works except when switching incoming frames from RTCCVPixelBuffer frames to I420 frames during runtime. If we received RTCCVPixelBuffers wrapping e.g. an RGB CVPixelBuffer, the encoder's pixel format have been changed to RGB. If we now get incoming frames in I420, we must convert these to RGB instead of NV12 to match the encoder's format. This bug can be triggered by calling `[_localVideoTrack setIsEnabled:NO]` in `ARDAppClient.m`. This will make the stream start sending black i420 frames to the encoder. This CL fixes this by resetting the compression session with the default NV12 format if the input frame type changes from native to I420. Bug: webrtc:8638 Change-Id: I5d784d204b7b1d09313a0f4cea6302ea72e9ed94 Reviewed-on: https://webrtc-review.googlesource.com/33260 Reviewed-by: Peter Hanspers <peterhanspers@webrtc.org> Reviewed-by: Magnus Jedvert <magjed@webrtc.org> Commit-Queue: Anders Carlsson <andersc@webrtc.org> Cr-Commit-Position: refs/heads/master@{#21382} |
||
---|---|---|
.. | ||
helpers.cc | ||
helpers.h | ||
nalu_rewriter.cc | ||
nalu_rewriter.h | ||
nalu_rewriter_unittest.cc | ||
objc_video_decoder_factory.h | ||
objc_video_decoder_factory.mm | ||
objc_video_encoder_factory.h | ||
objc_video_encoder_factory.mm | ||
RTCVideoDecoderH264.mm | ||
RTCVideoEncoderH264.mm |