Never use surface mode in MediaCodecVideoEncoder if egl_context_ is null.
When using VideoFrames, expect_encode_from_texture is true even for ByteBuffer frames. This causes the encoder to sometimes initialize itself in surface mode even when egl_context_ is not available. This leads to a crash. Bug: webrtc:8776 Change-Id: I8cac36514725b8f430d7bf456d481a4b0c6fcd42 Reviewed-on: https://webrtc-review.googlesource.com/43861 Reviewed-by: Anders Carlsson <andersc@webrtc.org> Commit-Queue: Sami Kalliomäki <sakal@webrtc.org> Cr-Commit-Position: refs/heads/master@{#21789}
This commit is contained in:
committed by
Commit Bot
parent
af4f1b4127
commit
88a0c4add3
@ -366,7 +366,8 @@ int32_t MediaCodecVideoEncoder::InitEncode(const VideoCodec* codec_settings,
|
||||
|
||||
return InitEncodeInternal(
|
||||
init_width, init_height, codec_settings->startBitrate,
|
||||
codec_settings->maxFramerate, codec_settings->expect_encode_from_texture);
|
||||
codec_settings->maxFramerate,
|
||||
codec_settings->expect_encode_from_texture && (egl_context_ != nullptr));
|
||||
}
|
||||
|
||||
int32_t MediaCodecVideoEncoder::SetChannelParameters(uint32_t /* packet_loss */,
|
||||
|
||||
Reference in New Issue
Block a user