Skip to content

Commit

Permalink
Set device media type for video preview explicitly
Browse files Browse the repository at this point in the history
  • Loading branch information
dasyad00 committed Aug 19, 2024
1 parent 7c1a05c commit 0cf1e06
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions packages/camera/camera_windows/windows/capture_controller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -479,6 +479,13 @@ HRESULT CaptureControllerImpl::FindBaseMediaTypes() {
return E_FAIL;
}

hr = source->SetCurrentDeviceMediaType(
(DWORD)MF_CAPTURE_ENGINE_PREFERRED_SOURCE_STREAM_FOR_VIDEO_PREVIEW,
base_preview_media_type_.Get());
if (FAILED(hr)) {
return hr;
}

// Find base media type for record and photo capture.
if (!FindBestMediaType(
(DWORD)MF_CAPTURE_ENGINE_PREFERRED_SOURCE_STREAM_FOR_VIDEO_RECORD,
Expand Down

0 comments on commit 0cf1e06

Please sign in to comment.