also looking at this
feat(media): add bounded PCM capture, owned snapshots and A/V streaming
#917
11 files
+683
-0
| @@ -0,0 +1,16 @@ | ||
| 1 | #include "native_capture.h" | |
| 2 | #include <assert.h> | |
| 3 | #include <stdint.h> | |
| 4 | #include <stddef.h> | |
| 5 | int main(void) { | |
| 6 | home_capture_config cfg={48000,2,480}; | |
| 7 | home_audio_capture *capture=NULL; | |
| 8 | assert(home_audio_open(&cfg,"null",&capture)==0); | |
| 9 | uint8_t bytes[1920];uint32_t frames=0;uint64_t timestamp=0;int64_t error=0; | |
| 10 | assert(home_audio_read(capture,bytes,480,100,&frames,×tamp,&error)==0); | |
| 11 | assert(frames>0 && frames<=480 && timestamp>0 && error==0); | |
| 12 | home_audio_close(capture); | |
| 13 | capture=NULL;cfg.channels=3; | |
| 14 | assert(home_audio_open(&cfg,"null",&capture)==-1 && !capture); | |
| 15 | return 0; | |
| 16 | } | |