Commit Graph

118 Commits

Author SHA1 Message Date
lifning f60b2c579c WIP: refactor ratecontrol audio component to use SDL AudioQueue, which might just be better for the Simple audio component too 2021-11-03 13:28:37 -07:00
lifning 5451aa735d WIP still awful but builds and runs 2021-11-03 02:12:38 -07:00
lifning c505428895 WIP messier shit figuring out audio format changing that the sdl2 crate generics currently make impossible 2021-11-02 23:43:48 -07:00
lifning a1e28e9838 WIP figuring out DRC audio component impl 2021-11-02 20:24:36 -07:00
lifning 11e014b9ed refactor stdlib components into submods 2021-11-02 17:49:49 -07:00
lifning c94400f1b6 more doc revisions 2021-11-02 00:32:53 -07:00
lifning 725a5d8f03 more struct docs 2021-11-01 21:14:25 -07:00
lifning ebea5ffd22 video and audio callback API change:
fn video_refresh(&mut self, data: &[u8], width: c_uint, height: c_uint, pitch: c_uint);
    fn video_refresh_dupe(&mut self, width: c_uint, height: c_uint, pitch: c_uint);
    fn video_refresh_hw(&mut self, width: c_uint, height: c_uint);
    fn audio_sample(&mut self, left: i16, right: i16);
    fn audio_sample_batch(&mut self, stereo_pcm: &[i16]) -> usize;

have been replaced with

    fn video_refresh(&mut self, frame: &VideoFrame);
    fn audio_samples(&mut self, stereo_pcm: &[i16]) -> usize;

where VideoFrame is

    pub enum VideoFrame<'a> {
        XRGB1555 { data: &'a [u16], width: c_uint, height: c_uint, pitch_u16: usize },
        RGB565 { data: &'a [u16], width: c_uint, height: c_uint, pitch_u16: usize },
        XRGB8888 { data: &'a [u32], width: c_uint, height: c_uint, pitch_u32: usize },
        Duplicate { width: c_uint, height: c_uint, pitch_u8: usize, },
        HardwareRender { width: c_uint, height: c_uint, },
    }

use `pub fn VideoFrame::data_pitch_as_bytes(&self) -> Option<(&'a [u8], usize)>` for things that need to access the framebuffer data as a byte array rather than a pixel array.
2021-11-01 00:56:23 -07:00
lifning 9d3e74b7cb make do_sleep pub & add a "stuff the buffer with silence" method useful when you wish to pause an interactive emulator 2021-10-19 00:07:34 -07:00
lifning 1b311837d4 that's not what that word means 2021-10-17 22:13:20 -07:00
lifning 2ff0444854 get rid of "component id" business 2021-10-17 22:08:49 -07:00
lifning f1a9f7dd23 add a non-mut version, component_ref 2021-10-17 21:56:53 -07:00
lifning 268f1b4ff8 add scary-looking-but-safe dynamic downcast for a component_mut accessor 2021-10-17 21:46:12 -07:00
lifning 26ff040136 adding plain sdl2 surface component 2021-10-16 02:26:33 -07:00
lifning b735e5f4e5 make example deps properly optional 2021-10-15 21:42:51 -07:00
lifning 55725b28e1 readme 2021-10-11 15:17:12 -07:00
lifning 79f6d79eb8 no longer unix-specific 2021-10-01 21:14:53 -07:00
lif 409bd03621 Merge pull request 'liffy/sdl-gl' (#16) from liffy/sdl-gl into matriarch
Reviewed-on: https://git.vvn.space/cinnabon/rustro/pulls/16
2021-08-22 06:16:01 +00:00
lifning 41c0864bef misc cleanup for SDL+GL 2021-08-21 21:45:57 -07:00
lifning 71240de38c Support 2D video_refresh in the SDL+GL component
...and alter the behavior of ThreadSleep component a bit.
2021-08-21 20:37:47 -07:00
lifning 0c5d0b5338 clear color buffer on vid refresh 2021-08-20 22:17:38 -07:00
lifning f954fe9ffb tell parallel-n64 to use glide64 when using the SDL_GL component 2021-08-20 21:47:48 -07:00
lifning 2b3409318b trace api-logging component 2021-08-20 21:47:26 -07:00
lifning 013cc247b9 wip messing around with SDL_GL as a possible hw render provider to later mix in with the existing 2D codepaths 2021-08-20 00:14:41 -07:00
lif e1c0670feb Merge pull request 'Split Sdl2Component into audio/video/input/framelimit' (#15) from liffy/sdl-split into matriarch
Reviewed-on: https://git.vvn.space/cinnabon/rustro/pulls/15
2021-08-19 05:44:36 +00:00
lifning 0501812ae9 Split Sdl2Component into audio/video/input/framelimit 2021-08-18 22:05:19 -07:00
Vivian Lim a3cd71a3b2 Merge pull request 'Split into two crates in one workspace: ferretro_core & ferretro_components' (#14) from viv/reorganize into matriarch
Reviewed-on: https://git.vvn.space/cinnabon/rustro/pulls/14
2021-08-19 00:03:43 +00:00
Vivian Lim 54bd5de72e update authors for ferretro_components 2021-08-18 16:17:38 -07:00
Vivian Lim 7b850c1800 ferretro_core -> ferretro_base 2021-08-18 14:47:57 -07:00
Vivian Lim 5d2692262c Split into two crates in one workspace: ferretro_core & ferretro_components 2021-08-18 14:32:55 -07:00
lifning d156c04a04 fix SDL2 audio thread hanging on close 2021-08-17 16:50:26 -07:00
Vivian Lim 12b879ac9f Merge pull request 'gigantic nightmare ffmpeg + components pr' (#12) from viv/ffmpeg2 into matriarch
Reviewed-on: https://git.vvn.space/cinnabon/rustro/pulls/12
2021-08-17 23:22:08 +00:00
Vivian Lim 2d2983fd1c fix setting memory maps when emu calls it 2021-08-17 16:16:07 -07:00
Vivian Lim cf076409f0 Merge branch 'matriarch' of ssh://vvn.space:2222/cinnabon/rustro into viv/ffmpeg2 2021-08-17 15:37:51 -07:00
Vivian Lim 999bac20a2 Merge branch 'liffy/api' of ssh://vvn.space:2222/cinnabon/rustro into viv/ffmpeg2 2021-08-17 15:35:29 -07:00
Vivian Lim f4d076b76f Add more derived traits to constants 2021-08-17 15:23:48 -07:00
lifning a7c4f0909d sorta works! ffmpeg component might need updating to latest example code 2021-08-17 04:06:40 -07:00
lifning 9dcbc94847 WIP: messing with mutability for a better tomorrow 2021-08-12 23:58:21 -07:00
lifning 7b06ed61d1 constructor for RetroComponentBase 2021-08-11 01:08:22 -07:00
lifning 47d7113b03 implement the rest of the callbacks in the dispatcher 2021-08-11 00:42:13 -07:00
lifning 2b73e3d836 document env callbacks & continue sketching component api 2021-08-10 17:59:00 -07:00
viv 4a38b99c5e add unserialize flag to ffmpeg_recorder 2021-08-09 22:32:22 -07:00
Vivian Lim d8d0038643 Merge pull request 'wrapper: invoke handler.set_memory_maps()' (#10) from viv/call-set-memory-maps into matriarch
Reviewed-on: https://git.vvn.space/cinnabon/rustro/pulls/10
2021-08-03 08:11:05 +00:00
viv 3cad3b1e29 Don't try to write an audio frame if there aren't any planes 2021-08-01 00:08:18 -07:00
Viv Lim 3beb1a8519 fix audio sync when being played by quicktime
the thing I was doing is on the audio, i was setting the pts (presentation timestamp) after the frame was filtered by ffmpeg, which could be frames later, and could be batched.
i set the pts before filtering, but that made things worse. for some reason, the audio filter is remapping the pts I use (frame count, 1/60) to the time base 1/44100.
the video filter does not do this, which is why I specifically remap it later
I had to make that remap step I added later skip the audio channel
2021-07-28 23:54:40 -07:00
Viv Lim 7c03aac388 Don't panic if the emulator doesn't have frames ready to render, use angrylion with parallel-n64 2021-07-27 00:50:11 -07:00
Viv Lim ee9678af68 cleaner pts rescaling at packet write time. writing headers can change time_base by design so just adapt to it 2021-07-26 01:10:48 -07:00
Viv Lim ea771c8dd7 synced a/v on some players at least. ideally i'd like to write the header with the right time bases set. 2021-07-26 00:42:06 -07:00
Viv Lim 57530da214 able to record ok-sounding audio from picodrive 2021-07-25 22:02:40 -07:00
Vivian Lim 41da935d42 actually write real audio (was sending aframe instead of filtered_aframe to encoder)
and a few other fixes / shufflings
2021-04-25 19:31:06 -07:00