This allows us to keep always some frame around so we can return it everytime consumer asks us to capture a frame as before we either returned current frame or nothing as there was no new frame available. This will be needed in order to support mouse cursor separately as DesktopAndCursorComposer requires frame everytime, even if it's the same one as before so we can combine it with the mouse cursor. Bug: webrtc:13429 Change-Id: Ice87968846870c0a880ab469d9e052b4978e658c Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/239362 Reviewed-by: Mark Foltz <mfoltz@chromium.org> Commit-Queue: Mark Foltz <mfoltz@chromium.org> Cr-Commit-Position: refs/heads/main@{#35956}
49 lines
1.5 KiB
C++
49 lines
1.5 KiB
C++
/*
|
|
* Copyright 2022 The WebRTC project authors. All Rights Reserved.
|
|
*
|
|
* Use of this source code is governed by a BSD-style license
|
|
* that can be found in the LICENSE file in the root of the source
|
|
* tree. An additional intellectual property rights grant can be found
|
|
* in the file PATENTS. All contributing project authors may
|
|
* be found in the AUTHORS file in the root of the source tree.
|
|
*/
|
|
|
|
#ifndef MODULES_DESKTOP_CAPTURE_LINUX_WAYLAND_SHARED_SCREENCAST_STREAM_H_
|
|
#define MODULES_DESKTOP_CAPTURE_LINUX_WAYLAND_SHARED_SCREENCAST_STREAM_H_
|
|
|
|
#include <memory>
|
|
|
|
#include "api/ref_counted_base.h"
|
|
#include "api/scoped_refptr.h"
|
|
#include "modules/desktop_capture/desktop_frame.h"
|
|
#include "rtc_base/system/rtc_export.h"
|
|
|
|
namespace webrtc {
|
|
|
|
class SharedScreenCastStreamPrivate;
|
|
|
|
class RTC_EXPORT SharedScreenCastStream
|
|
: public rtc::RefCountedNonVirtual<SharedScreenCastStream> {
|
|
public:
|
|
static rtc::scoped_refptr<SharedScreenCastStream> CreateDefault();
|
|
|
|
bool StartScreenCastStream(uint32_t stream_node_id, int fd);
|
|
void StopScreenCastStream();
|
|
std::unique_ptr<DesktopFrame> CaptureFrame();
|
|
|
|
~SharedScreenCastStream();
|
|
|
|
protected:
|
|
SharedScreenCastStream();
|
|
|
|
private:
|
|
SharedScreenCastStream(const SharedScreenCastStream&) = delete;
|
|
SharedScreenCastStream& operator=(const SharedScreenCastStream&) = delete;
|
|
|
|
std::unique_ptr<SharedScreenCastStreamPrivate> private_;
|
|
};
|
|
|
|
} // namespace webrtc
|
|
|
|
#endif // MODULES_DESKTOP_CAPTURE_LINUX_WAYLAND_SHARED_SCREENCAST_STREAM_H_
|