diff --git a/teraserver/easyrtc/static/js/tera_processing.js b/teraserver/easyrtc/static/js/tera_processing.js index f4e67cca..4de157ac 100644 --- a/teraserver/easyrtc/static/js/tera_processing.js +++ b/teraserver/easyrtc/static/js/tera_processing.js @@ -1,9 +1,9 @@ let unblurredTrack = undefined; // Blur local video. Only first local stream is supported for now. -function blur(enable = true) { +function blur(enable = true, refresh_stream = false) { if ( (enable && unblurredTrack !== undefined) || (!enable && unblurredTrack === undefined)) { - console.error("Blur: Can't unblur or blur a stream that's already blurred or unblurred.") + //console.error("Blur: Can't unblur or blur a stream that's already blurred or unblurred.") return; } @@ -54,7 +54,7 @@ function blur(enable = true) { // Only overwrite missing pixels. ctx.globalCompositeOperation = "destination-atop"; - ctx.filter = `blur(16px)`; + ctx.filter = `blur(10px)`; ctx.drawImage( results.image, 0, @@ -89,5 +89,6 @@ function blur(enable = true) { processedStream.removeTrack(unblurredTrack); processedStream.addTrack(trackGenerator); } - localVideoStreamSuccess(localStreams[0].stream); + if (refresh_stream) + localVideoStreamSuccess(localStreams[0].stream); } diff --git a/teraserver/easyrtc/static/js/tera_shared_object.js b/teraserver/easyrtc/static/js/tera_shared_object.js index 219f3786..9660c505 100644 --- a/teraserver/easyrtc/static/js/tera_shared_object.js +++ b/teraserver/easyrtc/static/js/tera_shared_object.js @@ -47,6 +47,8 @@ function setupSharedObjectCallbacks(channel){ channel.objects.SharedObject.newDataForward.connect(forwardData); channel.objects.SharedObject.newSecondSources.connect(selectSecondarySources); channel.objects.SharedObject.setLocalMirrorSignal.connect(setLocalMirror); + if (channel.objects.SharedObject.setLocalBlurSignal !== undefined) + channel.objects.SharedObject.setLocalBlurSignal.connect(setLocalBlur); if (channel.objects.SharedObject.videoSourceRemoved !== undefined) channel.objects.SharedObject.videoSourceRemoved.connect(removeVideoSource); @@ -65,6 +67,7 @@ function setupSharedObjectCallbacks(channel){ selectAudioSource(settings.audio); selectVideoSource(settings.video); setLocalMirror(settings.mirror); + setLocalBlur(settings.blur); selectSecondarySources(settings.secondAudioVideo); ptz = JSON.parse(settings.ptz); setPTZCapabilities(localContact.uuid, ptz.zoom, ptz.presets, ptz.settings, ptz.camera); @@ -94,6 +97,11 @@ function setLocalMirror(mirror){ setMirror(mirror, true, 1); } +function setLocalBlur(blur_value){ + console.log("setLocalBlur = " + blur_value); + currentConfig["video1Blur"] = blur_value; +} + function startRecordingRequest(){ if (!streamRecorder) streamRecorder = new TeraVideoRecorder(); diff --git a/teraserver/easyrtc/static/js/tera_webrtc.js b/teraserver/easyrtc/static/js/tera_webrtc.js index 743b0b38..1519c423 100644 --- a/teraserver/easyrtc/static/js/tera_webrtc.js +++ b/teraserver/easyrtc/static/js/tera_webrtc.js @@ -437,7 +437,6 @@ function localVideoStreamSuccess(stream){ }); } } - } easyrtc.setVideoObjectSrc(getVideoWidget(true, local_index+1)[0], stream); @@ -445,6 +444,10 @@ function localVideoStreamSuccess(stream){ easyrtc.enableMicrophone(!localContact.status.microMuted) updateStatusIconState(!localContact.status.microMuted, true, local_index+1, 'Mic'); updateStatusIconState(true, true, local_index+1, 'Video'); + if (local_index === 0){ + unblurredTrack = undefined; + blur(currentConfig.video1Blur, false); + } }else{ console.log("Got local stream - waiting for it to become active..."); diff --git a/teraserver/python/opentera/forms/TeraServiceConfigForm.py b/teraserver/python/opentera/forms/TeraServiceConfigForm.py index c0bec298..b0656964 100644 --- a/teraserver/python/opentera/forms/TeraServiceConfigForm.py +++ b/teraserver/python/opentera/forms/TeraServiceConfigForm.py @@ -50,6 +50,7 @@ def get_service_config_config_form(service_key: str): # Items section1.add_item(TeraFormItem("camera", gettext("Camera"), "videoinputs", False)) section1.add_item(TeraFormItem("mirror", gettext("Mirrored image"), "boolean", False, item_default=True)) + section1.add_item(TeraFormItem("blur", gettext("Blurred background"), "boolean", False, item_default=False)) item = TeraFormItem("teracam_src", gettext("URL"), "text", True, item_condition=TeraFormItemCondition("camera", "=", "OpenTeraCam")) diff --git a/teraserver/python/services/FileTransferService/translations/en/LC_MESSAGES/filetransferservice.po b/teraserver/python/services/FileTransferService/translations/en/LC_MESSAGES/filetransferservice.po index fab8143f..663826ff 100644 --- a/teraserver/python/services/FileTransferService/translations/en/LC_MESSAGES/filetransferservice.po +++ b/teraserver/python/services/FileTransferService/translations/en/LC_MESSAGES/filetransferservice.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PROJECT VERSION\n" "Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" -"POT-Creation-Date: 2024-10-07 15:05-0400\n" +"POT-Creation-Date: 2024-10-16 10:12-0400\n" "PO-Revision-Date: 2021-01-19 16:16-0500\n" "Last-Translator: FULL NAME \n" "Language: en\n" diff --git a/teraserver/python/services/FileTransferService/translations/fr/LC_MESSAGES/filetransferservice.po b/teraserver/python/services/FileTransferService/translations/fr/LC_MESSAGES/filetransferservice.po index 8cd9c6fe..38bc58cf 100644 --- a/teraserver/python/services/FileTransferService/translations/fr/LC_MESSAGES/filetransferservice.po +++ b/teraserver/python/services/FileTransferService/translations/fr/LC_MESSAGES/filetransferservice.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PROJECT VERSION\n" "Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" -"POT-Creation-Date: 2024-10-07 15:05-0400\n" +"POT-Creation-Date: 2024-10-16 10:12-0400\n" "PO-Revision-Date: 2023-02-28 08:22-0500\n" "Last-Translator: \n" "Language: fr\n" diff --git a/teraserver/python/services/LoggingService/translations/en/LC_MESSAGES/loggingservice.po b/teraserver/python/services/LoggingService/translations/en/LC_MESSAGES/loggingservice.po index 86c7e823..f74193ab 100644 --- a/teraserver/python/services/LoggingService/translations/en/LC_MESSAGES/loggingservice.po +++ b/teraserver/python/services/LoggingService/translations/en/LC_MESSAGES/loggingservice.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PROJECT VERSION\n" "Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" -"POT-Creation-Date: 2024-10-07 15:05-0400\n" +"POT-Creation-Date: 2024-10-16 10:12-0400\n" "PO-Revision-Date: 2023-01-26 13:29-0500\n" "Last-Translator: FULL NAME \n" "Language: en\n" diff --git a/teraserver/python/services/LoggingService/translations/fr/LC_MESSAGES/loggingservice.po b/teraserver/python/services/LoggingService/translations/fr/LC_MESSAGES/loggingservice.po index 38987866..c3c0d432 100644 --- a/teraserver/python/services/LoggingService/translations/fr/LC_MESSAGES/loggingservice.po +++ b/teraserver/python/services/LoggingService/translations/fr/LC_MESSAGES/loggingservice.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PROJECT VERSION\n" "Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" -"POT-Creation-Date: 2024-10-07 15:05-0400\n" +"POT-Creation-Date: 2024-10-16 10:12-0400\n" "PO-Revision-Date: 2023-02-28 08:10-0500\n" "Last-Translator: \n" "Language: fr\n" diff --git a/teraserver/python/services/VideoRehabService/translations/en/LC_MESSAGES/videorehabservice.po b/teraserver/python/services/VideoRehabService/translations/en/LC_MESSAGES/videorehabservice.po index 3374100e..1fb171c2 100644 --- a/teraserver/python/services/VideoRehabService/translations/en/LC_MESSAGES/videorehabservice.po +++ b/teraserver/python/services/VideoRehabService/translations/en/LC_MESSAGES/videorehabservice.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PROJECT VERSION\n" "Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" -"POT-Creation-Date: 2024-10-07 15:05-0400\n" +"POT-Creation-Date: 2024-10-16 10:11-0400\n" "PO-Revision-Date: 2021-01-19 16:16-0500\n" "Last-Translator: FULL NAME \n" "Language: en\n" diff --git a/teraserver/python/services/VideoRehabService/translations/fr/LC_MESSAGES/videorehabservice.po b/teraserver/python/services/VideoRehabService/translations/fr/LC_MESSAGES/videorehabservice.po index 2c75d6a8..ad17fe12 100644 --- a/teraserver/python/services/VideoRehabService/translations/fr/LC_MESSAGES/videorehabservice.po +++ b/teraserver/python/services/VideoRehabService/translations/fr/LC_MESSAGES/videorehabservice.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PROJECT VERSION\n" "Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" -"POT-Creation-Date: 2024-10-07 15:05-0400\n" +"POT-Creation-Date: 2024-10-16 10:11-0400\n" "PO-Revision-Date: 2023-05-23 14:29-0400\n" "Last-Translator: \n" "Language: fr\n" diff --git a/teraserver/python/translations/en/LC_MESSAGES/messages.po b/teraserver/python/translations/en/LC_MESSAGES/messages.po index 685782d6..16a64de3 100644 --- a/teraserver/python/translations/en/LC_MESSAGES/messages.po +++ b/teraserver/python/translations/en/LC_MESSAGES/messages.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PROJECT VERSION\n" "Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" -"POT-Creation-Date: 2024-10-07 15:05-0400\n" +"POT-Creation-Date: 2024-10-16 10:11-0400\n" "PO-Revision-Date: 2021-01-25 13:01-0500\n" "Last-Translator: \n" "Language: en\n" @@ -2147,45 +2147,49 @@ msgstr "" msgid "Mirrored image" msgstr "" -#: opentera/forms/TeraServiceConfigForm.py:54 +#: opentera/forms/TeraServiceConfigForm.py:53 +msgid "Blurred background" +msgstr "" + +#: opentera/forms/TeraServiceConfigForm.py:55 msgid "URL" msgstr "" -#: opentera/forms/TeraServiceConfigForm.py:58 +#: opentera/forms/TeraServiceConfigForm.py:59 msgid "Pan-Tilt-Zoom Camera" msgstr "" -#: opentera/forms/TeraServiceConfigForm.py:59 +#: opentera/forms/TeraServiceConfigForm.py:60 msgid "Control Type" msgstr "" -#: opentera/forms/TeraServiceConfigForm.py:60 +#: opentera/forms/TeraServiceConfigForm.py:61 msgid "Vivotek" msgstr "" -#: opentera/forms/TeraServiceConfigForm.py:65 +#: opentera/forms/TeraServiceConfigForm.py:66 msgid "Network Address" msgstr "" -#: opentera/forms/TeraServiceConfigForm.py:68 +#: opentera/forms/TeraServiceConfigForm.py:69 msgid "Port" msgstr "" -#: opentera/forms/TeraServiceConfigForm.py:71 opentera/forms/TeraUserForm.py:21 +#: opentera/forms/TeraServiceConfigForm.py:72 opentera/forms/TeraUserForm.py:21 #: templates/login.html:125 msgid "Username" msgstr "" -#: opentera/forms/TeraServiceConfigForm.py:74 opentera/forms/TeraUserForm.py:44 +#: opentera/forms/TeraServiceConfigForm.py:75 opentera/forms/TeraUserForm.py:44 #: templates/login.html:131 msgid "Password" msgstr "" -#: opentera/forms/TeraServiceConfigForm.py:78 +#: opentera/forms/TeraServiceConfigForm.py:79 msgid "Microphone" msgstr "" -#: opentera/forms/TeraServiceConfigForm.py:79 +#: opentera/forms/TeraServiceConfigForm.py:80 msgid "Secondary Camera" msgstr "" diff --git a/teraserver/python/translations/fr/LC_MESSAGES/messages.po b/teraserver/python/translations/fr/LC_MESSAGES/messages.po index 399ede57..727da310 100644 --- a/teraserver/python/translations/fr/LC_MESSAGES/messages.po +++ b/teraserver/python/translations/fr/LC_MESSAGES/messages.po @@ -7,8 +7,8 @@ msgid "" msgstr "" "Project-Id-Version: PROJECT VERSION\n" "Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" -"POT-Creation-Date: 2024-10-07 15:05-0400\n" -"PO-Revision-Date: 2024-10-07 15:10-0400\n" +"POT-Creation-Date: 2024-10-16 10:11-0400\n" +"PO-Revision-Date: 2024-10-16 10:11-0400\n" "Last-Translator: \n" "Language-Team: fr \n" "Language: fr\n" @@ -2235,45 +2235,49 @@ msgstr "Caméra" msgid "Mirrored image" msgstr "Image miroir" -#: opentera/forms/TeraServiceConfigForm.py:54 +#: opentera/forms/TeraServiceConfigForm.py:53 +msgid "Blurred background" +msgstr "Flouter l'arrière-plan" + +#: opentera/forms/TeraServiceConfigForm.py:55 msgid "URL" msgstr "Adresse web" -#: opentera/forms/TeraServiceConfigForm.py:58 +#: opentera/forms/TeraServiceConfigForm.py:59 msgid "Pan-Tilt-Zoom Camera" msgstr "Caméra Pan-Tilt-Zoom" -#: opentera/forms/TeraServiceConfigForm.py:59 +#: opentera/forms/TeraServiceConfigForm.py:60 msgid "Control Type" msgstr "Type de Contrôle" -#: opentera/forms/TeraServiceConfigForm.py:60 +#: opentera/forms/TeraServiceConfigForm.py:61 msgid "Vivotek" msgstr "Vivotek" -#: opentera/forms/TeraServiceConfigForm.py:65 +#: opentera/forms/TeraServiceConfigForm.py:66 msgid "Network Address" msgstr "Adresse Réseau" -#: opentera/forms/TeraServiceConfigForm.py:68 +#: opentera/forms/TeraServiceConfigForm.py:69 msgid "Port" msgstr "Port" -#: opentera/forms/TeraServiceConfigForm.py:71 opentera/forms/TeraUserForm.py:21 +#: opentera/forms/TeraServiceConfigForm.py:72 opentera/forms/TeraUserForm.py:21 #: templates/login.html:125 msgid "Username" msgstr "Code utilisateur" -#: opentera/forms/TeraServiceConfigForm.py:74 opentera/forms/TeraUserForm.py:44 +#: opentera/forms/TeraServiceConfigForm.py:75 opentera/forms/TeraUserForm.py:44 #: templates/login.html:131 msgid "Password" msgstr "Mot de passe" -#: opentera/forms/TeraServiceConfigForm.py:78 +#: opentera/forms/TeraServiceConfigForm.py:79 msgid "Microphone" msgstr "Microphone" -#: opentera/forms/TeraServiceConfigForm.py:79 +#: opentera/forms/TeraServiceConfigForm.py:80 msgid "Secondary Camera" msgstr "Caméra Secondaire"