Skip to content
Permalink
Browse files

Merge remote-tracking branch 'origin/shared_ptr_replacement'

  • Loading branch information...
bear101 committed Aug 5, 2019
2 parents 89fd41d + 6a527fb commit 874d0b327c3d9378e29e2103923fba7706d96187
@@ -28,9 +28,6 @@
#include "FFMpeg3Streamer.h"
#include <myace/MyACE.h>

#include <ace/Bound_Ptr.h>
#include <ace/Null_Mutex.h>

#include <map>

namespace vidcap {
@@ -25,7 +25,6 @@
#define AVCONVWRAPPER_H

#include <ace/Task.h>
#include <ace/Bound_Ptr.h>
#include <ace/Future.h>
#include <ace/Semaphore.h>

@@ -1093,7 +1093,7 @@ void Convert(const teamtalk::ClientUser& clientuser, User& result)
Convert(static_cast<const teamtalk::User&>(clientuser), result);

teamtalk::clientchannel_t channel = clientuser.GetChannel();
if(!channel.null())
if(channel)
result.nChannelID = channel->GetChannelID();
else
result.nChannelID = 0;
@@ -1148,7 +1148,7 @@ void Convert(const teamtalk::ServerUser& serveruser, User& result)

Convert(static_cast<const teamtalk::User&>(serveruser), result);
teamtalk::serverchannel_t channel = serveruser.GetChannel();
if(!channel.null())
if(channel)
result.nChannelID = channel->GetChannelID();
else
result.nChannelID = 0;
@@ -350,8 +350,8 @@ void TTMsgQueue::OnKicked(const teamtalk::clientuser_t& user, int channelid)
{
ACE_Message_Block* mb;
IntTTMessage* msg = MakeMsgBlock(mb, CLIENTEVENT_CMD_MYSELF_KICKED,
channelid, !user.null()? __USER : __NONE);
if(!user.null())
channelid, user? __USER : __NONE);
if(user)
Convert(*user, *msg->user);
EnqueueMsg(mb);
}
@@ -1029,7 +1029,7 @@ TEAMTALKDLL_API VideoFrame* TT_AcquireUserVideoCaptureFrame(IN TTInstance* lpTTI
{
//try and extract new one
clientuser_t user = pClientNode->GetUser(nUserID);
if(user.null())
if(!user)
return NULL;
g.release(); //don't hold lock while decoding
mb = user->GetVideoCaptureFrame();
@@ -1338,7 +1338,7 @@ TEAMTALKDLL_API INT32 TT_DoRecvFile(IN TTInstance* lpTTInstance,
{
clientchannel_t chan = pClientNode->GetChannel(nChannelID);
teamtalk::RemoteFile remotefile;
if(!chan.null() && chan->GetFile(nFileID, remotefile))
if(chan && chan->GetFile(nFileID, remotefile))
return pClientNode->DoFileRecv(nChannelID, szLocalFilePath,
remotefile.filename);
}
@@ -1356,7 +1356,7 @@ TEAMTALKDLL_API INT32 TT_DoDeleteFile(IN TTInstance* lpTTInstance,

clientchannel_t chan = pClientNode->GetChannel(nChannelID);
teamtalk::RemoteFile remotefile;
if(!chan.null() && chan->GetFile(nFileID, remotefile))
if(chan && chan->GetFile(nFileID, remotefile))
return pClientNode->DoFileDelete(nChannelID, remotefile.filename);
return -1;
}
@@ -1397,8 +1397,8 @@ TEAMTALKDLL_API TTBOOL TT_GetServerUsers(IN TTInstance* lpTTInstance,
while(ite != userids.end() && i < *lpnHowMany)
{
clientuser_t user = pClientNode->GetUser(*ite);
TTASSERT(!user.null());
if(!user.null())
TTASSERT(user);
if(user)
Convert(*user, lpUsers[i++]);
ite++;
}
@@ -1413,7 +1413,7 @@ TEAMTALKDLL_API INT32 TT_GetRootChannelID(IN TTInstance* lpTTInstance)
GET_CLIENTNODE_RET(pClientNode, lpTTInstance, 0);

clientchannel_t channel = pClientNode->GetRootChannel();
if(!channel.null())
if(channel)
return channel->GetChannelID();

return 0;
@@ -1452,7 +1452,7 @@ TEAMTALKDLL_API TTBOOL TT_GetChannelPath(IN TTInstance* lpTTInstance,
if(szChannelPath)
{
clientchannel_t channel = pClientNode->GetChannel(nChannelID);
if(!channel.null())
if(channel)
{
ACE_OS::strsncpy(szChannelPath, channel->GetChannelPath().c_str(), TT_STRLEN);
return TRUE;
@@ -1471,7 +1471,7 @@ TEAMTALKDLL_API INT32 TT_GetChannelIDFromPath(IN TTInstance* lpTTInstance,
{
clientchannel_t channel = ChangeChannel(pClientNode->GetRootChannel(),
szChannelPath);
if(!channel.null())
if (channel)
return channel->GetChannelID();
}
return 0;
@@ -1486,7 +1486,7 @@ TEAMTALKDLL_API TTBOOL TT_GetChannelUsers(IN TTInstance* lpTTInstance,
GET_CLIENTNODE_RET(pClientNode, lpTTInstance, FALSE);

clientchannel_t chan = pClientNode->GetChannel(nChannelID);
if(chan.null())
if(!chan)
return FALSE;

if(lpUsers == NULL)
@@ -1521,7 +1521,7 @@ TEAMTALKDLL_API TTBOOL TT_SetUserMediaStorageDir(IN TTInstance* lpTTInstance,
GET_CLIENTNODE_RET(pClientNode, lpTTInstance, FALSE);

clientuser_t user = pClientNode->GetUser(nUserID, TRUE);
if(!user.null())
if (user)
{
if(!szFolderPath)
szFolderPath = ACE_TEXT("");
@@ -1546,7 +1546,7 @@ TEAMTALKDLL_API TTBOOL TT_SetUserAudioStreamBufferSize(IN TTInstance* lpTTInstan
GET_CLIENTNODE_RET(pClientNode, lpTTInstance, FALSE);

clientuser_t user = pClientNode->GetUser(nUserID);
if(!user.null())
if(user)
{
user->SetAudioStreamBufferSize((teamtalk::StreamType)uStreamType, nMSec);
return TRUE;
@@ -1607,7 +1607,7 @@ TEAMTALKDLL_API TTBOOL TT_GetUser(IN TTInstance* lpTTInstance,
return FALSE;

clientuser_t user = pClientNode->GetUser(nUserID);
if(user.null())
if(!user)
return FALSE;

Convert(*user, *lpUser);
@@ -1623,7 +1623,7 @@ TEAMTALKDLL_API TTBOOL TT_GetUserStatistics(IN TTInstance* lpTTInstance,
GET_CLIENTNODE_RET(pClientNode, lpTTInstance, FALSE);

clientuser_t user = pClientNode->GetUser(nUserID);
if(!lpStats || user.null())
if(!lpStats || !user)
return FALSE;
Convert(user->GetStatistics(), *lpStats);
return TRUE;
@@ -1652,7 +1652,7 @@ TEAMTALKDLL_API TTBOOL TT_IsChannelOperator(IN TTInstance* lpTTInstance,
GET_CLIENTNODE_RET(pClientNode, lpTTInstance, FALSE);

clientchannel_t chan = pClientNode->GetChannel(nChannelID);
if(!chan.null())
if(chan)
return chan->IsOperator(nUserID);

return FALSE;
@@ -1671,7 +1671,7 @@ TEAMTALKDLL_API TTBOOL TT_GetServerChannels(IN TTInstance* lpTTInstance,
std::vector<teamtalk::ChannelProp> result;

clientchannel_t chan = pClientNode->GetRootChannel();
if(!chan.null())
if (chan)
{
queue<clientchannel_t> channels;
channels.push(chan);
@@ -1757,7 +1757,7 @@ TEAMTALKDLL_API TTBOOL TT_SetUserVolume(IN TTInstance* lpTTInstance,
nVolume = std::min(nVolume, (INT32)SOUND_VOLUME_MAX);

clientuser_t user = pClientNode->GetUser(nUserID);
if(!user.null())
if (user)
{
user->SetVolume((teamtalk::StreamType)nStreamType, nVolume);
return TRUE;
@@ -1774,7 +1774,7 @@ TEAMTALKDLL_API TTBOOL TT_SetUserMute(IN TTInstance* lpTTInstance,
GET_CLIENTNODE_RET(pClientNode, lpTTInstance, FALSE);

clientuser_t user = pClientNode->GetUser(nUserID);
if(!user.null())
if (user)
{
user->SetMute((teamtalk::StreamType)nStreamType, bMute);
return TRUE;
@@ -1791,7 +1791,7 @@ TEAMTALKDLL_API TTBOOL TT_SetUserStoppedPlaybackDelay(IN TTInstance* lpTTInstanc
GET_CLIENTNODE_RET(pClientNode, lpTTInstance, FALSE);

clientuser_t user = pClientNode->GetUser(nUserID);
if(!user.null())
if (user)
{
user->SetPlaybackStoppedDelay((teamtalk::StreamType)nStreamType, nDelayMSec);
return TRUE;
@@ -1811,7 +1811,7 @@ TEAMTALKDLL_API TTBOOL TT_SetUserPosition(IN TTInstance* lpTTInstance,
GET_CLIENTNODE_RET(pClientNode, lpTTInstance, FALSE);

clientuser_t user = pClientNode->GetUser(nUserID);
if(!user.null())
if (user)
{
user->SetPosition((teamtalk::StreamType)nStreamType, x, y, z);
return TRUE;
@@ -1829,7 +1829,7 @@ TEAMTALKDLL_API TTBOOL TT_SetUserStereo(IN TTInstance* lpTTInstance,
GET_CLIENTNODE_RET(pClientNode, lpTTInstance, FALSE);

clientuser_t user = pClientNode->GetUser(nUserID);
if(!user.null())
if (user)
{
user->SetStereo((teamtalk::StreamType)nStreamType, bLeftSpeaker, bRightSpeaker);
return TRUE;
@@ -1889,7 +1889,7 @@ TEAMTALKDLL_API VideoFrame* TT_AcquireUserMediaVideoFrame(IN TTInstance* lpTTIns
return NULL;

clientuser_t user = pClientNode->GetUser(nUserID);
if(user.null())
if (!user)
return NULL;

g.release(); //don't hold lock while decoding
@@ -2468,7 +2468,7 @@ TEAMTALKDLL_API TTBOOL TT_PaintDesktopWindow(IN TTInstance* lpTTInstance,
GET_CLIENTNODE_RET(pClientNode, lpTTInstance, FALSE);

clientuser_t user = pClientNode->GetUser(nUserID);
if(user.null() || !user->GetDesktopSession())
if (!user || !user->GetDesktopSession())
return FALSE;

desktop_viewer_t viewer = user->GetDesktopSession();
@@ -2501,7 +2501,7 @@ TEAMTALKDLL_API TTBOOL TT_PaintDesktopWindowEx(IN TTInstance* lpTTInstance,

clientuser_t user = pClientNode->GetUser(nUserID);
teamtalk::DesktopWindow wnd;
if(user.null() || !user->GetDesktopSession())
if (!user || !user->GetDesktopSession())
return FALSE;

desktop_viewer_t viewer = user->GetDesktopSession();
@@ -2834,7 +2834,7 @@ TEAMTALKDLL_API DesktopWindow* TT_AcquireUserDesktopWindow(IN TTInstance* lpTTIn

clientuser_t user = pClientNode->GetUser(nUserID);
teamtalk::DesktopWindow wnd;
if(user.null() || !user->GetDesktopWindow(wnd))
if (!user || !user->GetDesktopWindow(wnd))
return NULL;

desktop_viewer_t viewer = user->GetDesktopSession();
@@ -3142,7 +3142,7 @@ TEAMTALKDLL_API TTBOOL TT_GetChannelFile(IN TTInstance* lpTTInstance,
{
clientchannel_t chan = pClientNode->GetChannel(nChannelID);
teamtalk::RemoteFile ttremotefile;
if(!chan.null() && chan->GetFile(nFileID, ttremotefile, false))
if (chan && chan->GetFile(nFileID, ttremotefile, false))
{
Convert(ttremotefile, *lpRemoteFile);
return TRUE;
@@ -124,7 +124,7 @@ void ServerGuard::OnUserDisconnected(const ServerUser& user)
tostringstream oss;

serverchannel_t chan = user.GetChannel();
if(!chan.null())
if(chan)
{
oss << ACE_TEXT("User #") << user.GetUserID() << ACE_TEXT(" ");
oss << ACE_TEXT("nickname: \"") << LogPrepare(user.GetNickname()).c_str() << ACE_TEXT("\" ");
@@ -741,7 +741,7 @@ void ServerGuard::WebLoginComplete(ServerNode* servernode, ACE_UINT32 userid,
const UserAccount& useraccount, const ErrorMsg& err)
{
serveruser_t user = servernode->GetUser(userid);
if(user.null())
if(!user)
return;

if(!err.success())
@@ -1103,7 +1103,7 @@ namespace teamtalk {

MakeStaticChannels(servernode, channels);

if(servernode.GetRootChannel().null())
if(!servernode.GetRootChannel())
{
ChannelProp chanprop;
chanprop.channelid = 1;

0 comments on commit 874d0b3

Please sign in to comment.
You can’t perform that action at this time.