Source code for platypush.message.event.camera
import logging
from platypush.message.event import Event
[docs]
class CameraEvent(Event):
"""Base class for camera events"""
[docs]
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
[docs]
class CameraRecordingStartedEvent(CameraEvent):
"""
Event triggered when a new recording starts
"""
[docs]
def __init__(self, device, filename=None, *args, **kwargs):
super().__init__(*args, device=device, filename=filename, **kwargs)
[docs]
class CameraRecordingStoppedEvent(CameraEvent):
"""
Event triggered when a recording stops
"""
[docs]
def __init__(self, device, *args, **kwargs):
super().__init__(*args, device=device, **kwargs)
[docs]
class CameraVideoRenderedEvent(CameraEvent):
"""
Event triggered when a sequence of frames has been rendered into a video
"""
[docs]
def __init__(self, filename=None, *args, **kwargs):
super().__init__(*args, filename=filename, **kwargs)
[docs]
class CameraPictureTakenEvent(CameraEvent):
"""
Event triggered when a snapshot has been taken
"""
[docs]
def __init__(self, filename=None, *args, **kwargs):
super().__init__(*args, filename=filename, **kwargs)
[docs]
class CameraFrameCapturedEvent(CameraEvent):
"""
Event triggered when a camera frame has been captured
"""
[docs]
def __init__(self, filename=None, *args, **kwargs):
super().__init__(
*args,
filename=filename,
logging_level=kwargs.pop('logging_level', logging.DEBUG),
**kwargs
)
# vim:sw=4:ts=4:et: