mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-02-17 05:35:03 +00:00
fix(essentials): reworks logic for setting up cameras to wait until codec communication sync has finished
This commit is contained in:
@@ -32,6 +32,8 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
|
|||||||
IHasExternalSourceSwitching, IHasBranding, IHasCameraOff, IHasCameraMute, IHasDoNotDisturbMode,
|
IHasExternalSourceSwitching, IHasBranding, IHasCameraOff, IHasCameraMute, IHasDoNotDisturbMode,
|
||||||
IHasHalfWakeMode, IHasCallHold, IJoinCalls
|
IHasHalfWakeMode, IHasCallHold, IJoinCalls
|
||||||
{
|
{
|
||||||
|
private CiscoSparkCodecPropertiesConfig _config;
|
||||||
|
|
||||||
private bool _externalSourceChangeRequested;
|
private bool _externalSourceChangeRequested;
|
||||||
|
|
||||||
public event EventHandler<DirectoryEventArgs> DirectoryResultReturned;
|
public event EventHandler<DirectoryEventArgs> DirectoryResultReturned;
|
||||||
@@ -314,6 +316,8 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
|
|||||||
{
|
{
|
||||||
var props = JsonConvert.DeserializeObject<Codec.CiscoSparkCodecPropertiesConfig>(config.Properties.ToString());
|
var props = JsonConvert.DeserializeObject<Codec.CiscoSparkCodecPropertiesConfig>(config.Properties.ToString());
|
||||||
|
|
||||||
|
_config = props;
|
||||||
|
|
||||||
// Use the configured phonebook results limit if present
|
// Use the configured phonebook results limit if present
|
||||||
if (props.PhonebookResultsLimit > 0)
|
if (props.PhonebookResultsLimit > 0)
|
||||||
{
|
{
|
||||||
@@ -417,9 +421,6 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
|
|||||||
InputPorts.Add(HdmiIn2);
|
InputPorts.Add(HdmiIn2);
|
||||||
InputPorts.Add(HdmiIn3);
|
InputPorts.Add(HdmiIn3);
|
||||||
OutputPorts.Add(HdmiOut1);
|
OutputPorts.Add(HdmiOut1);
|
||||||
|
|
||||||
SetUpCameras(props.CameraInfo);
|
|
||||||
|
|
||||||
CreateOsdSource();
|
CreateOsdSource();
|
||||||
|
|
||||||
ExternalSourceListEnabled = props.ExternalSourceListEnabled;
|
ExternalSourceListEnabled = props.ExternalSourceListEnabled;
|
||||||
@@ -638,6 +639,8 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
|
|||||||
/// <param name="e"></param>
|
/// <param name="e"></param>
|
||||||
void SyncState_InitialSyncCompleted(object sender, EventArgs e)
|
void SyncState_InitialSyncCompleted(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
|
SetUpCameras(_config.CameraInfo);
|
||||||
|
|
||||||
// Fire the ready event
|
// Fire the ready event
|
||||||
SetIsReady();
|
SetIsReady();
|
||||||
//CommDebuggingIsOn = false;
|
//CommDebuggingIsOn = false;
|
||||||
@@ -1912,10 +1915,14 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
|
|||||||
{
|
{
|
||||||
var internalCamera = new CiscoSparkCamera(Key + "-camera1", "Near End", this, 1);
|
var internalCamera = new CiscoSparkCamera(Key + "-camera1", "Near End", this, 1);
|
||||||
|
|
||||||
|
if (camCount > 0)
|
||||||
|
{
|
||||||
|
// Try to get the capabilities from the codec
|
||||||
if (CodecStatus.Status.Cameras.Camera[0] != null && CodecStatus.Status.Cameras.Camera[0].Capabilities != null)
|
if (CodecStatus.Status.Cameras.Camera[0] != null && CodecStatus.Status.Cameras.Camera[0].Capabilities != null)
|
||||||
{
|
{
|
||||||
internalCamera.SetCapabilites(CodecStatus.Status.Cameras.Camera[0].Capabilities.Options.Value);
|
internalCamera.SetCapabilites(CodecStatus.Status.Cameras.Camera[0].Capabilities.Options.Value);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Cameras.Add(internalCamera);
|
Cameras.Add(internalCamera);
|
||||||
DeviceManager.AddDevice(internalCamera);
|
DeviceManager.AddDevice(internalCamera);
|
||||||
|
|||||||
@@ -328,15 +328,20 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
|
|||||||
|
|
||||||
LinkVideoCodecVolumeToApi(trilist, joinMap);
|
LinkVideoCodecVolumeToApi(trilist, joinMap);
|
||||||
|
|
||||||
|
// Register for this event to link any functions that require the codec to be ready first
|
||||||
|
codec.IsReadyChange += (o, a) =>
|
||||||
|
{
|
||||||
|
if (codec is IHasCodecCameras)
|
||||||
|
{
|
||||||
|
LinkVideoCodecCameraToApi(codec as IHasCodecCameras, trilist, joinMap);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
if (codec is ICommunicationMonitor)
|
if (codec is ICommunicationMonitor)
|
||||||
{
|
{
|
||||||
LinkVideoCodecCommMonitorToApi(codec as ICommunicationMonitor, trilist, joinMap);
|
LinkVideoCodecCommMonitorToApi(codec as ICommunicationMonitor, trilist, joinMap);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (codec is IHasCodecCameras)
|
|
||||||
{
|
|
||||||
LinkVideoCodecCameraToApi(codec as IHasCodecCameras, trilist, joinMap);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (codec is IHasCodecSelfView)
|
if (codec is IHasCodecSelfView)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user