Migrates AudioVideoManagement to generated rtiddsgen API
Converts accessor calls to plain member access across avm service and plugin.
This commit is contained in:
29 files changed
+308
-295
No files matched your search
+20
-20
@@ -157,9 +157,9 @@ QString recordingString(bool hasRecordingOn_, bool usePrealarm)
|
||||
|
||||
bool isMountingPointOfInterest(const InfrastructureManagement::InstrumentationAsset &asset)
|
||||
{
|
||||
return (asset.mountingPointTypeId() == InfrastructureManagement::MountingPointType::IndoorCamera ||
|
||||
asset.mountingPointTypeId() == InfrastructureManagement::MountingPointType::OutdoorCamera ||
|
||||
asset.mountingPointTypeId() == InfrastructureManagement::MountingPointType::AnnouncementUnit);
|
||||
return (asset.mountingPointTypeId == InfrastructureManagement::MountingPointType::IndoorCamera ||
|
||||
asset.mountingPointTypeId == InfrastructureManagement::MountingPointType::OutdoorCamera ||
|
||||
asset.mountingPointTypeId == InfrastructureManagement::MountingPointType::AnnouncementUnit);
|
||||
}
|
||||
|
||||
bool hasRecordingOn(const JsonObject &mountingPointProperties)
|
||||
@@ -170,10 +170,10 @@ bool hasRecordingOn(const JsonObject &mountingPointProperties)
|
||||
Stream toDds(const AvmDeviceConfigEx &dc, int32_t mountintPointId)
|
||||
{
|
||||
Stream stream;
|
||||
stream.id(dc.id);
|
||||
stream.name(dc.name.toStdString());
|
||||
stream.type(dc.streamType);
|
||||
stream.mountingPointId(mountintPointId);
|
||||
stream.id = dc.id;
|
||||
stream.name = dc.name.toStdString();
|
||||
stream.type = dc.streamType;
|
||||
stream.mountingPointId = mountintPointId;
|
||||
return stream;
|
||||
}
|
||||
|
||||
@@ -208,12 +208,12 @@ Streams::Streams(Asset *asset_, const AvmDeviceConfigEx &first_, const AvmDevice
|
||||
|
||||
int32_t Streams::assetId() const
|
||||
{
|
||||
return asset->data().id();
|
||||
return asset->data().id;
|
||||
}
|
||||
|
||||
int32_t Streams::mountingPointId() const
|
||||
{
|
||||
return asset->mountingPoint()->data().id();
|
||||
return asset->mountingPoint()->data().id;
|
||||
}
|
||||
|
||||
|
||||
@@ -246,23 +246,23 @@ Streams AudioVideoHandlerImpl::createStreams(Asset *asset_)
|
||||
Database::AvmDeviceConfig dc;
|
||||
dc.context = m_exContext.toString();
|
||||
dc.controller = avController();
|
||||
dc.name = internalStreamName(asset_->mountingPoint()->data().id());
|
||||
dc.name = internalStreamName(asset_->mountingPoint()->data().id);
|
||||
|
||||
const InfrastructureManagement::InstrumentationAsset &asset = asset_->data();
|
||||
const JsonObject assetProperties = jsonFromString(asset.properties());
|
||||
const JsonObject mpProperties = JsonObject::fromJson(asset_->mountingPoint()->data().properties());
|
||||
const JsonObject assetProperties = jsonFromString(asset.properties);
|
||||
const JsonObject mpProperties = JsonObject::fromJson(asset_->mountingPoint()->data().properties);
|
||||
|
||||
if (asset.mountingPointTypeId() == InfrastructureManagement::MountingPointType::AnnouncementUnit)
|
||||
if (asset.mountingPointTypeId == InfrastructureManagement::MountingPointType::AnnouncementUnit)
|
||||
{
|
||||
dc.definition = deviceDefinitionAnnouncementUnit(asset.hostname(), assetProperties, mpProperties);
|
||||
dc.definition = deviceDefinitionAnnouncementUnit(asset.hostname, assetProperties, mpProperties);
|
||||
dc.type = avTypeAudioChannel(assetProperties);
|
||||
return {asset_, {dc, StreamType::AudioOut}};
|
||||
}
|
||||
|
||||
Q_ASSERT(asset.mountingPointTypeId() == InfrastructureManagement::MountingPointType::IndoorCamera ||
|
||||
asset.mountingPointTypeId() == InfrastructureManagement::MountingPointType::OutdoorCamera);
|
||||
Q_ASSERT(asset.mountingPointTypeId == InfrastructureManagement::MountingPointType::IndoorCamera ||
|
||||
asset.mountingPointTypeId == InfrastructureManagement::MountingPointType::OutdoorCamera);
|
||||
|
||||
dc.definition = deviceDefinitionCameraVideo(asset.hostname(), assetProperties, mpProperties);
|
||||
dc.definition = deviceDefinitionCameraVideo(asset.hostname, assetProperties, mpProperties);
|
||||
dc.type = avTypeVideoChannel(assetProperties);
|
||||
|
||||
if (!cameraHasMicrophone(assetProperties) && !cameraHasSpeaker(assetProperties))
|
||||
@@ -279,7 +279,7 @@ Streams AudioVideoHandlerImpl::createStreams(Asset *asset_)
|
||||
else
|
||||
audioStreamType = StreamType::AudioOut;
|
||||
|
||||
dcAudio.definition = deviceDefinitionCameraAudio(asset.hostname(), assetProperties, mpProperties);
|
||||
dcAudio.definition = deviceDefinitionCameraAudio(asset.hostname, assetProperties, mpProperties);
|
||||
dcAudio.type = avTypeAudioChannel(assetProperties);
|
||||
return {asset_, {dc, StreamType::Video}, {dcAudio, audioStreamType}};
|
||||
}
|
||||
@@ -324,7 +324,7 @@ void AudioVideoHandlerImpl::onAssetChanged(Asset *asset)
|
||||
{
|
||||
Q_ASSERT(m_isActive);
|
||||
Q_ASSERT(asset);
|
||||
DEBUG_LOG(m_logger) << m_exContext << ": Asset changed: " << asset->data().name() << "(" << asset->data().id() << ")";
|
||||
DEBUG_LOG(m_logger) << m_exContext << ": Asset changed: " << asset->data().name << "(" << asset->data().id << ")";
|
||||
|
||||
updateDeviceConfig(asset);
|
||||
}
|
||||
@@ -333,7 +333,7 @@ void AudioVideoHandlerImpl::onMountingPointChanged(MountingPoint *mountingPoint)
|
||||
{
|
||||
Q_ASSERT(m_isActive);
|
||||
Q_ASSERT(mountingPoint);
|
||||
DEBUG_LOG(m_logger) << m_exContext << ": MountingPoint changed: " << mountingPoint->data().name() << "(" << mountingPoint->data().id() << ")";
|
||||
DEBUG_LOG(m_logger) << m_exContext << ": MountingPoint changed: " << mountingPoint->data().name << "(" << mountingPoint->data().id << ")";
|
||||
|
||||
updateDeviceConfig(mountingPoint->asset());
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user