forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
remoting: Support callback based frame capturing
Rather than doing a timer based frame capture, this change modifies the implementation to rely on callbacks from webrtc capturer whenever a new frame is received via pipewire. Corresponding WebRTC change is here: https://webrtc-review.googlesource.com/c/src/+/291080 Bug: chromium:1291247 Change-Id: Ia00edc110dfe40918e1ad0862472f70d7c849c9f Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4188923 Reviewed-by: Lambros Lambrou <lambroslambrou@chromium.org> Commit-Queue: Salman Malik <salmanmalik@chromium.org> Cr-Commit-Position: refs/heads/main@{#1099800}
- Loading branch information
Salman
authored and
Chromium LUCI CQ
committed
Feb 1, 2023
1 parent
77aea12
commit 2df935e
Showing
17 changed files
with
262 additions
and
13 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
// Copyright 2023 The Chromium Authors | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
#include "remoting/protocol/desktop_capturer.h" | ||
|
||
namespace remoting { | ||
|
||
bool DesktopCapturer::SupportsFrameCallbacks() { | ||
return false; | ||
} | ||
|
||
} // namespace remoting |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
// Copyright 2023 The Chromium Authors | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
#include "remoting/protocol/no_op_webrtc_frame_scheduler.h" | ||
|
||
#include "base/notreached.h" | ||
|
||
namespace remoting::protocol { | ||
|
||
NoOpWebrtcFrameScheduler::NoOpWebrtcFrameScheduler(DesktopCapturer* capturer) | ||
: capturer_(capturer) { | ||
DETACH_FROM_SEQUENCE(sequence_checker_); | ||
} | ||
|
||
NoOpWebrtcFrameScheduler::~NoOpWebrtcFrameScheduler() { | ||
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); | ||
} | ||
|
||
void NoOpWebrtcFrameScheduler::Start( | ||
const base::RepeatingClosure& capture_callback) { | ||
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); | ||
} | ||
|
||
void NoOpWebrtcFrameScheduler::Pause(bool pause) { | ||
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); | ||
|
||
if (pause) { | ||
capturer_->SetMaxFrameRate(0u); | ||
} else { | ||
capturer_->SetMaxFrameRate(last_frame_rate_); | ||
} | ||
} | ||
|
||
void NoOpWebrtcFrameScheduler::OnFrameCaptured( | ||
const webrtc::DesktopFrame* frame) { | ||
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); | ||
} | ||
|
||
void NoOpWebrtcFrameScheduler::SetMaxFramerateFps(int max_framerate_fps) { | ||
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); | ||
|
||
last_frame_rate_ = max_framerate_fps; | ||
capturer_->SetMaxFrameRate(last_frame_rate_); | ||
} | ||
|
||
void NoOpWebrtcFrameScheduler::BoostCaptureRate( | ||
base::TimeDelta capture_interval, | ||
base::TimeDelta duration) { | ||
NOTIMPLEMENTED() << "Boosting frame rate is not supported for wayland"; | ||
} | ||
|
||
} // namespace remoting::protocol |
Oops, something went wrong.