WGC capturer now fails with error when source is closed
When refactoring the WGC capture path, the check of a closed source had been placed at a level where the notification of a closed source was left without being detected since the error message was never provided to the main WgcCapturerWin::CaptureFrame() which sends the error message up to the client. This trivial change ensures that WgcCapturerWin::CaptureFrame() returns with DesktopCapturer::Result::ERROR_PERMANENT as soon as WgcCaptureSession::OnItemClosed() has been triggered and it will ensure that the WGC capture session stops and that any attached MediaStreamTrack will signal its onended event as expected. Bug: chromium:330863510 Change-Id: I57e44df417c33efa0595fc277cac5429cf539b26 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/344420 Reviewed-by: Alexander Cooper <alcooper@chromium.org> Commit-Queue: Henrik Andreassson <henrika@webrtc.org> Cr-Commit-Position: refs/heads/main@{#41963}
This commit is contained in:
parent
5928e35abf
commit
71b9a581b4
@ -261,6 +261,12 @@ bool WgcCaptureSession::GetFrame(std::unique_ptr<DesktopFrame>* output_frame,
|
||||
bool source_should_be_capturable) {
|
||||
RTC_DCHECK_RUN_ON(&sequence_checker_);
|
||||
|
||||
if (item_closed_) {
|
||||
RTC_LOG(LS_ERROR) << "The target source has been closed.";
|
||||
RecordGetFrameResult(GetFrameResult::kItemClosed);
|
||||
return false;
|
||||
}
|
||||
|
||||
// Try to process the captured frame and wait some if needed. Avoid trying
|
||||
// if we know that the source will not be capturable. This can happen e.g.
|
||||
// when captured window is minimized and if EnsureFrame() was called in this
|
||||
@ -316,12 +322,6 @@ HRESULT WgcCaptureSession::CreateMappedTexture(
|
||||
HRESULT WgcCaptureSession::ProcessFrame() {
|
||||
RTC_DCHECK_RUN_ON(&sequence_checker_);
|
||||
|
||||
if (item_closed_) {
|
||||
RTC_LOG(LS_ERROR) << "The target source has been closed.";
|
||||
RecordGetFrameResult(GetFrameResult::kItemClosed);
|
||||
return E_ABORT;
|
||||
}
|
||||
|
||||
RTC_DCHECK(is_capture_started_);
|
||||
|
||||
ComPtr<WGC::IDirect3D11CaptureFrame> capture_frame;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user