Repository: bevyengine/bevy
File: crates/bevy_dev_tools/src/easy_screenshot.rs (Rust)

Code before:
            tune: Tune::Animation,
            frame_time: Duration::from_millis(33),
        }
    }
}

#[cfg(feature = "screenrecording")]
/// Controls screen recording
#[derive(Message)]
pub enum RecordScreen {
    /// Starts screen recording
    Start,
    /// Stops screen recording
    Stop,
}

#[cfg(feature = "screenrecording")]
impl Plugin for EasyScreenRecordPlugin {
    #[cfg_attr(
        target_os = "windows",
        expect(unused_variables, reason = "not working on windows")
    )]
    fn build(&self, app: &mut App) {
        #[cfg(target_os = "windows")]
        {
            tracing::warn!("Screen recording is not supported on Windows");
        }
        #[cfg(not(target_os = "windows"))]
        {
            use bevy_image::Image;
            use bevy_render::view::screenshot::ScreenshotCaptured;
            use bevy_time::Time;
            use std::{fs::File, io::Write, sync::mpsc::channel};
            use tracing::info;
            use x264::{Colorspace, Encoder, Setup};

            enum RecordCommand {
                Start(String, Preset, Tune),
                Stop,
                Frame(Image),
            }

            let (tx, rx) = channel::<RecordCommand>();

            let frame_time = self.frame_time;

            std::thread::spawn(move || {
                let mut encoder: Option<Encoder> = None;
                let mut setup = None;
                let mut file: Option<File> = None;
                let mut frame = 0;

Review comment (suggestion):
```suggestion
            tracing::warn!("Screen recording is not currently supported on Windows: see https://github.com/bevyengine/bevy/issues/22132");
```

Code after:
            tune: Tune::Animation,
            frame_time: Duration::from_millis(33),
        }
    }
}

#[cfg(feature = "screenrecording")]
/// Controls screen recording
#[derive(Message)]
pub enum RecordScreen {
    /// Starts screen recording
    Start,
    /// Stops screen recording
    Stop,
}

#[cfg(feature = "screenrecording")]
impl Plugin for EasyScreenRecordPlugin {
    #[cfg_attr(
        target_os = "windows",
        expect(unused_variables, reason = "not working on windows")
    )]
    fn build(&self, app: &mut App) {
        #[cfg(target_os = "windows")]
        {
            tracing::warn!("Screen recording is not currently supported on Windows: see https://github.com/bevyengine/bevy/issues/22132");
        }
        #[cfg(not(target_os = "windows"))]
        {
            use bevy_image::Image;
            use bevy_render::view::screenshot::ScreenshotCaptured;
            use bevy_time::Time;
            use std::{fs::File, io::Write, sync::mpsc::channel};
            use tracing::info;
            use x264::{Colorspace, Encoder, Setup};

            enum RecordCommand {
                Start(String, Preset, Tune),
                Stop,
                Frame(Image),
            }

            let (tx, rx) = channel::<RecordCommand>();

            let frame_time = self.frame_time;

            std::thread::spawn(move || {
                let mut encoder: Option<Encoder> = None;
                let mut setup = None;
                let mut file: Option<File> = None;
                let mut frame = 0;