Skip to content

Commit

Permalink
Make MSVC happy.
Browse files Browse the repository at this point in the history
  • Loading branch information
hipersayanX committed Feb 11, 2025
1 parent 8f9d3cd commit 3c76afb
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 49 deletions.
18 changes: 9 additions & 9 deletions Service/src/service.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ bool AkVCam::ServicePrivate::clients(uint64_t clientId,
this->m_peerMutex.unlock();
outMessage = MsgClients(msgClients.clientType(),
clients,
inMessage.queryId());
inMessage.queryId()).toMessage();

return true;
}
Expand All @@ -260,7 +260,7 @@ bool AkVCam::ServicePrivate::updateDevices(uint64_t clientId,
this->m_devicesUpdated.notify_all();
this->m_devicesMutex.unlock();

outMessage = MsgStatus(0, inMessage.queryId());
outMessage = MsgStatus(0, inMessage.queryId()).toMessage();

return true;
}
Expand All @@ -278,7 +278,7 @@ bool AkVCam::ServicePrivate::devicesUpdated(uint64_t clientId,
this->m_devicesUpdated.wait_for(this->m_devicesMutex,
std::chrono::seconds(1));

outMessage = MsgStatus(this->m_devsUpdated? 0: -1, inMessage.queryId());
outMessage = MsgStatus(this->m_devsUpdated? 0: -1, inMessage.queryId()).toMessage();
this->m_devsUpdated = false;
this->m_devicesMutex.unlock();

Expand All @@ -299,7 +299,7 @@ bool AkVCam::ServicePrivate::updatePicture(uint64_t clientId,
this->m_pictureUpdated.notify_all();
this->m_pictureMutex.unlock();

outMessage = MsgStatus(0, inMessage.queryId());
outMessage = MsgStatus(0, inMessage.queryId()).toMessage();

return true;
}
Expand All @@ -319,7 +319,7 @@ bool AkVCam::ServicePrivate::pictureUpdated(uint64_t clientId,

outMessage = MsgPictureUpdated(this->m_picture,
this->m_pictUpdated,
inMessage.queryId());
inMessage.queryId()).toMessage();
this->m_pictUpdated = false;
this->m_pictureMutex.unlock();

Expand All @@ -340,7 +340,7 @@ bool AkVCam::ServicePrivate::updateControls(uint64_t clientId,
this->m_deviceControlsUpdated.notify_all();
this->m_deviceControlsMutex.unlock();

outMessage = MsgStatus(0, inMessage.queryId());
outMessage = MsgStatus(0, inMessage.queryId()).toMessage();

return true;
}
Expand All @@ -360,7 +360,7 @@ bool AkVCam::ServicePrivate::controlsUpdated(uint64_t clientId,

outMessage = MsgControlsUpdated(this->m_deviceControls,
this->m_devControlsUpdated,
inMessage.queryId());
inMessage.queryId()).toMessage();
this->m_devControlsUpdated = false;
this->m_deviceControlsMutex.unlock();

Expand Down Expand Up @@ -394,7 +394,7 @@ bool AkVCam::ServicePrivate::broadcast(uint64_t clientId,
}

this->m_peerMutex.unlock();
outMessage = status;
outMessage = status.toMessage();

return status.status() == 0;
}
Expand Down Expand Up @@ -422,7 +422,7 @@ bool AkVCam::ServicePrivate::listen(uint64_t clientId,
outMessage = MsgFrameReady(msgListen.device(),
slot.frame,
slot.broadcaster.pid != 0,
inMessage.queryId());
inMessage.queryId()).toMessage();
slot.frame = {};
ok = true;
this->m_peerMutex.unlock();
Expand Down
22 changes: 11 additions & 11 deletions VCamUtils/src/message.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ bool AkVCam::MsgStatus::operator ==(const MsgStatus &other) const
&& this->queryId() == other.queryId();
}

AkVCam::MsgStatus::operator Message() const
AkVCam::Message AkVCam::MsgStatus::toMessage() const
{
size_t totalSize = sizeof(this->d->m_status);
std::vector<char> data(totalSize);
Expand Down Expand Up @@ -291,7 +291,7 @@ bool AkVCam::MsgClients::operator ==(const MsgClients &other) const
&& this->queryId() == other.queryId();
}

AkVCam::MsgClients::operator Message() const
AkVCam::Message AkVCam::MsgClients::toMessage() const
{
size_t totalSize = sizeof(this->d->m_clientType)
+ sizeof(size_t)
Expand Down Expand Up @@ -369,7 +369,7 @@ bool AkVCam::MsgUpdateDevices::operator ==(const MsgUpdateDevices &other) const
return this->queryId() == other.queryId();
}

AkVCam::MsgUpdateDevices::operator Message() const
AkVCam::Message AkVCam::MsgUpdateDevices::toMessage() const
{
return {AKVCAM_SERVICE_MSG_UPDATE_DEVICES, this->queryId(), {}};
}
Expand Down Expand Up @@ -423,7 +423,7 @@ bool AkVCam::MsgDevicesUpdated::operator ==(const MsgDevicesUpdated &other) cons
return this->queryId() == other.queryId();
}

AkVCam::MsgDevicesUpdated::operator Message() const
AkVCam::Message AkVCam::MsgDevicesUpdated::toMessage() const
{
return {AKVCAM_SERVICE_MSG_DEVICES_UPDATED, this->queryId(), {}};
}
Expand Down Expand Up @@ -499,7 +499,7 @@ bool AkVCam::MsgUpdatePicture::operator ==(const MsgUpdatePicture &other) const
&& this->queryId() == other.queryId();
}

AkVCam::MsgUpdatePicture::operator Message() const
AkVCam::Message AkVCam::MsgUpdatePicture::toMessage() const
{
size_t totalSize = sizeof(size_t)
+ this->d->m_picture.size();
Expand Down Expand Up @@ -602,7 +602,7 @@ bool AkVCam::MsgPictureUpdated::operator ==(const MsgPictureUpdated &other) cons
&& this->queryId() == other.queryId();
}

AkVCam::MsgPictureUpdated::operator Message() const
AkVCam::Message AkVCam::MsgPictureUpdated::toMessage() const
{
size_t totalSize = sizeof(size_t)
+ this->d->m_picture.size()
Expand Down Expand Up @@ -703,7 +703,7 @@ bool AkVCam::MsgUpdateControls::operator ==(const MsgUpdateControls &other) cons
&& this->queryId() == other.queryId();
}

AkVCam::MsgUpdateControls::operator Message() const
AkVCam::Message AkVCam::MsgUpdateControls::toMessage() const
{
size_t totalSize = sizeof(size_t)
+ this->d->m_device.size();
Expand Down Expand Up @@ -806,7 +806,7 @@ bool AkVCam::MsgControlsUpdated::operator ==(const MsgControlsUpdated &other) co
&& this->queryId() == other.queryId();
}

AkVCam::MsgControlsUpdated::operator Message() const
AkVCam::Message AkVCam::MsgControlsUpdated::toMessage() const
{
size_t totalSize = sizeof(size_t)
+ this->d->m_device.size()
Expand Down Expand Up @@ -963,7 +963,7 @@ bool AkVCam::MsgFrameReady::operator ==(const MsgFrameReady &other) const
&& this->queryId() == other.queryId();
}

AkVCam::MsgFrameReady::operator Message() const
AkVCam::Message AkVCam::MsgFrameReady::toMessage() const
{
size_t totalSize = sizeof(size_t)
+ this->d->m_device.size()
Expand Down Expand Up @@ -1148,7 +1148,7 @@ bool AkVCam::MsgBroadcast::operator ==(const MsgBroadcast &other) const
&& this->queryId() == other.queryId();
}

AkVCam::MsgBroadcast::operator Message() const
AkVCam::Message AkVCam::MsgBroadcast::toMessage() const
{
size_t totalSize = sizeof(size_t)
+ this->d->m_device.size()
Expand Down Expand Up @@ -1289,7 +1289,7 @@ bool AkVCam::MsgListen::operator ==(const MsgListen &other) const
&& this->queryId() == other.queryId();
}

AkVCam::MsgListen::operator Message() const
AkVCam::Message AkVCam::MsgListen::toMessage() const
{
size_t totalSize = sizeof(size_t)
+ this->d->m_device.size()
Expand Down
22 changes: 11 additions & 11 deletions VCamUtils/src/message.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ namespace AkVCam
~MsgStatus();
MsgStatus &operator =(const MsgStatus &other);
bool operator ==(const MsgStatus &other) const;
operator Message() const;
Message toMessage() const;

int status() const;

Expand All @@ -104,7 +104,7 @@ namespace AkVCam
~MsgClients();
MsgClients &operator =(const MsgClients &other);
bool operator ==(const MsgClients &other) const;
operator Message() const;
Message toMessage() const;

ClientType clientType() const;
const std::vector<uint64_t> &clients() const;
Expand All @@ -124,7 +124,7 @@ namespace AkVCam
~MsgUpdateDevices();
MsgUpdateDevices &operator =(const MsgUpdateDevices &other);
bool operator ==(const MsgUpdateDevices &other) const;
operator Message() const;
Message toMessage() const;

private:
MsgUpdateDevicesPrivate *d;
Expand All @@ -141,7 +141,7 @@ namespace AkVCam
~MsgDevicesUpdated();
MsgDevicesUpdated &operator =(const MsgDevicesUpdated &other);
bool operator ==(const MsgDevicesUpdated &other) const;
operator Message() const;
Message toMessage() const;

private:
MsgDevicesUpdatedPrivate *d;
Expand All @@ -159,7 +159,7 @@ namespace AkVCam
~MsgUpdatePicture();
MsgUpdatePicture &operator =(const MsgUpdatePicture &other);
bool operator ==(const MsgUpdatePicture &other) const;
operator Message() const;
Message toMessage() const;

const std::string &picture() const;

Expand All @@ -180,7 +180,7 @@ namespace AkVCam
~MsgPictureUpdated();
MsgPictureUpdated &operator =(const MsgPictureUpdated &other);
bool operator ==(const MsgPictureUpdated &other) const;
operator Message() const;
Message toMessage() const;

const std::string &picture() const;
bool updated() const;
Expand All @@ -201,7 +201,7 @@ namespace AkVCam
~MsgUpdateControls();
MsgUpdateControls &operator =(const MsgUpdateControls &other);
bool operator ==(const MsgUpdateControls &other) const;
operator Message() const;
Message toMessage() const;

const std::string &device() const;

Expand All @@ -222,7 +222,7 @@ namespace AkVCam
~MsgControlsUpdated();
MsgControlsUpdated &operator =(const MsgControlsUpdated &other);
bool operator ==(const MsgControlsUpdated &other) const;
operator Message() const;
Message toMessage() const;

const std::string &device() const;
bool updated() const;
Expand All @@ -249,7 +249,7 @@ namespace AkVCam
~MsgFrameReady();
MsgFrameReady &operator =(const MsgFrameReady &other);
bool operator ==(const MsgFrameReady &other) const;
operator Message() const;
Message toMessage() const;

const std::string &device() const;
const VideoFrame &frame() const;
Expand All @@ -276,7 +276,7 @@ namespace AkVCam
~MsgBroadcast();
MsgBroadcast &operator =(const MsgBroadcast &other);
bool operator ==(const MsgBroadcast &other) const;
operator Message() const;
Message toMessage() const;

const std::string &device() const;
uint64_t pid() const;
Expand All @@ -299,7 +299,7 @@ namespace AkVCam
~MsgListen();
MsgListen &operator =(const MsgListen &other);
bool operator ==(const MsgListen &other) const;
operator Message() const;
Message toMessage() const;

const std::string &device() const;
uint64_t pid() const;
Expand Down
18 changes: 9 additions & 9 deletions cmio/VCamIPC/src/ipcbridge.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ void AkVCam::IpcBridge::setPicture(const std::string &picture)
return;

Preferences::setPicture(picture);
this->d->m_messageClient.send(MsgUpdatePicture(picture));
this->d->m_messageClient.send(MsgUpdatePicture(picture).toMessage());
}

int AkVCam::IpcBridge::logLevel() const
Expand Down Expand Up @@ -341,7 +341,7 @@ void AkVCam::IpcBridge::setControls(const std::string &deviceId,
if (!updated)
return;

this->d->m_messageClient.send(MsgUpdateControls(deviceId));
this->d->m_messageClient.send(MsgUpdateControls(deviceId).toMessage());
}

std::vector<uint64_t> AkVCam::IpcBridge::clientsPids() const
Expand All @@ -350,7 +350,7 @@ std::vector<uint64_t> AkVCam::IpcBridge::clientsPids() const

Message msgClients;

if (!this->d->m_messageClient.send(MsgClients(MsgClients::ClientType_VCams), msgClients))
if (!this->d->m_messageClient.send(MsgClients(MsgClients::ClientType_VCams).toMessage(), msgClients))
return {};

auto clients = MsgClients(msgClients).clients();
Expand Down Expand Up @@ -409,7 +409,7 @@ void AkVCam::IpcBridge::updateDevices()
{
AkLogFunction();

this->d->m_messageClient.send(MsgUpdateDevices());
this->d->m_messageClient.send(MsgUpdateDevices().toMessage());
}

bool AkVCam::IpcBridge::deviceStart(StreamType type,
Expand Down Expand Up @@ -438,7 +438,7 @@ bool AkVCam::IpcBridge::deviceStart(StreamType type,
});
} else {
slot.messageFuture =
this->d->m_messageClient.send(MsgListen(deviceId, currentPid()),
this->d->m_messageClient.send(MsgListen(deviceId, currentPid()).toMessage(),
std::bind(&IpcBridgePrivate::frameReady,
this->d,
std::placeholders::_1));
Expand Down Expand Up @@ -584,11 +584,11 @@ AkVCam::IpcBridgePrivate::IpcBridgePrivate(IpcBridge *self):
this->m_messageSlots[AKVCAM_SERVICE_MSG_DEVICES_UPDATED] = {};
this->m_messageSlots[AKVCAM_SERVICE_MSG_DEVICES_UPDATED].run = true;
this->m_messageSlots[AKVCAM_SERVICE_MSG_DEVICES_UPDATED].messageFuture =
this->m_messageClient.send(MsgDevicesUpdated(), AKVCAM_BIND_FUNC(IpcBridgePrivate::devicesUpdated));
this->m_messageClient.send(MsgDevicesUpdated().toMessage(), AKVCAM_BIND_FUNC(IpcBridgePrivate::devicesUpdated));
this->m_messageSlots[AKVCAM_SERVICE_MSG_PICTURE_UPDATED] = {};
this->m_messageSlots[AKVCAM_SERVICE_MSG_PICTURE_UPDATED].run = true;
this->m_messageSlots[AKVCAM_SERVICE_MSG_PICTURE_UPDATED].messageFuture =
this->m_messageClient.send(MsgPictureUpdated(), AKVCAM_BIND_FUNC(IpcBridgePrivate::pictureUpdated));
this->m_messageClient.send(MsgPictureUpdated().toMessage(), AKVCAM_BIND_FUNC(IpcBridgePrivate::pictureUpdated));

this->connectDeviceControlsMessages();
}
Expand Down Expand Up @@ -644,7 +644,7 @@ void AkVCam::IpcBridgePrivate::connectDeviceControlsMessages()
this->m_messageSlots[key] = {};
this->m_messageSlots[key].run = true;
this->m_messageSlots[key].messageFuture =
this->m_messageClient.send(MsgControlsUpdated(device), AKVCAM_BIND_FUNC(IpcBridgePrivate::controlsUpdated));
this->m_messageClient.send(MsgControlsUpdated(device).toMessage(), AKVCAM_BIND_FUNC(IpcBridgePrivate::controlsUpdated));
++i;
}
}
Expand Down Expand Up @@ -746,7 +746,7 @@ bool AkVCam::IpcBridgePrivate::frameRequired(const std::string &deviceId,
slot.available = false;
slot.frameMutex.unlock();

message = MsgBroadcast(deviceId, currentPid(), frame);
message = MsgBroadcast(deviceId, currentPid(), frame).toMessage();
this->m_broadcastsMutex.unlock();

return run;
Expand Down
Loading

0 comments on commit 3c76afb

Please sign in to comment.