Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix scap on windows #135

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open

Fix scap on windows #135

wants to merge 4 commits into from

Conversation

kerosina
Copy link

While compiling for windows, I get the following errors:

error[E0053]: method `new` has an incompatible type for trait
  --> C:\Users\makedon\.cargo\registry\src\index.crates.io-6f17d22bba15001f\scap-0.0.7\src\capturer\engine\win\mod.rs:39:25
   |
39 |     fn new(flag_values: Self::Flags) -> Result<Self, Self::Error> {
   |                         ^^^^^^^^^^^ expected `windows_capture::capture::Context<FlagStruct>`, found `FlagStruct`
   |
   = note: expected signature `fn(windows_capture::capture::Context<FlagStruct>) -> Result<_, _>`
              found signature `fn(FlagStruct) -> Result<_, _>`
help: change the parameter type to match the trait
   |
39 |     fn new(flag_values: windows_capture::capture::Context<FlagStruct>) -> Result<Self, Self::Error> {
   |                         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

error[E0599]: no method named `as_raw_nopadding_buffer` found for struct `FrameBuffer` in the current scope
  --> C:\Users\makedon\.cargo\registry\src\index.crates.io-6f17d22bba15001f\scap-0.0.7\src\capturer\engine\win\mod.rs:65:61
   |
65 |                 let raw_frame_buffer = match cropped_buffer.as_raw_nopadding_buffer() {
   |                                                             ^^^^^^^^^^^^^^^^^^^^^^^
   |
help: there is a method `as_nopadding_buffer` with a similar name
   |
65 |                 let raw_frame_buffer = match cropped_buffer.as_nopadding_buffer() {
   |                                                             ~~~~~~~~~~~~~~~~~~~

This PR fixes both errors by following the compiler's suggestions (modifying the function to take a Context and using as_nopadding_buffer).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant