On receive stream shutdown, deregister decoders on decoder thread.

Now Configure(), Decode() and Release() calls to the decoders should
all happen on the decoder thread. Added thread checkers to verify.

Bug: None
Change-Id: I2a1cf2cf7f3c3c7c50e382d82a3638e916ed9c34
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/272368
Reviewed-by: Evan Shrubsole <eshr@webrtc.org>
Commit-Queue: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37840}
This commit is contained in:
Erik Språng
2022-08-19 11:48:10 +02:00
committed by WebRTC LUCI CQ
parent 4f79b1d2e5
commit 79c96ded88
5 changed files with 31 additions and 72 deletions

View File

@ -44,20 +44,7 @@ class VideoReceiver2 {
int32_t Decode(const webrtc::VCMEncodedFrame* frame);
// Notification methods that are used to check our internal state and validate
// threading assumptions. These are called by VideoReceiveStreamInterface.
// See `IsDecoderThreadRunning()` for more details.
void DecoderThreadStarting();
void DecoderThreadStopped();
private:
// Used for DCHECKing thread correctness.
// In build where DCHECKs are enabled, will return false before
// DecoderThreadStarting is called, then true until DecoderThreadStopped
// is called.
// In builds where DCHECKs aren't enabled, it will return true.
bool IsDecoderThreadRunning();
SequenceChecker construction_sequence_checker_;
SequenceChecker decoder_sequence_checker_;
Clock* const clock_;
@ -68,10 +55,6 @@ class VideoReceiver2 {
// Once the decoder thread has been started, usage of `_codecDataBase` moves
// over to the decoder thread.
VCMDecoderDataBase codecDataBase_;
#if RTC_DCHECK_IS_ON
bool decoder_thread_is_running_ = false;
#endif
};
} // namespace webrtc