Add camera off and auto stuff to Zoom Room

This commit is contained in:
Andrew Welker
2020-09-30 15:47:32 -06:00
parent e365944dc3
commit e784c08f80
4 changed files with 98 additions and 14 deletions

View File

@@ -62,6 +62,8 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
public bool ShowSelfViewByDefault { get; protected set; } public bool ShowSelfViewByDefault { get; protected set; }
protected bool SupportsCameraOff;
protected bool SupportsCameraAutoMode;
public bool IsReady { get; protected set; } public bool IsReady { get; protected set; }
@@ -305,10 +307,16 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
if (codec is IHasCameraAutoMode) if (codec is IHasCameraAutoMode)
{ {
trilist.SetBool(joinMap.CameraSupportsAutoMode.JoinNumber, true); trilist.SetBool(joinMap.CameraSupportsAutoMode.JoinNumber, SupportsCameraAutoMode);
LinkVideoCodecCameraModeToApi(codec as IHasCameraAutoMode, trilist, joinMap); LinkVideoCodecCameraModeToApi(codec as IHasCameraAutoMode, trilist, joinMap);
} }
if (codec is IHasCameraOff)
{
trilist.SetBool(joinMap.CameraSupportsOffMode.JoinNumber, SupportsCameraOff);
LinkVideoCodecCameraOffToApi(codec as IHasCameraOff, trilist, joinMap);
}
if (codec is IHasCodecLayouts) if (codec is IHasCodecLayouts)
{ {
LinkVideoCodecCameraLayoutsToApi(codec as IHasCodecLayouts, trilist, joinMap); LinkVideoCodecCameraLayoutsToApi(codec as IHasCodecLayouts, trilist, joinMap);
@@ -366,6 +374,13 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
}; };
} }
private void LinkVideoCodecCameraOffToApi(IHasCameraOff codec, BasicTriList trilist, VideoCodecControllerJoinMap joinMap)
{
codec.CameraIsOffFeedback.LinkInputSig(trilist.BooleanInput[joinMap.CameraModeOff.JoinNumber]);
trilist.SetSigFalseAction(joinMap.CameraModeOff.JoinNumber, codec.CameraOff);
}
private void LinkVideoCodecVolumeToApi(BasicTriList trilist, VideoCodecControllerJoinMap joinMap) private void LinkVideoCodecVolumeToApi(BasicTriList trilist, VideoCodecControllerJoinMap joinMap)
{ {
MuteFeedback.LinkInputSig(trilist.BooleanInput[joinMap.VolumeMuteOn.JoinNumber]); MuteFeedback.LinkInputSig(trilist.BooleanInput[joinMap.VolumeMuteOn.JoinNumber]);
@@ -767,6 +782,8 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
trilist.BooleanInput[joinMap.CameraModeManual.JoinNumber]); trilist.BooleanInput[joinMap.CameraModeManual.JoinNumber]);
} }
private void LinkVideoCodecSelfviewToApi(IHasCodecSelfView codec, BasicTriList trilist, private void LinkVideoCodecSelfviewToApi(IHasCodecSelfView codec, BasicTriList trilist,
VideoCodecControllerJoinMap joinMap) VideoCodecControllerJoinMap joinMap)
{ {

View File

@@ -86,6 +86,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
public zConfiguration.Audio Audio { get; set; } public zConfiguration.Audio Audio { get; set; }
public zConfiguration.Video Video { get; set; } public zConfiguration.Video Video { get; set; }
public zConfiguration.Client Client { get; set; } public zConfiguration.Client Client { get; set; }
public zConfiguration.Camera Camera { get; set; }
public ZoomRoomConfiguration() public ZoomRoomConfiguration()
{ {
@@ -93,6 +94,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
Audio = new zConfiguration.Audio(); Audio = new zConfiguration.Audio();
Video = new zConfiguration.Video(); Video = new zConfiguration.Video();
Client = new zConfiguration.Client(); Client = new zConfiguration.Client();
Camera = new zConfiguration.Camera();
} }
} }
@@ -698,9 +700,25 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
public bool OptimizeVideoSharing { get; set; } public bool OptimizeVideoSharing { get; set; }
} }
public class Camera public class Camera : NotifiableObject
{ {
public bool Mute { get; set; } private bool _mute;
public bool Mute
{
get
{
return _mute;
}
set
{
if (value != _mute)
{
_mute = value;
NotifyPropertyChanged("Mute");
}
}
}
} }
public class Microphone : NotifiableObject public class Microphone : NotifiableObject

View File

@@ -20,7 +20,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
{ {
public class ZoomRoom : VideoCodecBase, IHasCodecSelfView, IHasDirectoryHistoryStack, ICommunicationMonitor, public class ZoomRoom : VideoCodecBase, IHasCodecSelfView, IHasDirectoryHistoryStack, ICommunicationMonitor,
IRouting, IRouting,
IHasScheduleAwareness, IHasCodecCameras, IHasParticipants IHasScheduleAwareness, IHasCodecCameras, IHasParticipants, IHasCameraOff, IHasCameraAutoMode
{ {
private const long MeetingRefreshTimer = 60000; private const long MeetingRefreshTimer = 60000;
private const uint DefaultMeetingDurationMin = 30; private const uint DefaultMeetingDurationMin = 30;
@@ -92,6 +92,8 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
SelfviewIsOnFeedback = new BoolFeedback(SelfViewIsOnFeedbackFunc); SelfviewIsOnFeedback = new BoolFeedback(SelfViewIsOnFeedbackFunc);
CameraIsOffFeedback = new BoolFeedback(CameraIsOffFeedbackFunc);
CodecSchedule = new CodecScheduleAwareness(MeetingRefreshTimer); CodecSchedule = new CodecScheduleAwareness(MeetingRefreshTimer);
SetUpFeedbackActions(); SetUpFeedbackActions();
@@ -101,6 +103,9 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
SetUpDirectory(); SetUpDirectory();
Participants = new CodecParticipants(); Participants = new CodecParticipants();
SupportsCameraOff = _props.SupportsCameraOff;
SupportsCameraAutoMode = _props.SupportsCameraAutoMode;
} }
public CommunicationGather PortGather { get; private set; } public CommunicationGather PortGather { get; private set; }
@@ -174,6 +179,12 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
get { return () => !Configuration.Video.HideConfSelfVideo; } get { return () => !Configuration.Video.HideConfSelfVideo; }
} }
protected Func<bool> CameraIsOffFeedbackFunc
{
get { return () => !Configuration.Camera.Mute; }
}
protected Func<string> SelfviewPipPositionFeedbackFunc protected Func<string> SelfviewPipPositionFeedbackFunc
{ {
get { return () => ""; } get { return () => ""; }
@@ -415,6 +426,13 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
} }
}; };
Configuration.Camera.PropertyChanged += (o, a) =>
{
if (a.PropertyName != "Mute") return;
CameraIsOffFeedback.FireUpdate();
};
Status.Call.Sharing.PropertyChanged += (o, a) => Status.Call.Sharing.PropertyChanged += (o, a) =>
{ {
if (a.PropertyName == "State") if (a.PropertyName == "State")
@@ -961,13 +979,9 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
break; break;
} }
case "bookings": case "bookings updated":
{
// Bookings have been updated, trigger a query to retreive the new bookings
if (responseObj["Updated"] != null)
{ {
GetBookings(); GetBookings();
}
break; break;
} }
@@ -1560,6 +1574,39 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
public CodecParticipants Participants { get; private set; } public CodecParticipants Participants { get; private set; }
#endregion #endregion
#region Implementation of IHasCameraOff
public BoolFeedback CameraIsOffFeedback { get; private set; }
public void CameraOff()
{
SendText("zCommand Call Camera Mute: On");
}
#endregion
#region Implementation of IHasCameraAutoMode
//Zoom doesn't support camera auto modes. Setting this to just unmute video
public void CameraAutoModeOn()
{
throw new NotImplementedException("Zoom Room Doesn't support camera auto mode");
}
//Zoom doesn't support camera auto modes. Setting this to just unmute video
public void CameraAutoModeOff()
{
SendText("zCommand Call Camera Mute: Off");
}
public void CameraAutoModeToggle()
{
throw new NotImplementedException("Zoom Room doesn't support camera auto mode");
}
public BoolFeedback CameraAutoModeIsOnFeedback { get; private set; }
#endregion
} }
/// <summary> /// <summary>

View File

@@ -14,5 +14,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
public CommunicationMonitorConfig CommunicationMonitorProperties { get; set; } public CommunicationMonitorConfig CommunicationMonitorProperties { get; set; }
public bool DisablePhonebookAutoDownload { get; set; } public bool DisablePhonebookAutoDownload { get; set; }
public bool SupportsCameraAutoMode { get; set; }
public bool SupportsCameraOff { get; set; }
} }
} }