Refactored ViESharedData.

Only vie_shared_data.* are refactored, all *_impl.cc are only changed due to changed names of members in ViESharedData. These files will be refactored later, so the indentation in these files might be corrupt at this stage.

References are not changed to pointers at this stage.

Review URL: http://webrtc-codereview.appspot.com/292006

git-svn-id: http://webrtc.googlecode.com/svn/trunk@1015 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
mflodman@webrtc.org 2011-11-24 15:16:00 +00:00
parent 9af365d3c5
commit 471e83e592
12 changed files with 806 additions and 811 deletions

View File

@ -62,19 +62,19 @@ ViEBase* ViEBase::GetInterface(VideoEngine* videoEngine)
// ----------------------------------------------------------------------------
int ViEBaseImpl::Release()
{
WEBRTC_TRACE(webrtc::kTraceApiCall, webrtc::kTraceVideo, _instanceId,
WEBRTC_TRACE(webrtc::kTraceApiCall, webrtc::kTraceVideo, instance_id_,
"ViEBase::Release()");
(*this)--; // Decrease ref count
WebRtc_Word32 refCount = GetCount();
if (refCount < 0)
{
WEBRTC_TRACE(webrtc::kTraceWarning, webrtc::kTraceVideo, _instanceId,
WEBRTC_TRACE(webrtc::kTraceWarning, webrtc::kTraceVideo, instance_id_,
"ViEBase release too many times");
SetLastError(kViEAPIDoesNotExist);
return -1;
}
WEBRTC_TRACE(webrtc::kTraceInfo, webrtc::kTraceVideo, _instanceId,
WEBRTC_TRACE(webrtc::kTraceInfo, webrtc::kTraceVideo, instance_id_,
"ViEBase reference count: %d", refCount);
return refCount;
}
@ -85,7 +85,7 @@ int ViEBaseImpl::Release()
ViEBaseImpl::ViEBaseImpl()
{
WEBRTC_TRACE(webrtc::kTraceMemory, webrtc::kTraceVideo, _instanceId,
WEBRTC_TRACE(webrtc::kTraceMemory, webrtc::kTraceVideo, instance_id_,
"ViEBaseImpl::ViEBaseImpl() Ctor");
}
@ -95,7 +95,7 @@ ViEBaseImpl::ViEBaseImpl()
ViEBaseImpl::~ViEBaseImpl()
{
WEBRTC_TRACE(webrtc::kTraceMemory, webrtc::kTraceVideo, _instanceId,
WEBRTC_TRACE(webrtc::kTraceMemory, webrtc::kTraceVideo, instance_id_,
"ViEBaseImpl::ViEBaseImpl() Dtor");
}
@ -108,10 +108,10 @@ ViEBaseImpl::~ViEBaseImpl()
int ViEBaseImpl::Init()
{
WEBRTC_TRACE(webrtc::kTraceApiCall, webrtc::kTraceVideo, _instanceId, "Init");
if (IsInitialized())
WEBRTC_TRACE(webrtc::kTraceApiCall, webrtc::kTraceVideo, instance_id_, "Init");
if (Initialized())
{
WEBRTC_TRACE(webrtc::kTraceWarning, webrtc::kTraceVideo, _instanceId,
WEBRTC_TRACE(webrtc::kTraceWarning, webrtc::kTraceVideo, instance_id_,
"Init called twice");
return 0;
}
@ -128,17 +128,17 @@ int ViEBaseImpl::Init()
int ViEBaseImpl::SetVoiceEngine(VoiceEngine* ptrVoiceEngine)
{
WEBRTC_TRACE(webrtc::kTraceApiCall, webrtc::kTraceVideo, ViEId(_instanceId), "%s",
WEBRTC_TRACE(webrtc::kTraceApiCall, webrtc::kTraceVideo, ViEId(instance_id_), "%s",
__FUNCTION__);
if (!IsInitialized())
if (!Initialized())
{
SetLastError(kViENotInitialized);
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo, ViEId(_instanceId),
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo, ViEId(instance_id_),
"%s - ViE instance %d not initialized", __FUNCTION__,
_instanceId);
instance_id_);
return -1;
}
if (_channelManager.SetVoiceEngine(ptrVoiceEngine) != 0)
if (channel_manager_.SetVoiceEngine(ptrVoiceEngine) != 0)
{
SetLastError(kViEBaseVoEFailure);
return -1;
@ -159,27 +159,27 @@ int ViEBaseImpl::SetVoiceEngine(VoiceEngine* ptrVoiceEngine)
int ViEBaseImpl::CreateChannel(int& videoChannel)
{
WEBRTC_TRACE(webrtc::kTraceApiCall, webrtc::kTraceVideo, ViEId(_instanceId), "%s",
WEBRTC_TRACE(webrtc::kTraceApiCall, webrtc::kTraceVideo, ViEId(instance_id_), "%s",
__FUNCTION__);
if (!IsInitialized())
if (!Initialized())
{
SetLastError(kViENotInitialized);
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo, ViEId(_instanceId),
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo, ViEId(instance_id_),
"%s - ViE instance %d not initialized", __FUNCTION__,
_instanceId);
instance_id_);
return -1;
}
if (_channelManager.CreateChannel(videoChannel) == -1)
if (channel_manager_.CreateChannel(videoChannel) == -1)
{
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo, ViEId(_instanceId),
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo, ViEId(instance_id_),
"%s: Could not create channel", __FUNCTION__);
videoChannel = -1;
SetLastError(kViEBaseChannelCreationFailed);
return -1;
}
WEBRTC_TRACE(webrtc::kTraceInfo, webrtc::kTraceVideo, ViEId(_instanceId),
WEBRTC_TRACE(webrtc::kTraceInfo, webrtc::kTraceVideo, ViEId(instance_id_),
"%s: channel created: %d", __FUNCTION__, videoChannel);
return 0;
}
@ -194,35 +194,35 @@ int ViEBaseImpl::CreateChannel(int& videoChannel)
int ViEBaseImpl::CreateChannel(int& videoChannel, int originalChannel)
{
if (!IsInitialized())
if (!Initialized())
{
SetLastError(kViENotInitialized);
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo, ViEId(_instanceId),
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo, ViEId(instance_id_),
"%s - ViE instance %d not initialized", __FUNCTION__,
_instanceId);
instance_id_);
return -1;
}
ViEChannelManagerScoped cs(_channelManager);
ViEChannelManagerScoped cs(channel_manager_);
if (!cs.Channel(originalChannel))
{
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo, ViEId(_instanceId),
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo, ViEId(instance_id_),
"%s - originalChannel does not exist.", __FUNCTION__,
_instanceId);
instance_id_);
SetLastError(kViEBaseInvalidChannelId);
return -1;
}
if (_channelManager.CreateChannel(videoChannel,
if (channel_manager_.CreateChannel(videoChannel,
originalChannel) == -1)
{
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo, ViEId(_instanceId),
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo, ViEId(instance_id_),
"%s: Could not create channel", __FUNCTION__);
videoChannel = -1;
SetLastError(kViEBaseChannelCreationFailed);
return -1;
}
WEBRTC_TRACE(webrtc::kTraceInfo, webrtc::kTraceVideo, ViEId(_instanceId),
WEBRTC_TRACE(webrtc::kTraceInfo, webrtc::kTraceVideo, ViEId(instance_id_),
"%s: channel created: %d", __FUNCTION__, videoChannel);
return 0;
}
@ -235,25 +235,25 @@ int ViEBaseImpl::CreateChannel(int& videoChannel, int originalChannel)
int ViEBaseImpl::DeleteChannel(const int videoChannel)
{
WEBRTC_TRACE(webrtc::kTraceApiCall, webrtc::kTraceVideo, ViEId(_instanceId), "%s(%d)",
WEBRTC_TRACE(webrtc::kTraceApiCall, webrtc::kTraceVideo, ViEId(instance_id_), "%s(%d)",
__FUNCTION__, videoChannel);
if (!IsInitialized())
if (!Initialized())
{
SetLastError(kViENotInitialized);
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo, ViEId(_instanceId),
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo, ViEId(instance_id_),
"%s - ViE instance %d not initialized", __FUNCTION__,
_instanceId);
instance_id_);
return -1;
}
{
ViEChannelManagerScoped cs(_channelManager);
ViEChannelManagerScoped cs(channel_manager_);
ViEChannel* vieChannel = cs.Channel(videoChannel);
if (vieChannel == NULL)
{
// No such channel
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo, ViEId(_instanceId),
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo, ViEId(instance_id_),
"%s: channel %d doesn't exist", __FUNCTION__,
videoChannel);
SetLastError(kViEBaseInvalidChannelId);
@ -267,7 +267,7 @@ int ViEBaseImpl::DeleteChannel(const int videoChannel)
// No other channels using this ViEEncoder.
// Disconnect the channel encoder from possible input.
// capture or file.
ViEInputManagerScoped is(_inputManager);
ViEInputManagerScoped is(input_manager_);
ViEFrameProviderBase* provider = is.FrameProvider(ptrViEEncoder);
if (provider)
{
@ -275,15 +275,15 @@ int ViEBaseImpl::DeleteChannel(const int videoChannel)
}
}
}
if (_channelManager.DeleteChannel(videoChannel) == -1)
if (channel_manager_.DeleteChannel(videoChannel) == -1)
{
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo, ViEId(_instanceId),
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo, ViEId(instance_id_),
"%s: Could not delete channel %d", __FUNCTION__,
videoChannel);
SetLastError(kViEBaseUnknownError);
return -1;
}
WEBRTC_TRACE(webrtc::kTraceInfo, webrtc::kTraceVideo, ViEId(_instanceId),
WEBRTC_TRACE(webrtc::kTraceInfo, webrtc::kTraceVideo, ViEId(instance_id_),
"%s: channel deleted: %d", __FUNCTION__, videoChannel);
return 0;
}
@ -297,29 +297,29 @@ int ViEBaseImpl::DeleteChannel(const int videoChannel)
int ViEBaseImpl::ConnectAudioChannel(const int videoChannel,
const int audioChannel)
{
WEBRTC_TRACE(webrtc::kTraceApiCall, webrtc::kTraceVideo, ViEId(_instanceId), "%s(%d)",
WEBRTC_TRACE(webrtc::kTraceApiCall, webrtc::kTraceVideo, ViEId(instance_id_), "%s(%d)",
__FUNCTION__, videoChannel);
if (!IsInitialized())
if (!Initialized())
{
SetLastError(kViENotInitialized);
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo, ViEId(_instanceId),
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo, ViEId(instance_id_),
"%s - ViE instance %d not initialized", __FUNCTION__,
_instanceId);
instance_id_);
return -1;
}
ViEChannelManagerScoped cs(_channelManager);
ViEChannelManagerScoped cs(channel_manager_);
if (cs.Channel(videoChannel) == NULL)
{
// No such channel
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo, ViEId(_instanceId),
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo, ViEId(instance_id_),
"%s: channel %d doesn't exist", __FUNCTION__, videoChannel);
SetLastError(kViEBaseInvalidChannelId);
return -1;
}
if (_channelManager.ConnectVoiceChannel(videoChannel, audioChannel) != 0)
if (channel_manager_.ConnectVoiceChannel(videoChannel, audioChannel) != 0)
{
SetLastError(kViEBaseVoEFailure);
return -1;
@ -335,27 +335,27 @@ int ViEBaseImpl::ConnectAudioChannel(const int videoChannel,
int ViEBaseImpl::DisconnectAudioChannel(const int videoChannel)
{
WEBRTC_TRACE(webrtc::kTraceApiCall, webrtc::kTraceVideo, ViEId(_instanceId), "%s(%d)",
WEBRTC_TRACE(webrtc::kTraceApiCall, webrtc::kTraceVideo, ViEId(instance_id_), "%s(%d)",
__FUNCTION__, videoChannel);
if (!IsInitialized())
if (!Initialized())
{
SetLastError(kViENotInitialized);
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo, ViEId(_instanceId),
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo, ViEId(instance_id_),
"%s - ViE instance %d not initialized", __FUNCTION__,
_instanceId);
instance_id_);
return -1;
}
ViEChannelManagerScoped cs(_channelManager);
ViEChannelManagerScoped cs(channel_manager_);
if (cs.Channel(videoChannel) == NULL)
{
// No such channel
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo, ViEId(_instanceId),
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo, ViEId(instance_id_),
"%s: channel %d doesn't exist", __FUNCTION__, videoChannel);
SetLastError(kViEBaseInvalidChannelId);
return -1;
}
if (_channelManager.DisconnectVoiceChannel(videoChannel) != 0)
if (channel_manager_.DisconnectVoiceChannel(videoChannel) != 0)
{
SetLastError(kViEBaseVoEFailure);
return -1;
@ -374,17 +374,17 @@ int ViEBaseImpl::DisconnectAudioChannel(const int videoChannel)
// ----------------------------------------------------------------------------
int ViEBaseImpl::StartSend(const int videoChannel)
{
WEBRTC_TRACE(webrtc::kTraceApiCall, webrtc::kTraceVideo, ViEId(_instanceId,
WEBRTC_TRACE(webrtc::kTraceApiCall, webrtc::kTraceVideo, ViEId(instance_id_,
videoChannel),
"%s(channel: %d)", __FUNCTION__, videoChannel);
ViEChannelManagerScoped cs(_channelManager);
ViEChannelManagerScoped cs(channel_manager_);
ViEChannel* ptrViEChannel = cs.Channel(videoChannel);
if (ptrViEChannel == NULL)
{
// The channel doesn't exists
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo,
ViEId(_instanceId, videoChannel),
ViEId(instance_id_, videoChannel),
"%s: Channel %d does not exist", __FUNCTION__, videoChannel);
SetLastError(kViEBaseInvalidChannelId);
return -1;
@ -394,7 +394,7 @@ int ViEBaseImpl::StartSend(const int videoChannel)
{
assert(false);
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo,
ViEId(_instanceId, videoChannel),
ViEId(instance_id_, videoChannel),
"%s: Could not find encoder for channel %d", __FUNCTION__,
videoChannel);
return -1;
@ -409,7 +409,7 @@ int ViEBaseImpl::StartSend(const int videoChannel)
ptrViEEncoder->Restart();
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo,
ViEId(_instanceId, videoChannel),
ViEId(instance_id_, videoChannel),
"%s: Could not start sending on channel %d", __FUNCTION__,
videoChannel);
if (error == kViEBaseAlreadySending)
@ -435,16 +435,16 @@ int ViEBaseImpl::StartSend(const int videoChannel)
int ViEBaseImpl::StopSend(const int videoChannel)
{
WEBRTC_TRACE(webrtc::kTraceApiCall, webrtc::kTraceVideo,
ViEId(_instanceId, videoChannel), "%s(channel: %d)",
ViEId(instance_id_, videoChannel), "%s(channel: %d)",
__FUNCTION__, videoChannel);
ViEChannelManagerScoped cs(_channelManager);
ViEChannelManagerScoped cs(channel_manager_);
ViEChannel* ptrViEChannel = cs.Channel(videoChannel);
if (ptrViEChannel == NULL)
{
// The channel doesn't exists
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo,
ViEId(_instanceId, videoChannel),
ViEId(instance_id_, videoChannel),
"%s: Channel %d does not exist", __FUNCTION__, videoChannel);
SetLastError(kViEBaseInvalidChannelId);
return -1;
@ -454,7 +454,7 @@ int ViEBaseImpl::StopSend(const int videoChannel)
if (error != 0)
{
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo,
ViEId(_instanceId, videoChannel),
ViEId(instance_id_, videoChannel),
"%s: Could not stop sending on channel %d", __FUNCTION__,
videoChannel);
if (error == kViEBaseNotSending)
@ -478,16 +478,16 @@ int ViEBaseImpl::StopSend(const int videoChannel)
int ViEBaseImpl::StartReceive(const int videoChannel)
{
WEBRTC_TRACE(webrtc::kTraceApiCall, webrtc::kTraceVideo,
ViEId(_instanceId, videoChannel), "%s(channel: %d)",
ViEId(instance_id_, videoChannel), "%s(channel: %d)",
__FUNCTION__, videoChannel);
ViEChannelManagerScoped cs(_channelManager);
ViEChannelManagerScoped cs(channel_manager_);
ViEChannel* ptrViEChannel = cs.Channel(videoChannel);
if (ptrViEChannel == NULL)
{
// The channel doesn't exists
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo,
ViEId(_instanceId, videoChannel),
ViEId(instance_id_, videoChannel),
"%s: Channel %d does not exist", __FUNCTION__, videoChannel);
SetLastError(kViEBaseInvalidChannelId);
return -1;
@ -495,7 +495,7 @@ int ViEBaseImpl::StartReceive(const int videoChannel)
if (ptrViEChannel->Receiving())
{
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo,
ViEId(_instanceId, videoChannel),
ViEId(instance_id_, videoChannel),
"%s: Channel %d already receive.", __FUNCTION__,
videoChannel);
SetLastError(kViEBaseAlreadyReceiving);
@ -517,16 +517,16 @@ int ViEBaseImpl::StartReceive(const int videoChannel)
int ViEBaseImpl::StopReceive(const int videoChannel)
{
WEBRTC_TRACE(webrtc::kTraceApiCall, webrtc::kTraceVideo,
ViEId(_instanceId, videoChannel), "%s(channel: %d)",
ViEId(instance_id_, videoChannel), "%s(channel: %d)",
__FUNCTION__, videoChannel);
ViEChannelManagerScoped cs(_channelManager);
ViEChannelManagerScoped cs(channel_manager_);
ViEChannel* ptrViEChannel = cs.Channel(videoChannel);
if (ptrViEChannel == NULL)
{
// The channel doesn't exists
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo,
ViEId(_instanceId, videoChannel),
ViEId(instance_id_, videoChannel),
"%s: Channel %d does not exist", __FUNCTION__, videoChannel);
SetLastError(kViEBaseInvalidChannelId);
return -1;
@ -551,14 +551,14 @@ int ViEBaseImpl::StopReceive(const int videoChannel)
int ViEBaseImpl::RegisterObserver(ViEBaseObserver& observer)
{
WEBRTC_TRACE(webrtc::kTraceApiCall, webrtc::kTraceVideo, ViEId(_instanceId),
WEBRTC_TRACE(webrtc::kTraceApiCall, webrtc::kTraceVideo, ViEId(instance_id_),
"%s", __FUNCTION__);
if (_viePerformanceMonitor.ViEBaseObserverRegistered())
if (vie_performance_monitor_.ViEBaseObserverRegistered())
{
SetLastError(kViEBaseObserverAlreadyRegistered);
return -1;
}
return _viePerformanceMonitor.Init(&observer);
return vie_performance_monitor_.Init(&observer);
}
// ----------------------------------------------------------------------------
@ -569,17 +569,17 @@ int ViEBaseImpl::RegisterObserver(ViEBaseObserver& observer)
int ViEBaseImpl::DeregisterObserver()
{
WEBRTC_TRACE(webrtc::kTraceApiCall, webrtc::kTraceVideo, ViEId(_instanceId),
WEBRTC_TRACE(webrtc::kTraceApiCall, webrtc::kTraceVideo, ViEId(instance_id_),
"%s", __FUNCTION__);
if (!_viePerformanceMonitor.ViEBaseObserverRegistered())
if (!vie_performance_monitor_.ViEBaseObserverRegistered())
{
SetLastError(kViEBaseObserverNotRegistered);
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo, _instanceId,
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo, instance_id_,
"%s No observer registered.", __FUNCTION__);
return -1;
}
_viePerformanceMonitor.Terminate();
vie_performance_monitor_.Terminate();
return 0;
}
@ -596,7 +596,7 @@ int ViEBaseImpl::DeregisterObserver()
int ViEBaseImpl::GetVersion(char version[1024])
{
WEBRTC_TRACE(webrtc::kTraceApiCall, webrtc::kTraceVideo, ViEId(_instanceId),
WEBRTC_TRACE(webrtc::kTraceApiCall, webrtc::kTraceVideo, ViEId(instance_id_),
"GetVersion(version=?)");
assert(kViEVersionMaxMessageSize == 1024);
@ -721,7 +721,7 @@ int ViEBaseImpl::GetVersion(char version[1024])
memcpy(version, versionBuf, accLen);
version[accLen] = '\0';
WEBRTC_TRACE(webrtc::kTraceStateInfo, webrtc::kTraceVideo, ViEId(_instanceId),
WEBRTC_TRACE(webrtc::kTraceStateInfo, webrtc::kTraceVideo, ViEId(instance_id_),
"GetVersion() => %s", version);
return 0;
}
@ -760,7 +760,7 @@ WebRtc_Word32 ViEBaseImpl::AddModuleVersion(webrtc::Module* module,
WebRtc_Word32 ViEBaseImpl::AddVCMVersion(char* str) const
{
webrtc::VideoCodingModule* vcmPtr =
webrtc::VideoCodingModule::Create(_instanceId);
webrtc::VideoCodingModule::Create(instance_id_);
int len = AddModuleVersion(vcmPtr, str);
webrtc::VideoCodingModule::Destroy(vcmPtr);
return len;
@ -774,7 +774,7 @@ WebRtc_Word32 ViEBaseImpl::AddVideoCaptureVersion(char* str) const
WebRtc_Word32 ViEBaseImpl::AddVideoProcessingVersion(char* str) const
{
webrtc::VideoProcessingModule* videoPtr =
webrtc::VideoProcessingModule::Create(_instanceId);
webrtc::VideoProcessingModule::Create(instance_id_);
int len = AddModuleVersion(videoPtr, str);
webrtc::VideoProcessingModule::Destroy(videoPtr);
return len;
@ -791,7 +791,7 @@ WebRtc_Word32 ViEBaseImpl::AddSocketModuleVersion(char* str) const
WebRtc_UWord8 numSockThreads(1);
UdpTransport* socketPtr =
UdpTransport::Create(
_instanceId, numSockThreads);
instance_id_, numSockThreads);
int len = AddModuleVersion(socketPtr, str);
UdpTransport::Destroy(socketPtr);
return len;

View File

@ -59,19 +59,19 @@ ViECapture* ViECapture::GetInterface(VideoEngine* videoEngine)
int ViECaptureImpl::Release()
{
WEBRTC_TRACE(webrtc::kTraceApiCall, webrtc::kTraceVideo, _instanceId,
WEBRTC_TRACE(webrtc::kTraceApiCall, webrtc::kTraceVideo, instance_id_,
"ViECapture::Release()");
(*this)--; // Decrease ref count
WebRtc_Word32 refCount = GetCount();
if (refCount < 0)
{
WEBRTC_TRACE(webrtc::kTraceWarning, webrtc::kTraceVideo, _instanceId,
WEBRTC_TRACE(webrtc::kTraceWarning, webrtc::kTraceVideo, instance_id_,
"ViECapture release too many times");
SetLastError(kViEAPIDoesNotExist);
return -1;
}
WEBRTC_TRACE(webrtc::kTraceInfo, webrtc::kTraceVideo, _instanceId,
WEBRTC_TRACE(webrtc::kTraceInfo, webrtc::kTraceVideo, instance_id_,
"ViECapture reference count: %d", refCount);
return refCount;
}
@ -82,7 +82,7 @@ int ViECaptureImpl::Release()
ViECaptureImpl::ViECaptureImpl()
{
WEBRTC_TRACE(webrtc::kTraceMemory, webrtc::kTraceVideo, _instanceId,
WEBRTC_TRACE(webrtc::kTraceMemory, webrtc::kTraceVideo, instance_id_,
"ViECaptureImpl::ViECaptureImpl() Ctor");
}
@ -92,7 +92,7 @@ ViECaptureImpl::ViECaptureImpl()
ViECaptureImpl::~ViECaptureImpl()
{
WEBRTC_TRACE(webrtc::kTraceMemory, webrtc::kTraceVideo, _instanceId,
WEBRTC_TRACE(webrtc::kTraceMemory, webrtc::kTraceVideo, instance_id_,
"ViECaptureImpl::~ViECaptureImpl() Dtor");
}
@ -107,17 +107,17 @@ ViECaptureImpl::~ViECaptureImpl()
// ----------------------------------------------------------------------------
int ViECaptureImpl::NumberOfCaptureDevices()
{
WEBRTC_TRACE(webrtc::kTraceApiCall, webrtc::kTraceVideo, ViEId(_instanceId), "%s",
WEBRTC_TRACE(webrtc::kTraceApiCall, webrtc::kTraceVideo, ViEId(instance_id_), "%s",
__FUNCTION__);
if (!IsInitialized())
if (!Initialized())
{
SetLastError(kViENotInitialized);
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo, ViEId(_instanceId),
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo, ViEId(instance_id_),
"%s - ViE instance %d not initialized", __FUNCTION__,
_instanceId);
instance_id_);
return -1;
}
return _inputManager.NumberOfCaptureDevices();
return input_manager_.NumberOfCaptureDevices();
}
// ----------------------------------------------------------------------------
@ -131,17 +131,17 @@ int ViECaptureImpl::GetCaptureDevice(unsigned int listNumber,
char* uniqueIdUTF8,
unsigned int uniqueIdUTF8Length)
{
WEBRTC_TRACE(webrtc::kTraceApiCall, webrtc::kTraceVideo, ViEId(_instanceId),
WEBRTC_TRACE(webrtc::kTraceApiCall, webrtc::kTraceVideo, ViEId(instance_id_),
"%s(listNumber: %d)", __FUNCTION__, listNumber);
if (!IsInitialized())
if (!Initialized())
{
SetLastError(kViENotInitialized);
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo, ViEId(_instanceId),
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo, ViEId(instance_id_),
"%s - ViE instance %d not initialized", __FUNCTION__,
_instanceId);
instance_id_);
return -1;
}
return _inputManager.GetDeviceName(listNumber,
return input_manager_.GetDeviceName(listNumber,
(WebRtc_UWord8*) deviceNameUTF8,
deviceNameUTF8Length,
(WebRtc_UWord8*) uniqueIdUTF8,
@ -163,19 +163,19 @@ int ViECaptureImpl::AllocateCaptureDevice(
const unsigned int uniqueIdUTF8Length,
int& captureId)
{
WEBRTC_TRACE(webrtc::kTraceApiCall, webrtc::kTraceVideo, ViEId(_instanceId),
WEBRTC_TRACE(webrtc::kTraceApiCall, webrtc::kTraceVideo, ViEId(instance_id_),
"%s(uniqueIdUTF8: %s)", __FUNCTION__, uniqueIdUTF8);
if (!IsInitialized())
if (!Initialized())
{
SetLastError(kViENotInitialized);
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo, ViEId(_instanceId),
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo, ViEId(instance_id_),
"%s - ViE instance %d not initialized", __FUNCTION__,
_instanceId);
instance_id_);
return -1;
}
const WebRtc_Word32
result =
_inputManager.CreateCaptureDevice(
input_manager_.CreateCaptureDevice(
(const WebRtc_UWord8*) uniqueIdUTF8,
(const WebRtc_UWord32) uniqueIdUTF8Length, captureId);
if (result != 0)
@ -195,19 +195,19 @@ int ViECaptureImpl::AllocateCaptureDevice(
int ViECaptureImpl::AllocateExternalCaptureDevice(
int& captureId, ViEExternalCapture*& externalCapture)
{
WEBRTC_TRACE(webrtc::kTraceApiCall, webrtc::kTraceVideo, ViEId(_instanceId), "%s",
WEBRTC_TRACE(webrtc::kTraceApiCall, webrtc::kTraceVideo, ViEId(instance_id_), "%s",
__FUNCTION__);
if (!IsInitialized())
if (!Initialized())
{
SetLastError(kViENotInitialized);
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo, ViEId(_instanceId),
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo, ViEId(instance_id_),
"%s - ViE instance %d not initialized", __FUNCTION__,
_instanceId);
instance_id_);
return -1;
}
const WebRtc_Word32 result =
_inputManager.CreateExternalCaptureDevice(externalCapture, captureId);
input_manager_.CreateExternalCaptureDevice(externalCapture, captureId);
if (result != 0)
{
@ -226,19 +226,19 @@ int ViECaptureImpl::AllocateExternalCaptureDevice(
int ViECaptureImpl::AllocateCaptureDevice(VideoCaptureModule& captureModule,
int& captureId)
{
WEBRTC_TRACE(webrtc::kTraceApiCall, webrtc::kTraceVideo, ViEId(_instanceId), "%s",
WEBRTC_TRACE(webrtc::kTraceApiCall, webrtc::kTraceVideo, ViEId(instance_id_), "%s",
__FUNCTION__);
if (!IsInitialized())
if (!Initialized())
{
SetLastError(kViENotInitialized);
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo, ViEId(_instanceId),
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo, ViEId(instance_id_),
"%s - ViE instance %d not initialized", __FUNCTION__,
_instanceId);
instance_id_);
return -1;
}
const WebRtc_Word32 result =
_inputManager.CreateCaptureDevice(captureModule, captureId);
input_manager_.CreateCaptureDevice(captureModule, captureId);
if (result != 0)
{
SetLastError(result);
@ -254,15 +254,15 @@ int ViECaptureImpl::AllocateCaptureDevice(VideoCaptureModule& captureModule,
// ----------------------------------------------------------------------------
int ViECaptureImpl::ReleaseCaptureDevice(const int captureId)
{
WEBRTC_TRACE(webrtc::kTraceApiCall, webrtc::kTraceVideo, ViEId(_instanceId),
WEBRTC_TRACE(webrtc::kTraceApiCall, webrtc::kTraceVideo, ViEId(instance_id_),
"%s(captureId: %d)", __FUNCTION__, captureId);
{
ViEInputManagerScoped is(_inputManager);
ViEInputManagerScoped is(input_manager_);
ViECapturer* ptrViECapture = is.Capture(captureId);
if (ptrViECapture == NULL)
{
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo, ViEId(_instanceId),
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo, ViEId(instance_id_),
"%s: Capture device %d doesn't exist", __FUNCTION__,
captureId);
SetLastError(kViECaptureDeviceDoesNotExist);
@ -272,7 +272,7 @@ int ViECaptureImpl::ReleaseCaptureDevice(const int captureId)
}
// Destroy the capture device
return _inputManager.DestroyCaptureDevice(captureId);
return input_manager_.DestroyCaptureDevice(captureId);
}
// ============================================================================
@ -290,28 +290,28 @@ int ViECaptureImpl::ConnectCaptureDevice(const int captureId,
const int videoChannel)
{
WEBRTC_TRACE(webrtc::kTraceApiCall, webrtc::kTraceVideo,
ViEId(_instanceId, videoChannel),
ViEId(instance_id_, videoChannel),
"%s(captureId: %d, videoChannel: %d)", __FUNCTION__, captureId,
videoChannel);
ViEInputManagerScoped is(_inputManager);
ViEInputManagerScoped is(input_manager_);
ViECapturer* ptrViECapture = is.Capture(captureId);
if (ptrViECapture == NULL)
{
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo,
ViEId(_instanceId, videoChannel),
ViEId(instance_id_, videoChannel),
"%s: Capture device %d doesn't exist", __FUNCTION__,
captureId);
SetLastError(kViECaptureDeviceDoesNotExist);
return -1;
}
ViEChannelManagerScoped cs(_channelManager);
ViEChannelManagerScoped cs(channel_manager_);
ViEEncoder* ptrViEEncoder = cs.Encoder(videoChannel);
if (ptrViEEncoder == NULL)
{
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo,
ViEId(_instanceId, videoChannel),
ViEId(instance_id_, videoChannel),
"%s: Channel %d doesn't exist", __FUNCTION__,
videoChannel);
SetLastError(kViECaptureDeviceInvalidChannelId);
@ -321,7 +321,7 @@ int ViECaptureImpl::ConnectCaptureDevice(const int captureId,
if (is.FrameProvider(ptrViEEncoder) != NULL)
{
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo,
ViEId(_instanceId, videoChannel),
ViEId(instance_id_, videoChannel),
"%s: Channel %d already connected to a capture device.",
__FUNCTION__, videoChannel);
SetLastError(kViECaptureDeviceAlreadyConnected);
@ -357,25 +357,25 @@ int ViECaptureImpl::ConnectCaptureDevice(const int captureId,
int ViECaptureImpl::DisconnectCaptureDevice(const int videoChannel)
{
WEBRTC_TRACE(webrtc::kTraceApiCall, webrtc::kTraceVideo,
ViEId(_instanceId, videoChannel), "%s(videoChannel: %d)",
ViEId(instance_id_, videoChannel), "%s(videoChannel: %d)",
__FUNCTION__, videoChannel);
ViEChannelManagerScoped cs(_channelManager);
ViEChannelManagerScoped cs(channel_manager_);
ViEEncoder* ptrViEEncoder = cs.Encoder(videoChannel);
if (ptrViEEncoder == NULL)
{
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo, ViEId(_instanceId),
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo, ViEId(instance_id_),
"%s: Channel %d doesn't exist", __FUNCTION__,
videoChannel);
SetLastError(kViECaptureDeviceInvalidChannelId);
return -1;
}
ViEInputManagerScoped is(_inputManager);
ViEInputManagerScoped is(input_manager_);
ViEFrameProviderBase* frameProvider = is.FrameProvider(ptrViEEncoder);
if (!frameProvider)
{
WEBRTC_TRACE(webrtc::kTraceWarning, webrtc::kTraceVideo, ViEId(_instanceId),
WEBRTC_TRACE(webrtc::kTraceWarning, webrtc::kTraceVideo, ViEId(instance_id_),
"%s: No capture device connected to channel %d",
__FUNCTION__, videoChannel);
SetLastError(kViECaptureDeviceNotConnected);
@ -384,7 +384,7 @@ int ViECaptureImpl::DisconnectCaptureDevice(const int videoChannel)
if (frameProvider->Id() < kViECaptureIdBase
|| frameProvider->Id() > kViECaptureIdMax)
{
WEBRTC_TRACE(webrtc::kTraceWarning, webrtc::kTraceVideo, ViEId(_instanceId),
WEBRTC_TRACE(webrtc::kTraceWarning, webrtc::kTraceVideo, ViEId(instance_id_),
"%s: No capture device connected to channel %d",
__FUNCTION__, videoChannel);
SetLastError(kViECaptureDeviceNotConnected);
@ -413,15 +413,15 @@ int ViECaptureImpl::DisconnectCaptureDevice(const int videoChannel)
int ViECaptureImpl::StartCapture(const int captureId,
const CaptureCapability captureCapability)
{
WEBRTC_TRACE(webrtc::kTraceApiCall, webrtc::kTraceVideo, ViEId(_instanceId),
WEBRTC_TRACE(webrtc::kTraceApiCall, webrtc::kTraceVideo, ViEId(instance_id_),
"%s(captureId: %d)", __FUNCTION__, captureId);
ViEInputManagerScoped is(_inputManager);
ViEInputManagerScoped is(input_manager_);
ViECapturer* ptrViECapture = is.Capture(captureId);
if (ptrViECapture == NULL)
{
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo,
ViEId(_instanceId, captureId),
ViEId(instance_id_, captureId),
"%s: Capture device %d doesn't exist", __FUNCTION__,
captureId);
SetLastError(kViECaptureDeviceDoesNotExist);
@ -447,15 +447,15 @@ int ViECaptureImpl::StartCapture(const int captureId,
// ----------------------------------------------------------------------------
int ViECaptureImpl::StopCapture(const int captureId)
{
WEBRTC_TRACE(webrtc::kTraceApiCall, webrtc::kTraceVideo, ViEId(_instanceId),
WEBRTC_TRACE(webrtc::kTraceApiCall, webrtc::kTraceVideo, ViEId(instance_id_),
"%s(captureId: %d)", __FUNCTION__, captureId);
ViEInputManagerScoped is(_inputManager);
ViEInputManagerScoped is(input_manager_);
ViECapturer* ptrViECapture = is.Capture(captureId);
if (ptrViECapture == NULL)
{
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo,
ViEId(_instanceId, captureId),
ViEId(instance_id_, captureId),
"%s: Capture device %d doesn't exist", __FUNCTION__,
captureId);
SetLastError(kViECaptureDeviceDoesNotExist);
@ -502,15 +502,15 @@ int ViECaptureImpl::SetRotateCapturedFrames(const int captureId,
break;
}
WEBRTC_TRACE(webrtc::kTraceApiCall, webrtc::kTraceVideo, ViEId(_instanceId),
WEBRTC_TRACE(webrtc::kTraceApiCall, webrtc::kTraceVideo, ViEId(instance_id_),
"%s(rotation: %d)", __FUNCTION__, iRotation);
ViEInputManagerScoped is(_inputManager);
ViEInputManagerScoped is(input_manager_);
ViECapturer* ptrViECapture = is.Capture(captureId);
if (ptrViECapture == NULL)
{
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo,
ViEId(_instanceId, captureId),
ViEId(instance_id_, captureId),
"%s: Capture device %d doesn't exist", __FUNCTION__,
captureId);
SetLastError(kViECaptureDeviceDoesNotExist);
@ -536,16 +536,16 @@ int ViECaptureImpl::SetRotateCapturedFrames(const int captureId,
int ViECaptureImpl::SetCaptureDelay(const int captureId,
const unsigned int captureDelayMs)
{
WEBRTC_TRACE(webrtc::kTraceApiCall, webrtc::kTraceVideo, ViEId(_instanceId),
WEBRTC_TRACE(webrtc::kTraceApiCall, webrtc::kTraceVideo, ViEId(instance_id_),
"%s(captureId: %d, captureDelayMs %u)", __FUNCTION__,
captureId, captureDelayMs);
ViEInputManagerScoped is(_inputManager);
ViEInputManagerScoped is(input_manager_);
ViECapturer* ptrViECapture = is.Capture(captureId);
if (ptrViECapture == NULL)
{
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo,
ViEId(_instanceId, captureId),
ViEId(instance_id_, captureId),
"%s: Capture device %d doesn't exist", __FUNCTION__,
captureId);
SetLastError(kViECaptureDeviceDoesNotExist);
@ -573,7 +573,7 @@ int ViECaptureImpl::SetCaptureDelay(const int captureId,
int ViECaptureImpl::NumberOfCapabilities(const char* uniqueIdUTF8,
const unsigned int uniqueIdUTF8Length)
{
WEBRTC_TRACE(webrtc::kTraceApiCall, webrtc::kTraceVideo, ViEId(_instanceId),
WEBRTC_TRACE(webrtc::kTraceApiCall, webrtc::kTraceVideo, ViEId(instance_id_),
"%s(captureDeviceName: %s)", __FUNCTION__, uniqueIdUTF8);
#if defined(WEBRTC_MAC_INTEL)
@ -582,22 +582,22 @@ int ViECaptureImpl::NumberOfCapabilities(const char* uniqueIdUTF8,
// automatically (mandatory).
// Thus this function cannot be supported on the Mac platform.
SetLastError(kViECaptureDeviceMacQtkitNotSupported);
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo, ViEId(_instanceId),
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo, ViEId(instance_id_),
"%s This API is not supported on Mac OS", __FUNCTION__,
_instanceId);
instance_id_);
return -1;
#endif
if (!IsInitialized())
if (!Initialized())
{
SetLastError(kViENotInitialized);
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo, ViEId(_instanceId),
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo, ViEId(instance_id_),
"%s - ViE instance %d not initialized", __FUNCTION__,
_instanceId);
instance_id_);
return -1;
}
return (int) _inputManager.NumberOfCaptureCapabilities(
return (int) input_manager_.NumberOfCaptureCapabilities(
(WebRtc_UWord8*) uniqueIdUTF8);
}
@ -611,7 +611,7 @@ int ViECaptureImpl::GetCaptureCapability(const char* uniqueIdUTF8,
const unsigned int capabilityNumber,
CaptureCapability& capability)
{
WEBRTC_TRACE(webrtc::kTraceApiCall, webrtc::kTraceVideo, ViEId(_instanceId),
WEBRTC_TRACE(webrtc::kTraceApiCall, webrtc::kTraceVideo, ViEId(instance_id_),
"%s(captureDeviceName: %s)", __FUNCTION__, uniqueIdUTF8);
#if defined(WEBRTC_MAC_INTEL)
@ -620,21 +620,21 @@ int ViECaptureImpl::GetCaptureCapability(const char* uniqueIdUTF8,
// automatically (mandatory).
// Thus this function cannot be supported on the Mac platform.
SetLastError(kViECaptureDeviceMacQtkitNotSupported);
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo, ViEId(_instanceId),
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo, ViEId(instance_id_),
"%s This API is not supported on Mac OS", __FUNCTION__,
_instanceId);
instance_id_);
return -1;
#endif
if (!IsInitialized())
if (!Initialized())
{
SetLastError(kViENotInitialized);
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo, ViEId(_instanceId),
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo, ViEId(instance_id_),
"%s - ViE instance %d not initialized", __FUNCTION__,
_instanceId);
instance_id_);
return -1;
}
if (_inputManager.GetCaptureCapability((WebRtc_UWord8*) uniqueIdUTF8,
if (input_manager_.GetCaptureCapability((WebRtc_UWord8*) uniqueIdUTF8,
capabilityNumber, capability) != 0)
{
SetLastError(kViECaptureDeviceUnknownError);
@ -654,16 +654,16 @@ int ViECaptureImpl::ShowCaptureSettingsDialogBox(
// automatically (mandatory).
// Thus this function cannot be supported on the Mac platform.
SetLastError(kViECaptureDeviceMacQtkitNotSupported);
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo, ViEId(_instanceId),
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo, ViEId(instance_id_),
"%s This API is not supported on Mac OS", __FUNCTION__,
_instanceId);
instance_id_);
return -1;
#endif
WEBRTC_TRACE(webrtc::kTraceApiCall, webrtc::kTraceVideo, ViEId(_instanceId),
WEBRTC_TRACE(webrtc::kTraceApiCall, webrtc::kTraceVideo, ViEId(instance_id_),
"%s captureId (captureDeviceName: %s)", __FUNCTION__,
uniqueIdUTF8);
return _inputManager.DisplayCaptureSettingsDialogBox(
return input_manager_.DisplayCaptureSettingsDialogBox(
(WebRtc_UWord8*) uniqueIdUTF8, (WebRtc_UWord8*) dialogTitle,
parentWindow, x, y);
}
@ -671,18 +671,18 @@ int ViECaptureImpl::ShowCaptureSettingsDialogBox(
int ViECaptureImpl::GetOrientation(const char* uniqueIdUTF8,
RotateCapturedFrame &orientation)
{
WEBRTC_TRACE(webrtc::kTraceApiCall, webrtc::kTraceVideo, ViEId(_instanceId),
WEBRTC_TRACE(webrtc::kTraceApiCall, webrtc::kTraceVideo, ViEId(instance_id_),
"%s (captureDeviceName: %s)", __FUNCTION__, uniqueIdUTF8);
if (!IsInitialized())
if (!Initialized())
{
SetLastError(kViENotInitialized);
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo, ViEId(_instanceId),
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo, ViEId(instance_id_),
"%s - ViE instance %d not initialized", __FUNCTION__,
_instanceId);
instance_id_);
return -1;
}
if (_inputManager.GetOrientation((WebRtc_UWord8*) uniqueIdUTF8,
if (input_manager_.GetOrientation((WebRtc_UWord8*) uniqueIdUTF8,
orientation) != 0)
{
SetLastError(kViECaptureDeviceUnknownError);
@ -703,12 +703,12 @@ int ViECaptureImpl::GetOrientation(const char* uniqueIdUTF8,
int ViECaptureImpl::EnableBrightnessAlarm(const int captureId,
const bool enable)
{
ViEInputManagerScoped is(_inputManager);
ViEInputManagerScoped is(input_manager_);
ViECapturer* ptrViECapture = is.Capture(captureId);
if (ptrViECapture == NULL)
{
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo,
ViEId(_instanceId, captureId),
ViEId(instance_id_, captureId),
"%s: Capture device %d doesn't exist", __FUNCTION__,
captureId);
SetLastError(kViECaptureDeviceDoesNotExist);
@ -730,12 +730,12 @@ int ViECaptureImpl::EnableBrightnessAlarm(const int captureId,
int ViECaptureImpl::RegisterObserver(const int captureId,
ViECaptureObserver& observer)
{
ViEInputManagerScoped is(_inputManager);
ViEInputManagerScoped is(input_manager_);
ViECapturer* ptrViECapture = is.Capture(captureId);
if (ptrViECapture == NULL)
{
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo,
ViEId(_instanceId, captureId),
ViEId(instance_id_, captureId),
"%s: Capture device %d doesn't exist", __FUNCTION__,
captureId);
SetLastError(kViECaptureDeviceDoesNotExist);
@ -744,7 +744,7 @@ int ViECaptureImpl::RegisterObserver(const int captureId,
if (ptrViECapture->IsObserverRegistered())
{
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo,
ViEId(_instanceId, captureId),
ViEId(instance_id_, captureId),
"%s: Observer already registered", __FUNCTION__);
SetLastError(kViECaptureObserverAlreadyRegistered);
return -1;
@ -765,12 +765,12 @@ int ViECaptureImpl::RegisterObserver(const int captureId,
// ----------------------------------------------------------------------------
int ViECaptureImpl::DeregisterObserver(const int captureId)
{
ViEInputManagerScoped is(_inputManager);
ViEInputManagerScoped is(input_manager_);
ViECapturer* ptrViECapture = is.Capture(captureId);
if (ptrViECapture == NULL)
{
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo,
ViEId(_instanceId, captureId),
ViEId(instance_id_, captureId),
"%s: Capture device %d doesn't exist", __FUNCTION__,
captureId);
SetLastError(kViECaptureDeviceDoesNotExist);

View File

@ -63,19 +63,19 @@ ViECodec* ViECodec::GetInterface(VideoEngine* videoEngine)
int ViECodecImpl::Release()
{
WEBRTC_TRACE(webrtc::kTraceApiCall, webrtc::kTraceVideo, _instanceId,
WEBRTC_TRACE(webrtc::kTraceApiCall, webrtc::kTraceVideo, instance_id_,
"ViECodecImpl::Release()");
(*this)--; // Decrease ref count
WebRtc_Word32 refCount = GetCount();
if (refCount < 0)
{
WEBRTC_TRACE(webrtc::kTraceWarning, webrtc::kTraceVideo, _instanceId,
WEBRTC_TRACE(webrtc::kTraceWarning, webrtc::kTraceVideo, instance_id_,
"ViECodec released too many times");
SetLastError(kViEAPIDoesNotExist);
return -1;
}
WEBRTC_TRACE(webrtc::kTraceInfo, webrtc::kTraceVideo, _instanceId,
WEBRTC_TRACE(webrtc::kTraceInfo, webrtc::kTraceVideo, instance_id_,
"ViECodec reference count: %d", refCount);
return refCount;
}
@ -86,7 +86,7 @@ int ViECodecImpl::Release()
ViECodecImpl::ViECodecImpl()
{
WEBRTC_TRACE(webrtc::kTraceMemory, webrtc::kTraceVideo, _instanceId,
WEBRTC_TRACE(webrtc::kTraceMemory, webrtc::kTraceVideo, instance_id_,
"ViECodecImpl::ViECodecImpl() Ctor");
}
@ -96,7 +96,7 @@ ViECodecImpl::ViECodecImpl()
ViECodecImpl::~ViECodecImpl()
{
WEBRTC_TRACE(webrtc::kTraceMemory, webrtc::kTraceVideo, _instanceId,
WEBRTC_TRACE(webrtc::kTraceMemory, webrtc::kTraceVideo, instance_id_,
"ViECodecImpl::~ViECodecImpl() Dtor");
}
@ -109,7 +109,7 @@ ViECodecImpl::~ViECodecImpl()
int ViECodecImpl::NumberOfCodecs() const
{
WEBRTC_TRACE(webrtc::kTraceApiCall, webrtc::kTraceVideo, ViEId(_instanceId), "%s",
WEBRTC_TRACE(webrtc::kTraceApiCall, webrtc::kTraceVideo, ViEId(instance_id_), "%s",
__FUNCTION__);
// +2 because of FEC(RED and ULPFEC)
return (int) (VideoCodingModule::NumberOfCodecs() + 2);
@ -124,7 +124,7 @@ int ViECodecImpl::NumberOfCodecs() const
int ViECodecImpl::GetCodec(const unsigned char listNumber,
VideoCodec& videoCodec) const
{
WEBRTC_TRACE(webrtc::kTraceApiCall, webrtc::kTraceVideo, ViEId(_instanceId),
WEBRTC_TRACE(webrtc::kTraceApiCall, webrtc::kTraceVideo, ViEId(instance_id_),
"%s(listNumber: %d, codecType: %d)", __FUNCTION__,
listNumber, videoCodec.codecType);
if (listNumber == VideoCodingModule::NumberOfCodecs())
@ -144,7 +144,7 @@ int ViECodecImpl::GetCodec(const unsigned char listNumber,
else if (VideoCodingModule::Codec(listNumber, &videoCodec)
!= VCM_OK)
{
WEBRTC_TRACE(webrtc::kTraceApiCall, webrtc::kTraceVideo, ViEId(_instanceId),
WEBRTC_TRACE(webrtc::kTraceApiCall, webrtc::kTraceVideo, ViEId(instance_id_),
"%s: Could not get codec for listNumber: %u", __FUNCTION__,
listNumber);
SetLastError(kViECodecInvalidArgument);
@ -165,10 +165,10 @@ int ViECodecImpl::SetSendCodec(const int videoChannel,
const VideoCodec& videoCodec)
{
WEBRTC_TRACE(webrtc::kTraceApiCall, webrtc::kTraceVideo,
ViEId(_instanceId,videoChannel),
ViEId(instance_id_,videoChannel),
"%s(videoChannel: %d, codecType: %d)", __FUNCTION__,
videoChannel, videoCodec.codecType);
WEBRTC_TRACE(webrtc::kTraceInfo, webrtc::kTraceVideo, ViEId(_instanceId, videoChannel),
WEBRTC_TRACE(webrtc::kTraceInfo, webrtc::kTraceVideo, ViEId(instance_id_, videoChannel),
"%s: codec: %d, plType: %d, width: %d, height: %d, bitrate: %d"
"maxBr: %d, minBr: %d, frameRate: %d)", __FUNCTION__,
videoCodec.codecType, videoCodec.plType, videoCodec.width,
@ -183,12 +183,12 @@ int ViECodecImpl::SetSendCodec(const int videoChannel,
return -1;
}
ViEChannelManagerScoped cs(_channelManager);
ViEChannelManagerScoped cs(channel_manager_);
ViEChannel* vieChannel = cs.Channel(videoChannel);
if (vieChannel == NULL)
{
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo,
ViEId(_instanceId, videoChannel), "%s: No channel %d",
ViEId(instance_id_, videoChannel), "%s: No channel %d",
__FUNCTION__, videoChannel);
SetLastError(kViECodecInvalidChannelId);
return -1;
@ -208,7 +208,7 @@ int ViECodecImpl::SetSendCodec(const int videoChannel,
// ... but should'nt limit the set start bitrate.
videoCodecInternal.maxBitrate = videoCodecInternal.startBitrate;
}
WEBRTC_TRACE(webrtc::kTraceInfo, webrtc::kTraceVideo, ViEId(_instanceId,
WEBRTC_TRACE(webrtc::kTraceInfo, webrtc::kTraceVideo, ViEId(instance_id_,
videoChannel),
"%s: New max bitrate set to %d kbps", __FUNCTION__,
videoCodecInternal.maxBitrate);
@ -219,7 +219,7 @@ int ViECodecImpl::SetSendCodec(const int videoChannel,
{
assert(false);
WEBRTC_TRACE(webrtc::kTraceInfo, webrtc::kTraceVideo,
ViEId(_instanceId, videoChannel),
ViEId(instance_id_, videoChannel),
"%s: No encoder found for channel %d", __FUNCTION__);
SetLastError(kViECodecInvalidChannelId);
return -1;
@ -240,7 +240,7 @@ int ViECodecImpl::SetSendCodec(const int videoChannel,
// We don't allow changing codec type or size when several
// channels share encoder.
WEBRTC_TRACE(webrtc::kTraceInfo, webrtc::kTraceVideo,
ViEId(_instanceId, videoChannel),
ViEId(instance_id_, videoChannel),
"%s: Settings differs from other channels using encoder",
__FUNCTION__);
SetLastError(kViECodecInUse);
@ -254,7 +254,7 @@ int ViECodecImpl::SetSendCodec(const int videoChannel,
{
// We don't allow simulcast channels to share encoder
WEBRTC_TRACE(webrtc::kTraceInfo, webrtc::kTraceVideo,
ViEId(_instanceId, videoChannel),
ViEId(instance_id_, videoChannel),
"%s: Can't share simulcast encoder",
__FUNCTION__);
SetLastError(kViECodecInUse);
@ -262,7 +262,7 @@ int ViECodecImpl::SetSendCodec(const int videoChannel,
}
}
ViEInputManagerScoped is(_inputManager);
ViEInputManagerScoped is(input_manager_);
ViEFrameProviderBase* frameProvider = NULL;
// Stop the media flow while reconfiguring
@ -290,7 +290,7 @@ int ViECodecImpl::SetSendCodec(const int videoChannel,
&& vieEncoder->SetEncoder(videoCodecInternal) != 0)
{
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo,
ViEId(_instanceId, videoChannel),
ViEId(instance_id_, videoChannel),
"%s: Could not change encoder for channel %d", __FUNCTION__,
videoChannel);
SetLastError(kViECodecUnknownError);
@ -301,7 +301,7 @@ int ViECodecImpl::SetSendCodec(const int videoChannel,
if (vieChannel->SetSendCodec(videoCodecInternal, newRtpStream) != 0)
{
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo,
ViEId(_instanceId, videoChannel),
ViEId(instance_id_, videoChannel),
"%s: Could not set send codec for channel %d", __FUNCTION__,
videoChannel);
SetLastError(kViECodecUnknownError);
@ -336,15 +336,15 @@ int ViECodecImpl::GetSendCodec(const int videoChannel,
VideoCodec& videoCodec) const
{
WEBRTC_TRACE(webrtc::kTraceApiCall, webrtc::kTraceVideo,
ViEId(_instanceId, videoChannel), "%s(videoChannel: %d)",
ViEId(instance_id_, videoChannel), "%s(videoChannel: %d)",
__FUNCTION__, videoChannel);
ViEChannelManagerScoped cs(_channelManager);
ViEChannelManagerScoped cs(channel_manager_);
ViEEncoder* vieEncoder = cs.Encoder(videoChannel);
if (vieEncoder == NULL)
{
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo,
ViEId(_instanceId, videoChannel),
ViEId(instance_id_, videoChannel),
"%s: No encoder for channel %d", __FUNCTION__, videoChannel);
SetLastError(kViECodecInvalidChannelId);
return -1;
@ -363,10 +363,10 @@ int ViECodecImpl::SetReceiveCodec(const int videoChannel,
const VideoCodec& videoCodec)
{
WEBRTC_TRACE(webrtc::kTraceApiCall, webrtc::kTraceVideo,
ViEId(_instanceId, videoChannel),
ViEId(instance_id_, videoChannel),
"%s(videoChannel: %d, codecType: %d)", __FUNCTION__,
videoChannel, videoCodec.codecType);
WEBRTC_TRACE(webrtc::kTraceInfo, webrtc::kTraceVideo, ViEId(_instanceId, videoChannel),
WEBRTC_TRACE(webrtc::kTraceInfo, webrtc::kTraceVideo, ViEId(instance_id_, videoChannel),
"%s: codec: %d, plType: %d, width: %d, height: %d, bitrate: %d,"
"maxBr: %d, minBr: %d, frameRate: %d", __FUNCTION__,
videoCodec.codecType, videoCodec.plType, videoCodec.width,
@ -381,12 +381,12 @@ int ViECodecImpl::SetReceiveCodec(const int videoChannel,
return -1;
}
ViEChannelManagerScoped cs(_channelManager);
ViEChannelManagerScoped cs(channel_manager_);
ViEChannel* vieChannel = cs.Channel(videoChannel);
if (vieChannel == NULL)
{
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo,
ViEId(_instanceId, videoChannel), "%s: No channel %d",
ViEId(instance_id_, videoChannel), "%s: No channel %d",
__FUNCTION__, videoChannel);
SetLastError(kViECodecInvalidChannelId);
return -1;
@ -394,7 +394,7 @@ int ViECodecImpl::SetReceiveCodec(const int videoChannel,
if (vieChannel->SetReceiveCodec(videoCodec) != 0)
{
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo, ViEId(_instanceId,
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo, ViEId(instance_id_,
videoChannel),
"%s: Could not set receive codec for channel %d",
__FUNCTION__, videoChannel);
@ -415,16 +415,16 @@ int ViECodecImpl::GetReceiveCodec(const int videoChannel,
VideoCodec& videoCodec) const
{
WEBRTC_TRACE(webrtc::kTraceApiCall, webrtc::kTraceVideo,
ViEId(_instanceId, videoChannel),
ViEId(instance_id_, videoChannel),
"%s(videoChannel: %d, codecType: %d)", __FUNCTION__,
videoChannel, videoCodec.codecType);
ViEChannelManagerScoped cs(_channelManager);
ViEChannelManagerScoped cs(channel_manager_);
ViEChannel* vieChannel = cs.Channel(videoChannel);
if (vieChannel == NULL)
{
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo,
ViEId(_instanceId, videoChannel), "%s: No channel %d",
ViEId(instance_id_, videoChannel), "%s: No channel %d",
__FUNCTION__, videoChannel);
SetLastError(kViECodecInvalidChannelId);
return -1;
@ -450,15 +450,15 @@ int ViECodecImpl::GetCodecConfigParameters(
unsigned char& configParametersSize) const
{
WEBRTC_TRACE(webrtc::kTraceApiCall, webrtc::kTraceVideo,
ViEId(_instanceId, videoChannel), "%s(videoChannel: %d)",
ViEId(instance_id_, videoChannel), "%s(videoChannel: %d)",
__FUNCTION__, videoChannel);
ViEChannelManagerScoped cs(_channelManager);
ViEChannelManagerScoped cs(channel_manager_);
ViEEncoder* vieEncoder = cs.Encoder(videoChannel);
if (vieEncoder == NULL)
{
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo,
ViEId(_instanceId, videoChannel),
ViEId(instance_id_, videoChannel),
"%s: No encoder for channel %d", __FUNCTION__, videoChannel);
SetLastError(kViECodecInvalidChannelId);
return -1;
@ -484,16 +484,16 @@ int ViECodecImpl::GetCodecConfigParameters(
int ViECodecImpl::SetImageScaleStatus(const int videoChannel, const bool enable)
{
WEBRTC_TRACE(webrtc::kTraceApiCall, webrtc::kTraceVideo,
ViEId(_instanceId, videoChannel),
ViEId(instance_id_, videoChannel),
"%s(videoChannel: %d, enable: %d)", __FUNCTION__, videoChannel,
enable);
ViEChannelManagerScoped cs(_channelManager);
ViEChannelManagerScoped cs(channel_manager_);
ViEEncoder* vieEncoder = cs.Encoder(videoChannel);
if (vieEncoder == NULL)
{
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo,
ViEId(_instanceId, videoChannel), "%s: No channel %d",
ViEId(instance_id_, videoChannel), "%s: No channel %d",
__FUNCTION__, videoChannel);
SetLastError(kViECodecInvalidChannelId);
return -1;
@ -520,15 +520,15 @@ int ViECodecImpl::GetSendCodecStastistics(const int videoChannel,
unsigned int& deltaFrames) const
{
WEBRTC_TRACE(webrtc::kTraceApiCall, webrtc::kTraceVideo,
ViEId(_instanceId, videoChannel), "%s(videoChannel %d)",
ViEId(instance_id_, videoChannel), "%s(videoChannel %d)",
__FUNCTION__, videoChannel);
ViEChannelManagerScoped cs(_channelManager);
ViEChannelManagerScoped cs(channel_manager_);
ViEEncoder* vieEncoder = cs.Encoder(videoChannel);
if (vieEncoder == NULL)
{
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo,
ViEId(_instanceId, videoChannel),
ViEId(instance_id_, videoChannel),
"%s: No send codec for channel %d", __FUNCTION__,
videoChannel);
SetLastError(kViECodecInvalidChannelId);
@ -555,16 +555,16 @@ int ViECodecImpl::GetReceiveCodecStastistics(const int videoChannel,
unsigned int& deltaFrames) const
{
WEBRTC_TRACE(webrtc::kTraceApiCall, webrtc::kTraceVideo,
ViEId(_instanceId, videoChannel),
ViEId(instance_id_, videoChannel),
"%s(videoChannel: %d, codecType: %d)", __FUNCTION__,
videoChannel);
ViEChannelManagerScoped cs(_channelManager);
ViEChannelManagerScoped cs(channel_manager_);
ViEChannel* vieChannel = cs.Channel(videoChannel);
if (vieChannel == NULL)
{
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo,
ViEId(_instanceId, videoChannel), "%s: No channel %d",
ViEId(instance_id_, videoChannel), "%s: No channel %d",
__FUNCTION__, videoChannel);
SetLastError(kViECodecInvalidChannelId);
return -1;
@ -581,16 +581,16 @@ int ViECodecImpl::GetReceiveCodecStastistics(const int videoChannel,
unsigned int ViECodecImpl::GetDiscardedPackets(const int videoChannel) const {
WEBRTC_TRACE(webrtc::kTraceApiCall, webrtc::kTraceVideo,
ViEId(_instanceId, videoChannel),
ViEId(instance_id_, videoChannel),
"%s(videoChannel: %d, codecType: %d)", __FUNCTION__,
videoChannel);
ViEChannelManagerScoped cs(_channelManager);
ViEChannelManagerScoped cs(channel_manager_);
ViEChannel* vieChannel = cs.Channel(videoChannel);
if (vieChannel == NULL)
{
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo,
ViEId(_instanceId, videoChannel), "%s: No channel %d",
ViEId(instance_id_, videoChannel), "%s: No channel %d",
__FUNCTION__, videoChannel);
SetLastError(kViECodecInvalidChannelId);
return -1;
@ -609,15 +609,15 @@ int ViECodecImpl::SetKeyFrameRequestCallbackStatus(const int videoChannel,
const bool enable)
{
WEBRTC_TRACE(webrtc::kTraceApiCall, webrtc::kTraceVideo,
ViEId(_instanceId, videoChannel), "%s(videoChannel: %d)",
ViEId(instance_id_, videoChannel), "%s(videoChannel: %d)",
__FUNCTION__, videoChannel);
ViEChannelManagerScoped cs(_channelManager);
ViEChannelManagerScoped cs(channel_manager_);
ViEChannel* vieChannel = cs.Channel(videoChannel);
if (vieChannel == NULL)
{
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo,
ViEId(_instanceId, videoChannel), "%s: No channel %d",
ViEId(instance_id_, videoChannel), "%s: No channel %d",
__FUNCTION__, videoChannel);
SetLastError(kViECodecInvalidChannelId);
return -1;
@ -643,16 +643,16 @@ int ViECodecImpl::SetSignalKeyPacketLossStatus(const int videoChannel,
const bool onlyKeyFrames)
{
WEBRTC_TRACE(webrtc::kTraceApiCall, webrtc::kTraceVideo,
ViEId(_instanceId, videoChannel),
ViEId(instance_id_, videoChannel),
"%s(videoChannel: %d, enable: %d, onlyKeyFrames: %d)",
__FUNCTION__, videoChannel, enable);
ViEChannelManagerScoped cs(_channelManager);
ViEChannelManagerScoped cs(channel_manager_);
ViEChannel* vieChannel = cs.Channel(videoChannel);
if (vieChannel == NULL)
{
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo,
ViEId(_instanceId, videoChannel), "%s: No channel %d",
ViEId(instance_id_, videoChannel), "%s: No channel %d",
__FUNCTION__, videoChannel);
SetLastError(kViECodecInvalidChannelId);
return -1;
@ -672,15 +672,15 @@ int ViECodecImpl::SetSignalKeyPacketLossStatus(const int videoChannel,
int ViECodecImpl::RegisterEncoderObserver(const int videoChannel,
ViEEncoderObserver& observer)
{
WEBRTC_TRACE(webrtc::kTraceApiCall, webrtc::kTraceVideo, ViEId(_instanceId), "%s",
WEBRTC_TRACE(webrtc::kTraceApiCall, webrtc::kTraceVideo, ViEId(instance_id_), "%s",
__FUNCTION__);
ViEChannelManagerScoped cs(_channelManager);
ViEChannelManagerScoped cs(channel_manager_);
ViEEncoder* vieEncoder = cs.Encoder(videoChannel);
if (vieEncoder == NULL)
{
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo,
ViEId(_instanceId, videoChannel),
ViEId(instance_id_, videoChannel),
"%s: No encoder for channel %d", __FUNCTION__, videoChannel);
SetLastError(kViECodecInvalidChannelId);
return -1;
@ -688,7 +688,7 @@ int ViECodecImpl::RegisterEncoderObserver(const int videoChannel,
if (vieEncoder->RegisterCodecObserver(&observer) != 0)
{
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo,
ViEId(_instanceId, videoChannel),
ViEId(instance_id_, videoChannel),
"%s: Could not register codec observer at channel",
__FUNCTION__);
SetLastError(kViECodecObserverAlreadyRegistered);
@ -703,15 +703,15 @@ int ViECodecImpl::RegisterEncoderObserver(const int videoChannel,
int ViECodecImpl::DeregisterEncoderObserver(const int videoChannel)
{
WEBRTC_TRACE(webrtc::kTraceApiCall, webrtc::kTraceVideo, ViEId(_instanceId), "%s",
WEBRTC_TRACE(webrtc::kTraceApiCall, webrtc::kTraceVideo, ViEId(instance_id_), "%s",
__FUNCTION__);
ViEChannelManagerScoped cs(_channelManager);
ViEChannelManagerScoped cs(channel_manager_);
ViEEncoder* vieEncoder = cs.Encoder(videoChannel);
if (vieEncoder == NULL)
{
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo,
ViEId(_instanceId, videoChannel),
ViEId(instance_id_, videoChannel),
"%s: No encoder for channel %d", __FUNCTION__, videoChannel);
SetLastError(kViECodecInvalidChannelId);
return -1;
@ -731,15 +731,15 @@ int ViECodecImpl::DeregisterEncoderObserver(const int videoChannel)
int ViECodecImpl::RegisterDecoderObserver(const int videoChannel,
ViEDecoderObserver& observer)
{
WEBRTC_TRACE(webrtc::kTraceApiCall, webrtc::kTraceVideo, ViEId(_instanceId), "%s",
WEBRTC_TRACE(webrtc::kTraceApiCall, webrtc::kTraceVideo, ViEId(instance_id_), "%s",
__FUNCTION__);
ViEChannelManagerScoped cs(_channelManager);
ViEChannelManagerScoped cs(channel_manager_);
ViEChannel* vieChannel = cs.Channel(videoChannel);
if (vieChannel == NULL)
{
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo,
ViEId(_instanceId, videoChannel), "%s: No channel %d",
ViEId(instance_id_, videoChannel), "%s: No channel %d",
__FUNCTION__, videoChannel);
SetLastError(kViECodecInvalidChannelId);
return -1;
@ -747,7 +747,7 @@ int ViECodecImpl::RegisterDecoderObserver(const int videoChannel,
if (vieChannel->RegisterCodecObserver(&observer) != 0)
{
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo,
ViEId(_instanceId, videoChannel),
ViEId(instance_id_, videoChannel),
"%s: Could not register codec observer at channel",
__FUNCTION__);
SetLastError(kViECodecObserverAlreadyRegistered);
@ -762,15 +762,15 @@ int ViECodecImpl::RegisterDecoderObserver(const int videoChannel,
int ViECodecImpl::DeregisterDecoderObserver(const int videoChannel)
{
WEBRTC_TRACE(webrtc::kTraceApiCall, webrtc::kTraceVideo, ViEId(_instanceId), "%s",
WEBRTC_TRACE(webrtc::kTraceApiCall, webrtc::kTraceVideo, ViEId(instance_id_), "%s",
__FUNCTION__);
ViEChannelManagerScoped cs(_channelManager);
ViEChannelManagerScoped cs(channel_manager_);
ViEChannel* vieChannel = cs.Channel(videoChannel);
if (vieChannel == NULL)
{
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo,
ViEId(_instanceId, videoChannel), "%s: No channel %d",
ViEId(instance_id_, videoChannel), "%s: No channel %d",
__FUNCTION__, videoChannel);
SetLastError(kViECodecInvalidChannelId);
return -1;
@ -793,15 +793,15 @@ int ViECodecImpl::DeregisterDecoderObserver(const int videoChannel)
int ViECodecImpl::SendKeyFrame(const int videoChannel)
{
WEBRTC_TRACE(webrtc::kTraceApiCall, webrtc::kTraceVideo, ViEId(_instanceId),
WEBRTC_TRACE(webrtc::kTraceApiCall, webrtc::kTraceVideo, ViEId(instance_id_),
"%s(videoChannel: %d)", __FUNCTION__, videoChannel);
ViEChannelManagerScoped cs(_channelManager);
ViEChannelManagerScoped cs(channel_manager_);
ViEEncoder* vieEncoder = cs.Encoder(videoChannel);
if (vieEncoder == NULL)
{
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo,
ViEId(_instanceId, videoChannel), "%s: No channel %d",
ViEId(instance_id_, videoChannel), "%s: No channel %d",
__FUNCTION__, videoChannel);
SetLastError(kViECodecInvalidChannelId);
return -1;
@ -823,16 +823,16 @@ int ViECodecImpl::SendKeyFrame(const int videoChannel)
int ViECodecImpl::WaitForFirstKeyFrame(const int videoChannel, const bool wait)
{
WEBRTC_TRACE(webrtc::kTraceApiCall, webrtc::kTraceVideo, ViEId(_instanceId),
WEBRTC_TRACE(webrtc::kTraceApiCall, webrtc::kTraceVideo, ViEId(instance_id_),
"%s(videoChannel: %d, wait: %d)", __FUNCTION__, videoChannel,
wait);
ViEChannelManagerScoped cs(_channelManager);
ViEChannelManagerScoped cs(channel_manager_);
ViEChannel* vieChannel = cs.Channel(videoChannel);
if (vieChannel == NULL)
{
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo,
ViEId(_instanceId, videoChannel), "%s: No channel %d",
ViEId(instance_id_, videoChannel), "%s: No channel %d",
__FUNCTION__, videoChannel);
SetLastError(kViECodecInvalidChannelId);
return -1;
@ -855,15 +855,15 @@ int ViECodecImpl::WaitForFirstKeyFrame(const int videoChannel, const bool wait)
int ViECodecImpl::SetInverseH263Logic(int videoChannel, bool enable)
{
WEBRTC_TRACE(webrtc::kTraceApiCall, webrtc::kTraceVideo, ViEId(_instanceId),
WEBRTC_TRACE(webrtc::kTraceApiCall, webrtc::kTraceVideo, ViEId(instance_id_),
"%s(videoChannel: %d)", __FUNCTION__, videoChannel);
ViEChannelManagerScoped cs(_channelManager);
ViEChannelManagerScoped cs(channel_manager_);
ViEChannel* vieChannel = cs.Channel(videoChannel);
if (vieChannel == NULL)
{
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo,
ViEId(_instanceId,videoChannel), "%s: No channel %d",
ViEId(instance_id_,videoChannel), "%s: No channel %d",
__FUNCTION__, videoChannel);
SetLastError(kViECodecInvalidChannelId);
return -1;

View File

@ -60,19 +60,19 @@ ViEEncryption* ViEEncryption::GetInterface(VideoEngine* videoEngine)
int ViEEncryptionImpl::Release()
{
WEBRTC_TRACE(webrtc::kTraceApiCall, webrtc::kTraceVideo, _instanceId,
WEBRTC_TRACE(webrtc::kTraceApiCall, webrtc::kTraceVideo, instance_id_,
"ViEEncryptionImpl::Release()");
(*this)--; // Decrease ref count
WebRtc_Word32 refCount = GetCount();
if (refCount < 0)
{
WEBRTC_TRACE(webrtc::kTraceWarning, webrtc::kTraceVideo, _instanceId,
WEBRTC_TRACE(webrtc::kTraceWarning, webrtc::kTraceVideo, instance_id_,
"ViEEncryptionImpl release too many times");
SetLastError(kViEAPIDoesNotExist);
return -1;
}
WEBRTC_TRACE(webrtc::kTraceInfo, webrtc::kTraceVideo, _instanceId,
WEBRTC_TRACE(webrtc::kTraceInfo, webrtc::kTraceVideo, instance_id_,
"ViEEncryptionImpl reference count: %d", refCount);
return refCount;
}
@ -83,7 +83,7 @@ int ViEEncryptionImpl::Release()
ViEEncryptionImpl::ViEEncryptionImpl()
{
WEBRTC_TRACE(webrtc::kTraceMemory, webrtc::kTraceVideo, _instanceId,
WEBRTC_TRACE(webrtc::kTraceMemory, webrtc::kTraceVideo, instance_id_,
"ViEEncryptionImpl::ViEEncryptionImpl() Ctor");
}
@ -93,7 +93,7 @@ ViEEncryptionImpl::ViEEncryptionImpl()
ViEEncryptionImpl::~ViEEncryptionImpl()
{
WEBRTC_TRACE(webrtc::kTraceMemory, webrtc::kTraceVideo, _instanceId,
WEBRTC_TRACE(webrtc::kTraceMemory, webrtc::kTraceVideo, instance_id_,
"ViEEncryptionImpl::~ViEEncryptionImpl() Dtor");
}
@ -114,7 +114,7 @@ int ViEEncryptionImpl::EnableSRTPSend(
const bool useForRTCP)
{
WEBRTC_TRACE(webrtc::kTraceApiCall, webrtc::kTraceVideo, _instanceId,
WEBRTC_TRACE(webrtc::kTraceApiCall, webrtc::kTraceVideo, instance_id_,
"EnableSRTPSend(channel=%d, cipherType=%d, cipherKeyLength=%d, "
"authType=%d, authKeyLength=%d, authTagLength=%d, level=%d, "
"key=?, RTCP=%s",
@ -125,9 +125,9 @@ int ViEEncryptionImpl::EnableSRTPSend(
if (!IsInitialized())
{
SetLastError(kViENotInitialized);
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo, ViEId(_instanceId),
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo, ViEId(instance_id_),
"%s - ViE instance %d not initialized", __FUNCTION__,
_instanceId);
instance_id_);
return -1;
}
@ -144,7 +144,7 @@ int ViEEncryptionImpl::EnableSRTPSend(
|| ((kAuthentication == level) && !cipherAllZero))
{
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo, _instanceId,
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo, instance_id_,
" Invalid input argument");
SetLastError(kViEEncryptionInvalidSrtpParameter);
return -1;
@ -156,7 +156,7 @@ int ViEEncryptionImpl::EnableSRTPSend(
|| (cipherKeyLength > kViEMaxSrtpEncryptLength)))
{
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo, _instanceId,
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo, instance_id_,
" Invalid cipher key length");
SetLastError(kViEEncryptionInvalidSrtpParameter);
return -1;
@ -170,7 +170,7 @@ int ViEEncryptionImpl::EnableSRTPSend(
|| (authTagLength > kViEMaxSrtpAuthSh1Length)))
{
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo, _instanceId,
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo, instance_id_,
" Invalid auth key or tag length");
SetLastError(kViEEncryptionInvalidSrtpParameter);
return -1;
@ -184,14 +184,14 @@ int ViEEncryptionImpl::EnableSRTPSend(
|| (authTagLength > kViEMaxSrtpTagAuthNullLength)))
{
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo, _instanceId,
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo, instance_id_,
" Invalid auth key or tag length");
SetLastError(kViEEncryptionInvalidSrtpParameter);
return -1;
}
if (!key)
{
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo, _instanceId,
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo, instance_id_,
" key NULL pointer");
SetLastError(kViEEncryptionInvalidSrtpParameter);
return -1;
@ -204,12 +204,12 @@ int ViEEncryptionImpl::EnableSRTPSend(
const SrtpModule::SecurityLevels security_level =
static_cast<const SrtpModule::SecurityLevels> (level);
ViEChannelManagerScoped cs(_channelManager);
ViEChannelManagerScoped cs(channel_manager_);
ViEChannel* vieChannel = cs.Channel(videoChannel);
if (vieChannel == NULL)
{
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo,
ViEId(_instanceId, videoChannel), "%s: No channel %d",
ViEId(instance_id_, videoChannel), "%s: No channel %d",
__FUNCTION__, videoChannel);
SetLastError(kViEEncryptionInvalidChannelId);
return -1;
@ -219,18 +219,18 @@ int ViEEncryptionImpl::EnableSRTPSend(
authKeyLength, authTagLength,
security_level, key, useForRTCP))
{
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo, _instanceId,
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo, instance_id_,
"Failed to configure SRTP Encryption for sending");
SetLastError(kViEEncryptionUnknownError);
return -1;
}
WEBRTC_TRACE(webrtc::kTraceStateInfo, webrtc::kTraceVideo, _instanceId,
WEBRTC_TRACE(webrtc::kTraceStateInfo, webrtc::kTraceVideo, instance_id_,
"SRTP Enabled for sending");
return 0;
#else
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVoice,
ViEId(_instanceId, videoChannel),
ViEId(instance_id_, videoChannel),
" _SRTP is undefined => _lastError = %d",
LastErrorInternal());
SetLastError(kViEEncryptionSrtpNotSupported);
@ -246,15 +246,15 @@ int ViEEncryptionImpl::EnableSRTPSend(
int ViEEncryptionImpl::DisableSRTPSend(const int videoChannel)
{
WEBRTC_TRACE(webrtc::kTraceApiCall, webrtc::kTraceVideo,
ViEId(_instanceId, videoChannel),
ViEId(instance_id_, videoChannel),
"DisableSRTPSend(videoChannel=%d)", videoChannel);
#ifdef WEBRTC_SRTP
ViEChannelManagerScoped cs(_channelManager);
ViEChannelManagerScoped cs(channel_manager_);
ViEChannel* vieChannel = cs.Channel(videoChannel);
if (vieChannel == NULL)
{
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo,
ViEId(_instanceId, videoChannel), "%s: No channel %d",
ViEId(instance_id_, videoChannel), "%s: No channel %d",
__FUNCTION__, videoChannel);
SetLastError(kViEEncryptionInvalidChannelId);
return -1;
@ -263,19 +263,19 @@ int ViEEncryptionImpl::DisableSRTPSend(const int videoChannel)
if (0 != vieChannel->DisableSRTPSend())
{
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo,
ViEId(_instanceId, videoChannel),
ViEId(instance_id_, videoChannel),
"Failed to Disable SRTP Encryption for sending");
SetLastError(kViEEncryptionUnknownError);
return -1;
}
WEBRTC_TRACE(webrtc::kTraceStateInfo, webrtc::kTraceVideo,
ViEId(_instanceId, videoChannel),
ViEId(instance_id_, videoChannel),
"SRTP Disabled for sending");
return 0;
#else
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVoice,
ViEId(_instanceId, videoChannel),
ViEId(instance_id_, videoChannel),
" _SRTP is undefined => _lastError = %d",
LastErrorInternal());
SetLastError(kViEEncryptionSrtpNotSupported);
@ -297,7 +297,7 @@ int ViEEncryptionImpl::EnableSRTPReceive(
const unsigned char key[kViEMaxSrtpKeyLength], const bool useForRTCP)
{
WEBRTC_TRACE(webrtc::kTraceApiCall, webrtc::kTraceVideo,
ViEId(_instanceId, videoChannel),
ViEId(instance_id_, videoChannel),
"EnableSRTPReceive(channel=%d, cipherType=%d, "
"cipherKeyLength=%d, authType=%d, authKeyLength=%d, "
"authTagLength=%d, level=%d, key=?, RTCP=%s)",
@ -309,9 +309,9 @@ int ViEEncryptionImpl::EnableSRTPReceive(
if (!IsInitialized())
{
SetLastError(kViENotInitialized);
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo, ViEId(_instanceId),
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo, ViEId(instance_id_),
"%s - ViE instance %d not initialized", __FUNCTION__,
_instanceId);
instance_id_);
return -1;
}
@ -329,7 +329,7 @@ int ViEEncryptionImpl::EnableSRTPReceive(
{
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo,
ViEId(_instanceId, videoChannel),
ViEId(instance_id_, videoChannel),
" Invalid input argument");
SetLastError(kViEEncryptionInvalidSrtpParameter);
return -1;
@ -342,7 +342,7 @@ int ViEEncryptionImpl::EnableSRTPReceive(
{
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo,
ViEId(_instanceId, videoChannel),
ViEId(instance_id_, videoChannel),
" Invalid cipher key length");
SetLastError(kViEEncryptionInvalidSrtpParameter);
return -1;
@ -357,7 +357,7 @@ int ViEEncryptionImpl::EnableSRTPReceive(
{
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo,
ViEId(_instanceId, videoChannel),
ViEId(instance_id_, videoChannel),
" Invalid auth key or tag length");
SetLastError(kViEEncryptionInvalidSrtpParameter);
return -1;
@ -372,7 +372,7 @@ int ViEEncryptionImpl::EnableSRTPReceive(
{
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo,
ViEId(_instanceId, videoChannel),
ViEId(instance_id_, videoChannel),
" Invalid auth key or tag length");
SetLastError(kViEEncryptionInvalidSrtpParameter);
return -1;
@ -381,7 +381,7 @@ int ViEEncryptionImpl::EnableSRTPReceive(
if (!key)
{
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo,
ViEId(_instanceId, videoChannel), " key NULL pointer");
ViEId(instance_id_, videoChannel), " key NULL pointer");
SetLastError(kViEEncryptionInvalidSrtpParameter);
return -1;
}
@ -393,12 +393,12 @@ int ViEEncryptionImpl::EnableSRTPReceive(
const SrtpModule::SecurityLevels security_level =
static_cast<const SrtpModule::SecurityLevels> (level);
ViEChannelManagerScoped cs(_channelManager);
ViEChannelManagerScoped cs(channel_manager_);
ViEChannel* vieChannel = cs.Channel(videoChannel);
if (vieChannel == NULL)
{
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo,
ViEId(_instanceId, videoChannel), "%s: No channel %d",
ViEId(instance_id_, videoChannel), "%s: No channel %d",
__FUNCTION__, videoChannel);
SetLastError(kViEEncryptionInvalidChannelId);
return -1;
@ -410,20 +410,20 @@ int ViEEncryptionImpl::EnableSRTPReceive(
useForRTCP))
{
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo,
ViEId(_instanceId, videoChannel),
ViEId(instance_id_, videoChannel),
"Failed to configure SRTP Encryption for receiving");
SetLastError(kViEEncryptionUnknownError);
return -1;
}
WEBRTC_TRACE(webrtc::kTraceStateInfo, webrtc::kTraceVideo,
ViEId(_instanceId, videoChannel),
ViEId(instance_id_, videoChannel),
"SRTP Enabled for receiving");
return 0;
#else
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVoice,
ViEId(_instanceId, videoChannel),
ViEId(instance_id_, videoChannel),
" _SRTP is undefined => _lastError = %d",
LastErrorInternal());
SetLastError(kViEEncryptionSrtpNotSupported);
@ -439,16 +439,16 @@ int ViEEncryptionImpl::EnableSRTPReceive(
int ViEEncryptionImpl::DisableSRTPReceive(const int videoChannel)
{
WEBRTC_TRACE(webrtc::kTraceApiCall, webrtc::kTraceVideo,
ViEId(_instanceId, videoChannel),
ViEId(instance_id_, videoChannel),
"DisableSRTPReceive(videoChannel=%d)", videoChannel);
#ifdef WEBRTC_SRTP
ViEChannelManagerScoped cs(_channelManager);
ViEChannelManagerScoped cs(channel_manager_);
ViEChannel* vieChannel = cs.Channel(videoChannel);
if (vieChannel == NULL)
{
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo,
ViEId(_instanceId, videoChannel), "%s: No channel %d",
ViEId(instance_id_, videoChannel), "%s: No channel %d",
__FUNCTION__, videoChannel);
SetLastError(kViEEncryptionInvalidChannelId);
return -1;
@ -457,18 +457,18 @@ int ViEEncryptionImpl::DisableSRTPReceive(const int videoChannel)
if (0 != vieChannel->DisableSRTPReceive())
{
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo,
ViEId(_instanceId, videoChannel),
ViEId(instance_id_, videoChannel),
"Failed to Disable SRTP Encryption for receiving");
SetLastError(kViEEncryptionUnknownError);
return -1;
}
WEBRTC_TRACE(webrtc::kTraceStateInfo, webrtc::kTraceVideo,
ViEId(_instanceId, videoChannel), "SRTP Disabled for receiving");
ViEId(instance_id_, videoChannel), "SRTP Disabled for receiving");
return 0;
#else
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVoice,
ViEId(_instanceId, videoChannel),
ViEId(instance_id_, videoChannel),
" _SRTP is undefined => _lastError = %d",
LastErrorInternal());
SetLastError(kViEEncryptionSrtpNotSupported);
@ -489,15 +489,15 @@ int ViEEncryptionImpl::RegisterExternalEncryption(const int videoChannel,
Encryption& encryption)
{
WEBRTC_TRACE(webrtc::kTraceApiCall, webrtc::kTraceVideo,
ViEId(_instanceId, videoChannel),
ViEId(instance_id_, videoChannel),
"RegisterExternalEncryption(videoChannel=%d)", videoChannel);
ViEChannelManagerScoped cs(_channelManager);
ViEChannelManagerScoped cs(channel_manager_);
ViEChannel* vieChannel = cs.Channel(videoChannel);
if (vieChannel == NULL)
{
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo,
ViEId(_instanceId, videoChannel), "%s: No channel %d",
ViEId(instance_id_, videoChannel), "%s: No channel %d",
__FUNCTION__, videoChannel);
SetLastError(kViEEncryptionInvalidChannelId);
return -1;
@ -519,15 +519,15 @@ int ViEEncryptionImpl::RegisterExternalEncryption(const int videoChannel,
int ViEEncryptionImpl::DeregisterExternalEncryption(const int videoChannel)
{
WEBRTC_TRACE(webrtc::kTraceApiCall, webrtc::kTraceVideo,
ViEId(_instanceId, videoChannel),
ViEId(instance_id_, videoChannel),
"RegisterExternalEncryption(videoChannel=%d)", videoChannel);
ViEChannelManagerScoped cs(_channelManager);
ViEChannelManagerScoped cs(channel_manager_);
ViEChannel* vieChannel = cs.Channel(videoChannel);
if (vieChannel == NULL)
{
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo,
ViEId(_instanceId, videoChannel), "%s: No channel %d",
ViEId(instance_id_, videoChannel), "%s: No channel %d",
__FUNCTION__, videoChannel);
SetLastError(kViEEncryptionInvalidChannelId);
return -1;

View File

@ -54,19 +54,19 @@ ViEExternalCodec* ViEExternalCodec::GetInterface(VideoEngine* videoEngine)
int ViEExternalCodecImpl::Release()
{
WEBRTC_TRACE(webrtc::kTraceApiCall, webrtc::kTraceVideo, _instanceId,
WEBRTC_TRACE(webrtc::kTraceApiCall, webrtc::kTraceVideo, instance_id_,
"ViEExternalCodec::Release()");
(*this)--; // Decrease ref count
WebRtc_Word32 refCount = GetCount();
if (refCount < 0)
{
WEBRTC_TRACE(webrtc::kTraceWarning, webrtc::kTraceVideo, _instanceId,
WEBRTC_TRACE(webrtc::kTraceWarning, webrtc::kTraceVideo, instance_id_,
"ViEExternalCodec release too many times");
SetLastError(kViEAPIDoesNotExist);
return -1;
}
WEBRTC_TRACE(webrtc::kTraceInfo, webrtc::kTraceVideo, _instanceId,
WEBRTC_TRACE(webrtc::kTraceInfo, webrtc::kTraceVideo, instance_id_,
"ViEExternalCodec reference count: %d", refCount);
return refCount;
}
@ -79,16 +79,16 @@ int ViEExternalCodecImpl::RegisterExternalSendCodec(const int videoChannel,
const unsigned char plType,
VideoEncoder* encoder)
{
WEBRTC_TRACE(webrtc::kTraceApiCall, webrtc::kTraceVideo, ViEId(_instanceId),
WEBRTC_TRACE(webrtc::kTraceApiCall, webrtc::kTraceVideo, ViEId(instance_id_),
"%s channel %d plType %d encoder 0x%x", __FUNCTION__,
videoChannel, plType, encoder);
ViEChannelManagerScoped cs(_channelManager);
ViEChannelManagerScoped cs(channel_manager_);
ViEEncoder* vieEncoder = cs.Encoder(videoChannel);
if (!vieEncoder)
{
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo,
ViEId(_instanceId, videoChannel),
ViEId(instance_id_, videoChannel),
"%s: Invalid argument videoChannel %u. Does it exist?",
__FUNCTION__, videoChannel);
SetLastError(kViECodecInvalidArgument);
@ -97,7 +97,7 @@ int ViEExternalCodecImpl::RegisterExternalSendCodec(const int videoChannel,
if (!encoder)
{
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo,
ViEId(_instanceId, videoChannel),
ViEId(instance_id_, videoChannel),
"%s: Invalid argument Encoder 0x%x.", __FUNCTION__, encoder);
SetLastError(kViECodecInvalidArgument);
return -1;
@ -114,15 +114,15 @@ int ViEExternalCodecImpl::RegisterExternalSendCodec(const int videoChannel,
int ViEExternalCodecImpl::DeRegisterExternalSendCodec(
const int videoChannel, const unsigned char plType)
{
WEBRTC_TRACE(webrtc::kTraceApiCall, webrtc::kTraceVideo, ViEId(_instanceId),
WEBRTC_TRACE(webrtc::kTraceApiCall, webrtc::kTraceVideo, ViEId(instance_id_),
"%s channel %d plType %d", __FUNCTION__, videoChannel, plType);
ViEChannelManagerScoped cs(_channelManager);
ViEChannelManagerScoped cs(channel_manager_);
ViEEncoder* vieEncoder = cs.Encoder(videoChannel);
if (!vieEncoder)
{
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo,
ViEId(_instanceId, videoChannel),
ViEId(instance_id_, videoChannel),
"%s: Invalid argument videoChannel %u. Does it exist?",
__FUNCTION__, videoChannel);
SetLastError(kViECodecInvalidArgument);
@ -142,17 +142,17 @@ int ViEExternalCodecImpl::RegisterExternalReceiveCodec(
const int videoChannel, const unsigned int plType, VideoDecoder* decoder,
bool decoderRender /*= false*/, int renderDelay /*= 0*/)
{
WEBRTC_TRACE(webrtc::kTraceApiCall, webrtc::kTraceVideo, ViEId(_instanceId),
WEBRTC_TRACE(webrtc::kTraceApiCall, webrtc::kTraceVideo, ViEId(instance_id_),
"%s channel %d plType %d decoder 0x%x, decoderRender %d, "
"renderDelay %d", __FUNCTION__, videoChannel, plType, decoder,
decoderRender, renderDelay);
ViEChannelManagerScoped cs(_channelManager);
ViEChannelManagerScoped cs(channel_manager_);
ViEChannel* vieChannel = cs.Channel(videoChannel);
if (!vieChannel)
{
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo,
ViEId(_instanceId, videoChannel),
ViEId(instance_id_, videoChannel),
"%s: Invalid argument videoChannel %u. Does it exist?",
__FUNCTION__, videoChannel);
SetLastError(kViECodecInvalidArgument);
@ -161,7 +161,7 @@ int ViEExternalCodecImpl::RegisterExternalReceiveCodec(
if (!decoder)
{
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo,
ViEId(_instanceId, videoChannel),
ViEId(instance_id_, videoChannel),
"%s: Invalid argument decoder 0x%x.", __FUNCTION__, decoder);
SetLastError(kViECodecInvalidArgument);
return -1;
@ -179,15 +179,15 @@ int ViEExternalCodecImpl::RegisterExternalReceiveCodec(
int ViEExternalCodecImpl::DeRegisterExternalReceiveCodec(
const int videoChannel, const unsigned char plType)
{
WEBRTC_TRACE(webrtc::kTraceApiCall, webrtc::kTraceVideo, ViEId(_instanceId),
WEBRTC_TRACE(webrtc::kTraceApiCall, webrtc::kTraceVideo, ViEId(instance_id_),
"%s channel %d plType %u", __FUNCTION__, videoChannel, plType);
ViEChannelManagerScoped cs(_channelManager);
ViEChannelManagerScoped cs(channel_manager_);
ViEChannel* vieChannel = cs.Channel(videoChannel);
if (!vieChannel)
{
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo,
ViEId(_instanceId, videoChannel),
ViEId(instance_id_, videoChannel),
"%s: Invalid argument videoChannel %u. Does it exist?",
__FUNCTION__, videoChannel);
SetLastError(kViECodecInvalidArgument);

View File

@ -70,19 +70,19 @@ ViEFile* ViEFile::GetInterface(VideoEngine* videoEngine)
int ViEFileImpl::Release()
{
WEBRTC_TRACE(webrtc::kTraceApiCall, webrtc::kTraceVideo, _instanceId,
WEBRTC_TRACE(webrtc::kTraceApiCall, webrtc::kTraceVideo, instance_id_,
"ViEFile::Release()");
(*this)--; // Decrease ref count
WebRtc_Word32 refCount = GetCount();
if (refCount < 0)
{
WEBRTC_TRACE(webrtc::kTraceWarning, webrtc::kTraceVideo, _instanceId,
WEBRTC_TRACE(webrtc::kTraceWarning, webrtc::kTraceVideo, instance_id_,
"ViEFile release too many times");
SetLastError(kViEAPIDoesNotExist);
return -1;
}
WEBRTC_TRACE(webrtc::kTraceInfo, webrtc::kTraceVideo, _instanceId,
WEBRTC_TRACE(webrtc::kTraceInfo, webrtc::kTraceVideo, instance_id_,
"ViEFile reference count: %d", refCount);
return refCount;
}
@ -94,7 +94,7 @@ int ViEFileImpl::Release()
ViEFileImpl::ViEFileImpl()
{
WEBRTC_TRACE(webrtc::kTraceMemory, webrtc::kTraceVideo, _instanceId,
WEBRTC_TRACE(webrtc::kTraceMemory, webrtc::kTraceVideo, instance_id_,
"ViEFileImpl::ViEFileImpl() Ctor");
}
@ -106,7 +106,7 @@ ViEFileImpl::ViEFileImpl()
ViEFileImpl::~ViEFileImpl()
{
WEBRTC_TRACE(webrtc::kTraceMemory, webrtc::kTraceVideo, _instanceId,
WEBRTC_TRACE(webrtc::kTraceMemory, webrtc::kTraceVideo, instance_id_,
"ViEFileImpl::~ViEFileImpl() Dtor");
}
@ -120,20 +120,20 @@ int ViEFileImpl::StartPlayFile(const char* fileNameUTF8, int& fileId,
/*= webrtc::kFileFormatAviFile*/)
{
WEBRTC_TRACE(webrtc::kTraceApiCall, webrtc::kTraceVideo, ViEId(_instanceId), "%s",
WEBRTC_TRACE(webrtc::kTraceApiCall, webrtc::kTraceVideo, ViEId(instance_id_), "%s",
__FUNCTION__);
if (!IsInitialized())
if (!Initialized())
{
SetLastError(kViENotInitialized);
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo, ViEId(_instanceId),
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo, ViEId(instance_id_),
"%s - ViE instance %d not initialized", __FUNCTION__,
_instanceId);
instance_id_);
return -1;
}
VoiceEngine* voice = _channelManager.GetVoiceEngine();
const WebRtc_Word32 result = _inputManager.CreateFilePlayer(fileNameUTF8,
VoiceEngine* voice = channel_manager_.GetVoiceEngine();
const WebRtc_Word32 result = input_manager_.CreateFilePlayer(fileNameUTF8,
loop,
fileFormat,
voice, fileId);
@ -147,15 +147,15 @@ int ViEFileImpl::StartPlayFile(const char* fileNameUTF8, int& fileId,
int ViEFileImpl::StopPlayFile(const int fileId)
{
WEBRTC_TRACE(webrtc::kTraceApiCall, webrtc::kTraceVideo, ViEId(_instanceId),
WEBRTC_TRACE(webrtc::kTraceApiCall, webrtc::kTraceVideo, ViEId(instance_id_),
"%s(fileId: %d)", __FUNCTION__, fileId);
{
ViEInputManagerScoped is(_inputManager);
ViEInputManagerScoped is(input_manager_);
ViEFilePlayer* ptrViEFilePlayer = is.FilePlayer(fileId);
if (ptrViEFilePlayer == NULL)
{
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo, ViEId(_instanceId),
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo, ViEId(instance_id_),
"%s: File with id %d is not playing.", __FUNCTION__,
fileId);
SetLastError(kViEFileNotPlaying);
@ -164,20 +164,20 @@ int ViEFileImpl::StopPlayFile(const int fileId)
}
// Destroy the capture device
return _inputManager.DestroyFilePlayer(fileId);
return input_manager_.DestroyFilePlayer(fileId);
}
int ViEFileImpl::RegisterObserver(int fileId, ViEFileObserver& observer)
{
WEBRTC_TRACE(webrtc::kTraceApiCall, webrtc::kTraceVideo, ViEId(_instanceId),
WEBRTC_TRACE(webrtc::kTraceApiCall, webrtc::kTraceVideo, ViEId(instance_id_),
"%s(fileId: %d)", __FUNCTION__, fileId);
ViEInputManagerScoped is(_inputManager);
ViEInputManagerScoped is(input_manager_);
ViEFilePlayer* ptrViEFilePlayer = is.FilePlayer(fileId);
if (ptrViEFilePlayer == NULL)
{
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo, ViEId(_instanceId),
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo, ViEId(instance_id_),
"%s: File with id %d is not playing.", __FUNCTION__,
fileId);
SetLastError(kViEFileNotPlaying);
@ -186,7 +186,7 @@ int ViEFileImpl::RegisterObserver(int fileId, ViEFileObserver& observer)
if (ptrViEFilePlayer->IsObserverRegistered())
{
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo,
ViEId(_instanceId, fileId),
ViEId(instance_id_, fileId),
"%s: Observer already registered", __FUNCTION__);
SetLastError(kViEFileObserverAlreadyRegistered);
return -1;
@ -194,7 +194,7 @@ int ViEFileImpl::RegisterObserver(int fileId, ViEFileObserver& observer)
if (ptrViEFilePlayer->RegisterObserver(observer) != 0)
{
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo,
ViEId(_instanceId, fileId),
ViEId(instance_id_, fileId),
"%s: Failed to register observer", __FUNCTION__, fileId);
SetLastError(kViEFileUnknownError);
return -1;
@ -206,14 +206,14 @@ int ViEFileImpl::RegisterObserver(int fileId, ViEFileObserver& observer)
int ViEFileImpl::DeregisterObserver(int fileId, ViEFileObserver& observer)
{
WEBRTC_TRACE(webrtc::kTraceApiCall, webrtc::kTraceVideo, ViEId(_instanceId),
WEBRTC_TRACE(webrtc::kTraceApiCall, webrtc::kTraceVideo, ViEId(instance_id_),
"%s(fileId: %d)", __FUNCTION__, fileId);
ViEInputManagerScoped is(_inputManager);
ViEInputManagerScoped is(input_manager_);
ViEFilePlayer* ptrViEFilePlayer = is.FilePlayer(fileId);
if (ptrViEFilePlayer == NULL)
{
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo, ViEId(_instanceId),
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo, ViEId(instance_id_),
"%s: File with id %d is not playing.", __FUNCTION__,
fileId);
SetLastError(kViEFileNotPlaying);
@ -222,7 +222,7 @@ int ViEFileImpl::DeregisterObserver(int fileId, ViEFileObserver& observer)
if (!ptrViEFilePlayer->IsObserverRegistered())
{
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo,
ViEId(_instanceId, fileId), "%s: No Observer registered",
ViEId(instance_id_, fileId), "%s: No Observer registered",
__FUNCTION__);
SetLastError(kViEFileObserverNotRegistered);
return -1;
@ -230,7 +230,7 @@ int ViEFileImpl::DeregisterObserver(int fileId, ViEFileObserver& observer)
if (ptrViEFilePlayer->DeRegisterObserver() != 0)
{
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo,
ViEId(_instanceId, fileId),
ViEId(instance_id_, fileId),
"%s: Failed to deregister observer", __FUNCTION__, fileId);
SetLastError(kViEFileUnknownError);
return -1;
@ -241,26 +241,26 @@ int ViEFileImpl::DeregisterObserver(int fileId, ViEFileObserver& observer)
int ViEFileImpl::SendFileOnChannel(const int fileId, const int videoChannel)
{
WEBRTC_TRACE(webrtc::kTraceApiCall, webrtc::kTraceVideo, ViEId(_instanceId),
WEBRTC_TRACE(webrtc::kTraceApiCall, webrtc::kTraceVideo, ViEId(instance_id_),
"%s(fileId: %d)", __FUNCTION__, fileId);
ViEChannelManagerScoped cs(_channelManager);
ViEChannelManagerScoped cs(channel_manager_);
ViEEncoder* ptrViEEncoder = cs.Encoder(videoChannel);
if (ptrViEEncoder == NULL)
{
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo,
ViEId(_instanceId, videoChannel),
ViEId(instance_id_, videoChannel),
"%s: Channel %d doesn't exist", __FUNCTION__,
videoChannel);
SetLastError(kViEFileInvalidChannelId);
return -1;
}
ViEInputManagerScoped is(_inputManager);
ViEInputManagerScoped is(input_manager_);
if (is.FrameProvider(ptrViEEncoder) != NULL)
{
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo,
ViEId(_instanceId, videoChannel),
ViEId(instance_id_, videoChannel),
"%s: Channel %d already connected to a capture device or "
"file.", __FUNCTION__, videoChannel);
SetLastError(kViEFileInputAlreadyConnected);
@ -270,7 +270,7 @@ int ViEFileImpl::SendFileOnChannel(const int fileId, const int videoChannel)
ViEFilePlayer* ptrViEFilePlayer = is.FilePlayer(fileId);
if (ptrViEFilePlayer == NULL)
{
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo, ViEId(_instanceId),
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo, ViEId(instance_id_),
"%s: File with id %d is not playing.", __FUNCTION__,
fileId);
SetLastError(kViEFileNotPlaying);
@ -280,7 +280,7 @@ int ViEFileImpl::SendFileOnChannel(const int fileId, const int videoChannel)
if (ptrViEFilePlayer->RegisterFrameCallback(videoChannel, ptrViEEncoder)
!= 0)
{
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo, ViEId(_instanceId),
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo, ViEId(instance_id_),
"%s: Failed to register frame callback.", __FUNCTION__,
fileId);
SetLastError(kViEFileUnknownError);
@ -291,29 +291,29 @@ int ViEFileImpl::SendFileOnChannel(const int fileId, const int videoChannel)
int ViEFileImpl::StopSendFileOnChannel(const int videoChannel)
{
WEBRTC_TRACE(webrtc::kTraceApiCall, webrtc::kTraceVideo, ViEId(_instanceId),
WEBRTC_TRACE(webrtc::kTraceApiCall, webrtc::kTraceVideo, ViEId(instance_id_),
"%s(videoChannel: %d)", __FUNCTION__, videoChannel);
ViEChannelManagerScoped cs(_channelManager);
ViEChannelManagerScoped cs(channel_manager_);
ViEEncoder* ptrViEEncoder = cs.Encoder(videoChannel);
if (ptrViEEncoder == NULL)
{
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo,
ViEId(_instanceId, videoChannel),
ViEId(instance_id_, videoChannel),
"%s: Channel %d doesn't exist", __FUNCTION__,
videoChannel);
SetLastError(kViEFileInvalidChannelId);
return -1;
}
ViEInputManagerScoped is(_inputManager);
ViEInputManagerScoped is(input_manager_);
ViEFrameProviderBase* frameProvider = is.FrameProvider(ptrViEEncoder);
if (frameProvider == NULL
|| frameProvider->Id() < kViEFileIdBase
|| frameProvider->Id() > kViEFileIdMax)
{
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo,
ViEId(_instanceId, videoChannel),
ViEId(instance_id_, videoChannel),
"%s: No file connected to Channel %d", __FUNCTION__,
videoChannel);
SetLastError(kViEFileNotConnected);
@ -322,7 +322,7 @@ int ViEFileImpl::StopSendFileOnChannel(const int videoChannel)
if (frameProvider->DeregisterFrameCallback(ptrViEEncoder) != 0)
{
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo,
ViEId(_instanceId, videoChannel),
ViEId(instance_id_, videoChannel),
"%s: Failed to deregister file from channel %d",
__FUNCTION__, videoChannel);
SetLastError(kViEFileUnknownError);
@ -336,12 +336,12 @@ int ViEFileImpl::StartPlayFileAsMicrophone(const int fileId,
bool mixMicrophone /*= false*/,
float volumeScaling /*= 1*/)
{
ViEInputManagerScoped is(_inputManager);
ViEInputManagerScoped is(input_manager_);
ViEFilePlayer* ptrViEFilePlayer = is.FilePlayer(fileId);
if (ptrViEFilePlayer == NULL)
{
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo, ViEId(_instanceId),
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo, ViEId(instance_id_),
"%s: File with id %d is not playing.", __FUNCTION__,
fileId);
SetLastError(kViEFileNotPlaying);
@ -360,12 +360,12 @@ int ViEFileImpl::StartPlayFileAsMicrophone(const int fileId,
int ViEFileImpl::StopPlayFileAsMicrophone(const int fileId,
const int audioChannel)
{
ViEInputManagerScoped is(_inputManager);
ViEInputManagerScoped is(input_manager_);
ViEFilePlayer* ptrViEFilePlayer = is.FilePlayer(fileId);
if (ptrViEFilePlayer == NULL)
{
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo, ViEId(_instanceId),
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo, ViEId(instance_id_),
"%s: File with id %d is not playing.", __FUNCTION__,
fileId);
SetLastError(kViEFileNotPlaying);
@ -384,12 +384,12 @@ int ViEFileImpl::StartPlayAudioLocally(const int fileId,
const int audioChannel,
float volumeScaling /*=1*/)
{
ViEInputManagerScoped is(_inputManager);
ViEInputManagerScoped is(input_manager_);
ViEFilePlayer* ptrViEFilePlayer = is.FilePlayer(fileId);
if (ptrViEFilePlayer == NULL)
{
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo, ViEId(_instanceId),
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo, ViEId(instance_id_),
"%s: File with id %d is not playing.", __FUNCTION__,
fileId);
SetLastError(kViEFileNotPlaying);
@ -405,12 +405,12 @@ int ViEFileImpl::StartPlayAudioLocally(const int fileId,
int ViEFileImpl::StopPlayAudioLocally(const int fileId, const int audioChannel)
{
ViEInputManagerScoped is(_inputManager);
ViEInputManagerScoped is(input_manager_);
ViEFilePlayer* ptrViEFilePlayer = is.FilePlayer(fileId);
if (ptrViEFilePlayer == NULL)
{
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo, ViEId(_instanceId),
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo, ViEId(instance_id_),
"%s: File with id %d is not playing.", __FUNCTION__,
fileId);
SetLastError(kViEFileNotPlaying);
@ -436,15 +436,15 @@ int ViEFileImpl::StartRecordOutgoingVideo(const int videoChannel,
/*= webrtc::kFileFormatAviFile*/)
{
WEBRTC_TRACE(webrtc::kTraceApiCall, webrtc::kTraceVideo,
ViEId(_instanceId, videoChannel), "%s videoChannel: %d)",
ViEId(instance_id_, videoChannel), "%s videoChannel: %d)",
__FUNCTION__, videoChannel);
ViEChannelManagerScoped cs(_channelManager);
ViEChannelManagerScoped cs(channel_manager_);
ViEEncoder* ptrViEEncoder = cs.Encoder(videoChannel);
if (ptrViEEncoder == NULL)
{
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo,
ViEId(_instanceId, videoChannel),
ViEId(instance_id_, videoChannel),
"%s: Channel %d doesn't exist", __FUNCTION__,
videoChannel);
SetLastError(kViEFileInvalidChannelId);
@ -454,7 +454,7 @@ int ViEFileImpl::StartRecordOutgoingVideo(const int videoChannel,
if (fileRecorder.RecordingStarted())
{
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo,
ViEId(_instanceId, videoChannel),
ViEId(instance_id_, videoChannel),
"%s: Already recording outgoing video on channel %d",
__FUNCTION__, videoChannel);
SetLastError(kViEFileAlreadyRecording);
@ -467,12 +467,12 @@ int ViEFileImpl::StartRecordOutgoingVideo(const int videoChannel,
{
ViEChannel* ptrViEChannel = cs.Channel(videoChannel);
veChannelId = ptrViEChannel->VoiceChannel();
vePtr = _channelManager.GetVoiceEngine();
vePtr = channel_manager_.GetVoiceEngine();
if (!vePtr)
{
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo,
ViEId(_instanceId, videoChannel),
ViEId(instance_id_, videoChannel),
"%s: Can't access voice engine. Have SetVoiceEngine "
"been called?", __FUNCTION__);
SetLastError(kViEFileVoENotSet);
@ -484,7 +484,7 @@ int ViEFileImpl::StartRecordOutgoingVideo(const int videoChannel,
fileFormat) != 0)
{
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo,
ViEId(_instanceId, videoChannel),
ViEId(instance_id_, videoChannel),
"%s: Failed to start recording. Check arguments.",
__FUNCTION__);
SetLastError(kViEFileUnknownError);
@ -497,15 +497,15 @@ int ViEFileImpl::StartRecordOutgoingVideo(const int videoChannel,
int ViEFileImpl::StopRecordOutgoingVideo(const int videoChannel)
{
WEBRTC_TRACE(webrtc::kTraceApiCall, webrtc::kTraceVideo,
ViEId(_instanceId, videoChannel), "%s videoChannel: %d)",
ViEId(instance_id_, videoChannel), "%s videoChannel: %d)",
__FUNCTION__, videoChannel);
ViEChannelManagerScoped cs(_channelManager);
ViEChannelManagerScoped cs(channel_manager_);
ViEEncoder* ptrViEEncoder = cs.Encoder(videoChannel);
if (ptrViEEncoder == NULL)
{
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo,
ViEId(_instanceId, videoChannel),
ViEId(instance_id_, videoChannel),
"%s: Channel %d doesn't exist", __FUNCTION__,
videoChannel);
SetLastError(kViEFileInvalidChannelId);
@ -515,7 +515,7 @@ int ViEFileImpl::StopRecordOutgoingVideo(const int videoChannel)
if (!fileRecorder.RecordingStarted())
{
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo,
ViEId(_instanceId, videoChannel),
ViEId(instance_id_, videoChannel),
"%s: Channel %d is not recording.", __FUNCTION__,
videoChannel);
SetLastError(kViEFileNotRecording);
@ -524,7 +524,7 @@ int ViEFileImpl::StopRecordOutgoingVideo(const int videoChannel)
if (fileRecorder.StopRecording() != 0)
{
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo,
ViEId(_instanceId, videoChannel),
ViEId(instance_id_, videoChannel),
"%s: Failed to stop recording of channel %d.",
__FUNCTION__, videoChannel);
SetLastError(kViEFileUnknownError);
@ -536,15 +536,15 @@ int ViEFileImpl::StopRecordOutgoingVideo(const int videoChannel)
int ViEFileImpl::StopRecordIncomingVideo(const int videoChannel)
{
WEBRTC_TRACE(webrtc::kTraceApiCall, webrtc::kTraceVideo,
ViEId(_instanceId, videoChannel), "%s videoChannel: %d)",
ViEId(instance_id_, videoChannel), "%s videoChannel: %d)",
__FUNCTION__, videoChannel);
ViEChannelManagerScoped cs(_channelManager);
ViEChannelManagerScoped cs(channel_manager_);
ViEChannel* ptrViEChannel = cs.Channel(videoChannel);
if (ptrViEChannel == NULL)
{
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo,
ViEId(_instanceId, videoChannel),
ViEId(instance_id_, videoChannel),
"%s: Channel %d doesn't exist", __FUNCTION__,
videoChannel);
SetLastError(kViEFileInvalidChannelId);
@ -554,7 +554,7 @@ int ViEFileImpl::StopRecordIncomingVideo(const int videoChannel)
if (!fileRecorder.RecordingStarted())
{
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo,
ViEId(_instanceId, videoChannel),
ViEId(instance_id_, videoChannel),
"%s: Channel %d is not recording.", __FUNCTION__,
videoChannel);
SetLastError(kViEFileNotRecording);
@ -565,7 +565,7 @@ int ViEFileImpl::StopRecordIncomingVideo(const int videoChannel)
if (fileRecorder.StopRecording() != 0)
{
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo,
ViEId(_instanceId, videoChannel),
ViEId(instance_id_, videoChannel),
"%s: Failed to stop recording of channel %d.",
__FUNCTION__, videoChannel);
SetLastError(kViEFileUnknownError);
@ -587,15 +587,15 @@ int ViEFileImpl::StartRecordIncomingVideo(const int videoChannel,
/*= webrtc::kFileFormatAviFile*/)
{
WEBRTC_TRACE(webrtc::kTraceApiCall, webrtc::kTraceVideo,
ViEId(_instanceId, videoChannel), "%s videoChannel: %d)",
ViEId(instance_id_, videoChannel), "%s videoChannel: %d)",
__FUNCTION__, videoChannel);
ViEChannelManagerScoped cs(_channelManager);
ViEChannelManagerScoped cs(channel_manager_);
ViEChannel* ptrViEChannel = cs.Channel(videoChannel);
if (ptrViEChannel == NULL)
{
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo,
ViEId(_instanceId, videoChannel),
ViEId(instance_id_, videoChannel),
"%s: Channel %d doesn't exist", __FUNCTION__,
videoChannel);
SetLastError(kViEFileInvalidChannelId);
@ -605,7 +605,7 @@ int ViEFileImpl::StartRecordIncomingVideo(const int videoChannel,
if (fileRecorder.RecordingStarted())
{
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo,
ViEId(_instanceId, videoChannel),
ViEId(instance_id_, videoChannel),
"%s: Already recording outgoing video on channel %d",
__FUNCTION__, videoChannel);
SetLastError(kViEFileAlreadyRecording);
@ -617,12 +617,12 @@ int ViEFileImpl::StartRecordIncomingVideo(const int videoChannel,
if (audioSource != NO_AUDIO)
{
veChannelId = ptrViEChannel->VoiceChannel();
vePtr = _channelManager.GetVoiceEngine();
vePtr = channel_manager_.GetVoiceEngine();
if (!vePtr)
{
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo,
ViEId(_instanceId, videoChannel),
ViEId(instance_id_, videoChannel),
"%s: Can't access voice engine. Have SetVoiceEngine "
"been called?", __FUNCTION__);
SetLastError(kViEFileVoENotSet);
@ -634,7 +634,7 @@ int ViEFileImpl::StartRecordIncomingVideo(const int videoChannel,
!= 0)
{
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo,
ViEId(_instanceId, videoChannel),
ViEId(instance_id_, videoChannel),
"%s: Failed to start recording. Check arguments.",
__FUNCTION__);
SetLastError(kViEFileUnknownError);
@ -660,7 +660,7 @@ int ViEFileImpl::GetFileInformation(const char* fileName,
/*= webrtc::kFileFormatAviFile*/)
{
return ViEFilePlayer::GetFileInformation(
_instanceId, (WebRtc_Word8*) fileName,
instance_id_, (WebRtc_Word8*) fileName,
videoCodec, audioCodec, fileFormat);
}
@ -674,7 +674,7 @@ int ViEFileImpl::GetRenderSnapshot(const int videoChannel,
{
// gain access to the renderer for the specified channel and get it's
// current frame
ViERenderManagerScoped rs(_renderManager);
ViERenderManagerScoped rs(render_manager_);
ViERenderer* ptrRender = rs.Renderer(videoChannel);
if (!ptrRender)
{
@ -705,7 +705,7 @@ int ViEFileImpl::GetRenderSnapshot(const int videoChannel,
{
// could not set filename for whatever reason
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo,
_instanceId,
instance_id_,
"\tCould not open output file '%s' for writing!",
fileNameUTF8);
return -1;
@ -720,7 +720,7 @@ int ViEFileImpl::GetRenderSnapshot(const int videoChannel,
{
// could not encode i420->jpeg
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo,
_instanceId,
instance_id_,
"\tCould not encode i420 -> jpeg file '%s' for "
"writing!", fileNameUTF8);
if (inputImage._buffer)
@ -737,7 +737,7 @@ int ViEFileImpl::GetRenderSnapshot(const int videoChannel,
}
default:
{
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceFile, _instanceId,
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceFile, instance_id_,
"\tUnsupported file format for %s", __FUNCTION__);
return -1;
break;
@ -756,7 +756,7 @@ int ViEFileImpl::GetRenderSnapshot(const int videoChannel, ViEPicture& picture)
// gain access to the renderer for the specified channel and get it's
// current frame
ViERenderManagerScoped rs(_renderManager);
ViERenderManagerScoped rs(render_manager_);
ViERenderer* ptrRender = rs.Renderer(videoChannel);
if (!ptrRender)
{
@ -791,7 +791,7 @@ int ViEFileImpl::GetRenderSnapshot(const int videoChannel, ViEPicture& picture)
int ViEFileImpl::GetCaptureDeviceSnapshot(const int captureId,
const char* fileNameUTF8)
{
ViEInputManagerScoped is(_inputManager);
ViEInputManagerScoped is(input_manager_);
ViECapturer* ptrCapture = is.Capture(captureId);
if (!ptrCapture)
{
@ -802,7 +802,7 @@ int ViEFileImpl::GetCaptureDeviceSnapshot(const int captureId,
if (GetNextCapturedFrame(captureId, videoFrame) == -1)
{
// Failed to get a snapshot...
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo, _instanceId,
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo, instance_id_,
"Could not gain acces to capture device %d video frame "
"%s:%d", captureId, __FUNCTION__);
return -1;
@ -831,7 +831,7 @@ int ViEFileImpl::GetCaptureDeviceSnapshot(const int captureId,
{
// could not set filename for whatever reason
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo,
_instanceId,
instance_id_,
"\tCould not open output file '%s' for writing!",
fileNameUTF8);
@ -846,7 +846,7 @@ int ViEFileImpl::GetCaptureDeviceSnapshot(const int captureId,
{
// could not encode i420->jpeg
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo,
_instanceId,
instance_id_,
"\tCould not encode i420 -> jpeg file '%s' for "
"writing!", fileNameUTF8);
@ -863,7 +863,7 @@ int ViEFileImpl::GetCaptureDeviceSnapshot(const int captureId,
}
default:
{
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceFile, _instanceId,
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceFile, instance_id_,
"\tUnsupported file format for %s", __FUNCTION__);
return -1;
break;
@ -882,7 +882,7 @@ int ViEFileImpl::GetCaptureDeviceSnapshot(const int captureId,
ViEPicture& picture)
{
VideoFrame videoFrame;
ViEInputManagerScoped is(_inputManager);
ViEInputManagerScoped is(input_manager_);
ViECapturer* ptrCapture = is.Capture(captureId);
if (!ptrCapture)
{
@ -892,7 +892,7 @@ int ViEFileImpl::GetCaptureDeviceSnapshot(const int captureId,
if (GetNextCapturedFrame(captureId, videoFrame) == -1)
{
// Failed to get a snapshot...
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo, _instanceId,
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo, instance_id_,
"Could not gain acces to capture device %d video frame "
"%s:%d", captureId, __FUNCTION__);
return -1;
@ -944,10 +944,10 @@ int ViEFileImpl::FreePicture(ViEPicture& picture)
int ViEFileImpl::SetCaptureDeviceImage(const int captureId,
const char* fileNameUTF8)
{
WEBRTC_TRACE(webrtc::kTraceApiCall, webrtc::kTraceVideo, _instanceId,
WEBRTC_TRACE(webrtc::kTraceApiCall, webrtc::kTraceVideo, instance_id_,
"%s(captureId: %d)", __FUNCTION__, captureId);
ViEInputManagerScoped is(_inputManager);
ViEInputManagerScoped is(input_manager_);
ViECapturer* ptrCapture = is.Capture(captureId);
if (!ptrCapture)
{
@ -957,10 +957,10 @@ int ViEFileImpl::SetCaptureDeviceImage(const int captureId,
VideoFrame captureImage;
if (ViEFileImage::ConvertJPEGToVideoFrame(
ViEId(_instanceId, captureId), fileNameUTF8, captureImage) != 0)
ViEId(instance_id_, captureId), fileNameUTF8, captureImage) != 0)
{
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo,
ViEId(_instanceId, captureId),
ViEId(instance_id_, captureId),
"%s(captureId: %d) Failed to open file.", __FUNCTION__,
captureId);
SetLastError(kViEFileInvalidFile);
@ -983,19 +983,19 @@ int ViEFileImpl::SetCaptureDeviceImage(const int captureId,
int ViEFileImpl::SetCaptureDeviceImage(const int captureId,
const ViEPicture& picture)
{
WEBRTC_TRACE(webrtc::kTraceApiCall, webrtc::kTraceVideo, _instanceId,
WEBRTC_TRACE(webrtc::kTraceApiCall, webrtc::kTraceVideo, instance_id_,
"%s(captureId: %d)", __FUNCTION__, captureId);
if (picture.type != kVideoI420)
{
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo,
ViEId(_instanceId, captureId),
ViEId(instance_id_, captureId),
"%s(captureId: %d) Not a valid picture type.",
__FUNCTION__, captureId);
SetLastError(kViEFileInvalidArgument);
return -1;
}
ViEInputManagerScoped is(_inputManager);
ViEInputManagerScoped is(input_manager_);
ViECapturer* ptrCapture = is.Capture(captureId);
if (!ptrCapture)
{
@ -1005,10 +1005,10 @@ int ViEFileImpl::SetCaptureDeviceImage(const int captureId,
VideoFrame captureImage;
if (ViEFileImage::ConvertPictureToVideoFrame(
ViEId(_instanceId,captureId), picture, captureImage) != 0)
ViEId(instance_id_,captureId), picture, captureImage) != 0)
{
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo,
ViEId(_instanceId, captureId),
ViEId(instance_id_, captureId),
"%s(captureId: %d) Failed to use picture.", __FUNCTION__,
captureId);
SetLastError(kViEFileInvalidFile);
@ -1036,10 +1036,10 @@ int ViEFileImpl::SetRenderStartImage(const int videoChannel,
const char* fileNameUTF8)
{
WEBRTC_TRACE(webrtc::kTraceApiCall, webrtc::kTraceVideo,
ViEId(_instanceId, videoChannel), "%s(videoChannel: %d)",
ViEId(instance_id_, videoChannel), "%s(videoChannel: %d)",
__FUNCTION__, videoChannel);
ViERenderManagerScoped rs(_renderManager);
ViERenderManagerScoped rs(render_manager_);
ViERenderer* ptrRender = rs.Renderer(videoChannel);
if (!ptrRender)
{
@ -1049,10 +1049,10 @@ int ViEFileImpl::SetRenderStartImage(const int videoChannel,
VideoFrame startImage;
if (ViEFileImage::ConvertJPEGToVideoFrame(
ViEId(_instanceId, videoChannel), fileNameUTF8, startImage) != 0)
ViEId(instance_id_, videoChannel), fileNameUTF8, startImage) != 0)
{
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo,
ViEId(_instanceId, videoChannel),
ViEId(instance_id_, videoChannel),
"%s(videoChannel: %d) Failed to open file.", __FUNCTION__,
videoChannel);
SetLastError(kViEFileInvalidFile);
@ -1076,20 +1076,20 @@ int ViEFileImpl::SetRenderStartImage(const int videoChannel,
const ViEPicture& picture)
{
WEBRTC_TRACE(webrtc::kTraceApiCall, webrtc::kTraceVideo,
ViEId(_instanceId, videoChannel), "%s(videoChannel: %d)",
ViEId(instance_id_, videoChannel), "%s(videoChannel: %d)",
__FUNCTION__, videoChannel);
if (picture.type != kVideoI420)
{
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo,
ViEId(_instanceId, videoChannel),
ViEId(instance_id_, videoChannel),
"%s(videoChannel: %d) Not a valid picture type.",
__FUNCTION__, videoChannel);
SetLastError(kViEFileInvalidArgument);
return -1;
}
ViERenderManagerScoped rs(_renderManager);
ViERenderManagerScoped rs(render_manager_);
ViERenderer* ptrRender = rs.Renderer(videoChannel);
if (!ptrRender)
{
@ -1099,10 +1099,10 @@ int ViEFileImpl::SetRenderStartImage(const int videoChannel,
VideoFrame startImage;
if (ViEFileImage::ConvertPictureToVideoFrame(
ViEId(_instanceId, videoChannel), picture, startImage) != 0)
ViEId(instance_id_, videoChannel), picture, startImage) != 0)
{
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo,
ViEId(_instanceId, videoChannel),
ViEId(instance_id_, videoChannel),
"%s(videoChannel: %d) Failed to use picture.",
__FUNCTION__, videoChannel);
SetLastError(kViEFileInvalidCapture);
@ -1131,10 +1131,10 @@ int ViEFileImpl::SetRenderTimeoutImage(const int videoChannel,
const unsigned int timeoutMs)
{
WEBRTC_TRACE(webrtc::kTraceApiCall, webrtc::kTraceVideo,
ViEId(_instanceId, videoChannel), "%s(videoChannel: %d)",
ViEId(instance_id_, videoChannel), "%s(videoChannel: %d)",
__FUNCTION__, videoChannel);
ViERenderManagerScoped rs(_renderManager);
ViERenderManagerScoped rs(render_manager_);
ViERenderer* ptrRender = rs.Renderer(videoChannel);
if (!ptrRender)
{
@ -1143,10 +1143,10 @@ int ViEFileImpl::SetRenderTimeoutImage(const int videoChannel,
}
VideoFrame timeoutImage;
if (ViEFileImage::ConvertJPEGToVideoFrame(
ViEId(_instanceId,videoChannel), fileNameUTF8, timeoutImage) != 0)
ViEId(instance_id_,videoChannel), fileNameUTF8, timeoutImage) != 0)
{
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo,
ViEId(_instanceId, videoChannel),
ViEId(instance_id_, videoChannel),
"%s(videoChannel: %d) Failed to open file.", __FUNCTION__,
videoChannel);
SetLastError(kViEFileInvalidFile);
@ -1156,7 +1156,7 @@ int ViEFileImpl::SetRenderTimeoutImage(const int videoChannel,
if (timeoutMs < kViEMinRenderTimeoutTimeMs)
{
WEBRTC_TRACE(webrtc::kTraceWarning, webrtc::kTraceVideo,
ViEId(_instanceId, videoChannel),
ViEId(instance_id_, videoChannel),
"%s(videoChannel: %d) Invalid timeoutMs, using %d.",
__FUNCTION__, videoChannel, kViEMinRenderTimeoutTimeMs);
timeoutTime = kViEMinRenderTimeoutTimeMs;
@ -1164,7 +1164,7 @@ int ViEFileImpl::SetRenderTimeoutImage(const int videoChannel,
if (timeoutMs > kViEMaxRenderTimeoutTimeMs)
{
WEBRTC_TRACE(webrtc::kTraceWarning, webrtc::kTraceVideo,
ViEId(_instanceId, videoChannel),
ViEId(instance_id_, videoChannel),
"%s(videoChannel: %d) Invalid timeoutMs, using %d.",
__FUNCTION__, videoChannel, kViEMaxRenderTimeoutTimeMs);
timeoutTime = kViEMaxRenderTimeoutTimeMs;
@ -1182,20 +1182,20 @@ int ViEFileImpl::SetRenderTimeoutImage(const int videoChannel,
const unsigned int timeoutMs)
{
WEBRTC_TRACE(webrtc::kTraceApiCall, webrtc::kTraceVideo,
ViEId(_instanceId, videoChannel), "%s(videoChannel: %d)",
ViEId(instance_id_, videoChannel), "%s(videoChannel: %d)",
__FUNCTION__, videoChannel);
if (picture.type != kVideoI420)
{
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo,
ViEId(_instanceId, videoChannel),
ViEId(instance_id_, videoChannel),
"%s(videoChannel: %d) Not a valid picture type.",
__FUNCTION__, videoChannel);
SetLastError(kViEFileInvalidArgument);
return -1;
}
ViERenderManagerScoped rs(_renderManager);
ViERenderManagerScoped rs(render_manager_);
ViERenderer* ptrRender = rs.Renderer(videoChannel);
if (!ptrRender)
{
@ -1204,10 +1204,10 @@ int ViEFileImpl::SetRenderTimeoutImage(const int videoChannel,
}
VideoFrame timeoutImage;
if (ViEFileImage::ConvertPictureToVideoFrame(
ViEId(_instanceId, videoChannel), picture, timeoutImage) != 0)
ViEId(instance_id_, videoChannel), picture, timeoutImage) != 0)
{
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo,
ViEId(_instanceId, videoChannel),
ViEId(instance_id_, videoChannel),
"%s(videoChannel: %d) Failed to use picture.",
__FUNCTION__, videoChannel);
SetLastError(kViEFileInvalidCapture);
@ -1217,7 +1217,7 @@ int ViEFileImpl::SetRenderTimeoutImage(const int videoChannel,
if (timeoutMs < kViEMinRenderTimeoutTimeMs)
{
WEBRTC_TRACE(webrtc::kTraceWarning, webrtc::kTraceVideo,
ViEId(_instanceId, videoChannel),
ViEId(instance_id_, videoChannel),
"%s(videoChannel: %d) Invalid timeoutMs, using %d.",
__FUNCTION__, videoChannel, kViEMinRenderTimeoutTimeMs);
timeoutTime = kViEMinRenderTimeoutTimeMs;
@ -1225,7 +1225,7 @@ int ViEFileImpl::SetRenderTimeoutImage(const int videoChannel,
if (timeoutMs > kViEMaxRenderTimeoutTimeMs)
{
WEBRTC_TRACE(webrtc::kTraceWarning, webrtc::kTraceVideo,
ViEId(_instanceId, videoChannel),
ViEId(instance_id_, videoChannel),
"%s(videoChannel: %d) Invalid timeoutMs, using %d.",
__FUNCTION__, videoChannel, kViEMaxRenderTimeoutTimeMs);
timeoutTime = kViEMaxRenderTimeoutTimeMs;
@ -1241,7 +1241,7 @@ int ViEFileImpl::SetRenderTimeoutImage(const int videoChannel,
WebRtc_Word32 ViEFileImpl::GetNextCapturedFrame(WebRtc_Word32 captureId,
VideoFrame& videoFrame)
{
ViEInputManagerScoped is(_inputManager);
ViEInputManagerScoped is(input_manager_);
ViECapturer* ptrCapture = is.Capture(captureId);
if (!ptrCapture)
{

View File

@ -58,19 +58,19 @@ ViEImageProcess* ViEImageProcess::GetInterface(VideoEngine* videoEngine)
int ViEImageProcessImpl::Release()
{
WEBRTC_TRACE(webrtc::kTraceApiCall, webrtc::kTraceVideo, _instanceId,
WEBRTC_TRACE(webrtc::kTraceApiCall, webrtc::kTraceVideo, instance_id_,
"ViEImageProcess::Release()");
(*this)--; // Decrease ref count
WebRtc_Word32 refCount = GetCount();
if (refCount < 0)
{
WEBRTC_TRACE(webrtc::kTraceWarning, webrtc::kTraceVideo, _instanceId,
WEBRTC_TRACE(webrtc::kTraceWarning, webrtc::kTraceVideo, instance_id_,
"ViEImageProcess release too many times");
SetLastError(kViEAPIDoesNotExist);
return -1;
}
WEBRTC_TRACE(webrtc::kTraceInfo, webrtc::kTraceVideo, _instanceId,
WEBRTC_TRACE(webrtc::kTraceInfo, webrtc::kTraceVideo, instance_id_,
"ViEImageProcess reference count: %d", refCount);
return refCount;
}
@ -81,7 +81,7 @@ int ViEImageProcessImpl::Release()
ViEImageProcessImpl::ViEImageProcessImpl()
{
WEBRTC_TRACE(webrtc::kTraceMemory, webrtc::kTraceVideo, _instanceId,
WEBRTC_TRACE(webrtc::kTraceMemory, webrtc::kTraceVideo, instance_id_,
"ViEImageProcessImpl::ViEImageProcessImpl() Ctor");
}
@ -91,7 +91,7 @@ ViEImageProcessImpl::ViEImageProcessImpl()
ViEImageProcessImpl::~ViEImageProcessImpl()
{
WEBRTC_TRACE(webrtc::kTraceMemory, webrtc::kTraceVideo, _instanceId,
WEBRTC_TRACE(webrtc::kTraceMemory, webrtc::kTraceVideo, instance_id_,
"ViEImageProcessImpl::~ViEImageProcessImpl() Dtor");
}
@ -108,22 +108,22 @@ ViEImageProcessImpl::~ViEImageProcessImpl()
int ViEImageProcessImpl::RegisterCaptureEffectFilter(
const int captureId, ViEEffectFilter& captureFilter)
{
WEBRTC_TRACE(webrtc::kTraceApiCall, webrtc::kTraceVideo, ViEId(_instanceId),
WEBRTC_TRACE(webrtc::kTraceApiCall, webrtc::kTraceVideo, ViEId(instance_id_),
"%s(captureId: %d)", __FUNCTION__, captureId);
if (!IsInitialized())
if (!Initialized())
{
SetLastError(kViENotInitialized);
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo, ViEId(_instanceId),
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo, ViEId(instance_id_),
"%s - ViE instance %d not initialized", __FUNCTION__,
_instanceId);
instance_id_);
return -1;
}
ViEInputManagerScoped is(_inputManager);
ViEInputManagerScoped is(input_manager_);
ViECapturer* vieCapture = is.Capture(captureId);
if (vieCapture == NULL)
{
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo, ViEId(_instanceId),
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo, ViEId(instance_id_),
"%s: Capture device %d doesn't exist", __FUNCTION__,
captureId);
SetLastError(kViEImageProcessInvalidCaptureId);
@ -146,14 +146,14 @@ int ViEImageProcessImpl::RegisterCaptureEffectFilter(
int ViEImageProcessImpl::DeregisterCaptureEffectFilter(const int captureId)
{
WEBRTC_TRACE(webrtc::kTraceApiCall, webrtc::kTraceVideo, ViEId(_instanceId),
WEBRTC_TRACE(webrtc::kTraceApiCall, webrtc::kTraceVideo, ViEId(instance_id_),
"%s(captureId: %d)", __FUNCTION__, captureId);
ViEInputManagerScoped is(_inputManager);
ViEInputManagerScoped is(input_manager_);
ViECapturer* vieCapture = is.Capture(captureId);
if (vieCapture == NULL)
{
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo, ViEId(_instanceId),
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo, ViEId(instance_id_),
"%s: Capture device %d doesn't exist", __FUNCTION__,
captureId);
SetLastError(kViEImageProcessInvalidCaptureId);
@ -176,14 +176,14 @@ int ViEImageProcessImpl::DeregisterCaptureEffectFilter(const int captureId)
int ViEImageProcessImpl::RegisterSendEffectFilter(const int videoChannel,
ViEEffectFilter& sendFilter)
{
WEBRTC_TRACE(webrtc::kTraceApiCall, webrtc::kTraceVideo, ViEId(_instanceId),
WEBRTC_TRACE(webrtc::kTraceApiCall, webrtc::kTraceVideo, ViEId(instance_id_),
"%s(videoChannel: %d)", __FUNCTION__, videoChannel);
ViEChannelManagerScoped cs(_channelManager);
ViEChannelManagerScoped cs(channel_manager_);
ViEEncoder* vieEncoder = cs.Encoder(videoChannel);
if (vieEncoder == NULL)
{
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo, ViEId(_instanceId),
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo, ViEId(instance_id_),
"%s: Channel %d doesn't exist", __FUNCTION__, videoChannel);
SetLastError(kViEImageProcessInvalidChannelId);
return -1;
@ -205,14 +205,14 @@ int ViEImageProcessImpl::RegisterSendEffectFilter(const int videoChannel,
int ViEImageProcessImpl::DeregisterSendEffectFilter(const int videoChannel)
{
WEBRTC_TRACE(webrtc::kTraceApiCall, webrtc::kTraceVideo, ViEId(_instanceId),
WEBRTC_TRACE(webrtc::kTraceApiCall, webrtc::kTraceVideo, ViEId(instance_id_),
"%s(videoChannel: %d)", __FUNCTION__, videoChannel);
ViEChannelManagerScoped cs(_channelManager);
ViEChannelManagerScoped cs(channel_manager_);
ViEEncoder* vieEncoder = cs.Encoder(videoChannel);
if (vieEncoder == NULL)
{
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo, ViEId(_instanceId),
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo, ViEId(instance_id_),
"%s: Channel %d doesn't exist", __FUNCTION__, videoChannel);
SetLastError(kViEImageProcessInvalidChannelId);
return -1;
@ -234,14 +234,14 @@ int ViEImageProcessImpl::DeregisterSendEffectFilter(const int videoChannel)
int ViEImageProcessImpl::RegisterRenderEffectFilter(
const int videoChannel, ViEEffectFilter& renderFilter)
{
WEBRTC_TRACE(webrtc::kTraceApiCall, webrtc::kTraceVideo, ViEId(_instanceId),
WEBRTC_TRACE(webrtc::kTraceApiCall, webrtc::kTraceVideo, ViEId(instance_id_),
"%s(videoChannel: %d)", __FUNCTION__, videoChannel);
ViEChannelManagerScoped cs(_channelManager);
ViEChannelManagerScoped cs(channel_manager_);
ViEChannel* vieChannel = cs.Channel(videoChannel);
if (vieChannel == NULL)
{
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo, ViEId(_instanceId),
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo, ViEId(instance_id_),
"%s: Channel %d doesn't exist", __FUNCTION__, videoChannel);
SetLastError(kViEImageProcessInvalidChannelId);
return -1;
@ -262,14 +262,14 @@ int ViEImageProcessImpl::RegisterRenderEffectFilter(
int ViEImageProcessImpl::DeregisterRenderEffectFilter(const int videoChannel)
{
WEBRTC_TRACE(webrtc::kTraceApiCall, webrtc::kTraceVideo, ViEId(_instanceId),
WEBRTC_TRACE(webrtc::kTraceApiCall, webrtc::kTraceVideo, ViEId(instance_id_),
"%s(videoChannel: %d)", __FUNCTION__, videoChannel);
ViEChannelManagerScoped cs(_channelManager);
ViEChannelManagerScoped cs(channel_manager_);
ViEChannel* vieChannel = cs.Channel(videoChannel);
if (vieChannel == NULL)
{
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo, ViEId(_instanceId),
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo, ViEId(instance_id_),
"%s: Channel %d doesn't exist", __FUNCTION__, videoChannel);
SetLastError(kViEImageProcessInvalidChannelId);
return -1;
@ -296,14 +296,14 @@ int ViEImageProcessImpl::DeregisterRenderEffectFilter(const int videoChannel)
int ViEImageProcessImpl::EnableDeflickering(const int captureId,
const bool enable)
{
WEBRTC_TRACE(webrtc::kTraceApiCall, webrtc::kTraceVideo, ViEId(_instanceId),
WEBRTC_TRACE(webrtc::kTraceApiCall, webrtc::kTraceVideo, ViEId(instance_id_),
"%s(captureId: %d, enable: %d)", __FUNCTION__, captureId, enable);
ViEInputManagerScoped is(_inputManager);
ViEInputManagerScoped is(input_manager_);
ViECapturer* vieCapture = is.Capture(captureId);
if (vieCapture == NULL)
{
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo, ViEId(_instanceId),
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo, ViEId(instance_id_),
"%s: Capture device %d doesn't exist", __FUNCTION__,
captureId);
SetLastError(kViEImageProcessInvalidChannelId);
@ -331,14 +331,14 @@ int ViEImageProcessImpl::EnableDeflickering(const int captureId,
int ViEImageProcessImpl::EnableDenoising(const int captureId, const bool enable)
{
WEBRTC_TRACE(webrtc::kTraceApiCall, webrtc::kTraceVideo, ViEId(_instanceId),
WEBRTC_TRACE(webrtc::kTraceApiCall, webrtc::kTraceVideo, ViEId(instance_id_),
"%s(captureId: %d, enable: %d)", __FUNCTION__, captureId, enable);
ViEInputManagerScoped is(_inputManager);
ViEInputManagerScoped is(input_manager_);
ViECapturer* vieCapture = is.Capture(captureId);
if (vieCapture == NULL)
{
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo, ViEId(_instanceId),
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo, ViEId(instance_id_),
"%s: Capture device %d doesn't exist", __FUNCTION__,
captureId);
SetLastError(kViEImageProcessInvalidCaptureId);
@ -368,15 +368,15 @@ int ViEImageProcessImpl::EnableDenoising(const int captureId, const bool enable)
int ViEImageProcessImpl::EnableColorEnhancement(const int videoChannel,
const bool enable)
{
WEBRTC_TRACE(webrtc::kTraceApiCall, webrtc::kTraceVideo, ViEId(_instanceId),
WEBRTC_TRACE(webrtc::kTraceApiCall, webrtc::kTraceVideo, ViEId(instance_id_),
"%s(videoChannel: %d, enable: %d)", __FUNCTION__, videoChannel,
enable);
ViEChannelManagerScoped cs(_channelManager);
ViEChannelManagerScoped cs(channel_manager_);
ViEChannel* vieChannel = cs.Channel(videoChannel);
if (vieChannel == NULL)
{
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo, ViEId(_instanceId),
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo, ViEId(instance_id_),
"%s: Channel %d doesn't exist", __FUNCTION__, videoChannel);
SetLastError(kViEImageProcessInvalidChannelId);
return -1;

View File

@ -67,19 +67,19 @@ ViENetwork* ViENetwork::GetInterface(VideoEngine* videoEngine)
int ViENetworkImpl::Release()
{
WEBRTC_TRACE(webrtc::kTraceApiCall, webrtc::kTraceVideo, _instanceId,
WEBRTC_TRACE(webrtc::kTraceApiCall, webrtc::kTraceVideo, instance_id_,
"ViENetwork::Release()");
(*this)--; // Decrease ref count
WebRtc_Word32 refCount = GetCount();
if (refCount < 0)
{
WEBRTC_TRACE(webrtc::kTraceWarning, webrtc::kTraceVideo, _instanceId,
WEBRTC_TRACE(webrtc::kTraceWarning, webrtc::kTraceVideo, instance_id_,
"ViENetwork release too many times");
SetLastError(kViEAPIDoesNotExist);
return -1;
}
WEBRTC_TRACE(webrtc::kTraceInfo, webrtc::kTraceVideo, _instanceId,
WEBRTC_TRACE(webrtc::kTraceInfo, webrtc::kTraceVideo, instance_id_,
"ViENetwork reference count: %d", refCount);
return refCount;
}
@ -90,7 +90,7 @@ int ViENetworkImpl::Release()
ViENetworkImpl::ViENetworkImpl()
{
WEBRTC_TRACE(webrtc::kTraceMemory, webrtc::kTraceVideo, _instanceId,
WEBRTC_TRACE(webrtc::kTraceMemory, webrtc::kTraceVideo, instance_id_,
"ViENetworkImpl::ViENetworkImpl() Ctor");
}
@ -100,7 +100,7 @@ ViENetworkImpl::ViENetworkImpl()
ViENetworkImpl::~ViENetworkImpl()
{
WEBRTC_TRACE(webrtc::kTraceMemory, webrtc::kTraceVideo, _instanceId,
WEBRTC_TRACE(webrtc::kTraceMemory, webrtc::kTraceVideo, instance_id_,
"ViENetworkImpl::~ViENetworkImpl() Dtor");
}
@ -119,26 +119,26 @@ int ViENetworkImpl::SetLocalReceiver(const int videoChannel,
const char* ipAddress)
{
WEBRTC_TRACE(webrtc::kTraceApiCall, webrtc::kTraceVideo,
ViEId(_instanceId, videoChannel),
ViEId(instance_id_, videoChannel),
"%s(channel: %d, rtpPort: %u, rtcpPort: %u, ipAddress: %s)",
__FUNCTION__, videoChannel, rtpPort, rtcpPort, ipAddress);
if (!IsInitialized())
if (!Initialized())
{
SetLastError(kViENotInitialized);
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo, ViEId(_instanceId),
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo, ViEId(instance_id_),
"%s - ViE instance %d not initialized", __FUNCTION__,
_instanceId);
instance_id_);
return -1;
}
// Get the channel
ViEChannelManagerScoped cs(_channelManager);
ViEChannelManagerScoped cs(channel_manager_);
ViEChannel* ptrViEChannel = cs.Channel(videoChannel);
if (ptrViEChannel == NULL)
{
// The channel doesn't exists
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo,
ViEId(_instanceId,videoChannel), "Channel doesn't exist");
ViEId(instance_id_,videoChannel), "Channel doesn't exist");
SetLastError(kViENetworkInvalidChannelId);
return -1;
}
@ -166,17 +166,17 @@ int ViENetworkImpl::GetLocalReceiver(const int videoChannel,
unsigned short& rtcpPort, char* ipAddress)
{
WEBRTC_TRACE(webrtc::kTraceApiCall, webrtc::kTraceVideo,
ViEId(_instanceId, videoChannel), "%s(channel: %d)",
ViEId(instance_id_, videoChannel), "%s(channel: %d)",
__FUNCTION__, videoChannel);
// Get the channel
ViEChannelManagerScoped cs(_channelManager);
ViEChannelManagerScoped cs(channel_manager_);
ViEChannel* ptrViEChannel = cs.Channel(videoChannel);
if (ptrViEChannel == NULL)
{
// The channel doesn't exists
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo,
ViEId(_instanceId, videoChannel), "Channel doesn't exist");
ViEId(instance_id_, videoChannel), "Channel doesn't exist");
SetLastError(kViENetworkInvalidChannelId);
return -1;
}
@ -205,28 +205,28 @@ int ViENetworkImpl::SetSendDestination(const int videoChannel,
const unsigned short sourceRtcpPort)
{
WEBRTC_TRACE(webrtc::kTraceApiCall, webrtc::kTraceVideo,
ViEId(_instanceId, videoChannel),
ViEId(instance_id_, videoChannel),
"%s(channel: %d, ipAddress: %s, rtpPort: %u, rtcpPort: %u, "
"sourceRtpPort: %u, sourceRtcpPort: %u)",
__FUNCTION__, videoChannel, ipAddress, rtpPort, rtcpPort,
sourceRtpPort, sourceRtcpPort);
if (!IsInitialized())
if (!Initialized())
{
SetLastError(kViENotInitialized);
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo, ViEId(_instanceId),
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo, ViEId(instance_id_),
"%s - ViE instance %d not initialized", __FUNCTION__,
_instanceId);
instance_id_);
return -1;
}
// Get the channel
ViEChannelManagerScoped cs(_channelManager);
ViEChannelManagerScoped cs(channel_manager_);
ViEChannel* ptrViEChannel = cs.Channel(videoChannel);
if (ptrViEChannel == NULL)
{
// The channel doesn't exists
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo,
ViEId(_instanceId, videoChannel),
ViEId(instance_id_, videoChannel),
"%s Channel doesn't exist", __FUNCTION__);
SetLastError(kViENetworkInvalidChannelId);
return -1;
@ -234,7 +234,7 @@ int ViENetworkImpl::SetSendDestination(const int videoChannel,
if (ptrViEChannel->Sending())
{
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo,
ViEId(_instanceId, videoChannel),
ViEId(instance_id_, videoChannel),
"%s Channel already sending.", __FUNCTION__);
SetLastError(kViENetworkAlreadySending);
return -1;
@ -261,17 +261,17 @@ int ViENetworkImpl::GetSendDestination(const int videoChannel, char* ipAddress,
unsigned short& sourceRtcpPort)
{
WEBRTC_TRACE(webrtc::kTraceApiCall, webrtc::kTraceVideo,
ViEId(_instanceId, videoChannel), "%s(channel: %d)",
ViEId(instance_id_, videoChannel), "%s(channel: %d)",
__FUNCTION__, videoChannel);
// Get the channel
ViEChannelManagerScoped cs(_channelManager);
ViEChannelManagerScoped cs(channel_manager_);
ViEChannel* ptrViEChannel = cs.Channel(videoChannel);
if (ptrViEChannel == NULL)
{
// The channel doesn't exists
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo,
ViEId(_instanceId, videoChannel), "Channel doesn't exist");
ViEId(instance_id_, videoChannel), "Channel doesn't exist");
SetLastError(kViENetworkInvalidChannelId);
return -1;
}
@ -297,25 +297,25 @@ int ViENetworkImpl::RegisterSendTransport(const int videoChannel,
Transport& transport)
{
WEBRTC_TRACE(webrtc::kTraceApiCall, webrtc::kTraceVideo,
ViEId(_instanceId, videoChannel), "%s(channel: %d)",
ViEId(instance_id_, videoChannel), "%s(channel: %d)",
__FUNCTION__, videoChannel);
if (!IsInitialized())
if (!Initialized())
{
SetLastError(kViENotInitialized);
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo, ViEId(_instanceId),
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo, ViEId(instance_id_),
"%s - ViE instance %d not initialized", __FUNCTION__,
_instanceId);
instance_id_);
return -1;
}
// Get the channel
ViEChannelManagerScoped cs(_channelManager);
ViEChannelManagerScoped cs(channel_manager_);
ViEChannel* ptrViEChannel = cs.Channel(videoChannel);
if (ptrViEChannel == NULL)
{
// The channel doesn't exists
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo,
ViEId(_instanceId, videoChannel),
ViEId(instance_id_, videoChannel),
"%s Channel doesn't exist", __FUNCTION__);
SetLastError(kViENetworkInvalidChannelId);
return -1;
@ -323,7 +323,7 @@ int ViENetworkImpl::RegisterSendTransport(const int videoChannel,
if (ptrViEChannel->Sending())
{
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo,
ViEId(_instanceId, videoChannel),
ViEId(instance_id_, videoChannel),
"%s Channel already sending.", __FUNCTION__);
SetLastError(kViENetworkAlreadySending);
return -1;
@ -345,17 +345,17 @@ int ViENetworkImpl::RegisterSendTransport(const int videoChannel,
int ViENetworkImpl::DeregisterSendTransport(const int videoChannel)
{
WEBRTC_TRACE(webrtc::kTraceApiCall, webrtc::kTraceVideo,
ViEId(_instanceId, videoChannel), "%s(channel: %d)",
ViEId(instance_id_, videoChannel), "%s(channel: %d)",
__FUNCTION__, videoChannel);
// Get the channel
ViEChannelManagerScoped cs(_channelManager);
ViEChannelManagerScoped cs(channel_manager_);
ViEChannel* ptrViEChannel = cs.Channel(videoChannel);
if (ptrViEChannel == NULL)
{
// The channel doesn't exists
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo,
ViEId(_instanceId, videoChannel),
ViEId(instance_id_, videoChannel),
"%s Channel doesn't exist", __FUNCTION__);
SetLastError(kViENetworkInvalidChannelId);
return -1;
@ -363,7 +363,7 @@ int ViENetworkImpl::DeregisterSendTransport(const int videoChannel)
if (ptrViEChannel->Sending())
{
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo,
ViEId(_instanceId, videoChannel),
ViEId(instance_id_, videoChannel),
"%s Channel already sending", __FUNCTION__);
SetLastError(kViENetworkAlreadySending);
return -1;
@ -385,26 +385,26 @@ int ViENetworkImpl::ReceivedRTPPacket(const int videoChannel, const void* data,
const int length)
{
WEBRTC_TRACE(webrtc::kTraceApiCall, webrtc::kTraceVideo,
ViEId(_instanceId, videoChannel),
ViEId(instance_id_, videoChannel),
"%s(channel: %d, data: -, length: %d)", __FUNCTION__,
videoChannel, length);
if (!IsInitialized())
if (!Initialized())
{
SetLastError(kViENotInitialized);
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo, ViEId(_instanceId),
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo, ViEId(instance_id_),
"%s - ViE instance %d not initialized", __FUNCTION__,
_instanceId);
instance_id_);
return -1;
}
// Get the channel
ViEChannelManagerScoped cs(_channelManager);
ViEChannelManagerScoped cs(channel_manager_);
ViEChannel* ptrViEChannel = cs.Channel(videoChannel);
if (ptrViEChannel == NULL)
{
// The channel doesn't exists
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo,
ViEId(_instanceId, videoChannel), "Channel doesn't exist");
ViEId(instance_id_, videoChannel), "Channel doesn't exist");
SetLastError(kViENetworkInvalidChannelId);
return -1;
}
@ -420,26 +420,26 @@ int ViENetworkImpl::ReceivedRTCPPacket(const int videoChannel,
const void* data, const int length)
{
WEBRTC_TRACE(webrtc::kTraceApiCall, webrtc::kTraceVideo,
ViEId(_instanceId, videoChannel),
ViEId(instance_id_, videoChannel),
"%s(channel: %d, data: -, length: %d)", __FUNCTION__,
videoChannel, length);
if (!IsInitialized())
if (!Initialized())
{
SetLastError(kViENotInitialized);
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo, ViEId(_instanceId),
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo, ViEId(instance_id_),
"%s - ViE instance %d not initialized", __FUNCTION__,
_instanceId);
instance_id_);
return -1;
}
// Get the channel
ViEChannelManagerScoped cs(_channelManager);
ViEChannelManagerScoped cs(channel_manager_);
ViEChannel* ptrViEChannel = cs.Channel(videoChannel);
if (ptrViEChannel == NULL)
{
// The channel doesn't exists
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo,
ViEId(_instanceId, videoChannel), "Channel doesn't exist");
ViEId(instance_id_, videoChannel), "Channel doesn't exist");
SetLastError(kViENetworkInvalidChannelId);
return -1;
}
@ -461,17 +461,17 @@ int ViENetworkImpl::GetSourceInfo(const int videoChannel,
unsigned int ipAddressLength)
{
WEBRTC_TRACE(webrtc::kTraceApiCall, webrtc::kTraceVideo,
ViEId(_instanceId, videoChannel), "%s(channel: %d)",
ViEId(instance_id_, videoChannel), "%s(channel: %d)",
__FUNCTION__, videoChannel);
// Get the channel
ViEChannelManagerScoped cs(_channelManager);
ViEChannelManagerScoped cs(channel_manager_);
ViEChannel* ptrViEChannel = cs.Channel(videoChannel);
if (ptrViEChannel == NULL)
{
// The channel doesn't exists
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo,
ViEId(_instanceId, videoChannel), "Channel doesn't exist");
ViEId(instance_id_, videoChannel), "Channel doesn't exist");
SetLastError(kViENetworkInvalidChannelId);
return -1;
}
@ -491,22 +491,22 @@ int ViENetworkImpl::GetSourceInfo(const int videoChannel,
// ----------------------------------------------------------------------------
int ViENetworkImpl::GetLocalIP(char ipAddress[64], bool ipv6)
{
WEBRTC_TRACE(webrtc::kTraceApiCall, webrtc::kTraceVideo, ViEId(_instanceId),
WEBRTC_TRACE(webrtc::kTraceApiCall, webrtc::kTraceVideo, ViEId(instance_id_),
"%s( ipAddress, ipV6: %d)", __FUNCTION__, ipv6);
#ifndef WEBRTC_EXTERNAL_TRANSPORT
if (!IsInitialized())
if (!Initialized())
{
SetLastError(kViENotInitialized);
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo, ViEId(_instanceId),
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo, ViEId(instance_id_),
"%s - ViE instance %d not initialized", __FUNCTION__,
_instanceId);
instance_id_);
return -1;
}
if (ipAddress == NULL)
{
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo, ViEId(_instanceId),
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo, ViEId(instance_id_),
"%s: No argument", __FUNCTION__);
SetLastError(kViENetworkInvalidArgument);
return -1;
@ -515,11 +515,11 @@ int ViENetworkImpl::GetLocalIP(char ipAddress[64], bool ipv6)
WebRtc_UWord8 numSocketThreads = 1;
UdpTransport* ptrSocketTransport =
UdpTransport::Create(
ViEModuleId(_instanceId,-1),numSocketThreads);
ViEModuleId(instance_id_,-1),numSocketThreads);
if (ptrSocketTransport == NULL)
{
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo, ViEId(_instanceId),
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo, ViEId(instance_id_),
"%s: Could not create socket module", __FUNCTION__);
SetLastError(kViENetworkUnknownError);
return -1;
@ -531,7 +531,7 @@ int ViENetworkImpl::GetLocalIP(char ipAddress[64], bool ipv6)
WebRtc_UWord8 localIP[16];
if (ptrSocketTransport->LocalHostAddressIPV6(localIP) != 0)
{
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo, ViEId(_instanceId),
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo, ViEId(instance_id_),
"%s: Could not get local IP", __FUNCTION__);
SetLastError(kViENetworkUnknownError);
return -1;
@ -549,7 +549,7 @@ int ViENetworkImpl::GetLocalIP(char ipAddress[64], bool ipv6)
WebRtc_UWord32 localIP = 0;
if (ptrSocketTransport->LocalHostAddress(localIP) != 0)
{
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo, ViEId(_instanceId),
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo, ViEId(instance_id_),
"%s: Could not get local IP", __FUNCTION__);
SetLastError(kViENetworkUnknownError);
return -1;
@ -562,12 +562,12 @@ int ViENetworkImpl::GetLocalIP(char ipAddress[64], bool ipv6)
strcpy(ipAddress, localIpAddress);
UdpTransport::Destroy(
ptrSocketTransport);
WEBRTC_TRACE(webrtc::kTraceStateInfo, webrtc::kTraceVideo, ViEId(_instanceId),
WEBRTC_TRACE(webrtc::kTraceStateInfo, webrtc::kTraceVideo, ViEId(instance_id_),
"%s: local ip = %s", __FUNCTION__, localIpAddress);
return 0;
#else
WEBRTC_TRACE(webrtc::kTraceStateInfo, webrtc::kTraceVideo, ViEId(_instanceId),
WEBRTC_TRACE(webrtc::kTraceStateInfo, webrtc::kTraceVideo, ViEId(instance_id_),
"%s: not available for external transport", __FUNCTION__);
return -1;
@ -586,17 +586,17 @@ int ViENetworkImpl::GetLocalIP(char ipAddress[64], bool ipv6)
int ViENetworkImpl::EnableIPv6(int videoChannel)
{
WEBRTC_TRACE(webrtc::kTraceApiCall, webrtc::kTraceVideo,
ViEId(_instanceId, videoChannel), "%s(channel: %d)",
ViEId(instance_id_, videoChannel), "%s(channel: %d)",
__FUNCTION__, videoChannel);
// Get the channel
ViEChannelManagerScoped cs(_channelManager);
ViEChannelManagerScoped cs(channel_manager_);
ViEChannel* ptrViEChannel = cs.Channel(videoChannel);
if (ptrViEChannel == NULL)
{
// The channel doesn't exists
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo,
ViEId(_instanceId, videoChannel), "Channel doesn't exist");
ViEId(instance_id_, videoChannel), "Channel doesn't exist");
SetLastError(kViENetworkInvalidChannelId);
return -1;
}
@ -616,17 +616,17 @@ int ViENetworkImpl::EnableIPv6(int videoChannel)
bool ViENetworkImpl::IsIPv6Enabled(int videoChannel)
{
WEBRTC_TRACE(webrtc::kTraceApiCall, webrtc::kTraceVideo,
ViEId(_instanceId, videoChannel), "%s(channel: %d)",
ViEId(instance_id_, videoChannel), "%s(channel: %d)",
__FUNCTION__, videoChannel);
// Get the channel
ViEChannelManagerScoped cs(_channelManager);
ViEChannelManagerScoped cs(channel_manager_);
ViEChannel* ptrViEChannel = cs.Channel(videoChannel);
if (ptrViEChannel == NULL)
{
// The channel doesn't exists
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo,
ViEId(_instanceId, videoChannel), "Channel doesn't exist");
ViEId(instance_id_, videoChannel), "Channel doesn't exist");
SetLastError(kViENetworkInvalidChannelId);
return false;
}
@ -649,18 +649,18 @@ int ViENetworkImpl::SetSourceFilter(const int videoChannel,
const char* ipAddress)
{
WEBRTC_TRACE(webrtc::kTraceApiCall, webrtc::kTraceVideo,
ViEId(_instanceId, videoChannel),
ViEId(instance_id_, videoChannel),
"%s(channel: %d, rtpPort: %u, rtcpPort: %u, ipAddress: %s)",
__FUNCTION__, videoChannel, rtpPort, rtcpPort, ipAddress);
// Get the channel
ViEChannelManagerScoped cs(_channelManager);
ViEChannelManagerScoped cs(channel_manager_);
ViEChannel* ptrViEChannel = cs.Channel(videoChannel);
if (ptrViEChannel == NULL)
{
// The channel doesn't exists
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo,
ViEId(_instanceId, videoChannel), "Channel doesn't exist");
ViEId(instance_id_, videoChannel), "Channel doesn't exist");
SetLastError(kViENetworkInvalidChannelId);
return -1;
}
@ -682,17 +682,17 @@ int ViENetworkImpl::GetSourceFilter(const int videoChannel,
unsigned short& rtcpPort, char* ipAddress)
{
WEBRTC_TRACE(webrtc::kTraceApiCall, webrtc::kTraceVideo,
ViEId(_instanceId, videoChannel), "%s(channel: %d)",
ViEId(instance_id_, videoChannel), "%s(channel: %d)",
__FUNCTION__, videoChannel);
// Get the channel
ViEChannelManagerScoped cs(_channelManager);
ViEChannelManagerScoped cs(channel_manager_);
ViEChannel* ptrViEChannel = cs.Channel(videoChannel);
if (ptrViEChannel == NULL)
{
// The channel doesn't exists
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo,
ViEId(_instanceId, videoChannel), "Channel doesn't exist");
ViEId(instance_id_, videoChannel), "Channel doesn't exist");
SetLastError(kViENetworkInvalidChannelId);
return -1;
}
@ -717,24 +717,24 @@ int ViENetworkImpl::SetSendToS(const int videoChannel, const int DSCP,
const bool useSetSockOpt = false)
{
WEBRTC_TRACE(webrtc::kTraceApiCall, webrtc::kTraceVideo,
ViEId(_instanceId, videoChannel),
ViEId(instance_id_, videoChannel),
"%s(channel: %d, DSCP: %d, useSetSockOpt: %d)", __FUNCTION__,
videoChannel, DSCP, useSetSockOpt);
// Get the channel
ViEChannelManagerScoped cs(_channelManager);
ViEChannelManagerScoped cs(channel_manager_);
ViEChannel* ptrViEChannel = cs.Channel(videoChannel);
if (ptrViEChannel == NULL)
{
// The channel doesn't exists
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo,
ViEId(_instanceId, videoChannel), "Channel doesn't exist");
ViEId(instance_id_, videoChannel), "Channel doesn't exist");
SetLastError(kViENetworkInvalidChannelId);
return -1;
}
#if defined(WEBRTC_LINUX) || defined(WEBRTC_MAC)
WEBRTC_TRACE(kTraceInfo, kTraceVideo, ViEId(_instanceId, videoChannel),
WEBRTC_TRACE(kTraceInfo, kTraceVideo, ViEId(instance_id_, videoChannel),
" force useSetSockopt=true since there is no alternative"
" implementation");
if (ptrViEChannel->SetToS(DSCP, true) != 0)
@ -757,17 +757,17 @@ int ViENetworkImpl::GetSendToS(const int videoChannel, int& DSCP,
bool& useSetSockOpt)
{
WEBRTC_TRACE(webrtc::kTraceApiCall, webrtc::kTraceVideo,
ViEId(_instanceId, videoChannel), "%s(channel: %d)",
ViEId(instance_id_, videoChannel), "%s(channel: %d)",
__FUNCTION__, videoChannel);
// Get the channel
ViEChannelManagerScoped cs(_channelManager);
ViEChannelManagerScoped cs(channel_manager_);
ViEChannel* ptrViEChannel = cs.Channel(videoChannel);
if (ptrViEChannel == NULL)
{
// The channel doesn't exists
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo,
ViEId(_instanceId, videoChannel), "Channel doesn't exist");
ViEId(instance_id_, videoChannel), "Channel doesn't exist");
SetLastError(kViENetworkInvalidChannelId);
return -1;
}
@ -793,16 +793,16 @@ int ViENetworkImpl::SetSendGQoS(const int videoChannel, const bool enable,
const int serviceType, const int overrideDSCP)
{
WEBRTC_TRACE(webrtc::kTraceApiCall, webrtc::kTraceVideo,
ViEId(_instanceId, videoChannel),
ViEId(instance_id_, videoChannel),
"%s(channel: %d, enable: %d, serviceType: %d, "
"overrideDSCP: %d)",
__FUNCTION__, videoChannel, enable, serviceType, overrideDSCP);
if (!IsInitialized())
if (!Initialized())
{
SetLastError(kViENotInitialized);
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo, ViEId(_instanceId),
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo, ViEId(instance_id_),
"%s - ViE instance %d not initialized", __FUNCTION__,
_instanceId);
instance_id_);
return -1;
}
@ -815,7 +815,7 @@ int ViENetworkImpl::SetSendGQoS(const int videoChannel, const bool enable,
(serviceType != SERVICETYPE_QUALITATIVE))
{
WEBRTC_TRACE(webrtc::kTraceApiCall, webrtc::kTraceVideo,
ViEId(_instanceId, videoChannel),
ViEId(instance_id_, videoChannel),
"%s: service type %d not supported", __FUNCTION__,
videoChannel, serviceType);
SetLastError(kViENetworkServiceTypeNotSupported);
@ -823,13 +823,13 @@ int ViENetworkImpl::SetSendGQoS(const int videoChannel, const bool enable,
}
// Get the channel
ViEChannelManagerScoped cs(_channelManager);
ViEChannelManagerScoped cs(channel_manager_);
ViEChannel* ptrViEChannel = cs.Channel(videoChannel);
if (ptrViEChannel == NULL)
{
// The channel doesn't exists
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo,
ViEId(_instanceId, videoChannel), "Channel doesn't exist");
ViEId(instance_id_, videoChannel), "Channel doesn't exist");
SetLastError(kViENetworkInvalidChannelId);
return -1;
}
@ -838,7 +838,7 @@ int ViENetworkImpl::SetSendGQoS(const int videoChannel, const bool enable,
{
// The channel doesn't exists
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo,
ViEId(_instanceId, videoChannel), "Channel doesn't exist");
ViEId(instance_id_, videoChannel), "Channel doesn't exist");
SetLastError(kViENetworkInvalidChannelId);
return -1;
}
@ -847,7 +847,7 @@ int ViENetworkImpl::SetSendGQoS(const int videoChannel, const bool enable,
{
// Could not get
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo,
ViEId(_instanceId, videoChannel),
ViEId(instance_id_, videoChannel),
"%s: Could not get max bitrate for the channel",
__FUNCTION__);
SetLastError(kViENetworkSendCodecNotSet);
@ -863,7 +863,7 @@ int ViENetworkImpl::SetSendGQoS(const int videoChannel, const bool enable,
#else
WEBRTC_TRACE(webrtc::kTraceApiCall, webrtc::kTraceVideo,
ViEId(_instanceId, videoChannel), "%s: Not supported",
ViEId(instance_id_, videoChannel), "%s: Not supported",
__FUNCTION__);
SetLastError(kViENetworkNotSupported);
return -1;
@ -879,17 +879,17 @@ int ViENetworkImpl::GetSendGQoS(const int videoChannel, bool& enabled,
int& serviceType, int& overrideDSCP)
{
WEBRTC_TRACE(webrtc::kTraceApiCall, webrtc::kTraceVideo,
ViEId(_instanceId, videoChannel), "%s(channel: %d)",
ViEId(instance_id_, videoChannel), "%s(channel: %d)",
__FUNCTION__, videoChannel);
// Get the channel
ViEChannelManagerScoped cs(_channelManager);
ViEChannelManagerScoped cs(channel_manager_);
ViEChannel* ptrViEChannel = cs.Channel(videoChannel);
if (ptrViEChannel == NULL)
{
// The channel doesn't exists
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo,
ViEId(_instanceId, videoChannel), "Channel doesn't exist");
ViEId(instance_id_, videoChannel), "Channel doesn't exist");
SetLastError(kViENetworkInvalidChannelId);
return -1;
}
@ -913,17 +913,17 @@ int ViENetworkImpl::GetSendGQoS(const int videoChannel, bool& enabled,
int ViENetworkImpl::SetMTU(int videoChannel, unsigned int mtu)
{
WEBRTC_TRACE(webrtc::kTraceApiCall, webrtc::kTraceVideo,
ViEId(_instanceId, videoChannel), "%s(channel: %d, mtu: %u)",
ViEId(instance_id_, videoChannel), "%s(channel: %d, mtu: %u)",
__FUNCTION__, videoChannel, mtu);
// Get the channel
ViEChannelManagerScoped cs(_channelManager);
ViEChannelManagerScoped cs(channel_manager_);
ViEChannel* ptrViEChannel = cs.Channel(videoChannel);
if (ptrViEChannel == NULL)
{
// The channel doesn't exists
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo,
ViEId(_instanceId, videoChannel), "Channel doesn't exist");
ViEId(instance_id_, videoChannel), "Channel doesn't exist");
SetLastError(kViENetworkInvalidChannelId);
return -1;
}
@ -950,18 +950,18 @@ int ViENetworkImpl::SetPacketTimeoutNotification(const int videoChannel,
int timeoutSeconds)
{
WEBRTC_TRACE(webrtc::kTraceApiCall, webrtc::kTraceVideo,
ViEId(_instanceId, videoChannel),
ViEId(instance_id_, videoChannel),
"%s(channel: %d, enable: %d, timeoutSeconds: %u)",
__FUNCTION__, videoChannel, enable, timeoutSeconds);
// Get the channel
ViEChannelManagerScoped cs(_channelManager);
ViEChannelManagerScoped cs(channel_manager_);
ViEChannel* ptrViEChannel = cs.Channel(videoChannel);
if (ptrViEChannel == NULL)
{
// The channel doesn't exists
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo,
ViEId(_instanceId, videoChannel), "Channel doesn't exist");
ViEId(instance_id_, videoChannel), "Channel doesn't exist");
SetLastError(kViENetworkInvalidChannelId);
return -1;
}
@ -985,17 +985,17 @@ int ViENetworkImpl::RegisterObserver(const int videoChannel,
ViENetworkObserver& observer)
{
WEBRTC_TRACE(webrtc::kTraceApiCall, webrtc::kTraceVideo,
ViEId(_instanceId, videoChannel), "%s(channel: %d)",
ViEId(instance_id_, videoChannel), "%s(channel: %d)",
__FUNCTION__, videoChannel);
// Get the channel
ViEChannelManagerScoped cs(_channelManager);
ViEChannelManagerScoped cs(channel_manager_);
ViEChannel* ptrViEChannel = cs.Channel(videoChannel);
if (ptrViEChannel == NULL)
{
// The channel doesn't exists
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo,
ViEId(_instanceId, videoChannel), "Channel doesn't exist");
ViEId(instance_id_, videoChannel), "Channel doesn't exist");
SetLastError(kViENetworkInvalidChannelId);
return -1;
}
@ -1013,17 +1013,17 @@ int ViENetworkImpl::RegisterObserver(const int videoChannel,
int ViENetworkImpl::DeregisterObserver(const int videoChannel)
{
WEBRTC_TRACE(webrtc::kTraceApiCall, webrtc::kTraceVideo,
ViEId(_instanceId, videoChannel), "%s(channel: %d)",
ViEId(instance_id_, videoChannel), "%s(channel: %d)",
__FUNCTION__, videoChannel);
// Get the channel
ViEChannelManagerScoped cs(_channelManager);
ViEChannelManagerScoped cs(channel_manager_);
ViEChannel* ptrViEChannel = cs.Channel(videoChannel);
if (ptrViEChannel == NULL)
{
// The channel doesn't exists
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo,
ViEId(_instanceId, videoChannel), "Channel doesn't exist");
ViEId(instance_id_, videoChannel), "Channel doesn't exist");
SetLastError(kViENetworkInvalidChannelId);
return -1;
}
@ -1045,18 +1045,18 @@ int ViENetworkImpl::SetPeriodicDeadOrAliveStatus(const int videoChannel,
unsigned int sampleTimeSeconds)
{
WEBRTC_TRACE(webrtc::kTraceApiCall, webrtc::kTraceVideo,
ViEId(_instanceId, videoChannel),
ViEId(instance_id_, videoChannel),
"%s(channel: %d, enable: %d, sampleTimeSeconds: %ul)",
__FUNCTION__, videoChannel, enable, sampleTimeSeconds);
// Get the channel
ViEChannelManagerScoped cs(_channelManager);
ViEChannelManagerScoped cs(channel_manager_);
ViEChannel* ptrViEChannel = cs.Channel(videoChannel);
if (ptrViEChannel == NULL)
{
// The channel doesn't exists
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo,
ViEId(_instanceId, videoChannel), "Channel doesn't exist");
ViEId(instance_id_, videoChannel), "Channel doesn't exist");
SetLastError(kViENetworkInvalidChannelId);
return -1;
}
@ -1090,27 +1090,27 @@ int ViENetworkImpl::SendUDPPacket(const int videoChannel, const void* data,
bool useRtcpSocket = false)
{
WEBRTC_TRACE(webrtc::kTraceApiCall, webrtc::kTraceVideo,
ViEId(_instanceId, videoChannel),
ViEId(instance_id_, videoChannel),
"%s(channel: %d, data: -, length: %d, transmitterBytes: -, "
"useRtcpSocket: %d)", __FUNCTION__, videoChannel, length,
useRtcpSocket);
if (!IsInitialized())
if (!Initialized())
{
SetLastError(kViENotInitialized);
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo, ViEId(_instanceId),
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo, ViEId(instance_id_),
"%s - ViE instance %d not initialized", __FUNCTION__,
_instanceId);
instance_id_);
return -1;
}
// Get the channel
ViEChannelManagerScoped cs(_channelManager);
ViEChannelManagerScoped cs(channel_manager_);
ViEChannel* ptrViEChannel = cs.Channel(videoChannel);
if (ptrViEChannel == NULL)
{
// The channel doesn't exists
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo,
ViEId(_instanceId, videoChannel), "Channel doesn't exist");
ViEId(instance_id_, videoChannel), "Channel doesn't exist");
SetLastError(kViENetworkInvalidChannelId);
return -1;
}

View File

@ -63,19 +63,19 @@ ViERender* ViERender::GetInterface(VideoEngine* videoEngine)
int ViERenderImpl::Release()
{
WEBRTC_TRACE(webrtc::kTraceApiCall, webrtc::kTraceVideo, _instanceId,
WEBRTC_TRACE(webrtc::kTraceApiCall, webrtc::kTraceVideo, instance_id_,
"ViERender::Release()");
(*this)--; // Decrease ref count
WebRtc_Word32 refCount = GetCount();
if (refCount < 0)
{
WEBRTC_TRACE(webrtc::kTraceWarning, webrtc::kTraceVideo, _instanceId,
WEBRTC_TRACE(webrtc::kTraceWarning, webrtc::kTraceVideo, instance_id_,
"ViERender release too many times");
// SetLastError()
return -1;
}
WEBRTC_TRACE(webrtc::kTraceInfo, webrtc::kTraceVideo, _instanceId,
WEBRTC_TRACE(webrtc::kTraceInfo, webrtc::kTraceVideo, instance_id_,
"ViERender reference count: %d", refCount);
return refCount;
}
@ -86,7 +86,7 @@ int ViERenderImpl::Release()
ViERenderImpl::ViERenderImpl()
{
WEBRTC_TRACE(webrtc::kTraceMemory, webrtc::kTraceVideo, _instanceId,
WEBRTC_TRACE(webrtc::kTraceMemory, webrtc::kTraceVideo, instance_id_,
"ViERenderImpl::ViERenderImpl() Ctor");
}
@ -96,7 +96,7 @@ ViERenderImpl::ViERenderImpl()
ViERenderImpl::~ViERenderImpl()
{
WEBRTC_TRACE(webrtc::kTraceMemory, webrtc::kTraceVideo, _instanceId,
WEBRTC_TRACE(webrtc::kTraceMemory, webrtc::kTraceVideo, instance_id_,
"ViERenderImpl::~ViERenderImpl() Dtor");
}
@ -115,10 +115,10 @@ ViERenderImpl::~ViERenderImpl()
int ViERenderImpl::RegisterVideoRenderModule(
VideoRender& renderModule)
{
WEBRTC_TRACE(webrtc::kTraceApiCall, webrtc::kTraceVideo, ViEId(_instanceId),
WEBRTC_TRACE(webrtc::kTraceApiCall, webrtc::kTraceVideo, ViEId(instance_id_),
"%s (&renderModule: %p)", __FUNCTION__, &renderModule);
if (_renderManager.RegisterVideoRenderModule(renderModule) != 0)
if (render_manager_.RegisterVideoRenderModule(renderModule) != 0)
{
// Error logging is done in RegisterVideoRenderModule
SetLastError(kViERenderUnknownError);
@ -139,9 +139,9 @@ int ViERenderImpl::RegisterVideoRenderModule(
int ViERenderImpl::DeRegisterVideoRenderModule(
VideoRender& renderModule)
{
WEBRTC_TRACE(webrtc::kTraceApiCall, webrtc::kTraceVideo, ViEId(_instanceId),
WEBRTC_TRACE(webrtc::kTraceApiCall, webrtc::kTraceVideo, ViEId(instance_id_),
"%s (&renderModule: %p)", __FUNCTION__, &renderModule);
if (_renderManager.DeRegisterVideoRenderModule(renderModule) != 0)
if (render_manager_.DeRegisterVideoRenderModule(renderModule) != 0)
{
// Error logging is done in DeRegisterVideoRenderModule
SetLastError(kViERenderUnknownError);
@ -160,25 +160,25 @@ int ViERenderImpl::AddRenderer(const int renderId, void* window,
const float top, const float right,
const float bottom)
{
WEBRTC_TRACE(webrtc::kTraceApiCall, webrtc::kTraceVideo, ViEId(_instanceId),
WEBRTC_TRACE(webrtc::kTraceApiCall, webrtc::kTraceVideo, ViEId(instance_id_),
"%s (renderId: %d, window: 0x%p, zOrder: %u, left: %f, "
"top: %f, right: %f, bottom: %f)",
__FUNCTION__, renderId, window, zOrder, left, top, right,
bottom);
if (!IsInitialized())
if (!Initialized())
{
SetLastError(kViENotInitialized);
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo, ViEId(_instanceId),
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo, ViEId(instance_id_),
"%s - ViE instance %d not initialized", __FUNCTION__,
_instanceId);
instance_id_);
return -1;
}
{ // Check if the renderer exist already
ViERenderManagerScoped rs(_renderManager);
ViERenderManagerScoped rs(render_manager_);
if (rs.Renderer(renderId) != NULL)
{
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo, ViEId(_instanceId),
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo, ViEId(instance_id_),
"%s - Renderer already exist %d.", __FUNCTION__,
renderId);
SetLastError(kViERenderAlreadyExists);
@ -189,17 +189,17 @@ int ViERenderImpl::AddRenderer(const int renderId, void* window,
if (renderId >= kViEChannelIdBase && renderId <= kViEChannelIdMax)
{
// This is a channel
ViEChannelManagerScoped cm(_channelManager);
ViEChannelManagerScoped cm(channel_manager_);
ViEFrameProviderBase* frameProvider = cm.Channel(renderId);
if (frameProvider == NULL)
{
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo, ViEId(_instanceId),
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo, ViEId(instance_id_),
"%s: FrameProvider id %d doesn't exist", __FUNCTION__,
renderId);
SetLastError(kViERenderInvalidRenderId);
return -1;
}
ViERenderer* renderer = _renderManager.AddRenderStream(renderId,
ViERenderer* renderer = render_manager_.AddRenderStream(renderId,
window, zOrder,
left, top,
right, bottom);
@ -212,17 +212,17 @@ int ViERenderImpl::AddRenderer(const int renderId, void* window,
}
else // camera or file
{
ViEInputManagerScoped is(_inputManager);
ViEInputManagerScoped is(input_manager_);
ViEFrameProviderBase* frameProvider = is.FrameProvider(renderId);
if (frameProvider == NULL)
{
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo, ViEId(_instanceId),
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo, ViEId(instance_id_),
"%s: FrameProvider id %d doesn't exist", __FUNCTION__,
renderId);
SetLastError(kViERenderInvalidRenderId);
return -1;
}
ViERenderer* renderer = _renderManager.AddRenderStream(renderId,
ViERenderer* renderer = render_manager_.AddRenderStream(renderId,
window, zOrder,
left, top,
right, bottom);
@ -240,24 +240,24 @@ int ViERenderImpl::AddRenderer(const int renderId, void* window,
int ViERenderImpl::RemoveRenderer(const int renderId)
{
WEBRTC_TRACE(webrtc::kTraceApiCall, webrtc::kTraceVideo, ViEId(_instanceId),
WEBRTC_TRACE(webrtc::kTraceApiCall, webrtc::kTraceVideo, ViEId(instance_id_),
"%s(renderId: %d)", __FUNCTION__, renderId);
if (!IsInitialized())
if (!Initialized())
{
SetLastError(kViENotInitialized);
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo, ViEId(_instanceId),
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo, ViEId(instance_id_),
"%s - ViE instance %d not initialized", __FUNCTION__,
_instanceId);
instance_id_);
return -1;
}
ViERenderer* renderer = NULL;
{
ViERenderManagerScoped rs(_renderManager);
ViERenderManagerScoped rs(render_manager_);
renderer = rs.Renderer(renderId);
if (!renderer)
{
WEBRTC_TRACE(webrtc::kTraceWarning, webrtc::kTraceVideo, ViEId(_instanceId),
WEBRTC_TRACE(webrtc::kTraceWarning, webrtc::kTraceVideo, ViEId(instance_id_),
"%s No render exist with renderId: %d", __FUNCTION__,
renderId);
SetLastError(kViERenderInvalidRenderId);
@ -269,11 +269,11 @@ int ViERenderImpl::RemoveRenderer(const int renderId)
if (renderId >= kViEChannelIdBase && renderId <= kViEChannelIdMax)
{
// This is a channel
ViEChannelManagerScoped cm(_channelManager);
ViEChannelManagerScoped cm(channel_manager_);
ViEChannel* channel = cm.Channel(renderId);
if (!channel)
{
WEBRTC_TRACE(webrtc::kTraceWarning, webrtc::kTraceVideo, ViEId(_instanceId),
WEBRTC_TRACE(webrtc::kTraceWarning, webrtc::kTraceVideo, ViEId(instance_id_),
"%s: no channel with id %d exists ", __FUNCTION__,
renderId);
SetLastError(kViERenderInvalidRenderId);
@ -283,11 +283,11 @@ int ViERenderImpl::RemoveRenderer(const int renderId)
}
else //Provider owned by inputmanager - ie file or capture device
{
ViEInputManagerScoped is(_inputManager);
ViEInputManagerScoped is(input_manager_);
ViEFrameProviderBase* provider = is.FrameProvider(renderId);
if (!provider)
{
WEBRTC_TRACE(webrtc::kTraceWarning, webrtc::kTraceVideo, ViEId(_instanceId),
WEBRTC_TRACE(webrtc::kTraceWarning, webrtc::kTraceVideo, ViEId(instance_id_),
"%s: no provider with id %d exists ", __FUNCTION__,
renderId);
SetLastError(kViERenderInvalidRenderId);
@ -296,7 +296,7 @@ int ViERenderImpl::RemoveRenderer(const int renderId)
provider->DeregisterFrameCallback(renderer);
}
if (_renderManager.RemoveRenderStream(renderId) != 0)
if (render_manager_.RemoveRenderStream(renderId) != 0)
{
SetLastError(kViERenderUnknownError);
return -1;
@ -317,16 +317,16 @@ int ViERenderImpl::RemoveRenderer(const int renderId)
int ViERenderImpl::StartRender(const int renderId)
{
WEBRTC_TRACE(webrtc::kTraceApiCall, webrtc::kTraceVideo,
ViEId(_instanceId, renderId), "%s(channel: %d)", __FUNCTION__,
ViEId(instance_id_, renderId), "%s(channel: %d)", __FUNCTION__,
renderId);
ViERenderManagerScoped rs(_renderManager);
ViERenderManagerScoped rs(render_manager_);
ViERenderer* ptrRender = rs.Renderer(renderId);
if (ptrRender == NULL)
{
// No renderer for this channel
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo,
ViEId(_instanceId, renderId),
ViEId(instance_id_, renderId),
"%s: No renderer with render Id %d exist.", __FUNCTION__,
renderId);
SetLastError(kViERenderInvalidRenderId);
@ -350,16 +350,16 @@ int ViERenderImpl::StartRender(const int renderId)
int ViERenderImpl::StopRender(const int renderId)
{
WEBRTC_TRACE(webrtc::kTraceApiCall, webrtc::kTraceVideo,
ViEId(_instanceId, renderId), "%s(channel: %d)", __FUNCTION__,
ViEId(instance_id_, renderId), "%s(channel: %d)", __FUNCTION__,
renderId);
ViERenderManagerScoped rs(_renderManager);
ViERenderManagerScoped rs(render_manager_);
ViERenderer* ptrRender = rs.Renderer(renderId);
if (ptrRender == NULL)
{
// No renderer for this channel
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo,
ViEId(_instanceId, renderId),
ViEId(instance_id_, renderId),
"%s: No renderer with renderId %d exist.", __FUNCTION__,
renderId);
SetLastError(kViERenderInvalidRenderId);
@ -387,16 +387,16 @@ int ViERenderImpl::ConfigureRender(int renderId, const unsigned int zOrder,
const float left, const float top,
const float right, const float bottom)
{
WEBRTC_TRACE(webrtc::kTraceApiCall, webrtc::kTraceVideo, ViEId(_instanceId, renderId),
WEBRTC_TRACE(webrtc::kTraceApiCall, webrtc::kTraceVideo, ViEId(instance_id_, renderId),
"%s(channel: %d)", __FUNCTION__, renderId);
ViERenderManagerScoped rs(_renderManager);
ViERenderManagerScoped rs(render_manager_);
ViERenderer* ptrRender = rs.Renderer(renderId);
if (ptrRender == NULL)
{
// No renderer for this channel
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo,
ViEId(_instanceId, renderId),
ViEId(instance_id_, renderId),
"%s: No renderer with renderId %d exist.", __FUNCTION__,
renderId);
SetLastError(kViERenderInvalidRenderId);
@ -421,13 +421,13 @@ int ViERenderImpl::MirrorRenderStream(const int renderId, const bool enable,
const bool mirrorXAxis,
const bool mirrorYAxis)
{
ViERenderManagerScoped rs(_renderManager);
ViERenderManagerScoped rs(render_manager_);
ViERenderer* ptrRender = rs.Renderer(renderId);
if (ptrRender == NULL)
{
// No renderer for this channel
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo,
ViEId(_instanceId, renderId),
ViEId(instance_id_, renderId),
"%s: No renderer with renderId %d exist.", __FUNCTION__,
renderId);
SetLastError(kViERenderInvalidRenderId);
@ -469,27 +469,27 @@ int ViERenderImpl::AddRenderer(const int renderId,
&& videoInputFormat != webrtc::kVideoARGB1555)
{
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo,
ViEId(_instanceId, renderId),
ViEId(instance_id_, renderId),
"%s: Unsupported video frame format requested",
__FUNCTION__, renderId);
SetLastError(kViERenderInvalidFrameFormat);
return -1;
}
if (!IsInitialized())
if (!Initialized())
{
SetLastError(kViENotInitialized);
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo, ViEId(_instanceId),
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo, ViEId(instance_id_),
"%s - ViE instance %d not initialized", __FUNCTION__,
_instanceId);
instance_id_);
return -1;
}
{ // Check if the renderer exist already
ViERenderManagerScoped rs(_renderManager);
ViERenderManagerScoped rs(render_manager_);
if (rs.Renderer(renderId) != NULL)
{
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo, ViEId(_instanceId),
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo, ViEId(instance_id_),
"%s - Renderer already exist %d.", __FUNCTION__,
renderId);
SetLastError(kViERenderAlreadyExists);
@ -500,17 +500,17 @@ int ViERenderImpl::AddRenderer(const int renderId,
if (renderId >= kViEChannelIdBase && renderId <= kViEChannelIdMax)
{
// This is a channel
ViEChannelManagerScoped cm(_channelManager);
ViEChannelManagerScoped cm(channel_manager_);
ViEFrameProviderBase* frameProvider = cm.Channel(renderId);
if (frameProvider == NULL)
{
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo, ViEId(_instanceId),
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo, ViEId(instance_id_),
"%s: FrameProvider id %d doesn't exist", __FUNCTION__,
renderId);
SetLastError(kViERenderInvalidRenderId);
return -1;
}
ViERenderer* ptrRender = _renderManager.AddRenderStream(renderId, NULL,
ViERenderer* ptrRender = render_manager_.AddRenderStream(renderId, NULL,
0, 0.0f, 0.0f,
1.0f, 1.0f);
if (ptrRender == NULL)
@ -529,17 +529,17 @@ int ViERenderImpl::AddRenderer(const int renderId,
}
else // camera or file
{
ViEInputManagerScoped is(_inputManager);
ViEInputManagerScoped is(input_manager_);
ViEFrameProviderBase* frameProvider = is.FrameProvider(renderId);
if (frameProvider == NULL)
{
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo, ViEId(_instanceId),
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo, ViEId(instance_id_),
"%s: FrameProvider id %d doesn't exist", __FUNCTION__,
renderId);
SetLastError(kViERenderInvalidRenderId);
return -1;
}
ViERenderer* ptrRender = _renderManager.AddRenderStream(renderId, NULL,
ViERenderer* ptrRender = render_manager_.AddRenderStream(renderId, NULL,
0, 0.0f, 0.0f,
1.0f, 1.0f);
if (ptrRender == NULL)

View File

@ -59,19 +59,19 @@ ViERTP_RTCP* ViERTP_RTCP::GetInterface(VideoEngine* videoEngine)
int ViERTP_RTCPImpl::Release()
{
WEBRTC_TRACE(webrtc::kTraceApiCall, webrtc::kTraceVideo, _instanceId,
WEBRTC_TRACE(webrtc::kTraceApiCall, webrtc::kTraceVideo, instance_id_,
"ViERTP_RTCP::Release()");
(*this)--; // Decrease ref count
WebRtc_Word32 refCount = GetCount();
if (refCount < 0)
{
WEBRTC_TRACE(webrtc::kTraceWarning, webrtc::kTraceVideo, _instanceId,
WEBRTC_TRACE(webrtc::kTraceWarning, webrtc::kTraceVideo, instance_id_,
"ViERTP_RTCP release too many times");
SetLastError(kViEAPIDoesNotExist);
return -1;
}
WEBRTC_TRACE(webrtc::kTraceInfo, webrtc::kTraceVideo, _instanceId,
WEBRTC_TRACE(webrtc::kTraceInfo, webrtc::kTraceVideo, instance_id_,
"ViERTP_RTCP reference count: %d", refCount);
return refCount;
}
@ -82,7 +82,7 @@ int ViERTP_RTCPImpl::Release()
ViERTP_RTCPImpl::ViERTP_RTCPImpl()
{
WEBRTC_TRACE(webrtc::kTraceMemory, webrtc::kTraceVideo, _instanceId,
WEBRTC_TRACE(webrtc::kTraceMemory, webrtc::kTraceVideo, instance_id_,
"ViERTP_RTCPImpl::ViERTP_RTCPImpl() Ctor");
}
@ -92,7 +92,7 @@ ViERTP_RTCPImpl::ViERTP_RTCPImpl()
ViERTP_RTCPImpl::~ViERTP_RTCPImpl()
{
WEBRTC_TRACE(webrtc::kTraceMemory, webrtc::kTraceVideo, _instanceId,
WEBRTC_TRACE(webrtc::kTraceMemory, webrtc::kTraceVideo, instance_id_,
"ViERTP_RTCPImpl::~ViERTP_RTCPImpl() Dtor");
}
@ -113,19 +113,19 @@ int ViERTP_RTCPImpl::SetLocalSSRC(const int videoChannel,
{
WEBRTC_TRACE(webrtc::kTraceApiCall,
webrtc::kTraceVideo,
ViEId(_instanceId, videoChannel),
ViEId(instance_id_, videoChannel),
"%s(channel: %d, SSRC: %d)",
__FUNCTION__, videoChannel, SSRC);
// Get the channel
ViEChannelManagerScoped cs(_channelManager);
ViEChannelManagerScoped cs(channel_manager_);
ViEChannel* ptrViEChannel = cs.Channel(videoChannel);
if (ptrViEChannel == NULL)
{
// The channel doesn't exists
WEBRTC_TRACE(webrtc::kTraceError,
webrtc::kTraceVideo,
ViEId(_instanceId, videoChannel),
ViEId(instance_id_, videoChannel),
"%s: Channel %d doesn't exist",
__FUNCTION__, videoChannel);
SetLastError(kViERtpRtcpInvalidChannelId);
@ -149,17 +149,17 @@ int ViERTP_RTCPImpl::GetLocalSSRC(const int videoChannel,
unsigned int& SSRC) const
{
WEBRTC_TRACE(webrtc::kTraceApiCall, webrtc::kTraceVideo,
ViEId(_instanceId, videoChannel), "%s(channel: %d, SSRC: %d)",
ViEId(instance_id_, videoChannel), "%s(channel: %d, SSRC: %d)",
__FUNCTION__, videoChannel, SSRC);
// Get the channel
ViEChannelManagerScoped cs(_channelManager);
ViEChannelManagerScoped cs(channel_manager_);
ViEChannel* ptrViEChannel = cs.Channel(videoChannel);
if (ptrViEChannel == NULL)
{
// The channel doesn't exists
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo,
ViEId(_instanceId, videoChannel),
ViEId(instance_id_, videoChannel),
"%s: Channel %d doesn't exist", __FUNCTION__,
videoChannel);
SetLastError(kViERtpRtcpInvalidChannelId);
@ -193,17 +193,17 @@ int ViERTP_RTCPImpl::GetRemoteSSRC(const int videoChannel,
unsigned int& SSRC) const
{
WEBRTC_TRACE(webrtc::kTraceApiCall, webrtc::kTraceVideo,
ViEId(_instanceId, videoChannel), "%s(channel: %d)",
ViEId(instance_id_, videoChannel), "%s(channel: %d)",
__FUNCTION__, videoChannel, SSRC);
// Get the channel
ViEChannelManagerScoped cs(_channelManager);
ViEChannelManagerScoped cs(channel_manager_);
ViEChannel* ptrViEChannel = cs.Channel(videoChannel);
if (ptrViEChannel == NULL)
{
// The channel doesn't exists
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo,
ViEId(_instanceId, videoChannel),
ViEId(instance_id_, videoChannel),
"%s: Channel %d doesn't exist", __FUNCTION__,
videoChannel);
SetLastError(kViERtpRtcpInvalidChannelId);
@ -228,17 +228,17 @@ int ViERTP_RTCPImpl::GetRemoteCSRCs(const int videoChannel,
unsigned int CSRCs[kRtpCsrcSize]) const
{
WEBRTC_TRACE(webrtc::kTraceApiCall, webrtc::kTraceVideo,
ViEId(_instanceId, videoChannel), "%s(channel: %d)",
ViEId(instance_id_, videoChannel), "%s(channel: %d)",
__FUNCTION__, videoChannel);
// Get the channel
ViEChannelManagerScoped cs(_channelManager);
ViEChannelManagerScoped cs(channel_manager_);
ViEChannel* ptrViEChannel = cs.Channel(videoChannel);
if (ptrViEChannel == NULL)
{
// The channel doesn't exists
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo,
ViEId(_instanceId, videoChannel),
ViEId(instance_id_, videoChannel),
"%s: Channel %d doesn't exist", __FUNCTION__,
videoChannel);
SetLastError(kViERtpRtcpInvalidChannelId);
@ -263,18 +263,18 @@ int ViERTP_RTCPImpl::SetStartSequenceNumber(const int videoChannel,
unsigned short sequenceNumber)
{
WEBRTC_TRACE(webrtc::kTraceApiCall, webrtc::kTraceVideo,
ViEId(_instanceId, videoChannel),
ViEId(instance_id_, videoChannel),
"%s(channel: %d, sequenceNumber: %u)", __FUNCTION__,
videoChannel, sequenceNumber);
// Get the channel
ViEChannelManagerScoped cs(_channelManager);
ViEChannelManagerScoped cs(channel_manager_);
ViEChannel* ptrViEChannel = cs.Channel(videoChannel);
if (ptrViEChannel == NULL)
{
// The channel doesn't exists
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo,
ViEId(_instanceId, videoChannel),
ViEId(instance_id_, videoChannel),
"%s: Channel %d doesn't exist", __FUNCTION__,
videoChannel);
SetLastError(kViERtpRtcpInvalidChannelId);
@ -283,7 +283,7 @@ int ViERTP_RTCPImpl::SetStartSequenceNumber(const int videoChannel,
if (ptrViEChannel->Sending())
{
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo,
ViEId(_instanceId, videoChannel),
ViEId(instance_id_, videoChannel),
"%s: Channel %d already sending.", __FUNCTION__,
videoChannel);
SetLastError(kViERtpRtcpAlreadySending);
@ -312,17 +312,17 @@ int ViERTP_RTCPImpl::SetRTCPStatus(const int videoChannel,
const ViERTCPMode rtcpMode)
{
WEBRTC_TRACE(webrtc::kTraceApiCall, webrtc::kTraceVideo,
ViEId(_instanceId,videoChannel), "%s(channel: %d, mode: %d)",
ViEId(instance_id_,videoChannel), "%s(channel: %d, mode: %d)",
__FUNCTION__, videoChannel, rtcpMode);
// Get the channel
ViEChannelManagerScoped cs(_channelManager);
ViEChannelManagerScoped cs(channel_manager_);
ViEChannel* ptrViEChannel = cs.Channel(videoChannel);
if (ptrViEChannel == NULL)
{
// The channel doesn't exists
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo,
ViEId(_instanceId, videoChannel),
ViEId(instance_id_, videoChannel),
"%s: Channel %d doesn't exist", __FUNCTION__,
videoChannel);
SetLastError(kViERtpRtcpInvalidChannelId);
@ -350,17 +350,17 @@ int ViERTP_RTCPImpl::GetRTCPStatus(const int videoChannel,
ViERTCPMode& rtcpMode)
{
WEBRTC_TRACE(webrtc::kTraceApiCall, webrtc::kTraceVideo,
ViEId(_instanceId, videoChannel), "%s(channel: %d)",
ViEId(instance_id_, videoChannel), "%s(channel: %d)",
__FUNCTION__, videoChannel, rtcpMode);
// Get the channel
ViEChannelManagerScoped cs(_channelManager);
ViEChannelManagerScoped cs(channel_manager_);
ViEChannel* ptrViEChannel = cs.Channel(videoChannel);
if (ptrViEChannel == NULL)
{
// The channel doesn't exists
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo,
ViEId(_instanceId, videoChannel),
ViEId(instance_id_, videoChannel),
"%s: Channel %d doesn't exist", __FUNCTION__,
videoChannel);
SetLastError(kViERtpRtcpInvalidChannelId);
@ -371,7 +371,7 @@ int ViERTP_RTCPImpl::GetRTCPStatus(const int videoChannel,
if (ptrViEChannel->GetRTCPMode(moduleMode) != 0)
{
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo,
ViEId(_instanceId, videoChannel),
ViEId(instance_id_, videoChannel),
"%s: could not get current RTCP mode", __FUNCTION__);
SetLastError(kViERtpRtcpUnknownError);
return -1;
@ -391,17 +391,17 @@ int ViERTP_RTCPImpl::SetRTCPCName(const int videoChannel,
const char rtcpCName[KMaxRTCPCNameLength])
{
WEBRTC_TRACE(webrtc::kTraceApiCall, webrtc::kTraceVideo,
ViEId(_instanceId, videoChannel), "%s(channel: %d, name: %s)",
ViEId(instance_id_, videoChannel), "%s(channel: %d, name: %s)",
__FUNCTION__, videoChannel, rtcpCName);
// Get the channel
ViEChannelManagerScoped cs(_channelManager);
ViEChannelManagerScoped cs(channel_manager_);
ViEChannel* ptrViEChannel = cs.Channel(videoChannel);
if (ptrViEChannel == NULL)
{
// The channel doesn't exists
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo,
ViEId(_instanceId, videoChannel),
ViEId(instance_id_, videoChannel),
"%s: Channel %d doesn't exist", __FUNCTION__,
videoChannel);
SetLastError(kViERtpRtcpInvalidChannelId);
@ -411,7 +411,7 @@ int ViERTP_RTCPImpl::SetRTCPCName(const int videoChannel,
if (ptrViEChannel->Sending())
{
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo,
ViEId(_instanceId, videoChannel),
ViEId(instance_id_, videoChannel),
"%s: Channel %d already sending.", __FUNCTION__,
videoChannel);
SetLastError(kViERtpRtcpAlreadySending);
@ -437,17 +437,17 @@ int ViERTP_RTCPImpl::GetRTCPCName(const int videoChannel,
char rtcpCName[KMaxRTCPCNameLength])
{
WEBRTC_TRACE(webrtc::kTraceApiCall, webrtc::kTraceVideo,
ViEId(_instanceId, videoChannel), "%s(channel: %d)",
ViEId(instance_id_, videoChannel), "%s(channel: %d)",
__FUNCTION__, videoChannel);
// Get the channel
ViEChannelManagerScoped cs(_channelManager);
ViEChannelManagerScoped cs(channel_manager_);
ViEChannel* ptrViEChannel = cs.Channel(videoChannel);
if (ptrViEChannel == NULL)
{
// The channel doesn't exists
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo,
ViEId(_instanceId, videoChannel),
ViEId(instance_id_, videoChannel),
"%s: Channel %d doesn't exist", __FUNCTION__,
videoChannel);
SetLastError(kViERtpRtcpInvalidChannelId);
@ -472,17 +472,17 @@ int ViERTP_RTCPImpl::GetRemoteRTCPCName(const int videoChannel,
char rtcpCName[KMaxRTCPCNameLength]) const
{
WEBRTC_TRACE(webrtc::kTraceApiCall, webrtc::kTraceVideo,
ViEId(_instanceId, videoChannel), "%s(channel: %d)",
ViEId(instance_id_, videoChannel), "%s(channel: %d)",
__FUNCTION__, videoChannel);
// Get the channel
ViEChannelManagerScoped cs(_channelManager);
ViEChannelManagerScoped cs(channel_manager_);
ViEChannel* ptrViEChannel = cs.Channel(videoChannel);
if (ptrViEChannel == NULL)
{
// The channel doesn't exists
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo,
ViEId(_instanceId, videoChannel),
ViEId(instance_id_, videoChannel),
"%s: Channel %d doesn't exist", __FUNCTION__,
videoChannel);
SetLastError(kViERtpRtcpInvalidChannelId);
@ -556,18 +556,18 @@ int ViERTP_RTCPImpl::SendApplicationDefinedRTCPPacket(
const char* data, unsigned short dataLengthInBytes)
{
WEBRTC_TRACE(webrtc::kTraceApiCall, webrtc::kTraceVideo,
ViEId(_instanceId, videoChannel),
ViEId(instance_id_, videoChannel),
"%s(channel: %d, subType: %c, name: %d, data: x, length: %u)",
__FUNCTION__, videoChannel, subType, name, dataLengthInBytes);
// Get the channel
ViEChannelManagerScoped cs(_channelManager);
ViEChannelManagerScoped cs(channel_manager_);
ViEChannel* ptrViEChannel = cs.Channel(videoChannel);
if (ptrViEChannel == NULL)
{
// The channel doesn't exists
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo,
ViEId(_instanceId, videoChannel),
ViEId(instance_id_, videoChannel),
"%s: Channel %d doesn't exist", __FUNCTION__,
videoChannel);
SetLastError(kViERtpRtcpInvalidChannelId);
@ -576,7 +576,7 @@ int ViERTP_RTCPImpl::SendApplicationDefinedRTCPPacket(
if (!ptrViEChannel->Sending())
{
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo,
ViEId(_instanceId, videoChannel),
ViEId(instance_id_, videoChannel),
"%s: Channel %d not sending", __FUNCTION__, videoChannel);
SetLastError(kViERtpRtcpNotSending);
return -1;
@ -585,7 +585,7 @@ int ViERTP_RTCPImpl::SendApplicationDefinedRTCPPacket(
if (ptrViEChannel->GetRTCPMode(method) != 0 || method == kRtcpOff)
{
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo,
ViEId(_instanceId, videoChannel),
ViEId(instance_id_, videoChannel),
"%s: RTCP disabled on channel %d.", __FUNCTION__,
videoChannel);
SetLastError(kViERtpRtcpRtcpDisabled);
@ -610,18 +610,18 @@ int ViERTP_RTCPImpl::SendApplicationDefinedRTCPPacket(
int ViERTP_RTCPImpl::SetNACKStatus(const int videoChannel, const bool enable)
{
WEBRTC_TRACE(webrtc::kTraceApiCall, webrtc::kTraceVideo,
ViEId(_instanceId, videoChannel),
ViEId(instance_id_, videoChannel),
"%s(channel: %d, enable: %d)", __FUNCTION__, videoChannel,
enable);
// Get the channel
ViEChannelManagerScoped cs(_channelManager);
ViEChannelManagerScoped cs(channel_manager_);
ViEChannel* ptrViEChannel = cs.Channel(videoChannel);
if (ptrViEChannel == NULL)
{
// The channel doesn't exists
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo,
ViEId(_instanceId, videoChannel),
ViEId(instance_id_, videoChannel),
"%s: Channel %d doesn't exist", __FUNCTION__,
videoChannel);
SetLastError(kViERtpRtcpInvalidChannelId);
@ -631,7 +631,7 @@ int ViERTP_RTCPImpl::SetNACKStatus(const int videoChannel, const bool enable)
if (ptrViEChannel->SetNACKStatus(enable) != 0)
{
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo,
ViEId(_instanceId, videoChannel),
ViEId(instance_id_, videoChannel),
"%s: failed for channel %d", __FUNCTION__, videoChannel);
SetLastError(kViERtpRtcpUnknownError);
return -1;
@ -642,7 +642,7 @@ int ViERTP_RTCPImpl::SetNACKStatus(const int videoChannel, const bool enable)
if (ptrViEEncoder == NULL)
{
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo,
ViEId(_instanceId, videoChannel),
ViEId(instance_id_, videoChannel),
"%s: Could not get encoder for channel %d", __FUNCTION__,
videoChannel);
SetLastError(kViERtpRtcpUnknownError);
@ -665,20 +665,20 @@ int ViERTP_RTCPImpl::SetFECStatus(const int videoChannel, const bool enable,
{
WEBRTC_TRACE(webrtc::kTraceApiCall, webrtc::kTraceVideo,
ViEId(_instanceId, videoChannel),
ViEId(instance_id_, videoChannel),
"%s(channel: %d, enable: %d, payloadTypeRED: %u, "
"payloadTypeFEC: %u)",
__FUNCTION__, videoChannel, enable, payloadTypeRED,
payloadTypeFEC);
// Get the channel
ViEChannelManagerScoped cs(_channelManager);
ViEChannelManagerScoped cs(channel_manager_);
ViEChannel* ptrViEChannel = cs.Channel(videoChannel);
if (ptrViEChannel == NULL)
{
// The channel doesn't exists
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo,
ViEId(_instanceId, videoChannel),
ViEId(instance_id_, videoChannel),
"%s: Channel %d doesn't exist", __FUNCTION__,
videoChannel);
SetLastError(kViERtpRtcpInvalidChannelId);
@ -690,7 +690,7 @@ int ViERTP_RTCPImpl::SetFECStatus(const int videoChannel, const bool enable,
!= 0)
{
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo,
ViEId(_instanceId, videoChannel),
ViEId(instance_id_, videoChannel),
"%s: failed for channel %d", __FUNCTION__, videoChannel);
SetLastError(kViERtpRtcpUnknownError);
return -1;
@ -701,7 +701,7 @@ int ViERTP_RTCPImpl::SetFECStatus(const int videoChannel, const bool enable,
if (ptrViEEncoder == NULL)
{
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo,
ViEId(_instanceId, videoChannel),
ViEId(instance_id_, videoChannel),
"%s: Could not get encoder for channel %d", __FUNCTION__,
videoChannel);
SetLastError(kViERtpRtcpUnknownError);
@ -723,20 +723,20 @@ int ViERTP_RTCPImpl::SetHybridNACKFECStatus(const int videoChannel,
const unsigned char payloadTypeFEC)
{
WEBRTC_TRACE(webrtc::kTraceApiCall, webrtc::kTraceVideo,
ViEId(_instanceId, videoChannel),
ViEId(instance_id_, videoChannel),
"%s(channel: %d, enable: %d, payloadTypeRED: %u, "
"payloadTypeFEC: %u)",
__FUNCTION__, videoChannel, enable, payloadTypeRED,
payloadTypeFEC);
// Get the channel
ViEChannelManagerScoped cs(_channelManager);
ViEChannelManagerScoped cs(channel_manager_);
ViEChannel* ptrViEChannel = cs.Channel(videoChannel);
if (ptrViEChannel == NULL)
{
// The channel doesn't exists
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo,
ViEId(_instanceId, videoChannel),
ViEId(instance_id_, videoChannel),
"%s: Channel %d doesn't exist", __FUNCTION__,
videoChannel);
SetLastError(kViERtpRtcpInvalidChannelId);
@ -748,7 +748,7 @@ int ViERTP_RTCPImpl::SetHybridNACKFECStatus(const int videoChannel,
payloadTypeFEC) != 0)
{
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo,
ViEId(_instanceId, videoChannel),
ViEId(instance_id_, videoChannel),
"%s: failed for channel %d", __FUNCTION__, videoChannel);
SetLastError(kViERtpRtcpUnknownError);
return -1;
@ -759,7 +759,7 @@ int ViERTP_RTCPImpl::SetHybridNACKFECStatus(const int videoChannel,
if (ptrViEEncoder == NULL)
{
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo,
ViEId(_instanceId, videoChannel),
ViEId(instance_id_, videoChannel),
"%s: Could not get encoder for channel %d", __FUNCTION__,
videoChannel);
SetLastError(kViERtpRtcpUnknownError);
@ -779,18 +779,18 @@ int ViERTP_RTCPImpl::SetKeyFrameRequestMethod(
const int videoChannel, const ViEKeyFrameRequestMethod method)
{
WEBRTC_TRACE(webrtc::kTraceApiCall, webrtc::kTraceVideo,
ViEId(_instanceId, videoChannel),
ViEId(instance_id_, videoChannel),
"%s(channel: %d, method: %d)", __FUNCTION__, videoChannel,
method);
// Get the channel
ViEChannelManagerScoped cs(_channelManager);
ViEChannelManagerScoped cs(channel_manager_);
ViEChannel* ptrViEChannel = cs.Channel(videoChannel);
if (ptrViEChannel == NULL)
{
// The channel doesn't exists
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo,
ViEId(_instanceId, videoChannel),
ViEId(instance_id_, videoChannel),
"%s: Channel %d doesn't exist", __FUNCTION__,
videoChannel);
SetLastError(kViERtpRtcpInvalidChannelId);
@ -815,18 +815,18 @@ int ViERTP_RTCPImpl::SetKeyFrameRequestMethod(
int ViERTP_RTCPImpl::SetTMMBRStatus(const int videoChannel, const bool enable)
{
WEBRTC_TRACE(webrtc::kTraceApiCall, webrtc::kTraceVideo,
ViEId(_instanceId, videoChannel),
ViEId(instance_id_, videoChannel),
"%s(channel: %d, enable: %d)", __FUNCTION__, videoChannel,
enable);
// Get the channel
ViEChannelManagerScoped cs(_channelManager);
ViEChannelManagerScoped cs(channel_manager_);
ViEChannel* ptrViEChannel = cs.Channel(videoChannel);
if (ptrViEChannel == NULL)
{
// The channel doesn't exists
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo,
ViEId(_instanceId, videoChannel),
ViEId(instance_id_, videoChannel),
"%s: Channel %d doesn't exist", __FUNCTION__,
videoChannel);
SetLastError(kViERtpRtcpInvalidChannelId);
@ -857,17 +857,17 @@ int ViERTP_RTCPImpl::GetReceivedRTCPStatistics(
unsigned int& jitter, int& rttMs) const
{
WEBRTC_TRACE(webrtc::kTraceApiCall, webrtc::kTraceVideo,
ViEId(_instanceId, videoChannel), "%s(channel: %d)",
ViEId(instance_id_, videoChannel), "%s(channel: %d)",
__FUNCTION__, videoChannel);
// Get the channel
ViEChannelManagerScoped cs(_channelManager);
ViEChannelManagerScoped cs(channel_manager_);
ViEChannel* ptrViEChannel = cs.Channel(videoChannel);
if (ptrViEChannel == NULL)
{
// The channel doesn't exists
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo,
ViEId(_instanceId, videoChannel),
ViEId(instance_id_, videoChannel),
"%s: Channel %d doesn't exist", __FUNCTION__,
videoChannel);
SetLastError(kViERtpRtcpInvalidChannelId);
@ -899,17 +899,17 @@ int ViERTP_RTCPImpl::GetSentRTCPStatistics(const int videoChannel,
int& rttMs) const
{
WEBRTC_TRACE(webrtc::kTraceApiCall, webrtc::kTraceVideo,
ViEId(_instanceId, videoChannel), "%s(channel: %d)",
ViEId(instance_id_, videoChannel), "%s(channel: %d)",
__FUNCTION__, videoChannel);
// Get the channel
ViEChannelManagerScoped cs(_channelManager);
ViEChannelManagerScoped cs(channel_manager_);
ViEChannel* ptrViEChannel = cs.Channel(videoChannel);
if (ptrViEChannel == NULL)
{
// The channel doesn't exists
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo,
ViEId(_instanceId, videoChannel),
ViEId(instance_id_, videoChannel),
"%s: Channel %d doesn't exist", __FUNCTION__,
videoChannel);
SetLastError(kViERtpRtcpInvalidChannelId);
@ -941,17 +941,17 @@ int ViERTP_RTCPImpl::GetRTPStatistics(const int videoChannel,
unsigned int& packetsReceived) const
{
WEBRTC_TRACE(webrtc::kTraceApiCall, webrtc::kTraceVideo,
ViEId(_instanceId, videoChannel), "%s(channel: %d)",
ViEId(instance_id_, videoChannel), "%s(channel: %d)",
__FUNCTION__, videoChannel);
// Get the channel
ViEChannelManagerScoped cs(_channelManager);
ViEChannelManagerScoped cs(channel_manager_);
ViEChannel* ptrViEChannel = cs.Channel(videoChannel);
if (ptrViEChannel == NULL)
{
// The channel doesn't exists
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo,
ViEId(_instanceId, videoChannel),
ViEId(instance_id_, videoChannel),
"%s: Channel %d doesn't exist", __FUNCTION__,
videoChannel);
SetLastError(kViERtpRtcpInvalidChannelId);
@ -976,15 +976,15 @@ int ViERTP_RTCPImpl::GetBandwidthUsage(const int videoChannel,
unsigned int& fecBitrateSent,
unsigned int& nackBitrateSent) const {
WEBRTC_TRACE(webrtc::kTraceApiCall, webrtc::kTraceVideo,
ViEId(_instanceId, videoChannel), "%s(channel: %d)",
ViEId(instance_id_, videoChannel), "%s(channel: %d)",
__FUNCTION__, videoChannel);
ViEChannelManagerScoped cs(_channelManager);
ViEChannelManagerScoped cs(channel_manager_);
ViEChannel* ptrViEChannel = cs.Channel(videoChannel);
if (ptrViEChannel == NULL) {
// The channel doesn't exists
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo,
ViEId(_instanceId, videoChannel),
ViEId(instance_id_, videoChannel),
"%s: Channel %d doesn't exist", __FUNCTION__,
videoChannel);
SetLastError(kViERtpRtcpInvalidChannelId);
@ -1014,20 +1014,20 @@ int ViERTP_RTCPImpl::SetRTPKeepAliveStatus(
const unsigned int deltaTransmitTimeSeconds)
{
WEBRTC_TRACE(webrtc::kTraceApiCall, webrtc::kTraceVideo,
ViEId(_instanceId, videoChannel),
ViEId(instance_id_, videoChannel),
"%s(channel: %d, enable: %d, unknownPayloadType: %d, "
"deltaTransmitTimeMS: %ul)",
__FUNCTION__, videoChannel, enable, (int) unknownPayloadType,
deltaTransmitTimeSeconds);
// Get the channel
ViEChannelManagerScoped cs(_channelManager);
ViEChannelManagerScoped cs(channel_manager_);
ViEChannel* ptrViEChannel = cs.Channel(videoChannel);
if (ptrViEChannel == NULL)
{
// The channel doesn't exists
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo,
ViEId(_instanceId, videoChannel),
ViEId(instance_id_, videoChannel),
"%s: Channel %d doesn't exist", __FUNCTION__,
videoChannel);
SetLastError(kViERtpRtcpInvalidChannelId);
@ -1052,17 +1052,17 @@ int ViERTP_RTCPImpl::GetRTPKeepAliveStatus(
unsigned int& deltaTransmitTimeSeconds)
{
WEBRTC_TRACE(webrtc::kTraceApiCall, webrtc::kTraceVideo,
ViEId(_instanceId, videoChannel), "%s(channel: %d)",
ViEId(instance_id_, videoChannel), "%s(channel: %d)",
__FUNCTION__, videoChannel);
// Get the channel
ViEChannelManagerScoped cs(_channelManager);
ViEChannelManagerScoped cs(channel_manager_);
ViEChannel* ptrViEChannel = cs.Channel(videoChannel);
if (ptrViEChannel == NULL)
{
// The channel doesn't exists
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo,
ViEId(_instanceId, videoChannel),
ViEId(instance_id_, videoChannel),
"%s: Channel %d doesn't exist", __FUNCTION__,
videoChannel);
SetLastError(kViERtpRtcpInvalidChannelId);
@ -1095,20 +1095,20 @@ int ViERTP_RTCPImpl::StartRTPDump(const int videoChannel,
RTPDirections direction)
{
WEBRTC_TRACE(webrtc::kTraceApiCall, webrtc::kTraceVideo,
ViEId(_instanceId, videoChannel),
ViEId(instance_id_, videoChannel),
"%s(channel: %d, fileName: %s, direction: %d)", __FUNCTION__,
videoChannel, fileNameUTF8, direction);
assert(FileWrapper::kMaxFileNameSize == 1024);
// Get the channel
ViEChannelManagerScoped cs(_channelManager);
ViEChannelManagerScoped cs(channel_manager_);
ViEChannel* ptrViEChannel = cs.Channel(videoChannel);
if (ptrViEChannel == NULL)
{
// The channel doesn't exists
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo,
ViEId(_instanceId, videoChannel),
ViEId(instance_id_, videoChannel),
"%s: Channel %d doesn't exist", __FUNCTION__,
videoChannel);
SetLastError(kViERtpRtcpInvalidChannelId);
@ -1133,18 +1133,18 @@ int ViERTP_RTCPImpl::StopRTPDump(const int videoChannel,
RTPDirections direction)
{
WEBRTC_TRACE(webrtc::kTraceApiCall, webrtc::kTraceVideo,
ViEId(_instanceId, videoChannel),
ViEId(instance_id_, videoChannel),
"%s(channel: %d, direction: %d)", __FUNCTION__, videoChannel,
direction);
// Get the channel
ViEChannelManagerScoped cs(_channelManager);
ViEChannelManagerScoped cs(channel_manager_);
ViEChannel* ptrViEChannel = cs.Channel(videoChannel);
if (ptrViEChannel == NULL)
{
// The channel doesn't exists
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo,
ViEId(_instanceId, videoChannel),
ViEId(instance_id_, videoChannel),
"%s: Channel %d doesn't exist", __FUNCTION__,
videoChannel);
SetLastError(kViERtpRtcpInvalidChannelId);
@ -1173,17 +1173,17 @@ int ViERTP_RTCPImpl::RegisterRTPObserver(const int videoChannel,
ViERTPObserver& observer)
{
WEBRTC_TRACE(webrtc::kTraceApiCall, webrtc::kTraceVideo,
ViEId(_instanceId, videoChannel), "%s(channel: %d)",
ViEId(instance_id_, videoChannel), "%s(channel: %d)",
__FUNCTION__, videoChannel);
// Get the channel
ViEChannelManagerScoped cs(_channelManager);
ViEChannelManagerScoped cs(channel_manager_);
ViEChannel* ptrViEChannel = cs.Channel(videoChannel);
if (ptrViEChannel == NULL)
{
// The channel doesn't exists
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo,
ViEId(_instanceId, videoChannel),
ViEId(instance_id_, videoChannel),
"%s: Channel %d doesn't exist", __FUNCTION__,
videoChannel);
SetLastError(kViERtpRtcpInvalidChannelId);
@ -1207,17 +1207,17 @@ int ViERTP_RTCPImpl::RegisterRTPObserver(const int videoChannel,
int ViERTP_RTCPImpl::DeregisterRTPObserver(const int videoChannel)
{
WEBRTC_TRACE(webrtc::kTraceApiCall, webrtc::kTraceVideo,
ViEId(_instanceId, videoChannel), "%s(channel: %d)",
ViEId(instance_id_, videoChannel), "%s(channel: %d)",
__FUNCTION__, videoChannel);
// Get the channel
ViEChannelManagerScoped cs(_channelManager);
ViEChannelManagerScoped cs(channel_manager_);
ViEChannel* ptrViEChannel = cs.Channel(videoChannel);
if (ptrViEChannel == NULL)
{
// The channel doesn't exists
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo,
ViEId(_instanceId, videoChannel),
ViEId(instance_id_, videoChannel),
"%s: Channel %d doesn't exist", __FUNCTION__,
videoChannel);
SetLastError(kViERtpRtcpInvalidChannelId);
@ -1239,17 +1239,17 @@ int ViERTP_RTCPImpl::RegisterRTCPObserver(const int videoChannel,
ViERTCPObserver& observer)
{
WEBRTC_TRACE(webrtc::kTraceApiCall, webrtc::kTraceVideo,
ViEId(_instanceId, videoChannel), "%s(channel: %d)",
ViEId(instance_id_, videoChannel), "%s(channel: %d)",
__FUNCTION__, videoChannel);
// Get the channel
ViEChannelManagerScoped cs(_channelManager);
ViEChannelManagerScoped cs(channel_manager_);
ViEChannel* ptrViEChannel = cs.Channel(videoChannel);
if (ptrViEChannel == NULL)
{
// The channel doesn't exists
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo,
ViEId(_instanceId, videoChannel),
ViEId(instance_id_, videoChannel),
"%s: Channel %d doesn't exist", __FUNCTION__,
videoChannel);
SetLastError(kViERtpRtcpInvalidChannelId);
@ -1271,17 +1271,17 @@ int ViERTP_RTCPImpl::RegisterRTCPObserver(const int videoChannel,
int ViERTP_RTCPImpl::DeregisterRTCPObserver(const int videoChannel)
{
WEBRTC_TRACE(webrtc::kTraceApiCall, webrtc::kTraceVideo,
ViEId(_instanceId, videoChannel), "%s(channel: %d)",
ViEId(instance_id_, videoChannel), "%s(channel: %d)",
__FUNCTION__, videoChannel);
// Get the channel
ViEChannelManagerScoped cs(_channelManager);
ViEChannelManagerScoped cs(channel_manager_);
ViEChannel* ptrViEChannel = cs.Channel(videoChannel);
if (ptrViEChannel == NULL)
{
// The channel doesn't exists
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo,
ViEId(_instanceId, videoChannel),
ViEId(instance_id_, videoChannel),
"%s: Channel %d doesn't exist", __FUNCTION__,
videoChannel);
SetLastError(kViERtpRtcpInvalidChannelId);

View File

@ -10,84 +10,76 @@
// ViESharedData.cpp
#include "vie_shared_data.h"
#include "vie_defines.h"
#include "cpu_info.h"
#include "critical_section_wrapper.h"
#include "process_thread.h"
#include "trace.h"
#include "vie_channel_manager.h"
#include "vie_defines.h"
#include "vie_input_manager.h"
#include "vie_render_manager.h"
#include "vie_shared_data.h"
namespace webrtc {
// Active instance counter
int ViESharedData::_instanceCounter = 0;
int ViESharedData::instance_counter_ = 0;
ViESharedData::ViESharedData()
: _instanceId(++_instanceCounter),
_apiCritsect(*CriticalSectionWrapper::CreateCriticalSection()),
_isInitialized(false),
_numberOfCores(CpuInfo::DetectNumberOfCores()),
_viePerformanceMonitor(ViEPerformanceMonitor(_instanceId)),
_channelManager(*new ViEChannelManager(_instanceId, _numberOfCores,
_viePerformanceMonitor)),
_inputManager(*new ViEInputManager(_instanceId)),
_renderManager(*new ViERenderManager(_instanceId)),
_moduleProcessThreadPtr(ProcessThread::CreateProcessThread()),
_lastError(0)
{
Trace::CreateTrace();
_channelManager.SetModuleProcessThread(*_moduleProcessThreadPtr);
_inputManager.SetModuleProcessThread(*_moduleProcessThreadPtr);
_moduleProcessThreadPtr->Start();
: instance_id_(++instance_counter_),
api_critsect_(*CriticalSectionWrapper::CreateCriticalSection()),
initialized_(false),
number_cores_(CpuInfo::DetectNumberOfCores()),
vie_performance_monitor_(ViEPerformanceMonitor(instance_id_)),
channel_manager_(*new ViEChannelManager(instance_id_, number_cores_,
vie_performance_monitor_)),
input_manager_(*new ViEInputManager(instance_id_)),
render_manager_(*new ViERenderManager(instance_id_)),
module_process_thread_(ProcessThread::CreateProcessThread()),
last_error_(0) {
Trace::CreateTrace();
channel_manager_.SetModuleProcessThread(*module_process_thread_);
input_manager_.SetModuleProcessThread(*module_process_thread_);
module_process_thread_->Start();
}
ViESharedData::~ViESharedData()
{
delete &_inputManager;
delete &_channelManager;
delete &_renderManager;
ViESharedData::~ViESharedData() {
delete &input_manager_;
delete &channel_manager_;
delete &render_manager_;
_moduleProcessThreadPtr->Stop();
ProcessThread::DestroyProcessThread(_moduleProcessThreadPtr);
delete &_apiCritsect;
Trace::ReturnTrace();
module_process_thread_->Stop();
ProcessThread::DestroyProcessThread(module_process_thread_);
delete &api_critsect_;
Trace::ReturnTrace();
}
bool ViESharedData::IsInitialized() const
{
return _isInitialized;
bool ViESharedData::Initialized() const {
return initialized_;
}
int ViESharedData::SetInitialized()
{
_isInitialized = true;
return 0;
int ViESharedData::SetInitialized() {
initialized_ = true;
return 0;
}
int ViESharedData::SetUnInitialized()
{
_isInitialized = false;
return 0;
int ViESharedData::SetUnInitialized() {
initialized_ = false;
return 0;
}
void ViESharedData::SetLastError(const int error) const
{
_lastError = error;
void ViESharedData::SetLastError(const int error) const {
last_error_ = error;
}
int ViESharedData::LastErrorInternal() const
{
int error = _lastError;
_lastError = 0;
return error;
int ViESharedData::LastErrorInternal() const {
int error = last_error_;
last_error_ = 0;
return error;
}
int ViESharedData::NumberOfCores() const
{
return _numberOfCores;
int ViESharedData::NumberOfCores() const {
return number_cores_;
}
} // namespace webrtc
} // namespace webrtc

View File

@ -8,49 +8,52 @@
* be found in the AUTHORS file in the root of the source tree.
*/
// vie_shared_data.h
// ViESharedData contains data and instances common to all interface
// implementations.
#ifndef WEBRTC_VIDEO_ENGINE_MAIN_SOURCE_VIE_SHARED_DATA_H_
#define WEBRTC_VIDEO_ENGINE_MAIN_SOURCE_VIE_SHARED_DATA_H_
#ifndef WEBRTC_VIDEO_ENGINE_VIE_SHARED_DATA_H_
#define WEBRTC_VIDEO_ENGINE_VIE_SHARED_DATA_H_
#include "vie_defines.h"
#include "vie_performance_monitor.h"
namespace webrtc {
class CriticalSectionWrapper;
class ViERenderManager;
class ProcessThread;
class ViEChannelManager;
class ViEInputManager;
class ProcessThread;
class ViERenderManager;
class ViESharedData
{
protected:
ViESharedData();
~ViESharedData();
class ViESharedData {
protected:
ViESharedData();
~ViESharedData();
bool IsInitialized() const;
int SetInitialized();
int SetUnInitialized();
void SetLastError(const int error) const;
int LastErrorInternal() const;
protected:
int NumberOfCores() const;
bool Initialized() const;
int SetInitialized();
int SetUnInitialized();
void SetLastError(const int error) const;
int LastErrorInternal() const;
static int _instanceCounter;
const int _instanceId;
CriticalSectionWrapper& _apiCritsect;
bool _isInitialized;
const int _numberOfCores;
int NumberOfCores() const;
ViEPerformanceMonitor _viePerformanceMonitor;
ViEChannelManager& _channelManager;
ViEInputManager& _inputManager;
ViERenderManager& _renderManager;
ProcessThread* _moduleProcessThreadPtr;
private:
mutable int _lastError;
static int instance_counter_;
const int instance_id_;
CriticalSectionWrapper& api_critsect_;
bool initialized_;
const int number_cores_;
ViEPerformanceMonitor vie_performance_monitor_;
ViEChannelManager& channel_manager_;
ViEInputManager& input_manager_;
ViERenderManager& render_manager_;
ProcessThread* module_process_thread_;
private:
mutable int last_error_;
};
} // namespace webrtc
#endif // WEBRTC_VIDEO_ENGINE_MAIN_SOURCE_VIE_SHARED_DATA_H_
} // namespace webrtc
#endif // WEBRTC_VIDEO_ENGINE_VIE_SHARED_DATA_H_