Remove RecordingState::keyframe_needed.

This variable is not used, always set to false but complicates
things for `keyframe_generation_requested_` as setting keyframe_needed
requires keyframe_generation_requested_ to be read synchronously from
what soon will be a different thread than where SetAndGetRecordingState
is called on.

Bug: webrtc:11993
Change-Id: I25675d9b70c9ec96a2542e7cf5480c835ea984eb
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/220840
Reviewed-by: Stefan Holmer <stefan@webrtc.org>
Commit-Queue: Tommi <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34188}
This commit is contained in:
Tommi
2021-06-01 09:49:03 +02:00
committed by WebRTC LUCI CQ
parent d99430410b
commit d23628dfb6
2 changed files with 1 additions and 7 deletions

View File

@ -53,11 +53,6 @@ class VideoReceiveStream {
// Callback stored from the VideoReceiveStream. The VideoReceiveStream
// client should not interpret the attribute.
std::function<void(const RecordableEncodedFrame&)> callback;
// Memento of internal state in VideoReceiveStream, recording wether
// we're currently causing generation of a keyframe from the sender. Needed
// to avoid sending double keyframe requests. The VideoReceiveStream client
// should not interpret the attribute.
bool keyframe_needed = false;
// Memento of when a keyframe request was last sent. The VideoReceiveStream
// client should not interpret the attribute.
absl::optional<int64_t> last_keyframe_request_ms;

View File

@ -762,7 +762,6 @@ VideoReceiveStream::RecordingState VideoReceiveStream::SetAndGetRecordingState(
RTC_DCHECK_RUN_ON(&decode_queue_);
// Save old state.
old_state.callback = std::move(encoded_frame_buffer_function_);
old_state.keyframe_needed = keyframe_generation_requested_;
old_state.last_keyframe_request_ms = last_keyframe_request_ms_;
// Set new state.
@ -771,7 +770,7 @@ VideoReceiveStream::RecordingState VideoReceiveStream::SetAndGetRecordingState(
RequestKeyFrame(clock_->TimeInMilliseconds());
keyframe_generation_requested_ = true;
} else {
keyframe_generation_requested_ = state.keyframe_needed;
keyframe_generation_requested_ = false;
last_keyframe_request_ms_ = state.last_keyframe_request_ms.value_or(0);
}
event.Set();