Examples do not close properly - required a ^Z to pause and then be killed.
mungewell opened this issue · comments
I think that this is related to 'class LiveviewStreamThread()' running it it's own thread and then in a tight loop. Maybe we need some 'stop()' or 'de-init()' call for it?
$ python2 src/example/sony_camera_liveview.py
('Supported liveview size:', {'result': ['M'], 'id': 1})
[i] LiveviewStreamThread started.
* Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)
127.0.0.1 - - [03/Nov/2017 16:15:25] "GET / HTTP/1.1" 200 -
127.0.0.1 - - [03/Nov/2017 16:15:25] "GET /video_feed HTTP/1.1" 200 -
^C----------------------------------------
Exception happened during processing of request from ('127.0.0.1', 55232)
Traceback (most recent call last):
File "/usr/lib/python2.7/SocketServer.py", line 290, in _handle_request_noblock
self.process_request(request, client_address)
File "/usr/lib/python2.7/SocketServer.py", line 318, in process_request
self.finish_request(request, client_address)
File "/usr/lib/python2.7/SocketServer.py", line 331, in finish_request
self.RequestHandlerClass(request, client_address, self)
File "/usr/lib/python2.7/SocketServer.py", line 652, in __init__
self.handle()
File "/usr/lib/python2.7/dist-packages/werkzeug/serving.py", line 203, in handle
rv = BaseHTTPRequestHandler.handle(self)
File "/usr/lib/python2.7/BaseHTTPServer.py", line 340, in handle
self.handle_one_request()
File "/usr/lib/python2.7/dist-packages/werkzeug/serving.py", line 238, in handle_one_request
return self.run_wsgi()
File "/usr/lib/python2.7/dist-packages/werkzeug/serving.py", line 180, in run_wsgi
execute(self.server.app)
File "/usr/lib/python2.7/dist-packages/werkzeug/serving.py", line 170, in execute
for data in application_iter:
File "/usr/lib/python2.7/dist-packages/werkzeug/wsgi.py", line 693, in __next__
return self._next()
File "/usr/lib/python2.7/dist-packages/werkzeug/wrappers.py", line 81, in _iter_encoded
for item in iterable:
File "src/example/sony_camera_liveview.py", line 35, in gen
frame = flask_app.get_frame_handle()
File "build/bdist.linux-x86_64/egg/pysony.py", line 354, in get_latest_view
data_img = self._lilo_jpeg_pool.get()
File "/usr/lib/python2.7/Queue.py", line 168, in get
self.not_empty.wait()
File "/usr/lib/python2.7/threading.py", line 340, in wait
waiter.acquire()
KeyboardInterrupt
----------------------------------------
^C^C^C^C^Z
[1]+ Stopped python2 src/example/sony_camera_liveview.py
$ killall -9 python2
I think it because sleep and while. I think I know how to fix it. thanks for reporting