1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
use {
    crate::{
        cx::Cx,
        decoding_api::{CxDecodingApi, VideoDecodingInputFn},
        makepad_live_id::LiveId,
    },
    std::{
        collections::HashMap,
        sync::{Arc, Mutex},
    },
};

#[derive(Default)]
pub struct CxWindowsDecoding {
    pub video_decoding_input_cb: HashMap<LiveId, Arc<Mutex<Option<VideoDecodingInputFn>>>>,
}

impl Cx {}

impl CxDecodingApi for Cx {
    fn video_decoding_input_box(&mut self, video_id: LiveId, f: VideoDecodingInputFn) {
        let callback = Arc::new(Mutex::new(Some(f)));
        self.os
            .decoding
            .video_decoding_input_cb
            .insert(video_id, callback);
    }
}