diff --git a/pyhap/camera.py b/pyhap/camera.py index 155aad92..d02cff71 100644 --- a/pyhap/camera.py +++ b/pyhap/camera.py @@ -223,6 +223,8 @@ ) '''Template for the ffmpeg command.''' +logger = logging.getLogger(__name__) + class Camera(Accessory): """An Accessory that can negotiated camera stream settings with iOS and start a @@ -310,7 +312,7 @@ def get_supported_audio_stream_config(audio_params): codec = AUDIO_CODEC_TYPES['AACELD'] bitrate = AUDIO_CODEC_PARAM_BIT_RATE_TYPES['VARIABLE'] else: - logging.warning('Unsupported codec %s', param_type) + logger.warning('Unsupported codec %s', param_type) continue param_samplerate = codec_param['samplerate'] @@ -321,7 +323,7 @@ def get_supported_audio_stream_config(audio_params): elif param_samplerate == 24: samplerate = AUDIO_CODEC_PARAM_SAMPLE_RATE_TYPES['KHZ_24'] else: - logging.warning('Unsupported sample rate %s', param_samplerate) + logger.warning('Unsupported sample rate %s', param_samplerate) continue param_tlv = tlv.encode(AUDIO_CODEC_PARAM_TYPES['CHANNEL'], b'\x01', @@ -332,7 +334,7 @@ def get_supported_audio_stream_config(audio_params): configs += tlv.encode(SUPPORTED_AUDIO_CODECS_TAG, config_tlv) if not has_supported_codec: - logging.warning('Client does not support any audio codec that iOS supports.') + logger.warning('Client does not support any audio codec that iOS supports.') codec = AUDIO_CODEC_TYPES['OPUS'] bitrate = AUDIO_CODEC_PARAM_BIT_RATE_TYPES['VARIABLE'] @@ -483,20 +485,25 @@ async def _start_stream(self, objs, reconfigure): # pylint: disable=unused-argu video_rtp_param = video_objs.get(VIDEO_TYPES['RTP_PARAM']) if video_rtp_param: video_rtp_param_objs = tlv.decode(video_rtp_param) - # TODO: Optionals, handle the case where they are missing - opts['v_ssrc'] = struct.unpack('