mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-02-14 20:24:57 +00:00
fix: ignore CameraBase routing port list
The `RoutingPortCollection` type appears to not be currently serializable. If a class that contains this collection is going to be serialized, the collection should have the `JsonIgnore` attribute added. If the list is needed, use a conversion object and convert it to a regular list.
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
using System;
|
using Newtonsoft.Json;
|
||||||
|
using System;
|
||||||
|
|
||||||
|
|
||||||
namespace PepperDash.Essentials.Core
|
namespace PepperDash.Essentials.Core
|
||||||
@@ -8,10 +9,11 @@ namespace PepperDash.Essentials.Core
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public class RoutingInputPort : RoutingPort
|
public class RoutingInputPort : RoutingPort
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The IRoutingInputs object this lives on
|
/// The IRoutingInputs object this lives on
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public IRoutingInputs ParentDevice { get; private set; }
|
[JsonIgnore]
|
||||||
|
public IRoutingInputs ParentDevice { get; private set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Constructor for a basic RoutingInputPort
|
/// Constructor for a basic RoutingInputPort
|
||||||
|
|||||||
@@ -1,14 +1,17 @@
|
|||||||
using System;
|
using Newtonsoft.Json;
|
||||||
|
using System;
|
||||||
|
|
||||||
|
|
||||||
namespace PepperDash.Essentials.Core
|
namespace PepperDash.Essentials.Core
|
||||||
{
|
{
|
||||||
public class RoutingOutputPort : RoutingPort
|
public class RoutingOutputPort : RoutingPort
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The IRoutingOutputs object this port lives on
|
/// The IRoutingOutputs object this port lives on
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public IRoutingOutputs ParentDevice { get; private set; }
|
///
|
||||||
|
[JsonIgnore]
|
||||||
|
public IRoutingOutputs ParentDevice { get; private set; }
|
||||||
|
|
||||||
public InUseTracking InUseTracker { get; private set; }
|
public InUseTracking InUseTracker { get; private set; }
|
||||||
|
|
||||||
|
|||||||
@@ -2,9 +2,6 @@
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
|
||||||
using PepperDash.Core;
|
|
||||||
|
|
||||||
|
|
||||||
namespace PepperDash.Essentials.Core
|
namespace PepperDash.Essentials.Core
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@@ -37,6 +37,7 @@ namespace PepperDash.Essentials.Devices.Common.Cameras
|
|||||||
|
|
||||||
#region IRoutingOutputs Members
|
#region IRoutingOutputs Members
|
||||||
|
|
||||||
|
[JsonIgnore]
|
||||||
public RoutingPortCollection<RoutingOutputPort> OutputPorts { get; protected set; }
|
public RoutingPortCollection<RoutingOutputPort> OutputPorts { get; protected set; }
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using Newtonsoft.Json.Linq;
|
using Newtonsoft.Json.Linq;
|
||||||
using PepperDash.Core;
|
using PepperDash.Core;
|
||||||
|
using PepperDash.Core.Logging;
|
||||||
using PepperDash.Essentials.Core;
|
using PepperDash.Essentials.Core;
|
||||||
using PepperDash.Essentials.Core.DeviceTypeInterfaces;
|
using PepperDash.Essentials.Core.DeviceTypeInterfaces;
|
||||||
using System;
|
using System;
|
||||||
@@ -152,11 +153,13 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
|||||||
|
|
||||||
message.Name = _device.Name;
|
message.Name = _device.Name;
|
||||||
|
|
||||||
PostStatusMessage(JToken.FromObject(message), MessagePath, clientId);
|
var token = JToken.FromObject(message);
|
||||||
|
|
||||||
|
PostStatusMessage(token, MessagePath, clientId);
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
Debug.LogMessage(ex, "Exception posting status message", this);
|
this.LogError(ex, "Exception posting status message for {messagePath} to {clientId}", MessagePath, clientId ?? "all clients");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -173,11 +176,13 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
|||||||
|
|
||||||
deviceState.MessageBasePath = MessagePath;
|
deviceState.MessageBasePath = MessagePath;
|
||||||
|
|
||||||
PostStatusMessage(JToken.FromObject(deviceState), type, clientId);
|
var token = JToken.FromObject(deviceState);
|
||||||
|
|
||||||
|
PostStatusMessage(token, type, clientId);
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
Debug.LogMessage(ex, "Exception posting status message", this);
|
this.LogError(ex, "Exception posting status message for {type} to {clientId}", type, clientId ?? "all clients");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -12,7 +12,6 @@ using PepperDash.Essentials.Devices.Common.VideoCodec.Interfaces;
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using static PepperDash.Essentials.AppServer.Messengers.VideoCodecBaseStateMessage.CameraStatus;
|
|
||||||
|
|
||||||
namespace PepperDash.Essentials.AppServer.Messengers
|
namespace PepperDash.Essentials.AppServer.Messengers
|
||||||
{
|
{
|
||||||
@@ -78,16 +77,23 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
|||||||
/// <param name="e"></param>
|
/// <param name="e"></param>
|
||||||
private void CallHistory_RecentCallsListHasChanged(object sender, EventArgs e)
|
private void CallHistory_RecentCallsListHasChanged(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
var state = new VideoCodecBaseStateMessage();
|
try
|
||||||
|
|
||||||
if (!(sender is CodecCallHistory codecCallHistory)) return;
|
|
||||||
var recents = codecCallHistory.RecentCalls;
|
|
||||||
|
|
||||||
if (recents != null)
|
|
||||||
{
|
{
|
||||||
state.RecentCalls = recents;
|
var state = new VideoCodecBaseStateMessage();
|
||||||
|
|
||||||
PostStatusMessage(state);
|
if (!(sender is CodecCallHistory codecCallHistory)) return;
|
||||||
|
var recents = codecCallHistory.RecentCalls;
|
||||||
|
|
||||||
|
if (recents != null)
|
||||||
|
{
|
||||||
|
state.RecentCalls = recents;
|
||||||
|
|
||||||
|
PostStatusMessage(state);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
this.LogError(ex, "Error posting call history");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -107,28 +113,24 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
protected void SendDirectory(CodecDirectory directory)
|
protected void SendDirectory(CodecDirectory directory)
|
||||||
{
|
{
|
||||||
var state = new VideoCodecBaseStateMessage();
|
try
|
||||||
|
|
||||||
|
|
||||||
if (Codec is IHasDirectory dirCodec)
|
|
||||||
{
|
{
|
||||||
this.LogVerbose("Sending Directory. Directory Item Count: {directoryItemCount}", directory.CurrentDirectoryResults.Count);
|
var state = new VideoCodecBaseStateMessage();
|
||||||
|
|
||||||
//state.CurrentDirectory = PrefixDirectoryFolderItems(directory);
|
|
||||||
state.CurrentDirectory = directory;
|
|
||||||
CrestronInvoke.BeginInvoke((o) => PostStatusMessage(state));
|
|
||||||
|
|
||||||
/* var directoryMessage = new
|
if (Codec is IHasDirectory dirCodec)
|
||||||
{
|
{
|
||||||
currentDirectory = new
|
this.LogVerbose("Sending Directory. Directory Item Count: {directoryItemCount}", directory.CurrentDirectoryResults.Count);
|
||||||
{
|
|
||||||
directoryResults = prefixedDirectoryResults,
|
|
||||||
isRootDirectory = isRoot
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
//Spool up a thread in case this is a large quantity of data
|
//state.CurrentDirectory = PrefixDirectoryFolderItems(directory);
|
||||||
CrestronInvoke.BeginInvoke((o) => PostStatusMessage(directoryMessage)); */
|
state.CurrentDirectory = directory;
|
||||||
|
|
||||||
|
CrestronInvoke.BeginInvoke((o) => PostStatusMessage(state));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
this.LogError(ex, "Error sending directory");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -139,14 +141,20 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
|||||||
/// <param name="e"></param>
|
/// <param name="e"></param>
|
||||||
private void Codec_IsReadyChange(object sender, EventArgs e)
|
private void Codec_IsReadyChange(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
var state = new VideoCodecBaseStateMessage
|
try
|
||||||
{
|
{
|
||||||
IsReady = true
|
var state = new VideoCodecBaseStateMessage
|
||||||
};
|
{
|
||||||
|
IsReady = true
|
||||||
|
};
|
||||||
|
|
||||||
PostStatusMessage(state);
|
PostStatusMessage(state);
|
||||||
|
|
||||||
SendFullStatus();
|
SendFullStatus();
|
||||||
|
} catch (Exception ex)
|
||||||
|
{
|
||||||
|
this.LogError(ex, "Error sending codec ready status");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -353,32 +361,51 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
|||||||
|
|
||||||
private void SharingSourceFeedback_OutputChange(object sender, FeedbackEventArgs e)
|
private void SharingSourceFeedback_OutputChange(object sender, FeedbackEventArgs e)
|
||||||
{
|
{
|
||||||
var state = new VideoCodecBaseStateMessage
|
try
|
||||||
{
|
{
|
||||||
SharingSource = e.StringValue
|
var state = new VideoCodecBaseStateMessage
|
||||||
};
|
{
|
||||||
|
SharingSource = e.StringValue
|
||||||
|
};
|
||||||
|
|
||||||
PostStatusMessage(state);
|
PostStatusMessage(state);
|
||||||
|
} catch (Exception ex)
|
||||||
|
{
|
||||||
|
this.LogError(ex, "Error posting sharing source");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void SharingContentIsOnFeedback_OutputChange(object sender, FeedbackEventArgs e)
|
private void SharingContentIsOnFeedback_OutputChange(object sender, FeedbackEventArgs e)
|
||||||
{
|
{
|
||||||
var state = new VideoCodecBaseStateMessage
|
try
|
||||||
{
|
{
|
||||||
SharingContentIsOn = e.BoolValue
|
var state = new VideoCodecBaseStateMessage
|
||||||
};
|
{
|
||||||
|
SharingContentIsOn = e.BoolValue
|
||||||
|
};
|
||||||
|
|
||||||
PostStatusMessage(state);
|
PostStatusMessage(state);
|
||||||
|
} catch (Exception ex)
|
||||||
|
{
|
||||||
|
this.LogError(ex, "Error posting sharing content");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void PhonebookSyncState_InitialSyncCompleted(object sender, EventArgs e)
|
private void PhonebookSyncState_InitialSyncCompleted(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
var state = new VideoCodecBaseStateMessage
|
try
|
||||||
{
|
{
|
||||||
InitialPhonebookSyncComplete = true
|
var state = new VideoCodecBaseStateMessage
|
||||||
};
|
{
|
||||||
|
InitialPhonebookSyncComplete = true
|
||||||
|
};
|
||||||
|
|
||||||
PostStatusMessage(state);
|
PostStatusMessage(state);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
this.LogError(ex, "Error posting phonebook sync state");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void CameraIsOffFeedback_OutputChange(object sender, FeedbackEventArgs e)
|
private void CameraIsOffFeedback_OutputChange(object sender, FeedbackEventArgs e)
|
||||||
@@ -404,8 +431,14 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
|||||||
|
|
||||||
private void CameraCodec_CameraSelected(object sender, CameraSelectedEventArgs e)
|
private void CameraCodec_CameraSelected(object sender, CameraSelectedEventArgs e)
|
||||||
{
|
{
|
||||||
MapCameraActions();
|
try
|
||||||
PostSelectedCamera();
|
{
|
||||||
|
MapCameraActions();
|
||||||
|
PostSelectedCamera();
|
||||||
|
} catch(Exception ex)
|
||||||
|
{
|
||||||
|
this.LogError(ex, "Exception handling camera selected event");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -564,21 +597,28 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
|||||||
|
|
||||||
private void PostCallHistory()
|
private void PostCallHistory()
|
||||||
{
|
{
|
||||||
var codec = (Codec as IHasCallHistory);
|
try
|
||||||
|
|
||||||
if (codec != null)
|
|
||||||
{
|
{
|
||||||
var status = new VideoCodecBaseStateMessage();
|
var codec = (Codec as IHasCallHistory);
|
||||||
|
|
||||||
var recents = codec.CallHistory.RecentCalls;
|
if (codec != null)
|
||||||
|
|
||||||
if (recents != null)
|
|
||||||
{
|
{
|
||||||
status.RecentCalls = codec.CallHistory.RecentCalls;
|
var status = new VideoCodecBaseStateMessage();
|
||||||
|
|
||||||
PostStatusMessage(status);
|
var recents = codec.CallHistory.RecentCalls;
|
||||||
|
|
||||||
|
if (recents != null)
|
||||||
|
{
|
||||||
|
status.RecentCalls = codec.CallHistory.RecentCalls;
|
||||||
|
|
||||||
|
PostStatusMessage(status);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
this.LogError(ex, "Error posting call history");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -609,23 +649,30 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
private void GetDirectoryRoot()
|
private void GetDirectoryRoot()
|
||||||
{
|
{
|
||||||
if (!(Codec is IHasDirectory dirCodec))
|
try
|
||||||
{
|
{
|
||||||
// do something else?
|
if (!(Codec is IHasDirectory dirCodec))
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (!dirCodec.PhonebookSyncState.InitialSyncComplete)
|
|
||||||
{
|
|
||||||
var state = new VideoCodecBaseStateMessage
|
|
||||||
{
|
{
|
||||||
InitialPhonebookSyncComplete = false
|
// do something else?
|
||||||
};
|
return;
|
||||||
|
}
|
||||||
|
if (!dirCodec.PhonebookSyncState.InitialSyncComplete)
|
||||||
|
{
|
||||||
|
var state = new VideoCodecBaseStateMessage
|
||||||
|
{
|
||||||
|
InitialPhonebookSyncComplete = false
|
||||||
|
};
|
||||||
|
|
||||||
PostStatusMessage(state);
|
PostStatusMessage(state);
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
dirCodec.SetCurrentDirectoryToRoot();
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
this.LogError(ex, "Error getting directory root");
|
||||||
}
|
}
|
||||||
|
|
||||||
dirCodec.SetCurrentDirectoryToRoot();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -654,14 +701,21 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
private void SendIsReady()
|
private void SendIsReady()
|
||||||
{
|
{
|
||||||
var status = new VideoCodecBaseStateMessage();
|
try
|
||||||
|
{
|
||||||
|
var status = new VideoCodecBaseStateMessage();
|
||||||
|
|
||||||
var codecType = Codec.GetType();
|
var codecType = Codec.GetType();
|
||||||
|
|
||||||
status.IsReady = Codec.IsReady;
|
status.IsReady = Codec.IsReady;
|
||||||
status.IsZoomRoom = codecType.GetInterface("IHasZoomRoomLayouts") != null;
|
status.IsZoomRoom = codecType.GetInterface("IHasZoomRoomLayouts") != null;
|
||||||
|
|
||||||
PostStatusMessage(status);
|
PostStatusMessage(status);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
this.LogError(ex, "Error sending codec ready status");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -670,55 +724,60 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
|||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
protected VideoCodecBaseStateMessage GetStatus()
|
protected VideoCodecBaseStateMessage GetStatus()
|
||||||
{
|
{
|
||||||
var status = new VideoCodecBaseStateMessage();
|
try
|
||||||
|
|
||||||
|
|
||||||
if (Codec is IHasCodecCameras camerasCodec)
|
|
||||||
{
|
{
|
||||||
status.Cameras = new VideoCodecBaseStateMessage.CameraStatus
|
var status = new VideoCodecBaseStateMessage();
|
||||||
|
|
||||||
|
if (Codec is IHasCodecCameras camerasCodec)
|
||||||
{
|
{
|
||||||
CameraManualIsSupported = true,
|
status.Cameras = new CameraStatus
|
||||||
CameraAutoIsSupported = Codec.SupportsCameraAutoMode,
|
{
|
||||||
CameraOffIsSupported = Codec.SupportsCameraOff,
|
CameraManualIsSupported = true,
|
||||||
CameraMode = GetCameraMode(),
|
CameraAutoIsSupported = Codec.SupportsCameraAutoMode,
|
||||||
Cameras = camerasCodec.Cameras,
|
CameraOffIsSupported = Codec.SupportsCameraOff,
|
||||||
SelectedCamera = GetSelectedCamera(camerasCodec)
|
CameraMode = GetCameraMode(),
|
||||||
};
|
Cameras = camerasCodec.Cameras,
|
||||||
}
|
SelectedCamera = GetSelectedCamera(camerasCodec)
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
if (Codec is IHasDirectory directoryCodec)
|
if (Codec is IHasDirectory directoryCodec)
|
||||||
|
{
|
||||||
|
status.HasDirectory = true;
|
||||||
|
status.HasDirectorySearch = true;
|
||||||
|
status.CurrentDirectory = directoryCodec.CurrentDirectoryResult;
|
||||||
|
}
|
||||||
|
|
||||||
|
var codecType = Codec.GetType();
|
||||||
|
|
||||||
|
status.CameraSelfViewIsOn = Codec is IHasCodecSelfView && (Codec as IHasCodecSelfView).SelfviewIsOnFeedback.BoolValue;
|
||||||
|
status.IsInCall = Codec.IsInCall;
|
||||||
|
status.PrivacyModeIsOn = Codec.PrivacyModeIsOnFeedback.BoolValue;
|
||||||
|
status.SharingContentIsOn = Codec.SharingContentIsOnFeedback.BoolValue;
|
||||||
|
status.SharingSource = Codec.SharingSourceFeedback.StringValue;
|
||||||
|
status.StandbyIsOn = Codec.StandbyIsOnFeedback.BoolValue;
|
||||||
|
status.Calls = Codec.ActiveCalls;
|
||||||
|
status.Info = Codec.CodecInfo;
|
||||||
|
status.ShowSelfViewByDefault = Codec.ShowSelfViewByDefault;
|
||||||
|
status.SupportsAdHocMeeting = Codec is IHasStartMeeting;
|
||||||
|
status.HasRecents = Codec is IHasCallHistory;
|
||||||
|
status.HasCameras = Codec is IHasCameras;
|
||||||
|
status.Presets = GetCurrentPresets();
|
||||||
|
status.IsZoomRoom = codecType.GetInterface("IHasZoomRoomLayouts") != null;
|
||||||
|
status.ReceivingContent = Codec is IHasFarEndContentStatus && (Codec as IHasFarEndContentStatus).ReceivingContent.BoolValue;
|
||||||
|
|
||||||
|
if (Codec is IHasMeetingInfo meetingInfoCodec)
|
||||||
|
{
|
||||||
|
status.MeetingInfo = meetingInfoCodec.MeetingInfo;
|
||||||
|
}
|
||||||
|
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
status.HasDirectory = true;
|
this.LogError(ex, "Error getting codec status");
|
||||||
status.HasDirectorySearch = true;
|
return null;
|
||||||
status.CurrentDirectory = directoryCodec.CurrentDirectoryResult;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var codecType = Codec.GetType();
|
|
||||||
|
|
||||||
status.CameraSelfViewIsOn = Codec is IHasCodecSelfView && (Codec as IHasCodecSelfView).SelfviewIsOnFeedback.BoolValue;
|
|
||||||
status.IsInCall = Codec.IsInCall;
|
|
||||||
status.PrivacyModeIsOn = Codec.PrivacyModeIsOnFeedback.BoolValue;
|
|
||||||
status.SharingContentIsOn = Codec.SharingContentIsOnFeedback.BoolValue;
|
|
||||||
status.SharingSource = Codec.SharingSourceFeedback.StringValue;
|
|
||||||
status.StandbyIsOn = Codec.StandbyIsOnFeedback.BoolValue;
|
|
||||||
status.Calls = Codec.ActiveCalls;
|
|
||||||
status.Info = Codec.CodecInfo;
|
|
||||||
status.ShowSelfViewByDefault = Codec.ShowSelfViewByDefault;
|
|
||||||
status.SupportsAdHocMeeting = Codec is IHasStartMeeting;
|
|
||||||
status.HasRecents = Codec is IHasCallHistory;
|
|
||||||
status.HasCameras = Codec is IHasCameras;
|
|
||||||
status.Presets = GetCurrentPresets();
|
|
||||||
status.IsZoomRoom = codecType.GetInterface("IHasZoomRoomLayouts") != null;
|
|
||||||
status.ReceivingContent = Codec is IHasFarEndContentStatus && (Codec as IHasFarEndContentStatus).ReceivingContent.BoolValue;
|
|
||||||
|
|
||||||
if (Codec is IHasMeetingInfo meetingInfoCodec)
|
|
||||||
{
|
|
||||||
status.MeetingInfo = meetingInfoCodec.MeetingInfo;
|
|
||||||
}
|
|
||||||
|
|
||||||
//Debug.Console(2, this, "VideoCodecBaseStatus:\n{0}", JsonConvert.SerializeObject(status));
|
|
||||||
|
|
||||||
return status;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected virtual void SendFullStatus()
|
protected virtual void SendFullStatus()
|
||||||
@@ -733,22 +792,36 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
|||||||
|
|
||||||
private void PostReceivingContent(bool receivingContent)
|
private void PostReceivingContent(bool receivingContent)
|
||||||
{
|
{
|
||||||
var state = new VideoCodecBaseStateMessage
|
try
|
||||||
{
|
{
|
||||||
ReceivingContent = receivingContent
|
var state = new VideoCodecBaseStateMessage
|
||||||
};
|
{
|
||||||
PostStatusMessage(state);
|
ReceivingContent = receivingContent
|
||||||
|
};
|
||||||
|
|
||||||
|
PostStatusMessage(state);
|
||||||
|
} catch(Exception ex)
|
||||||
|
{
|
||||||
|
this.LogError(ex, "Error posting receiving content");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void PostCameraSelfView()
|
private void PostCameraSelfView()
|
||||||
{
|
{
|
||||||
var status = new VideoCodecBaseStateMessage
|
try
|
||||||
{
|
{
|
||||||
CameraSelfViewIsOn = Codec is IHasCodecSelfView
|
var status = new VideoCodecBaseStateMessage
|
||||||
&& (Codec as IHasCodecSelfView).SelfviewIsOnFeedback.BoolValue
|
{
|
||||||
};
|
CameraSelfViewIsOn = Codec is IHasCodecSelfView
|
||||||
|
&& (Codec as IHasCodecSelfView).SelfviewIsOnFeedback.BoolValue
|
||||||
|
};
|
||||||
|
|
||||||
PostStatusMessage(status);
|
PostStatusMessage(status);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
this.LogError(ex, "Error posting camera self view");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -756,34 +829,56 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
private void PostCameraMode()
|
private void PostCameraMode()
|
||||||
{
|
{
|
||||||
var status = new VideoCodecBaseStateMessage
|
try
|
||||||
{
|
{
|
||||||
CameraMode = GetCameraMode()
|
var status = new VideoCodecBaseStateMessage
|
||||||
};
|
{
|
||||||
|
CameraMode = GetCameraMode()
|
||||||
|
};
|
||||||
|
|
||||||
PostStatusMessage(status);
|
PostStatusMessage(status);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
this.LogError(ex, "Error posting camera mode");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void PostSelectedCamera()
|
private void PostSelectedCamera()
|
||||||
{
|
{
|
||||||
var camerasCodec = Codec as IHasCodecCameras;
|
try
|
||||||
|
|
||||||
var status = new VideoCodecBaseStateMessage
|
|
||||||
{
|
{
|
||||||
Cameras = new VideoCodecBaseStateMessage.CameraStatus() { SelectedCamera = GetSelectedCamera(camerasCodec) },
|
var camerasCodec = Codec as IHasCodecCameras;
|
||||||
Presets = GetCurrentPresets()
|
|
||||||
};
|
var status = new VideoCodecBaseStateMessage
|
||||||
PostStatusMessage(status);
|
{
|
||||||
|
Cameras = new CameraStatus() { SelectedCamera = GetSelectedCamera(camerasCodec) },
|
||||||
|
Presets = GetCurrentPresets()
|
||||||
|
};
|
||||||
|
|
||||||
|
PostStatusMessage(status);
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
this.LogError(e, "Error posting selected camera");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void PostCameraPresets()
|
private void PostCameraPresets()
|
||||||
{
|
{
|
||||||
var status = new VideoCodecBaseStateMessage
|
try
|
||||||
{
|
{
|
||||||
Presets = GetCurrentPresets()
|
var status = new VideoCodecBaseStateMessage
|
||||||
};
|
{
|
||||||
|
Presets = GetCurrentPresets()
|
||||||
|
};
|
||||||
|
|
||||||
PostStatusMessage(status);
|
PostStatusMessage(status);
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
this.LogError(e, "Error posting camera presets");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private Camera GetSelectedCamera(IHasCodecCameras camerasCodec)
|
private Camera GetSelectedCamera(IHasCodecCameras camerasCodec)
|
||||||
@@ -796,7 +891,7 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
|||||||
{
|
{
|
||||||
camera.Name = camerasCodec.SelectedCamera.Name;
|
camera.Name = camerasCodec.SelectedCamera.Name;
|
||||||
|
|
||||||
camera.Capabilities = new Camera.CameraCapabilities()
|
camera.Capabilities = new CameraCapabilities()
|
||||||
{
|
{
|
||||||
CanPan = camerasCodec.SelectedCamera.CanPan,
|
CanPan = camerasCodec.SelectedCamera.CanPan,
|
||||||
CanTilt = camerasCodec.SelectedCamera.CanTilt,
|
CanTilt = camerasCodec.SelectedCamera.CanTilt,
|
||||||
@@ -922,59 +1017,57 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
|||||||
|
|
||||||
[JsonProperty("supportsAdHocMeeting", NullValueHandling = NullValueHandling.Ignore)]
|
[JsonProperty("supportsAdHocMeeting", NullValueHandling = NullValueHandling.Ignore)]
|
||||||
public bool? SupportsAdHocMeeting { get; set; }
|
public bool? SupportsAdHocMeeting { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
public class CameraStatus
|
public class CameraStatus
|
||||||
{
|
{
|
||||||
[JsonProperty("cameraManualSupported", NullValueHandling = NullValueHandling.Ignore)]
|
[JsonProperty("cameraManualSupported", NullValueHandling = NullValueHandling.Ignore)]
|
||||||
public bool? CameraManualIsSupported { get; set; }
|
public bool? CameraManualIsSupported { get; set; }
|
||||||
|
|
||||||
[JsonProperty("cameraAutoSupported", NullValueHandling = NullValueHandling.Ignore)]
|
[JsonProperty("cameraAutoSupported", NullValueHandling = NullValueHandling.Ignore)]
|
||||||
public bool? CameraAutoIsSupported { get; set; }
|
public bool? CameraAutoIsSupported { get; set; }
|
||||||
|
|
||||||
[JsonProperty("cameraOffSupported", NullValueHandling = NullValueHandling.Ignore)]
|
[JsonProperty("cameraOffSupported", NullValueHandling = NullValueHandling.Ignore)]
|
||||||
public bool? CameraOffIsSupported { get; set; }
|
public bool? CameraOffIsSupported { get; set; }
|
||||||
|
|
||||||
[JsonProperty("cameraMode", NullValueHandling = NullValueHandling.Ignore)]
|
[JsonProperty("cameraMode", NullValueHandling = NullValueHandling.Ignore)]
|
||||||
public string CameraMode { get; set; }
|
public string CameraMode { get; set; }
|
||||||
|
|
||||||
[JsonProperty("cameraList", NullValueHandling = NullValueHandling.Ignore)]
|
[JsonProperty("cameraList", NullValueHandling = NullValueHandling.Ignore)]
|
||||||
public List<CameraBase> Cameras { get; set; }
|
public List<CameraBase> Cameras { get; set; }
|
||||||
|
|
||||||
[JsonProperty("selectedCamera", NullValueHandling = NullValueHandling.Ignore)]
|
[JsonProperty("selectedCamera", NullValueHandling = NullValueHandling.Ignore)]
|
||||||
public Camera SelectedCamera { get; set; }
|
public Camera SelectedCamera { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
public class Camera
|
public class Camera
|
||||||
{
|
{
|
||||||
[JsonProperty("key", NullValueHandling = NullValueHandling.Ignore)]
|
[JsonProperty("key", NullValueHandling = NullValueHandling.Ignore)]
|
||||||
public string Key { get; set; }
|
public string Key { get; set; }
|
||||||
|
|
||||||
[JsonProperty("name", NullValueHandling = NullValueHandling.Ignore)]
|
[JsonProperty("name", NullValueHandling = NullValueHandling.Ignore)]
|
||||||
public string Name { get; set; }
|
public string Name { get; set; }
|
||||||
|
|
||||||
[JsonProperty("isFarEnd", NullValueHandling = NullValueHandling.Ignore)]
|
[JsonProperty("isFarEnd", NullValueHandling = NullValueHandling.Ignore)]
|
||||||
public bool? IsFarEnd { get; set; }
|
public bool? IsFarEnd { get; set; }
|
||||||
|
|
||||||
[JsonProperty("capabilities", NullValueHandling = NullValueHandling.Ignore)]
|
[JsonProperty("capabilities", NullValueHandling = NullValueHandling.Ignore)]
|
||||||
public CameraCapabilities Capabilities { get; set; }
|
public CameraCapabilities Capabilities { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
public class CameraCapabilities
|
public class CameraCapabilities
|
||||||
{
|
{
|
||||||
[JsonProperty("canPan", NullValueHandling = NullValueHandling.Ignore)]
|
[JsonProperty("canPan", NullValueHandling = NullValueHandling.Ignore)]
|
||||||
public bool? CanPan { get; set; }
|
public bool? CanPan { get; set; }
|
||||||
|
|
||||||
[JsonProperty("canTilt", NullValueHandling = NullValueHandling.Ignore)]
|
[JsonProperty("canTilt", NullValueHandling = NullValueHandling.Ignore)]
|
||||||
public bool? CanTilt { get; set; }
|
public bool? CanTilt { get; set; }
|
||||||
|
|
||||||
[JsonProperty("canZoom", NullValueHandling = NullValueHandling.Ignore)]
|
[JsonProperty("canZoom", NullValueHandling = NullValueHandling.Ignore)]
|
||||||
public bool? CanZoom { get; set; }
|
public bool? CanZoom { get; set; }
|
||||||
|
|
||||||
[JsonProperty("canFocus", NullValueHandling = NullValueHandling.Ignore)]
|
[JsonProperty("canFocus", NullValueHandling = NullValueHandling.Ignore)]
|
||||||
public bool? CanFocus { get; set; }
|
public bool? CanFocus { get; set; }
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user