feat: add public apis to set video/audio bitrate #109
+118
−0
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR closes #108: adds public runtime bitrate setters to esp_webrtc.
Behavior
If
rtc->capture_pathexists, callesp_capture_sink_set_bitrate()immediately (both for Video and Audio).If called before start, cache the values and apply them in
pc_start()right afteresp_capture_sink_setup()/esp_capture_sink_enable().Why here
esp-webrtc-solutionintegratesesp_captureas its media layer; providing first-class bitrate control at this level makes it straightforward for applications to adapt quality without restarting streams.Public API docs (headers) explain that bps is bits per second and that calls are valid before or during streaming.
Related
esp-gmf/esp_capture(esp_capture_sink_set_bitrate() returns NOT_SUPPORTED and confuses audio/video (AUD-6879) esp-gmf#29) to ensureesp_capture_sink_set_bitrate()forwards to the path manager and encoder (so runtime changes actually apply).Testing
Environments
ESP-IDF: latest
Board: ESP32-P4
Scenarios
During stream: Run any sender demo (e.g., Video Call). Invoke
esp_webrtc_set_video_bitrate(rtc, 300000). Expect lower throughput/quality.Pre-start (pending): Call
esp_webrtc_set_video_bitrate(rtc, 500000)beforeesp_webrtc_start().Start streaming and confirm bitrate is applied afterpc_start()creates/enables the sink.Audio path: Invoke
esp_webrtc_set_audio_bitrate(rtc, 64000)and track payload sizes or encoder stats.Checklist
Before submitting a Pull Request, please ensure the following: