Repository navigation
fix: make decoder QP parsing flag atomic and give up codec calls without a JNI frame - #515
Merged
Merged
Conversation
…out a JNI frame qpParsingEnabled is written from the Java decoder's output thread while Decode reads it, so it is now atomic. A failed PushLocalFrame no longer clears the OutOfMemoryError silently: it is reported like other codec exceptions and the call gives up, except release, which still runs and frees its one reference itself. Encode drops the frame instead of failing, since WebRTC switches away from an encoder that fails.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
VideoDecoderWrapper::qpParsingEnabledis read inDecodewhile a Java decoder that delivers frames from its own thread writes it inOnDecodedFrame; it is now atomic.PushLocalFrameno longer clears theOutOfMemoryErrorsilently.JavaLocalFramereports it like other codec exceptions and exposespushed(), and every codec call gives up before making local references.releasestill runs, since skipping it would keep the Java codec's resources, and deletes its one reference itself.Encodedrops the frame instead of failing, because WebRTC switches away from an encoder whoseEncodefails.asyncJavaDecoderRoundTripstest with a decoder that hands frames over on its own thread, alternating with and without QP.