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:
@ -53,11 +53,6 @@ class VideoReceiveStream {
|
|||||||
// Callback stored from the VideoReceiveStream. The VideoReceiveStream
|
// Callback stored from the VideoReceiveStream. The VideoReceiveStream
|
||||||
// client should not interpret the attribute.
|
// client should not interpret the attribute.
|
||||||
std::function<void(const RecordableEncodedFrame&)> callback;
|
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
|
// Memento of when a keyframe request was last sent. The VideoReceiveStream
|
||||||
// client should not interpret the attribute.
|
// client should not interpret the attribute.
|
||||||
absl::optional<int64_t> last_keyframe_request_ms;
|
absl::optional<int64_t> last_keyframe_request_ms;
|
||||||
|
@ -762,7 +762,6 @@ VideoReceiveStream::RecordingState VideoReceiveStream::SetAndGetRecordingState(
|
|||||||
RTC_DCHECK_RUN_ON(&decode_queue_);
|
RTC_DCHECK_RUN_ON(&decode_queue_);
|
||||||
// Save old state.
|
// Save old state.
|
||||||
old_state.callback = std::move(encoded_frame_buffer_function_);
|
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_;
|
old_state.last_keyframe_request_ms = last_keyframe_request_ms_;
|
||||||
|
|
||||||
// Set new state.
|
// Set new state.
|
||||||
@ -771,7 +770,7 @@ VideoReceiveStream::RecordingState VideoReceiveStream::SetAndGetRecordingState(
|
|||||||
RequestKeyFrame(clock_->TimeInMilliseconds());
|
RequestKeyFrame(clock_->TimeInMilliseconds());
|
||||||
keyframe_generation_requested_ = true;
|
keyframe_generation_requested_ = true;
|
||||||
} else {
|
} else {
|
||||||
keyframe_generation_requested_ = state.keyframe_needed;
|
keyframe_generation_requested_ = false;
|
||||||
last_keyframe_request_ms_ = state.last_keyframe_request_ms.value_or(0);
|
last_keyframe_request_ms_ = state.last_keyframe_request_ms.value_or(0);
|
||||||
}
|
}
|
||||||
event.Set();
|
event.Set();
|
||||||
|
Reference in New Issue
Block a user