Commit Graph

16 Commits

Author SHA1 Message Date
Harisreedhar 9f6a19c1d2 feat(rtc): 2-way REMB with in-place encoder bitrate update (#1131)
* implement remb other direction

* update test
2026-05-30 04:41:10 +05:30
Harisreedhar 6b9ddd9a4f feat(rtc): REMB bitrate adaptation with in-place encoder update (#1130)
* improve test

* fix lint

* cleanup

* cleanup
2026-05-29 21:15:03 +05:30
henryruhs 871559cb6a clean and simplify tests 2026-05-29 15:44:07 +02:00
Harisreedhar 2a8672b54d Implement tier 1 REMB (#1129)
* implement tier 1

* fix lint

* cleanup

* cleanup

* fix lint

* use clear_remb method

* use single callback

* improve test

* improve test

* improve test

* improve test

* improve test
2026-05-29 19:00:27 +05:30
Harisreedhar 4fe79483ea Fix stream lifecycle bugs: threading, RTP sync, and resource cleanup (#1125)
* fix executor thread not terminating after stream deletion

* fix stream shutdown and thread lifecycle

* add todo

* cleanup

* cleanup

* cleanup

* cleanup

* audio_queue.put() → get_nowait() + put_nowait()

* rename test

* fix test

* merge tests

* cleanup tests

* cleanup tests

* cleanup tests

* simplify test logic with mock

* cleanup

* cleanup hard to read stream_helper.py

* introduce rtc_peer.has_peers

* fix lint

* add todos

* fix test hash
2026-05-22 16:29:45 +05:30
Harisreedhar 520dcbfd6b Refine stream helper: queue-based loops, AV1/WHIP support, endpoint separation (#1124)
* rearrange methods

* add test_stream_helper.py

* improve tests

* use deque

* move decoder to recieve methods

* remove cleanup_peer

* add destroy_stream

* make run_peer_loop more readable

* make video and audio method simlar

* change deque to queue to avoid extra thread event

* remove negative condition

* cleanup

* remove wait_for_frame

* cleanup

* cleanup

* fix process_image

* fix lint

* cleanup

* remove last_time

* add todos
2026-05-20 23:43:14 +05:30
Henry Ruhs c00ea92f35 Migrate to WHIP (#1120)
* migrate to whip part1

* migrate to whip part2

* migrate to whip part3

* migrate to whip part4

* migrate to whip/whep with bidirectional

* migrate to whip/whep with bidirectional

* use next library

* add _next to lid datachannel files

* cleanup and add todos

* use internal helper rtcGetPayloadTypesForCodec

* fix lint

* refactor decode()

* move logic to codecs

* move logic to codecs

* break encoders and decoders into multiple files

* break encoders and decoders into multiple files

* cleanup more

* drop action for stream endpoints, keep type for self documentation

* restore the v4 store

* fix: align frame_width and frame_height to even in both collect() and read_resolution() in both decoders.

---------

Co-authored-by: harisreedhar <h4harisreedhar.s.s@gmail.com>
2026-05-18 16:16:06 +02:00
Harisreedhar c48c238f88 Combine encode loop methods (#1119)
* combine run_aom_encode_loop and run_vpx_encode_loop to encode_video_loop

* run_opus_encode_loop -> encode_audio_loop

* use else instead of continue

* rename to video_codec
2026-05-16 23:29:36 +05:30
Henry Ruhs dd1ded1408 Refactor/rtc cleanup 3 (#1118)
* tweak rtc store and make the decision to ban trivial testing

* clear todos for rtc_test, remove redundant tests

* clear todos for rtc_test, remove redundant tests

* break negotiation out of rtc flow, introduce create_sdp_answer and set_remote_description

* add todo

* move timeline control to the stream helper, clean send_audio|video_to_peers

* rename some methods

* fix test

* introduce detect_sdp_media

* introduce detect_sdp_media
2026-05-16 09:06:04 +02:00
Harisreedhar 0019d3ad0f Refactor stream_helper: queue-based audio/video loops with unified threading (#1116)
* rearrange methods following the flow

* add test_stream_helper.py

* fix lint

* fix lint

* refactor audio flow to match video by replacing dequeue with queue

* remove unused keyframe interval

* remove try block

* remove while True

* simplify run_aom_encode_loop and run_vp8_encode_loop

* cleanup names

* simplify run_opus_encode_loop

* move opus_encoder creation to run_opus_encode_loop

* add todos

* fix lint

* update todos and tests
2026-05-15 21:47:30 +05:30
Henry Ruhs 76c413a2c1 Refactor/ffmpeg less stream (#1092)
* remove ffmpeg from stream to use opus and vpx, add bunch of todos

* fix testing

* improve download checkout

* fix datachannel download, fix super dirty test clients - setup logic does not belong there

* fix testing
2026-05-11 16:36:23 +02:00
Henry Ruhs a8db033033 move stream mode to query parameter (#1089) 2026-05-11 16:36:23 +02:00
henryruhs fda6b7f69d fix test 2026-05-11 16:36:23 +02:00
henryruhs 9a2d57ae54 refactor detect_websocket_stream_mode and related tests a bit, disable broken tests 2026-05-11 16:36:23 +02:00
Harisreedhar dfaa1f9cd4 Replace aiortc with libdatachannel direct pipeline (#1083)
* fix stdin close error

* Refactor stream endpoint, fix encoder thread safety and improve tests

* fix and improve test

* remove not None

* use Enum

* use Enum and add todo

* remove poll
2026-05-11 16:36:23 +02:00
Harisreedhar a2aedc8814 Add stream helper utilities and IVF frame iterator (#1082)
* Add stream helper utilities and IVF frame iterator

* fix lint

* some cosmetics

* fix lint

* changes

* improve test

* improve types and test

* add todo for better bitrate calculation
2026-05-11 16:36:23 +02:00