streamlit-webrtc 0.63.1__py3-none-any.whl → 0.63.3__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.
@@ -6,7 +6,7 @@
6
6
  <meta name="viewport" content="width=device-width, initial-scale=1" />
7
7
  <meta name="theme-color" content="#000000" />
8
8
  <meta name="description" content="Streamlit WebRTC Component" />
9
- <script type="module" crossorigin src="./assets/index-Cn4hJFys.js"></script>
9
+ <script type="module" crossorigin src="./assets/index-4jnSNRmM.js"></script>
10
10
  </head>
11
11
  <body>
12
12
  <noscript>You need to enable JavaScript to run this app.</noscript>
streamlit_webrtc/mix.py CHANGED
@@ -2,10 +2,8 @@ import asyncio
2
2
  import fractions
3
3
  import functools
4
4
  import logging
5
- import sys
6
5
  import threading
7
6
  import time
8
- import traceback
9
7
  import weakref
10
8
  from collections import OrderedDict
11
9
  from typing import Callable, Generic, List, NamedTuple, Optional, Union, cast
@@ -106,11 +104,12 @@ async def mix_coro(mix_track: "MediaStreamMixTrack"):
106
104
  output_frame.pts = int(timestamp * AUDIO_SAMPLE_RATE)
107
105
  output_frame.time_base = AUDIO_TIME_BASE
108
106
 
109
- except Exception:
110
- exc_type, exc_value, exc_traceback = sys.exc_info()
111
- for tb in traceback.format_exception(exc_type, exc_value, exc_traceback):
112
- for tbline in tb.rstrip().splitlines():
113
- LOGGER.error(tbline.rstrip())
107
+ except Exception as exc:
108
+ LOGGER.error(
109
+ "Error occurred in the WebRTC mixer task: %s", exc, exc_info=True
110
+ )
111
+ raise exc
112
+
114
113
  mix_track._queue.put_nowait(output_frame)
115
114
 
116
115
  wait = this_iter_start_time + mix_track.mixer_output_interval - time.monotonic()
@@ -2,10 +2,8 @@ import asyncio
2
2
  import itertools
3
3
  import logging
4
4
  import queue
5
- import sys
6
5
  import threading
7
6
  import time
8
- import traceback
9
7
  from collections import deque
10
8
  from typing import Generic, List, Optional, Union
11
9
 
@@ -84,6 +82,15 @@ class AsyncMediaProcessTrack(MediaStreamTrack, Generic[ProcessorT, FrameT]):
84
82
 
85
83
  self._thread: Optional[threading.Thread] = None
86
84
 
85
+ self._worker_exception_lock = threading.Lock()
86
+ self._worker_exception: Optional[Exception] = None
87
+
88
+ def on_input_track_ended():
89
+ logger.debug("Input track %s ended. Stop self %s", self.track, self)
90
+ self.stop()
91
+
92
+ self.track.on("ended", on_input_track_ended)
93
+
87
94
  def _start(self) -> None:
88
95
  if self._thread:
89
96
  return
@@ -99,22 +106,13 @@ class AsyncMediaProcessTrack(MediaStreamTrack, Generic[ProcessorT, FrameT]):
99
106
  )
100
107
  self._thread.start()
101
108
 
102
- def on_input_track_ended():
103
- logger.debug("Input track %s ended. Stop self %s", self.track, self)
104
- self.stop()
105
-
106
- self.track.on("ended", on_input_track_ended)
107
-
108
109
  def _run_worker_thread(self):
109
110
  try:
110
111
  self._worker_thread()
111
- except Exception:
112
- logger.error("Error occurred in the WebRTC thread:")
113
-
114
- exc_type, exc_value, exc_traceback = sys.exc_info()
115
- for tb in traceback.format_exception(exc_type, exc_value, exc_traceback):
116
- for tbline in tb.rstrip().splitlines():
117
- logger.error(tbline.rstrip())
112
+ except Exception as exc:
113
+ logger.error("Error occurred in the WebRTC thread: %s", exc, exc_info=True)
114
+ with self._worker_exception_lock:
115
+ self._worker_exception = exc
118
116
 
119
117
  async def _fallback_recv_queued(self, frames: List[FrameT]) -> List[FrameT]:
120
118
  """
@@ -224,6 +222,10 @@ class AsyncMediaProcessTrack(MediaStreamTrack, Generic[ProcessorT, FrameT]):
224
222
  if self.readyState != "live":
225
223
  raise MediaStreamError
226
224
 
225
+ with self._worker_exception_lock:
226
+ if self._worker_exception:
227
+ raise self._worker_exception
228
+
227
229
  self._start()
228
230
 
229
231
  frame = await self.track.recv()
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: streamlit-webrtc
3
- Version: 0.63.1
3
+ Version: 0.63.3
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,14 +1,14 @@
1
1
  streamlit_webrtc/__init__.py,sha256=dzw8DtZ0D_FAXPeS7qT7QaKPTcxp9XAekpmcthwjF3I,2465
2
2
  streamlit_webrtc/_compat.py,sha256=AVRcUGdgWDQcCE7-ufhGr6Hb5P6EHLgejUAA72ArJmg,4384
3
- streamlit_webrtc/component.py,sha256=pixNqGXrTlogxXjXx6fSgMx2xPo0dj2fsXKenvWeqQk,28269
3
+ streamlit_webrtc/component.py,sha256=3EJiVNZijQ3GhiH6AwVtp9lb-ndKM7PUZZm02uy97c4,28209
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
7
7
  streamlit_webrtc/eventloop.py,sha256=AFmxGlRRxVdl0cTS9pKpRZR2Mnq6v6DgudVZZ425IVw,1333
8
8
  streamlit_webrtc/factory.py,sha256=4iKhb_g0wBO1YRoyCmdqIYwkNXODt4f9KbKxni5mQ0s,7927
9
- streamlit_webrtc/mix.py,sha256=Uh9gJviP3VLxwBQ-i3RftJ8GQ5qDPGqJKgm2M-vQYo4,8775
9
+ streamlit_webrtc/mix.py,sha256=8uQXCJvC3FISU4jRpPAnXXEXFgeMPGk3wKI6p4WfIHQ,8643
10
10
  streamlit_webrtc/models.py,sha256=3sKVjCFgX-eQ7nlMHGWxzR9ohdstxUSZaiOHjyDAHVQ,6308
11
- streamlit_webrtc/process.py,sha256=i1bSoyIAccKCKmYGnrYLq0ElPFND_5SsY1u91NY-B48,7878
11
+ streamlit_webrtc/process.py,sha256=sz-jo3od2yjVWLEO89zVRhXKKiYxrjcMA-McNz7lzhQ,7956
12
12
  streamlit_webrtc/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
13
13
  streamlit_webrtc/receive.py,sha256=gzv1uZDTAlxJ0hyJ5LweTr0lVuoisrH5xRevGnYkWwo,2922
14
14
  streamlit_webrtc/relay.py,sha256=2K2h0uNz50ARUOScYZPYlEmZb0uAi0agaYxI9z3mLeI,896
@@ -17,9 +17,9 @@ streamlit_webrtc/session_info.py,sha256=V1EdzD2I8dWANXdC84EKSz8XgPM-zugtkYsb4hJm
17
17
  streamlit_webrtc/shutdown.py,sha256=PUjMoNZcTRGzZCooCmjWARpeVs5EG_9JXAf1Iay7dBM,2353
18
18
  streamlit_webrtc/source.py,sha256=-bcvQYMyXcrhnsQNL3VlHwLT4KGjJ4jIZcPLKrbczZM,4215
19
19
  streamlit_webrtc/webrtc.py,sha256=WzgydYm3Xhoi5c1QHNLc_GiF_E0aGC5ynzmxeAbtJCw,29900
20
- streamlit_webrtc/frontend/dist/index.html,sha256=9Ld6LBoaaTi2Kis9PNJzVYEXTr4HZCrzLdRPjFcV5Rc,527
21
- streamlit_webrtc/frontend/dist/assets/index-Cn4hJFys.js,sha256=RCkqQD2BlksGpCz-hYmK9wpoLII2VMux8x7unbw6uYA,589981
22
- streamlit_webrtc-0.63.1.dist-info/METADATA,sha256=3EHTSFeXJv1Pm7T5bXCChckWpahF_FHvwAHEnHcIjlE,18288
23
- streamlit_webrtc-0.63.1.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
24
- streamlit_webrtc-0.63.1.dist-info/licenses/LICENSE,sha256=pwccNHVA7r4rYofGlMU10aKEU90GLUlQr8uY80PR0NQ,1081
25
- streamlit_webrtc-0.63.1.dist-info/RECORD,,
20
+ streamlit_webrtc/frontend/dist/index.html,sha256=68D6PDNx0C4SAHnTcjTbJXf7rUFKm8SFhU9gu5xsRyA,527
21
+ streamlit_webrtc/frontend/dist/assets/index-4jnSNRmM.js,sha256=JaUM7ss0KLDvThxYulCxA16l5OMlXOHjD84yi2B5hY8,586448
22
+ streamlit_webrtc-0.63.3.dist-info/METADATA,sha256=6IqXuEeC2Y3cRbqLTdr0O1C02YL382St7MjDh2f-ZcA,18288
23
+ streamlit_webrtc-0.63.3.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
24
+ streamlit_webrtc-0.63.3.dist-info/licenses/LICENSE,sha256=pwccNHVA7r4rYofGlMU10aKEU90GLUlQr8uY80PR0NQ,1081
25
+ streamlit_webrtc-0.63.3.dist-info/RECORD,,