streamlit-webrtc 0.62.0__py3-none-any.whl → 0.62.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- streamlit_webrtc/component.py +14 -13
- {streamlit_webrtc-0.62.0.dist-info → streamlit_webrtc-0.62.1.dist-info}/METADATA +1 -1
- {streamlit_webrtc-0.62.0.dist-info → streamlit_webrtc-0.62.1.dist-info}/RECORD +5 -5
- {streamlit_webrtc-0.62.0.dist-info → streamlit_webrtc-0.62.1.dist-info}/WHEEL +0 -0
- {streamlit_webrtc-0.62.0.dist-info → streamlit_webrtc-0.62.1.dist-info}/licenses/LICENSE +0 -0
streamlit_webrtc/component.py
CHANGED
@@ -597,11 +597,8 @@ def webrtc_streamer(
|
|
597
597
|
on_ended=on_audio_ended,
|
598
598
|
)
|
599
599
|
|
600
|
-
worker_created_in_this_run = None
|
601
600
|
with context._worker_creation_lock: # This point can be reached in parallel so we need to use a lock to make the worker creation process atomic.
|
602
|
-
|
603
|
-
|
604
|
-
if should_create_worker_in_this_run:
|
601
|
+
if not context._get_worker() and sdp_offer:
|
605
602
|
LOGGER.debug(
|
606
603
|
"No worker exists though the offer SDP is set. "
|
607
604
|
'Create a new worker (key="%s").',
|
@@ -621,7 +618,7 @@ def webrtc_streamer(
|
|
621
618
|
ice_servers = get_available_ice_servers() # NOTE: This may include a yield point where Streamlit's script runner interrupts the execution and may stop the current run.
|
622
619
|
aiortc_rtc_configuration.iceServers = compile_ice_servers(ice_servers)
|
623
620
|
|
624
|
-
worker_created_in_this_run = WebRtcWorker(
|
621
|
+
worker_created_in_this_run: WebRtcWorker = WebRtcWorker(
|
625
622
|
mode=mode,
|
626
623
|
rtc_configuration=aiortc_rtc_configuration,
|
627
624
|
player_factory=player_factory,
|
@@ -644,19 +641,23 @@ def webrtc_streamer(
|
|
644
641
|
sendback_audio=sendback_audio,
|
645
642
|
)
|
646
643
|
|
644
|
+
worker_created_in_this_run.process_offer(
|
645
|
+
sdp_offer["sdp"],
|
646
|
+
sdp_offer["type"],
|
647
|
+
timeout=10, # The timeout of aioice's method that is used in the internal of this method is 5: https://github.com/aiortc/aioice/blob/aaada959aa8de31b880822db36f1c0c0cef75c0e/src/aioice/ice.py#L973. We set a bit longer timeout here.
|
648
|
+
)
|
649
|
+
|
647
650
|
# Set the worker here within the lock.
|
648
651
|
context._set_worker(worker_created_in_this_run)
|
649
652
|
|
653
|
+
# It's important to lock the entire block including creating the worker, waiting for process_offer(), and calling rerun().
|
654
|
+
# Otherwise, `rerun()` may fail because another script run completes during this run is pending to wait for these operations
|
655
|
+
# and it sets the `ScriptRequests._state` to `ScriptRequestType.STOP` which denies the rerun request.
|
656
|
+
LOGGER.debug("Rerun to send the SDP answer to frontend")
|
657
|
+
rerun()
|
658
|
+
|
650
659
|
webrtc_worker = context._get_worker()
|
651
660
|
if webrtc_worker and ice_candidates:
|
652
661
|
webrtc_worker.set_ice_candidates_from_offerer(ice_candidates)
|
653
662
|
|
654
|
-
if worker_created_in_this_run:
|
655
|
-
worker_created_in_this_run.process_offer(
|
656
|
-
sdp_offer["sdp"], sdp_offer["type"], timeout=None
|
657
|
-
)
|
658
|
-
|
659
|
-
# Rerun to send the SDP answer to frontend
|
660
|
-
rerun()
|
661
|
-
|
662
663
|
return context
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: streamlit-webrtc
|
3
|
-
Version: 0.62.
|
3
|
+
Version: 0.62.1
|
4
4
|
Summary: Real-time video and audio processing on Streamlit
|
5
5
|
Project-URL: Repository, https://github.com/whitphx/streamlit-webrtc
|
6
6
|
Author-email: "Yuichiro Tachibana (Tsuchiya)" <t.yic.yt@gmail.com>
|
@@ -1,6 +1,6 @@
|
|
1
1
|
streamlit_webrtc/__init__.py,sha256=jMWwXoQ9hVyYXPD4Vrps7MyiR9goyC-n7LtkZNFBOxU,2273
|
2
2
|
streamlit_webrtc/_compat.py,sha256=AVRcUGdgWDQcCE7-ufhGr6Hb5P6EHLgejUAA72ArJmg,4384
|
3
|
-
streamlit_webrtc/component.py,sha256=
|
3
|
+
streamlit_webrtc/component.py,sha256=wUxaxKPCMC1YteXnyvJ7WnZ7NjSRWQ7BLSqtp6WAs14,27691
|
4
4
|
streamlit_webrtc/components_callbacks.py,sha256=tdrj2TlV8qcexFEdjm4PVkz8JwHffo4A8imoXOtjNHA,2401
|
5
5
|
streamlit_webrtc/config.py,sha256=yKFIVjIoX2F62_G2qcDrNYm2Qe_qx1E9E0YqAnAibMo,5544
|
6
6
|
streamlit_webrtc/credentials.py,sha256=fTs-DhUhScK8m7OEfkgTMw7pKXnS9QNpjtJAvR9oIzs,4619
|
@@ -19,7 +19,7 @@ streamlit_webrtc/source.py,sha256=haPqMZ50Xh8tg7Z1yN8Frfk8v7D3oOuKteaD59asbzs,22
|
|
19
19
|
streamlit_webrtc/webrtc.py,sha256=WzgydYm3Xhoi5c1QHNLc_GiF_E0aGC5ynzmxeAbtJCw,29900
|
20
20
|
streamlit_webrtc/frontend/dist/index.html,sha256=ZY_Iflaf7wRUHHNpw7JMlSMraE3ewM9T_tZA94NIPRs,527
|
21
21
|
streamlit_webrtc/frontend/dist/assets/index-Cz1nSw2-.js,sha256=j126AA3NGo8BLgQSjjMyQR6QwpDRq_jILP9woihrncI,589799
|
22
|
-
streamlit_webrtc-0.62.
|
23
|
-
streamlit_webrtc-0.62.
|
24
|
-
streamlit_webrtc-0.62.
|
25
|
-
streamlit_webrtc-0.62.
|
22
|
+
streamlit_webrtc-0.62.1.dist-info/METADATA,sha256=nfgcOiaohmwGgMDGOQu7q7L9U6xngk-t1e7XPVQ7BOg,18288
|
23
|
+
streamlit_webrtc-0.62.1.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
24
|
+
streamlit_webrtc-0.62.1.dist-info/licenses/LICENSE,sha256=pwccNHVA7r4rYofGlMU10aKEU90GLUlQr8uY80PR0NQ,1081
|
25
|
+
streamlit_webrtc-0.62.1.dist-info/RECORD,,
|
File without changes
|
File without changes
|