diff --git a/webrtc/video_engine/vie_file_image.cc b/webrtc/video_engine/vie_file_image.cc index c756c26bf..919da9fa1 100644 --- a/webrtc/video_engine/vie_file_image.cc +++ b/webrtc/video_engine/vie_file_image.cc @@ -20,7 +20,6 @@ #include "webrtc/common_video/interface/video_image.h" #include "webrtc/common_video/jpeg/include/jpeg.h" #include "webrtc/common_video/libyuv/include/webrtc_libyuv.h" -#include "webrtc/system_wrappers/interface/trace.h" namespace webrtc { @@ -32,38 +31,25 @@ int ViEFileImage::ConvertJPEGToVideoFrame(int engine_id, FILE* image_file = fopen(file_nameUTF8, "rb"); if (!image_file) { - WEBRTC_TRACE(kTraceError, kTraceVideo, engine_id, - "%s could not open file %s", __FUNCTION__, file_nameUTF8); return -1; } if (fseek(image_file, 0, SEEK_END) != 0) { fclose(image_file); - WEBRTC_TRACE(kTraceError, kTraceVideo, engine_id, - "ConvertJPEGToVideoFrame fseek SEEK_END error for file %s", - file_nameUTF8); return -1; } int buffer_size = ftell(image_file); if (buffer_size == -1) { fclose(image_file); - WEBRTC_TRACE(kTraceError, kTraceVideo, engine_id, - "ConvertJPEGToVideoFrame could tell file size for file %s", - file_nameUTF8); return -1; } image_buffer._size = buffer_size; if (fseek(image_file, 0, SEEK_SET) != 0) { fclose(image_file); - WEBRTC_TRACE(kTraceError, kTraceVideo, engine_id, - "ConvertJPEGToVideoFrame fseek SEEK_SET error for file %s", - file_nameUTF8); return -1; } image_buffer._buffer = new uint8_t[ image_buffer._size + 1]; if (image_buffer._size != fread(image_buffer._buffer, sizeof(uint8_t), image_buffer._size, image_file)) { - WEBRTC_TRACE(kTraceError, kTraceVideo, engine_id, - "%s could not read file %s", __FUNCTION__, file_nameUTF8); fclose(image_file); delete [] image_buffer._buffer; return -1; @@ -76,14 +62,8 @@ int ViEFileImage::ConvertJPEGToVideoFrame(int engine_id, image_buffer._buffer = NULL; if (ret == -1) { - WEBRTC_TRACE(kTraceError, kTraceVideo, engine_id, - "%s could decode file %s from jpeg format", __FUNCTION__, - file_nameUTF8); return -1; } else if (ret == -3) { - WEBRTC_TRACE(kTraceError, kTraceVideo, engine_id, - "%s could not convert jpeg's data to i420 format", - __FUNCTION__, file_nameUTF8); } return 0; } diff --git a/webrtc/video_engine/vie_image_process_impl.cc b/webrtc/video_engine/vie_image_process_impl.cc index b10e774a3..d089c0490 100644 --- a/webrtc/video_engine/vie_image_process_impl.cc +++ b/webrtc/video_engine/vie_image_process_impl.cc @@ -10,7 +10,7 @@ #include "webrtc/video_engine/vie_image_process_impl.h" -#include "webrtc/system_wrappers/interface/trace.h" +#include "webrtc/system_wrappers/interface/logging.h" #include "webrtc/video_engine/include/vie_errors.h" #include "webrtc/video_engine/vie_capturer.h" #include "webrtc/video_engine/vie_channel.h" @@ -39,45 +39,30 @@ ViEImageProcess* ViEImageProcess::GetInterface(VideoEngine* video_engine) { } int ViEImageProcessImpl::Release() { - WEBRTC_TRACE(kTraceApiCall, kTraceVideo, shared_data_->instance_id(), - "ViEImageProcess::Release()"); // Decrease ref count. (*this)--; int32_t ref_count = GetCount(); if (ref_count < 0) { - WEBRTC_TRACE(kTraceWarning, kTraceVideo, shared_data_->instance_id(), - "ViEImageProcess release too many times"); + LOG(LS_ERROR) << "ViEImageProcess release too many times"; shared_data_->SetLastError(kViEAPIDoesNotExist); return -1; } - WEBRTC_TRACE(kTraceInfo, kTraceVideo, shared_data_->instance_id(), - "ViEImageProcess reference count: %d", ref_count); return ref_count; } ViEImageProcessImpl::ViEImageProcessImpl(ViESharedData* shared_data) - : shared_data_(shared_data) { - WEBRTC_TRACE(kTraceMemory, kTraceVideo, shared_data_->instance_id(), - "ViEImageProcessImpl::ViEImageProcessImpl() Ctor"); -} + : shared_data_(shared_data) {} -ViEImageProcessImpl::~ViEImageProcessImpl() { - WEBRTC_TRACE(kTraceMemory, kTraceVideo, shared_data_->instance_id(), - "ViEImageProcessImpl::~ViEImageProcessImpl() Dtor"); -} +ViEImageProcessImpl::~ViEImageProcessImpl() {} int ViEImageProcessImpl::RegisterCaptureEffectFilter( const int capture_id, ViEEffectFilter& capture_filter) { - WEBRTC_TRACE(kTraceApiCall, kTraceVideo, ViEId(shared_data_->instance_id()), - "%s(capture_id: %d)", __FUNCTION__, capture_id); + LOG_F(LS_INFO) << "capture_id: " << capture_id; ViEInputManagerScoped is(*(shared_data_->input_manager())); ViECapturer* vie_capture = is.Capture(capture_id); if (!vie_capture) { - WEBRTC_TRACE(kTraceError, kTraceVideo, ViEId(shared_data_->instance_id()), - "%s: Capture device %d doesn't exist", __FUNCTION__, - capture_id); shared_data_->SetLastError(kViEImageProcessInvalidCaptureId); return -1; } @@ -89,15 +74,11 @@ int ViEImageProcessImpl::RegisterCaptureEffectFilter( } int ViEImageProcessImpl::DeregisterCaptureEffectFilter(const int capture_id) { - WEBRTC_TRACE(kTraceApiCall, kTraceVideo, ViEId(shared_data_->instance_id()), - "%s(capture_id: %d)", __FUNCTION__, capture_id); + LOG_F(LS_INFO) << "capture_id: " << capture_id; ViEInputManagerScoped is(*(shared_data_->input_manager())); ViECapturer* vie_capture = is.Capture(capture_id); if (!vie_capture) { - WEBRTC_TRACE(kTraceError, kTraceVideo, ViEId(shared_data_->instance_id()), - "%s: Capture device %d doesn't exist", __FUNCTION__, - capture_id); shared_data_->SetLastError(kViEImageProcessInvalidCaptureId); return -1; } @@ -111,14 +92,11 @@ int ViEImageProcessImpl::DeregisterCaptureEffectFilter(const int capture_id) { int ViEImageProcessImpl::RegisterSendEffectFilter( const int video_channel, ViEEffectFilter& send_filter) { - WEBRTC_TRACE(kTraceApiCall, kTraceVideo, ViEId(shared_data_->instance_id()), - "%s(video_channel: %d)", __FUNCTION__, video_channel); + LOG_F(LS_INFO) << "video_channel: " << video_channel; ViEChannelManagerScoped cs(*(shared_data_->channel_manager())); ViEEncoder* vie_encoder = cs.Encoder(video_channel); if (vie_encoder == NULL) { - WEBRTC_TRACE(kTraceError, kTraceVideo, ViEId(shared_data_->instance_id()), - "%s: Channel %d doesn't exist", __FUNCTION__, video_channel); shared_data_->SetLastError(kViEImageProcessInvalidChannelId); return -1; } @@ -131,14 +109,11 @@ int ViEImageProcessImpl::RegisterSendEffectFilter( } int ViEImageProcessImpl::DeregisterSendEffectFilter(const int video_channel) { - WEBRTC_TRACE(kTraceApiCall, kTraceVideo, ViEId(shared_data_->instance_id()), - "%s(video_channel: %d)", __FUNCTION__, video_channel); + LOG_F(LS_INFO) << "video_channel: " << video_channel; ViEChannelManagerScoped cs(*(shared_data_->channel_manager())); ViEEncoder* vie_encoder = cs.Encoder(video_channel); if (vie_encoder == NULL) { - WEBRTC_TRACE(kTraceError, kTraceVideo, ViEId(shared_data_->instance_id()), - "%s: Channel %d doesn't exist", __FUNCTION__, video_channel); shared_data_->SetLastError(kViEImageProcessInvalidChannelId); return -1; } @@ -152,14 +127,11 @@ int ViEImageProcessImpl::DeregisterSendEffectFilter(const int video_channel) { int ViEImageProcessImpl::RegisterRenderEffectFilter( const int video_channel, ViEEffectFilter& render_filter) { - WEBRTC_TRACE(kTraceApiCall, kTraceVideo, ViEId(shared_data_->instance_id()), - "%s(video_channel: %d)", __FUNCTION__, video_channel); + LOG_F(LS_INFO) << "video_channel: " << video_channel; ViEChannelManagerScoped cs(*(shared_data_->channel_manager())); ViEChannel* vie_channel = cs.Channel(video_channel); if (!vie_channel) { - WEBRTC_TRACE(kTraceError, kTraceVideo, ViEId(shared_data_->instance_id()), - "%s: Channel %d doesn't exist", __FUNCTION__, video_channel); shared_data_->SetLastError(kViEImageProcessInvalidChannelId); return -1; } @@ -171,14 +143,11 @@ int ViEImageProcessImpl::RegisterRenderEffectFilter( } int ViEImageProcessImpl::DeregisterRenderEffectFilter(const int video_channel) { - WEBRTC_TRACE(kTraceApiCall, kTraceVideo, ViEId(shared_data_->instance_id()), - "%s(video_channel: %d)", __FUNCTION__, video_channel); + LOG_F(LS_INFO) << "video_channel: " << video_channel; ViEChannelManagerScoped cs(*(shared_data_->channel_manager())); ViEChannel* vie_channel = cs.Channel(video_channel); if (!vie_channel) { - WEBRTC_TRACE(kTraceError, kTraceVideo, ViEId(shared_data_->instance_id()), - "%s: Channel %d doesn't exist", __FUNCTION__, video_channel); shared_data_->SetLastError(kViEImageProcessInvalidChannelId); return -1; } @@ -192,16 +161,12 @@ int ViEImageProcessImpl::DeregisterRenderEffectFilter(const int video_channel) { int ViEImageProcessImpl::EnableDeflickering(const int capture_id, const bool enable) { - WEBRTC_TRACE(kTraceApiCall, kTraceVideo, ViEId(shared_data_->instance_id()), - "%s(capture_id: %d, enable: %d)", __FUNCTION__, capture_id, - enable); + LOG_F(LS_INFO) << "capture_id: " << capture_id + << " enable: " << (enable ? "on" : "off"); ViEInputManagerScoped is(*(shared_data_->input_manager())); ViECapturer* vie_capture = is.Capture(capture_id); if (!vie_capture) { - WEBRTC_TRACE(kTraceError, kTraceVideo, ViEId(shared_data_->instance_id()), - "%s: Capture device %d doesn't exist", __FUNCTION__, - capture_id); shared_data_->SetLastError(kViEImageProcessInvalidChannelId); return -1; } @@ -219,16 +184,12 @@ int ViEImageProcessImpl::EnableDeflickering(const int capture_id, int ViEImageProcessImpl::EnableDenoising(const int capture_id, const bool enable) { - WEBRTC_TRACE(kTraceApiCall, kTraceVideo, ViEId(shared_data_->instance_id()), - "%s(capture_id: %d, enable: %d)", __FUNCTION__, capture_id, - enable); + LOG_F(LS_INFO) << "capture_id: " << capture_id + << " enable: " << (enable ? "on" : "off"); ViEInputManagerScoped is(*(shared_data_->input_manager())); ViECapturer* vie_capture = is.Capture(capture_id); if (!vie_capture) { - WEBRTC_TRACE(kTraceError, kTraceVideo, ViEId(shared_data_->instance_id()), - "%s: Capture device %d doesn't exist", __FUNCTION__, - capture_id); shared_data_->SetLastError(kViEImageProcessInvalidCaptureId); return -1; } @@ -246,15 +207,12 @@ int ViEImageProcessImpl::EnableDenoising(const int capture_id, int ViEImageProcessImpl::EnableColorEnhancement(const int video_channel, const bool enable) { - WEBRTC_TRACE(kTraceApiCall, kTraceVideo, ViEId(shared_data_->instance_id()), - "%s(video_channel: %d, enable: %d)", __FUNCTION__, video_channel, - enable); + LOG_F(LS_INFO) << "video_channel: " << video_channel + << " enable: " << (enable ? "on" : "off"); ViEChannelManagerScoped cs(*(shared_data_->channel_manager())); ViEChannel* vie_channel = cs.Channel(video_channel); if (!vie_channel) { - WEBRTC_TRACE(kTraceError, kTraceVideo, ViEId(shared_data_->instance_id()), - "%s: Channel %d doesn't exist", __FUNCTION__, video_channel); shared_data_->SetLastError(kViEImageProcessInvalidChannelId); return -1; } diff --git a/webrtc/video_engine/vie_impl.cc b/webrtc/video_engine/vie_impl.cc index c4f2b1a37..34de82026 100644 --- a/webrtc/video_engine/vie_impl.cc +++ b/webrtc/video_engine/vie_impl.cc @@ -11,6 +11,7 @@ #include "webrtc/video_engine/vie_impl.h" #include "webrtc/common.h" +#include "webrtc/system_wrappers/interface/logging.h" #include "webrtc/system_wrappers/interface/trace.h" #ifdef WEBRTC_ANDROID @@ -31,82 +32,71 @@ VideoEngine* VideoEngine::Create(const Config& config) { } bool VideoEngine::Delete(VideoEngine*& video_engine) { - if (!video_engine) { - WEBRTC_TRACE(kTraceError, kTraceVideo, kModuleId, - "VideoEngine::Delete - No argument"); + if (!video_engine) return false; - } - WEBRTC_TRACE(kTraceApiCall, kTraceVideo, kModuleId, - "VideoEngine::Delete(vie = 0x%p)", video_engine); + + LOG_F(LS_INFO); VideoEngineImpl* vie_impl = static_cast(video_engine); // Check all reference counters. ViEBaseImpl* vie_base = vie_impl; if (vie_base->GetCount() > 0) { - WEBRTC_TRACE(kTraceError, kTraceVideo, kModuleId, - "ViEBase ref count: %d", vie_base->GetCount()); + LOG(LS_ERROR) << "ViEBase ref count > 0: " << vie_base->GetCount(); return false; } #ifdef WEBRTC_VIDEO_ENGINE_CAPTURE_API ViECaptureImpl* vie_capture = vie_impl; if (vie_capture->GetCount() > 0) { - WEBRTC_TRACE(kTraceError, kTraceVideo, kModuleId, - "ViECapture ref count: %d", vie_capture->GetCount()); + LOG(LS_ERROR) << "ViECapture ref count > 0: " << vie_capture->GetCount(); return false; } #endif #ifdef WEBRTC_VIDEO_ENGINE_CODEC_API ViECodecImpl* vie_codec = vie_impl; if (vie_codec->GetCount() > 0) { - WEBRTC_TRACE(kTraceError, kTraceVideo, kModuleId, - "ViECodec ref count: %d", vie_codec->GetCount()); + LOG(LS_ERROR) << "ViECodec ref count > 0: " << vie_codec->GetCount(); return false; } #endif #ifdef WEBRTC_VIDEO_ENGINE_EXTERNAL_CODEC_API ViEExternalCodecImpl* vie_external_codec = vie_impl; if (vie_external_codec->GetCount() > 0) { - WEBRTC_TRACE(kTraceError, kTraceVideo, kModuleId, - "ViEExternalCodec ref count: %d", vie_external_codec->GetCount()); + LOG(LS_ERROR) << "ViEExternalCodec ref count > 0: " + << vie_external_codec->GetCount(); return false; } #endif #ifdef WEBRTC_VIDEO_ENGINE_FILE_API ViEFileImpl* vie_file = vie_impl; if (vie_file->GetCount() > 0) { - WEBRTC_TRACE(kTraceError, kTraceVideo, kModuleId, - "ViEFile ref count: %d", vie_file->GetCount()); + LOG(LS_ERROR) << "ViEFile ref count > 0: " << vie_file->GetCount(); return false; } #endif #ifdef WEBRTC_VIDEO_ENGINE_IMAGE_PROCESS_API ViEImageProcessImpl* vie_image_process = vie_impl; if (vie_image_process->GetCount() > 0) { - WEBRTC_TRACE(kTraceError, kTraceVideo, kModuleId, - "ViEImageProcess ref count: %d", - vie_image_process->GetCount()); + LOG(LS_ERROR) << "ViEImageProcess ref count > 0: " + << vie_image_process->GetCount(); return false; } #endif ViENetworkImpl* vie_network = vie_impl; if (vie_network->GetCount() > 0) { - WEBRTC_TRACE(kTraceError, kTraceVideo, kModuleId, - "ViENetwork ref count: %d", vie_network->GetCount()); + LOG(LS_ERROR) << "ViENetwork ref count > 0: " << vie_network->GetCount(); return false; } #ifdef WEBRTC_VIDEO_ENGINE_RENDER_API ViERenderImpl* vie_render = vie_impl; if (vie_render->GetCount() > 0) { - WEBRTC_TRACE(kTraceError, kTraceVideo, kModuleId, - "ViERender ref count: %d", vie_render->GetCount()); + LOG(LS_ERROR) << "ViERender ref count > 0: " << vie_render->GetCount(); return false; } #endif #ifdef WEBRTC_VIDEO_ENGINE_RTP_RTCP_API ViERTP_RTCPImpl* vie_rtp_rtcp = vie_impl; if (vie_rtp_rtcp->GetCount() > 0) { - WEBRTC_TRACE(kTraceError, kTraceVideo, kModuleId, - "ViERTP_RTCP ref count: %d", vie_rtp_rtcp->GetCount()); + LOG(LS_ERROR) << "ViERTP_RTCP ref count > 0: " << vie_rtp_rtcp->GetCount(); return false; } #endif @@ -115,8 +105,6 @@ bool VideoEngine::Delete(VideoEngine*& video_engine) { vie_impl = NULL; video_engine = NULL; - WEBRTC_TRACE(kTraceInfo, kTraceVideo, kModuleId, - "%s: instance deleted.", __FUNCTION__); return true; } @@ -128,9 +116,8 @@ int VideoEngine::SetTraceFile(const char* file_nameUTF8, if (Trace::SetTraceFile(file_nameUTF8, add_file_counter) == -1) { return -1; } - WEBRTC_TRACE(kTraceApiCall, kTraceVideo, kModuleId, - "SetTraceFileName(file_nameUTF8 = %s, add_file_counter = %d", - file_nameUTF8, add_file_counter); + LOG_F(LS_INFO) << "filename: " << file_nameUTF8 + << " add_file_counter: " << (add_file_counter ? "yes" : "no"); return 0; } @@ -139,35 +126,29 @@ int VideoEngine::SetTraceFilter(const unsigned int filter) { if (filter == kTraceNone && old_filter != kTraceNone) { // Do the logging before turning it off. - WEBRTC_TRACE(kTraceApiCall, kTraceVideo, kModuleId, - "SetTraceFilter(filter = 0x%x)", filter); + LOG_F(LS_INFO) << "filter: " << filter; } Trace::set_level_filter(filter); - WEBRTC_TRACE(kTraceApiCall, kTraceVideo, kModuleId, - "SetTraceFilter(filter = 0x%x)", filter); + LOG_F(LS_INFO) << "filter: " << filter; return 0; } int VideoEngine::SetTraceCallback(TraceCallback* callback) { - WEBRTC_TRACE(kTraceApiCall, kTraceVideo, kModuleId, - "SetTraceCallback(TraceCallback = 0x%p)", callback); + LOG_F(LS_INFO); return Trace::SetTraceCallback(callback); } #if defined(ANDROID) && !defined(WEBRTC_CHROMIUM_BUILD) int VideoEngine::SetAndroidObjects(JavaVM* javaVM) { - WEBRTC_TRACE(kTraceApiCall, kTraceVideo, kModuleId, - "SetAndroidObjects()"); + LOG_F(LS_INFO); if (SetCaptureAndroidVM(javaVM) != 0) { - WEBRTC_TRACE(kTraceError, kTraceVideo, kModuleId, - "Could not set capture Android VM"); + LOG(LS_ERROR) << "Could not set capture Android VM"; return -1; } if (SetRenderAndroidVM(javaVM) != 0) { - WEBRTC_TRACE(kTraceError, kTraceVideo, kModuleId, - "Could not set render Android VM"); + LOG(LS_ERROR) << "Could not set render Android VM"; return -1; } return 0; diff --git a/webrtc/video_engine/vie_input_manager.cc b/webrtc/video_engine/vie_input_manager.cc index 80ace3d5a..68570e51c 100644 --- a/webrtc/video_engine/vie_input_manager.cc +++ b/webrtc/video_engine/vie_input_manager.cc @@ -19,7 +19,6 @@ #include "webrtc/system_wrappers/interface/critical_section_wrapper.h" #include "webrtc/system_wrappers/interface/logging.h" #include "webrtc/system_wrappers/interface/rw_lock_wrapper.h" -#include "webrtc/system_wrappers/interface/trace.h" #include "webrtc/video_engine/include/vie_errors.h" #include "webrtc/video_engine/vie_capturer.h" #include "webrtc/video_engine/vie_defines.h" @@ -34,17 +33,12 @@ ViEInputManager::ViEInputManager(const int engine_id, const Config& config) vie_frame_provider_map_(), capture_device_info_(NULL), module_process_thread_(NULL) { - WEBRTC_TRACE(webrtc::kTraceMemory, webrtc::kTraceVideo, ViEId(engine_id_), - "%s", __FUNCTION__); - for (int idx = 0; idx < kViEMaxCaptureDevices; idx++) { free_capture_device_id_[idx] = true; } } ViEInputManager::~ViEInputManager() { - WEBRTC_TRACE(webrtc::kTraceMemory, webrtc::kTraceVideo, ViEId(engine_id_), - "%s", __FUNCTION__); for (FrameProviderMap::iterator it = vie_frame_provider_map_.begin(); it != vie_frame_provider_map_.end(); ++it) { @@ -60,8 +54,6 @@ void ViEInputManager::SetModuleProcessThread( } int ViEInputManager::NumberOfCaptureDevices() { - WEBRTC_TRACE(webrtc::kTraceInfo, webrtc::kTraceVideo, ViEId(engine_id_), "%s", - __FUNCTION__); CriticalSectionScoped cs(device_info_cs_.get()); if (capture_device_info_ == NULL) capture_device_info_ = VideoCaptureFactory::CreateDeviceInfo( @@ -75,8 +67,6 @@ int ViEInputManager::GetDeviceName(uint32_t device_number, uint32_t device_name_length, char* device_unique_idUTF8, uint32_t device_unique_idUTF8Length) { - WEBRTC_TRACE(webrtc::kTraceInfo, webrtc::kTraceVideo, ViEId(engine_id_), - "%s(device_number: %d)", __FUNCTION__, device_number); CriticalSectionScoped cs(device_info_cs_.get()); if (capture_device_info_ == NULL) capture_device_info_ = VideoCaptureFactory::CreateDeviceInfo( @@ -90,8 +80,6 @@ int ViEInputManager::GetDeviceName(uint32_t device_number, int ViEInputManager::NumberOfCaptureCapabilities( const char* device_unique_idUTF8) { - WEBRTC_TRACE(webrtc::kTraceInfo, webrtc::kTraceVideo, ViEId(engine_id_), "%s", - __FUNCTION__); CriticalSectionScoped cs(device_info_cs_.get()); if (capture_device_info_ == NULL) capture_device_info_ = VideoCaptureFactory::CreateDeviceInfo( @@ -104,9 +92,6 @@ int ViEInputManager::GetCaptureCapability( const char* device_unique_idUTF8, const uint32_t device_capability_number, CaptureCapability& capability) { - WEBRTC_TRACE(webrtc::kTraceInfo, webrtc::kTraceVideo, ViEId(engine_id_), - "%s(device_unique_idUTF8: %s, device_capability_number: %d)", - __FUNCTION__, device_unique_idUTF8, device_capability_number); CriticalSectionScoped cs(device_info_cs_.get()); if (capture_device_info_ == NULL) capture_device_info_ = VideoCaptureFactory::CreateDeviceInfo( @@ -132,9 +117,6 @@ int ViEInputManager::GetCaptureCapability( int ViEInputManager::GetOrientation(const char* device_unique_idUTF8, RotateCapturedFrame& orientation) { - WEBRTC_TRACE(webrtc::kTraceInfo, webrtc::kTraceVideo, ViEId(engine_id_), - "%s(device_unique_idUTF8: %s,)", __FUNCTION__, - device_unique_idUTF8); CriticalSectionScoped cs(device_info_cs_.get()); if (capture_device_info_ == NULL) capture_device_info_ = VideoCaptureFactory::CreateDeviceInfo( @@ -181,8 +163,6 @@ int ViEInputManager::CreateCaptureDevice( const char* device_unique_idUTF8, const uint32_t device_unique_idUTF8Length, int& capture_id) { - WEBRTC_TRACE(webrtc::kTraceInfo, webrtc::kTraceVideo, ViEId(engine_id_), - "%s(device_unique_id: %s)", __FUNCTION__, device_unique_idUTF8); CriticalSectionScoped cs(map_cs_.get()); // Make sure the device is not already allocated. @@ -228,57 +208,39 @@ int ViEInputManager::CreateCaptureDevice( const char* cast_id = reinterpret_cast(device_unique_idUTF8); if (strncmp(cast_id, reinterpret_cast(found_unique_name), strlen(cast_id)) == 0) { - WEBRTC_TRACE(webrtc::kTraceDebug, webrtc::kTraceVideo, ViEId(engine_id_), - "%s:%d Capture device was found by unique ID: %s. Returning", - __FUNCTION__, __LINE__, device_unique_idUTF8); found_device = true; break; } } if (!found_device) { - WEBRTC_TRACE(webrtc::kTraceDebug, webrtc::kTraceVideo, ViEId(engine_id_), - "%s:%d Capture device NOT found by unique ID: %s. Returning", - __FUNCTION__, __LINE__, device_unique_idUTF8); + LOG(LS_ERROR) << "Capture device not found: " << device_unique_idUTF8; return kViECaptureDeviceDoesNotExist; } int newcapture_id = 0; - if (GetFreeCaptureId(&newcapture_id) == false) { - WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo, ViEId(engine_id_), - "%s: Maximum supported number of capture devices already in " - "use", __FUNCTION__); + if (!GetFreeCaptureId(&newcapture_id)) { + LOG(LS_ERROR) << "All capture devices already allocated."; return kViECaptureDeviceMaxNoDevicesAllocated; } ViECapturer* vie_capture = ViECapturer::CreateViECapture( newcapture_id, engine_id_, config_, device_unique_idUTF8, device_unique_idUTF8Length, *module_process_thread_); if (!vie_capture) { - ReturnCaptureId(newcapture_id); - WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo, ViEId(engine_id_), - "%s: Could not create capture module for %s", __FUNCTION__, - device_unique_idUTF8); + ReturnCaptureId(newcapture_id); return kViECaptureDeviceUnknownError; } vie_frame_provider_map_[newcapture_id] = vie_capture; capture_id = newcapture_id; - WEBRTC_TRACE(webrtc::kTraceInfo, webrtc::kTraceVideo, ViEId(engine_id_), - "%s(device_unique_id: %s, capture_id: %d)", __FUNCTION__, - device_unique_idUTF8, capture_id); return 0; } int ViEInputManager::CreateCaptureDevice(VideoCaptureModule* capture_module, int& capture_id) { - WEBRTC_TRACE(webrtc::kTraceInfo, webrtc::kTraceVideo, ViEId(engine_id_), "%s", - __FUNCTION__); - CriticalSectionScoped cs(map_cs_.get()); int newcapture_id = 0; if (!GetFreeCaptureId(&newcapture_id)) { - WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo, ViEId(engine_id_), - "%s: Maximum supported number of capture devices already in " - "use", __FUNCTION__); + LOG(LS_ERROR) << "All capture devices already allocated."; return kViECaptureDeviceMaxNoDevicesAllocated; } @@ -286,21 +248,15 @@ int ViEInputManager::CreateCaptureDevice(VideoCaptureModule* capture_module, newcapture_id, engine_id_, config_, capture_module, *module_process_thread_); if (!vie_capture) { - ReturnCaptureId(newcapture_id); - WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo, ViEId(engine_id_), - "%s: Could attach capture module.", __FUNCTION__); + ReturnCaptureId(newcapture_id); return kViECaptureDeviceUnknownError; } vie_frame_provider_map_[newcapture_id] = vie_capture; capture_id = newcapture_id; - WEBRTC_TRACE(webrtc::kTraceInfo, webrtc::kTraceVideo, ViEId(engine_id_), - "%s, capture_id: %d", __FUNCTION__, capture_id); return 0; } int ViEInputManager::DestroyCaptureDevice(const int capture_id) { - WEBRTC_TRACE(webrtc::kTraceInfo, webrtc::kTraceVideo, ViEId(engine_id_), - "%s(capture_id: %d)", __FUNCTION__, capture_id); ViECapturer* vie_capture = NULL; { // We need exclusive access to the object to delete it. @@ -310,18 +266,14 @@ int ViEInputManager::DestroyCaptureDevice(const int capture_id) { vie_capture = ViECapturePtr(capture_id); if (!vie_capture) { - WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo, ViEId(engine_id_), - "%s(capture_id: %d) - No such capture device id", - __FUNCTION__, capture_id); + LOG(LS_ERROR) << "No such capture device id: " << capture_id; return -1; } uint32_t num_callbacks = vie_capture->NumberOfRegisteredFrameCallbacks(); if (num_callbacks > 0) { - WEBRTC_TRACE(webrtc::kTraceWarning, webrtc::kTraceVideo, - ViEId(engine_id_), "%s(capture_id: %d) - %u registered " - "callbacks when destroying capture device", - __FUNCTION__, capture_id, num_callbacks); + LOG(LS_WARNING) << num_callbacks << " still registered to capture id " + << capture_id << " when destroying capture device."; } vie_frame_provider_map_.erase(capture_id); ReturnCaptureId(capture_id); @@ -336,15 +288,11 @@ int ViEInputManager::DestroyCaptureDevice(const int capture_id) { int ViEInputManager::CreateExternalCaptureDevice( ViEExternalCapture*& external_capture, int& capture_id) { - WEBRTC_TRACE(webrtc::kTraceInfo, webrtc::kTraceVideo, ViEId(engine_id_), "%s", - __FUNCTION__); CriticalSectionScoped cs(map_cs_.get()); int newcapture_id = 0; if (GetFreeCaptureId(&newcapture_id) == false) { - WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo, ViEId(engine_id_), - "%s: Maximum supported number of capture devices already in " - "use", __FUNCTION__); + LOG(LS_ERROR) << "All capture devices already allocated."; return kViECaptureDeviceMaxNoDevicesAllocated; } @@ -352,30 +300,21 @@ int ViEInputManager::CreateExternalCaptureDevice( newcapture_id, engine_id_, config_, NULL, 0, *module_process_thread_); if (!vie_capture) { ReturnCaptureId(newcapture_id); - WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo, ViEId(engine_id_), - "%s: Could not create capture module for external capture.", - __FUNCTION__); return kViECaptureDeviceUnknownError; } vie_frame_provider_map_[newcapture_id] = vie_capture; capture_id = newcapture_id; external_capture = vie_capture; - WEBRTC_TRACE(webrtc::kTraceInfo, webrtc::kTraceVideo, ViEId(engine_id_), - "%s, capture_id: %d)", __FUNCTION__, capture_id); return 0; } bool ViEInputManager::GetFreeCaptureId(int* freecapture_id) { - WEBRTC_TRACE(webrtc::kTraceInfo, webrtc::kTraceVideo, ViEId(engine_id_), "%s", - __FUNCTION__); for (int id = 0; id < kViEMaxCaptureDevices; id++) { if (free_capture_device_id_[id]) { // We found a free capture device id. free_capture_device_id_[id] = false; *freecapture_id = id + kViECaptureIdBase; - WEBRTC_TRACE(webrtc::kTraceInfo, webrtc::kTraceVideo, ViEId(engine_id_), - "%s: new id: %d", __FUNCTION__, *freecapture_id); return true; } } @@ -383,8 +322,6 @@ bool ViEInputManager::GetFreeCaptureId(int* freecapture_id) { } void ViEInputManager::ReturnCaptureId(int capture_id) { - WEBRTC_TRACE(webrtc::kTraceInfo, webrtc::kTraceVideo, ViEId(engine_id_), - "%s(%d)", __FUNCTION__, capture_id); CriticalSectionScoped cs(map_cs_.get()); if (capture_id >= kViECaptureIdBase && capture_id < kViEMaxCaptureDevices + kViECaptureIdBase) { diff --git a/webrtc/video_engine/vie_network_impl.cc b/webrtc/video_engine/vie_network_impl.cc index 2b80159ff..4a9d86658 100644 --- a/webrtc/video_engine/vie_network_impl.cc +++ b/webrtc/video_engine/vie_network_impl.cc @@ -16,7 +16,7 @@ #endif #include "webrtc/engine_configurations.h" -#include "webrtc/system_wrappers/interface/trace.h" +#include "webrtc/system_wrappers/interface/logging.h" #include "webrtc/video_engine/include/vie_errors.h" #include "webrtc/video_engine/vie_channel.h" #include "webrtc/video_engine/vie_channel_manager.h" @@ -39,35 +39,25 @@ ViENetwork* ViENetwork::GetInterface(VideoEngine* video_engine) { } int ViENetworkImpl::Release() { - WEBRTC_TRACE(kTraceApiCall, kTraceVideo, shared_data_->instance_id(), - "ViENetwork::Release()"); // Decrease ref count. (*this)--; int32_t ref_count = GetCount(); if (ref_count < 0) { - WEBRTC_TRACE(kTraceWarning, kTraceVideo, shared_data_->instance_id(), - "ViENetwork release too many times"); + LOG(LS_ERROR) << "ViENetwork release too many times"; shared_data_->SetLastError(kViEAPIDoesNotExist); return -1; } - WEBRTC_TRACE(kTraceInfo, kTraceVideo, shared_data_->instance_id(), - "ViENetwork reference count: %d", ref_count); return ref_count; } void ViENetworkImpl::SetNetworkTransmissionState(const int video_channel, const bool is_transmitting) { - WEBRTC_TRACE(kTraceApiCall, kTraceVideo, - ViEId(shared_data_->instance_id(), video_channel), - "%s(event: Network %s)", __FUNCTION__, - is_transmitting ? "transmitting" : "not transmitting"); + LOG_F(LS_INFO) << "channel: " << video_channel + << " transmitting: " << (is_transmitting ? "yes" : "no"); ViEChannelManagerScoped cs(*(shared_data_->channel_manager())); ViEEncoder* vie_encoder = cs.Encoder(video_channel); if (!vie_encoder) { - WEBRTC_TRACE(kTraceError, kTraceVideo, - ViEId(shared_data_->instance_id(), video_channel), - "An encoder doesn't exist for this channel"); shared_data_->SetLastError(kViENetworkInvalidChannelId); return; } @@ -75,34 +65,21 @@ void ViENetworkImpl::SetNetworkTransmissionState(const int video_channel, } ViENetworkImpl::ViENetworkImpl(ViESharedData* shared_data) - : shared_data_(shared_data) { - WEBRTC_TRACE(kTraceMemory, kTraceVideo, shared_data_->instance_id(), - "ViENetworkImpl::ViENetworkImpl() Ctor"); -} + : shared_data_(shared_data) {} -ViENetworkImpl::~ViENetworkImpl() { - WEBRTC_TRACE(kTraceMemory, kTraceVideo, shared_data_->instance_id(), - "ViENetworkImpl::~ViENetworkImpl() Dtor"); -} +ViENetworkImpl::~ViENetworkImpl() {} int ViENetworkImpl::RegisterSendTransport(const int video_channel, Transport& transport) { - WEBRTC_TRACE(kTraceApiCall, kTraceVideo, - ViEId(shared_data_->instance_id(), video_channel), - "%s(channel: %d)", __FUNCTION__, video_channel); + LOG_F(LS_INFO) << "channel: " << video_channel; ViEChannelManagerScoped cs(*(shared_data_->channel_manager())); ViEChannel* vie_channel = cs.Channel(video_channel); if (!vie_channel) { - WEBRTC_TRACE(kTraceError, kTraceVideo, - ViEId(shared_data_->instance_id(), video_channel), - "%s Channel doesn't exist", __FUNCTION__); shared_data_->SetLastError(kViENetworkInvalidChannelId); return -1; } if (vie_channel->Sending()) { - WEBRTC_TRACE(kTraceError, kTraceVideo, - ViEId(shared_data_->instance_id(), video_channel), - "%s Channel already sending.", __FUNCTION__); + LOG_F(LS_ERROR) << "Already sending on channel: " << video_channel; shared_data_->SetLastError(kViENetworkAlreadySending); return -1; } @@ -114,22 +91,15 @@ int ViENetworkImpl::RegisterSendTransport(const int video_channel, } int ViENetworkImpl::DeregisterSendTransport(const int video_channel) { - WEBRTC_TRACE(kTraceApiCall, kTraceVideo, - ViEId(shared_data_->instance_id(), video_channel), - "%s(channel: %d)", __FUNCTION__, video_channel); + LOG_F(LS_INFO) << "channel: " << video_channel; ViEChannelManagerScoped cs(*(shared_data_->channel_manager())); ViEChannel* vie_channel = cs.Channel(video_channel); if (!vie_channel) { - WEBRTC_TRACE(kTraceError, kTraceVideo, - ViEId(shared_data_->instance_id(), video_channel), - "%s Channel doesn't exist", __FUNCTION__); shared_data_->SetLastError(kViENetworkInvalidChannelId); return -1; } if (vie_channel->Sending()) { - WEBRTC_TRACE(kTraceError, kTraceVideo, - ViEId(shared_data_->instance_id(), video_channel), - "%s Channel already sending", __FUNCTION__); + LOG_F(LS_ERROR) << "Actively sending on channel: " << video_channel; shared_data_->SetLastError(kViENetworkAlreadySending); return -1; } @@ -143,17 +113,9 @@ int ViENetworkImpl::DeregisterSendTransport(const int video_channel) { int ViENetworkImpl::ReceivedRTPPacket(const int video_channel, const void* data, const int length, const PacketTime& packet_time) { - WEBRTC_TRACE(kTraceApiCall, kTraceVideo, - ViEId(shared_data_->instance_id(), video_channel), - "%s(channel: %d, data: -, length: %d)", __FUNCTION__, - video_channel, length); ViEChannelManagerScoped cs(*(shared_data_->channel_manager())); ViEChannel* vie_channel = cs.Channel(video_channel); if (!vie_channel) { - // The channel doesn't exists - WEBRTC_TRACE(kTraceError, kTraceVideo, - ViEId(shared_data_->instance_id(), video_channel), - "Channel doesn't exist"); shared_data_->SetLastError(kViENetworkInvalidChannelId); return -1; } @@ -162,16 +124,9 @@ int ViENetworkImpl::ReceivedRTPPacket(const int video_channel, const void* data, int ViENetworkImpl::ReceivedRTCPPacket(const int video_channel, const void* data, const int length) { - WEBRTC_TRACE(kTraceApiCall, kTraceVideo, - ViEId(shared_data_->instance_id(), video_channel), - "%s(channel: %d, data: -, length: %d)", __FUNCTION__, - video_channel, length); ViEChannelManagerScoped cs(*(shared_data_->channel_manager())); ViEChannel* vie_channel = cs.Channel(video_channel); if (!vie_channel) { - WEBRTC_TRACE(kTraceError, kTraceVideo, - ViEId(shared_data_->instance_id(), video_channel), - "Channel doesn't exist"); shared_data_->SetLastError(kViENetworkInvalidChannelId); return -1; } @@ -179,15 +134,10 @@ int ViENetworkImpl::ReceivedRTCPPacket(const int video_channel, } int ViENetworkImpl::SetMTU(int video_channel, unsigned int mtu) { - WEBRTC_TRACE(kTraceApiCall, kTraceVideo, - ViEId(shared_data_->instance_id(), video_channel), - "%s(channel: %d, mtu: %u)", __FUNCTION__, video_channel, mtu); + LOG_F(LS_INFO) << "channel: " << video_channel << " mtu: " << mtu; ViEChannelManagerScoped cs(*(shared_data_->channel_manager())); ViEChannel* vie_channel = cs.Channel(video_channel); if (!vie_channel) { - WEBRTC_TRACE(kTraceError, kTraceVideo, - ViEId(shared_data_->instance_id(), video_channel), - "Channel doesn't exist"); shared_data_->SetLastError(kViENetworkInvalidChannelId); return -1; } @@ -200,16 +150,9 @@ int ViENetworkImpl::SetMTU(int video_channel, unsigned int mtu) { int ViENetworkImpl::ReceivedBWEPacket(const int video_channel, int64_t arrival_time_ms, int payload_size, const RTPHeader& header) { - WEBRTC_TRACE(kTraceStream, kTraceVideo, - ViEId(shared_data_->instance_id(), video_channel), - "%s(channel: %d, time: %d, size: %d, ssrc: %u)", __FUNCTION__, - video_channel, arrival_time_ms, payload_size, header.ssrc); ViEChannelManagerScoped cs(*(shared_data_->channel_manager())); ViEChannel* vie_channel = cs.Channel(video_channel); if (!vie_channel) { - WEBRTC_TRACE(kTraceError, kTraceVideo, - ViEId(shared_data_->instance_id(), video_channel), - "Channel doesn't exist"); shared_data_->SetLastError(kViENetworkInvalidChannelId); return -1; } @@ -220,9 +163,7 @@ int ViENetworkImpl::ReceivedBWEPacket(const int video_channel, bool ViENetworkImpl::SetBandwidthEstimationConfig( int video_channel, const webrtc::Config& config) { - WEBRTC_TRACE(kTraceApiCall, kTraceVideo, - ViEId(shared_data_->instance_id(), video_channel), - "%s(channel: %d)", __FUNCTION__, video_channel); + LOG_F(LS_INFO) << "channel: " << video_channel; return shared_data_->channel_manager()->SetBandwidthEstimationConfig( video_channel, config); } diff --git a/webrtc/video_engine/vie_receiver.cc b/webrtc/video_engine/vie_receiver.cc index ce6bdf20e..0fd6cda41 100644 --- a/webrtc/video_engine/vie_receiver.cc +++ b/webrtc/video_engine/vie_receiver.cc @@ -25,7 +25,6 @@ #include "webrtc/system_wrappers/interface/logging.h" #include "webrtc/system_wrappers/interface/tick_util.h" #include "webrtc/system_wrappers/interface/timestamp_extrapolator.h" -#include "webrtc/system_wrappers/interface/trace.h" namespace webrtc { @@ -34,7 +33,6 @@ ViEReceiver::ViEReceiver(const int32_t channel_id, RemoteBitrateEstimator* remote_bitrate_estimator, RtpFeedback* rtp_feedback) : receive_cs_(CriticalSectionWrapper::CreateCriticalSection()), - channel_id_(channel_id), rtp_header_parser_(RtpHeaderParser::Create()), rtp_payload_registry_(new RTPPayloadRegistry( RTPPayloadStrategy::CreateStrategy(false))), @@ -211,8 +209,6 @@ bool ViEReceiver::OnRecoveredPacket(const uint8_t* rtp_packet, int rtp_packet_length) { RTPHeader header; if (!rtp_header_parser_->Parse(rtp_packet, rtp_packet_length, &header)) { - WEBRTC_TRACE(kTraceDebug, webrtc::kTraceVideo, channel_id_, - "IncomingPacket invalid RTP header"); return false; } header.payload_type_frequency = kVideoPayloadTypeFrequency; @@ -247,8 +243,6 @@ int ViEReceiver::InsertRTPPacket(const uint8_t* rtp_packet, RTPHeader header; if (!rtp_header_parser_->Parse(rtp_packet, rtp_packet_length, &header)) { - WEBRTC_TRACE(webrtc::kTraceDebug, webrtc::kTraceVideo, channel_id_, - "Incoming packet: Invalid RTP header"); return -1; } int payload_length = rtp_packet_length - header.headerLength; @@ -299,8 +293,6 @@ bool ViEReceiver::ParseAndHandleEncapsulatingHeader(const uint8_t* packet, rtp_receive_statistics_->FecPacketReceived(header.ssrc); if (fec_receiver_->AddReceivedRedPacket( header, packet, packet_length, ulpfec_pt) != 0) { - WEBRTC_TRACE(webrtc::kTraceDebug, webrtc::kTraceVideo, channel_id_, - "Incoming RED packet error"); return false; } return fec_receiver_->ProcessReceivedFec() == 0; @@ -317,16 +309,14 @@ bool ViEReceiver::ParseAndHandleEncapsulatingHeader(const uint8_t* packet, return false; CriticalSectionScoped cs(receive_cs_.get()); if (restored_packet_in_use_) { - WEBRTC_TRACE(webrtc::kTraceDebug, webrtc::kTraceVideo, channel_id_, - "Multiple RTX headers detected, dropping packet"); + LOG(LS_WARNING) << "Multiple RTX headers detected, dropping packet."; return false; } uint8_t* restored_packet_ptr = restored_packet_; if (!rtp_payload_registry_->RestoreOriginalPacket( &restored_packet_ptr, packet, &packet_length, rtp_receiver_->SSRC(), header)) { - WEBRTC_TRACE(webrtc::kTraceDebug, webrtc::kTraceVideo, channel_id_, - "Incoming RTX packet: invalid RTP header"); + LOG(LS_WARNING) << "Incoming RTX packet: Invalid RTP header"; return false; } restored_packet_in_use_ = true; @@ -430,16 +420,12 @@ int ViEReceiver::StartRTPDump(const char file_nameUTF8[1024]) { } else { rtp_dump_ = RtpDump::CreateRtpDump(); if (rtp_dump_ == NULL) { - WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo, channel_id_, - "StartRTPDump: Failed to create RTP dump"); return -1; } } if (rtp_dump_->Start(file_nameUTF8) != 0) { RtpDump::DestroyRtpDump(rtp_dump_); rtp_dump_ = NULL; - WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo, channel_id_, - "StartRTPDump: Failed to start RTP dump"); return -1; } return 0; @@ -450,15 +436,10 @@ int ViEReceiver::StopRTPDump() { if (rtp_dump_) { if (rtp_dump_->IsActive()) { rtp_dump_->Stop(); - } else { - WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo, channel_id_, - "StopRTPDump: Dump not active"); } RtpDump::DestroyRtpDump(rtp_dump_); rtp_dump_ = NULL; } else { - WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo, channel_id_, - "StopRTPDump: RTP dump not started"); return -1; } return 0; diff --git a/webrtc/video_engine/vie_receiver.h b/webrtc/video_engine/vie_receiver.h index bd753ae9b..dfd4459ac 100644 --- a/webrtc/video_engine/vie_receiver.h +++ b/webrtc/video_engine/vie_receiver.h @@ -109,7 +109,6 @@ class ViEReceiver : public RtpData { void CalculateCaptureNtpTime(WebRtcRTPHeader* rtp_header); scoped_ptr receive_cs_; - const int32_t channel_id_; scoped_ptr rtp_header_parser_; scoped_ptr rtp_payload_registry_; scoped_ptr rtp_receiver_; diff --git a/webrtc/video_engine/vie_remb.cc b/webrtc/video_engine/vie_remb.cc index d318a4bb2..d04f0a30a 100644 --- a/webrtc/video_engine/vie_remb.cc +++ b/webrtc/video_engine/vie_remb.cc @@ -37,15 +37,12 @@ VieRemb::~VieRemb() {} void VieRemb::AddReceiveChannel(RtpRtcp* rtp_rtcp) { assert(rtp_rtcp); - WEBRTC_TRACE(kTraceStateInfo, kTraceVideo, -1, - "VieRemb::AddReceiveChannel(%p)", rtp_rtcp); CriticalSectionScoped cs(list_crit_.get()); if (std::find(receive_modules_.begin(), receive_modules_.end(), rtp_rtcp) != receive_modules_.end()) return; - WEBRTC_TRACE(kTraceInfo, kTraceVideo, -1, "AddRembChannel"); // The module probably doesn't have a remote SSRC yet, so don't add it to the // map. receive_modules_.push_back(rtp_rtcp); @@ -53,8 +50,6 @@ void VieRemb::AddReceiveChannel(RtpRtcp* rtp_rtcp) { void VieRemb::RemoveReceiveChannel(RtpRtcp* rtp_rtcp) { assert(rtp_rtcp); - WEBRTC_TRACE(kTraceStateInfo, kTraceVideo, -1, - "VieRemb::RemoveReceiveChannel(%p)", rtp_rtcp); CriticalSectionScoped cs(list_crit_.get()); for (RtpModules::iterator it = receive_modules_.begin(); @@ -68,8 +63,6 @@ void VieRemb::RemoveReceiveChannel(RtpRtcp* rtp_rtcp) { void VieRemb::AddRembSender(RtpRtcp* rtp_rtcp) { assert(rtp_rtcp); - WEBRTC_TRACE(kTraceStateInfo, kTraceVideo, -1, - "VieRemb::AddRembSender(%p)", rtp_rtcp); CriticalSectionScoped cs(list_crit_.get()); @@ -82,8 +75,6 @@ void VieRemb::AddRembSender(RtpRtcp* rtp_rtcp) { void VieRemb::RemoveRembSender(RtpRtcp* rtp_rtcp) { assert(rtp_rtcp); - WEBRTC_TRACE(kTraceStateInfo, kTraceVideo, -1, - "VieRemb::RemoveRembSender(%p)", rtp_rtcp); CriticalSectionScoped cs(list_crit_.get()); for (RtpModules::iterator it = rtcp_sender_.begin(); @@ -105,8 +96,6 @@ bool VieRemb::InUse() const { void VieRemb::OnReceiveBitrateChanged(const std::vector& ssrcs, unsigned int bitrate) { - WEBRTC_TRACE(kTraceStream, kTraceVideo, -1, - "VieRemb::UpdateBitrateEstimate(bitrate: %u)", bitrate); list_crit_->Enter(); // If we already have an estimate, check if the new total estimate is below // kSendThresholdPercent of the previous estimate. diff --git a/webrtc/video_engine/vie_render_impl.cc b/webrtc/video_engine/vie_render_impl.cc index b7b7c94cd..00c0186a2 100644 --- a/webrtc/video_engine/vie_render_impl.cc +++ b/webrtc/video_engine/vie_render_impl.cc @@ -13,7 +13,7 @@ #include "webrtc/engine_configurations.h" #include "webrtc/modules/video_render/include/video_render.h" #include "webrtc/modules/video_render/include/video_render_defines.h" -#include "webrtc/system_wrappers/interface/trace.h" +#include "webrtc/system_wrappers/interface/logging.h" #include "webrtc/video_engine/include/vie_errors.h" #include "webrtc/video_engine/vie_capturer.h" #include "webrtc/video_engine/vie_channel.h" @@ -44,36 +44,24 @@ ViERender* ViERender::GetInterface(VideoEngine* video_engine) { } int ViERenderImpl::Release() { - WEBRTC_TRACE(kTraceApiCall, kTraceVideo, shared_data_->instance_id(), - "ViERender::Release()"); // Decrease ref count (*this)--; int32_t ref_count = GetCount(); if (ref_count < 0) { - WEBRTC_TRACE(kTraceWarning, kTraceVideo, shared_data_->instance_id(), - "ViERender release too many times"); + LOG(LS_ERROR) << "ViERender release too many times"; return -1; } - WEBRTC_TRACE(kTraceInfo, kTraceVideo, shared_data_->instance_id(), - "ViERender reference count: %d", ref_count); return ref_count; } ViERenderImpl::ViERenderImpl(ViESharedData* shared_data) - : shared_data_(shared_data) { - WEBRTC_TRACE(kTraceMemory, kTraceVideo, shared_data_->instance_id(), - "ViERenderImpl::ViERenderImpl() Ctor"); -} + : shared_data_(shared_data) {} -ViERenderImpl::~ViERenderImpl() { - WEBRTC_TRACE(kTraceMemory, kTraceVideo, shared_data_->instance_id(), - "ViERenderImpl::~ViERenderImpl() Dtor"); -} +ViERenderImpl::~ViERenderImpl() {} int ViERenderImpl::RegisterVideoRenderModule( VideoRender& render_module) { - WEBRTC_TRACE(kTraceApiCall, kTraceVideo, ViEId(shared_data_->instance_id()), - "%s (&render_module: %p)", __FUNCTION__, &render_module); + LOG_F(LS_INFO); if (shared_data_->render_manager()->RegisterVideoRenderModule( &render_module) != 0) { shared_data_->SetLastError(kViERenderUnknownError); @@ -84,8 +72,7 @@ int ViERenderImpl::RegisterVideoRenderModule( int ViERenderImpl::DeRegisterVideoRenderModule( VideoRender& render_module) { - WEBRTC_TRACE(kTraceApiCall, kTraceVideo, ViEId(shared_data_->instance_id()), - "%s (&render_module: %p)", __FUNCTION__, &render_module); + LOG_F(LS_INFO); if (shared_data_->render_manager()->DeRegisterVideoRenderModule( &render_module) != 0) { // Error logging is done in ViERenderManager::DeRegisterVideoRenderModule. @@ -99,17 +86,14 @@ int ViERenderImpl::AddRenderer(const int render_id, void* window, const unsigned int z_order, const float left, const float top, const float right, const float bottom) { - WEBRTC_TRACE(kTraceApiCall, kTraceVideo, ViEId(shared_data_->instance_id()), - "%s (render_id: %d, window: 0x%p, z_order: %u, left: %f, " - "top: %f, right: %f, bottom: %f)", - __FUNCTION__, render_id, window, z_order, left, top, right, - bottom); + LOG_F(LS_INFO) << "render_id: " << render_id << " z_order: " << z_order + << " left: " << left << " top: " << top << " right: " << right + << " bottom: " << bottom; { ViERenderManagerScoped rs(*(shared_data_->render_manager())); if (rs.Renderer(render_id)) { - WEBRTC_TRACE(kTraceError, kTraceVideo, ViEId(shared_data_->instance_id()), - "%s - Renderer already exist %d.", __FUNCTION__, - render_id); + LOG(LS_ERROR) << "Renderer for render_id: " << render_id + << " already exists."; shared_data_->SetLastError(kViERenderAlreadyExists); return -1; } @@ -119,9 +103,6 @@ int ViERenderImpl::AddRenderer(const int render_id, void* window, ViEChannelManagerScoped cm(*(shared_data_->channel_manager())); ViEFrameProviderBase* frame_provider = cm.Channel(render_id); if (!frame_provider) { - WEBRTC_TRACE(kTraceError, kTraceVideo, ViEId(shared_data_->instance_id()), - "%s: FrameProvider id %d doesn't exist", __FUNCTION__, - render_id); shared_data_->SetLastError(kViERenderInvalidRenderId); return -1; } @@ -137,9 +118,6 @@ int ViERenderImpl::AddRenderer(const int render_id, void* window, ViEInputManagerScoped is(*(shared_data_->input_manager())); ViEFrameProviderBase* frame_provider = is.FrameProvider(render_id); if (!frame_provider) { - WEBRTC_TRACE(kTraceError, kTraceVideo, ViEId(shared_data_->instance_id()), - "%s: FrameProvider id %d doesn't exist", __FUNCTION__, - render_id); shared_data_->SetLastError(kViERenderInvalidRenderId); return -1; } @@ -154,17 +132,12 @@ int ViERenderImpl::AddRenderer(const int render_id, void* window, } int ViERenderImpl::RemoveRenderer(const int render_id) { - WEBRTC_TRACE(kTraceApiCall, kTraceVideo, ViEId(shared_data_->instance_id()), - "%s(render_id: %d)", __FUNCTION__, render_id); + LOG_F(LS_INFO) << "render_id: " << render_id; ViERenderer* renderer = NULL; { ViERenderManagerScoped rs(*(shared_data_->render_manager())); renderer = rs.Renderer(render_id); if (!renderer) { - WEBRTC_TRACE(kTraceWarning, kTraceVideo, - ViEId(shared_data_->instance_id()), - "%s No render exist with render_id: %d", __FUNCTION__, - render_id); shared_data_->SetLastError(kViERenderInvalidRenderId); return -1; } @@ -176,10 +149,6 @@ int ViERenderImpl::RemoveRenderer(const int render_id) { ViEChannelManagerScoped cm(*(shared_data_->channel_manager())); ViEChannel* channel = cm.Channel(render_id); if (!channel) { - WEBRTC_TRACE(kTraceWarning, kTraceVideo, - ViEId(shared_data_->instance_id()), - "%s: no channel with id %d exists ", __FUNCTION__, - render_id); shared_data_->SetLastError(kViERenderInvalidRenderId); return -1; } @@ -189,10 +158,6 @@ int ViERenderImpl::RemoveRenderer(const int render_id) { ViEInputManagerScoped is(*(shared_data_->input_manager())); ViEFrameProviderBase* provider = is.FrameProvider(render_id); if (!provider) { - WEBRTC_TRACE(kTraceWarning, kTraceVideo, - ViEId(shared_data_->instance_id()), - "%s: no provider with id %d exists ", __FUNCTION__, - render_id); shared_data_->SetLastError(kViERenderInvalidRenderId); return -1; } @@ -206,16 +171,10 @@ int ViERenderImpl::RemoveRenderer(const int render_id) { } int ViERenderImpl::StartRender(const int render_id) { - WEBRTC_TRACE(kTraceApiCall, kTraceVideo, - ViEId(shared_data_->instance_id(), render_id), - "%s(channel: %d)", __FUNCTION__, render_id); + LOG_F(LS_INFO) << "render_id: " << render_id; ViERenderManagerScoped rs(*(shared_data_->render_manager())); ViERenderer* renderer = rs.Renderer(render_id); if (!renderer) { - WEBRTC_TRACE(kTraceError, kTraceVideo, - ViEId(shared_data_->instance_id(), render_id), - "%s: No renderer with render Id %d exist.", __FUNCTION__, - render_id); shared_data_->SetLastError(kViERenderInvalidRenderId); return -1; } @@ -227,16 +186,10 @@ int ViERenderImpl::StartRender(const int render_id) { } int ViERenderImpl::StopRender(const int render_id) { - WEBRTC_TRACE(kTraceApiCall, kTraceVideo, - ViEId(shared_data_->instance_id(), render_id), - "%s(channel: %d)", __FUNCTION__, render_id); + LOG_F(LS_INFO) << "render_id: " << render_id; ViERenderManagerScoped rs(*(shared_data_->render_manager())); ViERenderer* renderer = rs.Renderer(render_id); if (!renderer) { - WEBRTC_TRACE(kTraceError, kTraceVideo, - ViEId(shared_data_->instance_id(), render_id), - "%s: No renderer with render_id %d exist.", __FUNCTION__, - render_id); shared_data_->SetLastError(kViERenderInvalidRenderId); return -1; } @@ -248,16 +201,11 @@ int ViERenderImpl::StopRender(const int render_id) { } int ViERenderImpl::SetExpectedRenderDelay(int render_id, int render_delay) { - WEBRTC_TRACE(kTraceApiCall, kTraceVideo, - ViEId(shared_data_->instance_id(), render_id), - "%s(channel: %d)", __FUNCTION__, render_id); + LOG_F(LS_INFO) << "render_id: " << render_id + << " render_delay: " << render_delay; ViERenderManagerScoped rs(*(shared_data_->render_manager())); ViERenderer* renderer = rs.Renderer(render_id); if (!renderer) { - WEBRTC_TRACE(kTraceError, kTraceVideo, - ViEId(shared_data_->instance_id(), render_id), - "%s: No renderer with render_id %d exist.", __FUNCTION__, - render_id); shared_data_->SetLastError(kViERenderInvalidRenderId); return -1; } @@ -271,16 +219,12 @@ int ViERenderImpl::SetExpectedRenderDelay(int render_id, int render_delay) { int ViERenderImpl::ConfigureRender(int render_id, const unsigned int z_order, const float left, const float top, const float right, const float bottom) { - WEBRTC_TRACE(kTraceApiCall, kTraceVideo, - ViEId(shared_data_->instance_id(), render_id), - "%s(channel: %d)", __FUNCTION__, render_id); + LOG_F(LS_INFO) << "render_id: " << render_id << " z_order: " << z_order + << " left: " << left << " top: " << top << " right: " << right + << " bottom: " << bottom; ViERenderManagerScoped rs(*(shared_data_->render_manager())); ViERenderer* renderer = rs.Renderer(render_id); if (!renderer) { - WEBRTC_TRACE(kTraceError, kTraceVideo, - ViEId(shared_data_->instance_id(), render_id), - "%s: No renderer with render_id %d exist.", __FUNCTION__, - render_id); shared_data_->SetLastError(kViERenderInvalidRenderId); return -1; } @@ -298,10 +242,6 @@ int ViERenderImpl::MirrorRenderStream(const int render_id, const bool enable, ViERenderManagerScoped rs(*(shared_data_->render_manager())); ViERenderer* renderer = rs.Renderer(render_id); if (!renderer) { - WEBRTC_TRACE(kTraceError, kTraceVideo, - ViEId(shared_data_->instance_id(), render_id), - "%s: No renderer with render_id %d exist.", __FUNCTION__, - render_id); shared_data_->SetLastError(kViERenderInvalidRenderId); return -1; } @@ -326,10 +266,7 @@ int ViERenderImpl::AddRenderer(const int render_id, video_input_format != kVideoRGB565 && video_input_format != kVideoARGB4444 && video_input_format != kVideoARGB1555) { - WEBRTC_TRACE(kTraceError, kTraceVideo, - ViEId(shared_data_->instance_id(), render_id), - "%s: Unsupported video frame format requested", - __FUNCTION__, render_id); + LOG(LS_ERROR) << "Unsupported video frame format requested."; shared_data_->SetLastError(kViERenderInvalidFrameFormat); return -1; } @@ -337,9 +274,7 @@ int ViERenderImpl::AddRenderer(const int render_id, // Verify the renderer doesn't exist. ViERenderManagerScoped rs(*(shared_data_->render_manager())); if (rs.Renderer(render_id)) { - WEBRTC_TRACE(kTraceError, kTraceVideo, ViEId(shared_data_->instance_id()), - "%s - Renderer already exist %d.", __FUNCTION__, - render_id); + LOG_F(LS_ERROR) << "Renderer already exists for render_id: " << render_id; shared_data_->SetLastError(kViERenderAlreadyExists); return -1; } @@ -349,9 +284,6 @@ int ViERenderImpl::AddRenderer(const int render_id, ViEChannelManagerScoped cm(*(shared_data_->channel_manager())); ViEFrameProviderBase* frame_provider = cm.Channel(render_id); if (!frame_provider) { - WEBRTC_TRACE(kTraceError, kTraceVideo, ViEId(shared_data_->instance_id()), - "%s: FrameProvider id %d doesn't exist", __FUNCTION__, - render_id); shared_data_->SetLastError(kViERenderInvalidRenderId); return -1; } @@ -373,9 +305,6 @@ int ViERenderImpl::AddRenderer(const int render_id, ViEInputManagerScoped is(*(shared_data_->input_manager())); ViEFrameProviderBase* frame_provider = is.FrameProvider(render_id); if (!frame_provider) { - WEBRTC_TRACE(kTraceError, kTraceVideo, ViEId(shared_data_->instance_id()), - "%s: FrameProvider id %d doesn't exist", __FUNCTION__, - render_id); shared_data_->SetLastError(kViERenderInvalidRenderId); return -1; } @@ -402,12 +331,6 @@ int ViERenderImpl::AddRenderCallback(int render_id, ViEChannelManagerScoped cm(*(shared_data_->channel_manager())); ViEFrameProviderBase* frame_provider = cm.Channel(render_id); if (!frame_provider) { - WEBRTC_TRACE(kTraceError, - kTraceVideo, - ViEId(shared_data_->instance_id()), - "%s: FrameProvider id %d doesn't exist", - __FUNCTION__, - render_id); shared_data_->SetLastError(kViERenderInvalidRenderId); return -1; } diff --git a/webrtc/video_engine/vie_render_manager.cc b/webrtc/video_engine/vie_render_manager.cc index b232e5602..e044bfac9 100644 --- a/webrtc/video_engine/vie_render_manager.cc +++ b/webrtc/video_engine/vie_render_manager.cc @@ -15,7 +15,7 @@ #include "webrtc/modules/video_render/include/video_render_defines.h" #include "webrtc/system_wrappers/interface/critical_section_wrapper.h" #include "webrtc/system_wrappers/interface/rw_lock_wrapper.h" -#include "webrtc/system_wrappers/interface/trace.h" +#include "webrtc/system_wrappers/interface/logging.h" #include "webrtc/video_engine/vie_defines.h" #include "webrtc/video_engine/vie_renderer.h" @@ -35,14 +35,9 @@ ViERenderManager::ViERenderManager(int32_t engine_id) : list_cs_(CriticalSectionWrapper::CreateCriticalSection()), engine_id_(engine_id), use_external_render_module_(false) { - WEBRTC_TRACE(webrtc::kTraceMemory, webrtc::kTraceVideo, ViEId(engine_id), - "ViERenderManager::ViERenderManager(engine_id: %d) - " - "Constructor", engine_id); } ViERenderManager::~ViERenderManager() { - WEBRTC_TRACE(webrtc::kTraceMemory, webrtc::kTraceVideo, ViEId(engine_id_), - "ViERenderManager Destructor, engine_id: %d", engine_id_); for (RendererMap::iterator it = stream_to_vie_renderer_.begin(); it != stream_to_vie_renderer_.end(); ++it) { @@ -57,10 +52,7 @@ int32_t ViERenderManager::RegisterVideoRenderModule( // the registrant render module is associated with. VideoRender* current_module = FindRenderModule(render_module->Window()); if (current_module) { - WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo, ViEId(engine_id_), - "A module is already registered for this window (window=%p, " - "current module=%p, registrant module=%p.", - render_module->Window(), current_module, render_module); + LOG_F(LS_ERROR) << "A render module is already registered for this window."; return -1; } @@ -75,9 +67,8 @@ int32_t ViERenderManager::DeRegisterVideoRenderModule( // Check if there are streams in the module. uint32_t n_streams = render_module->GetNumIncomingRenderStreams(); if (n_streams != 0) { - WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo, ViEId(engine_id_), - "There are still %d streams in this module, cannot " - "de-register", n_streams); + LOG(LS_ERROR) << "There are still " << n_streams + << "in this module, cannot de-register."; return -1; } @@ -89,8 +80,8 @@ int32_t ViERenderManager::DeRegisterVideoRenderModule( return 0; } } - WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo, ViEId(engine_id_), - "Module not registered"); + + LOG(LS_ERROR) << "Module not registered."; return -1; } @@ -105,9 +96,7 @@ ViERenderer* ViERenderManager::AddRenderStream(const int32_t render_id, if (stream_to_vie_renderer_.find(render_id) != stream_to_vie_renderer_.end()) { - // This stream is already added to a renderer, not allowed! - WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo, ViEId(engine_id_), - "Render stream already exists"); + LOG(LS_ERROR) << "Render stream already exists"; return NULL; } @@ -117,11 +106,9 @@ ViERenderer* ViERenderManager::AddRenderStream(const int32_t render_id, // No render module for this window, create a new one. render_module = VideoRender::CreateVideoRender(ViEModuleId(engine_id_, -1), window, false); - if (!render_module) { - WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo, ViEId(engine_id_), - "Could not create new render module"); + if (!render_module) return NULL; - } + render_list_.push_back(render_module); } @@ -131,12 +118,9 @@ ViERenderer* ViERenderManager::AddRenderStream(const int32_t render_id, *this, z_order, left, top, right, bottom); - if (!vie_renderer) { - WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo, - ViEId(engine_id_, render_id), - "Could not create new render stream"); + if (!vie_renderer) return NULL; - } + stream_to_vie_renderer_[render_id] = vie_renderer; return vie_renderer; } @@ -149,9 +133,7 @@ int32_t ViERenderManager::RemoveRenderStream( CriticalSectionScoped cs(list_cs_.get()); RendererMap::iterator it = stream_to_vie_renderer_.find(render_id); if (it == stream_to_vie_renderer_.end()) { - // No such stream - WEBRTC_TRACE(webrtc::kTraceWarning, webrtc::kTraceVideo, ViEId(engine_id_), - "No renderer for this stream found, channel_id"); + LOG(LS_ERROR) << "No renderer found for render_id: " << render_id; return 0; } diff --git a/webrtc/video_engine/vie_rtp_rtcp_impl.cc b/webrtc/video_engine/vie_rtp_rtcp_impl.cc index 5f0d65f2a..3ee5d5214 100644 --- a/webrtc/video_engine/vie_rtp_rtcp_impl.cc +++ b/webrtc/video_engine/vie_rtp_rtcp_impl.cc @@ -12,7 +12,7 @@ #include "webrtc/engine_configurations.h" #include "webrtc/system_wrappers/interface/file_wrapper.h" -#include "webrtc/system_wrappers/interface/trace.h" +#include "webrtc/system_wrappers/interface/logging.h" #include "webrtc/video_engine/include/vie_errors.h" #include "webrtc/video_engine/vie_channel.h" #include "webrtc/video_engine/vie_channel_manager.h" @@ -90,48 +90,31 @@ ViERTP_RTCP* ViERTP_RTCP::GetInterface(VideoEngine* video_engine) { } int ViERTP_RTCPImpl::Release() { - WEBRTC_TRACE(kTraceApiCall, kTraceVideo, shared_data_->instance_id(), - "ViERTP_RTCP::Release()"); // Decrease ref count. (*this)--; int32_t ref_count = GetCount(); if (ref_count < 0) { - WEBRTC_TRACE(kTraceWarning, kTraceVideo, shared_data_->instance_id(), - "ViERTP_RTCP release too many times"); + LOG(LS_ERROR) << "ViERTP_RTCP released too many times."; shared_data_->SetLastError(kViEAPIDoesNotExist); return -1; } - WEBRTC_TRACE(kTraceInfo, kTraceVideo, shared_data_->instance_id(), - "ViERTP_RTCP reference count: %d", ref_count); return ref_count; } ViERTP_RTCPImpl::ViERTP_RTCPImpl(ViESharedData* shared_data) - : shared_data_(shared_data) { - WEBRTC_TRACE(kTraceMemory, kTraceVideo, shared_data_->instance_id(), - "ViERTP_RTCPImpl::ViERTP_RTCPImpl() Ctor"); -} + : shared_data_(shared_data) {} -ViERTP_RTCPImpl::~ViERTP_RTCPImpl() { - WEBRTC_TRACE(kTraceMemory, kTraceVideo, shared_data_->instance_id(), - "ViERTP_RTCPImpl::~ViERTP_RTCPImpl() Dtor"); -} +ViERTP_RTCPImpl::~ViERTP_RTCPImpl() {} int ViERTP_RTCPImpl::SetLocalSSRC(const int video_channel, const unsigned int SSRC, const StreamType usage, const unsigned char simulcast_idx) { - WEBRTC_TRACE(kTraceApiCall, kTraceVideo, - ViEId(shared_data_->instance_id(), video_channel), - "%s(channel: %d, SSRC: %d)", __FUNCTION__, video_channel, SSRC); + LOG_F(LS_INFO) << "channel: " << video_channel << " ssrc: " << SSRC << ""; ViEChannelManagerScoped cs(*(shared_data_->channel_manager())); ViEChannel* vie_channel = cs.Channel(video_channel); if (!vie_channel) { - // The channel doesn't exists - WEBRTC_TRACE(kTraceError, kTraceVideo, - ViEId(shared_data_->instance_id(), video_channel), - "%s: Channel %d doesn't exist", __FUNCTION__, video_channel); shared_data_->SetLastError(kViERtpRtcpInvalidChannelId); return -1; } @@ -145,20 +128,13 @@ int ViERTP_RTCPImpl::SetLocalSSRC(const int video_channel, int ViERTP_RTCPImpl::SetRemoteSSRCType(const int videoChannel, const StreamType usage, const unsigned int SSRC) const { - WEBRTC_TRACE(webrtc::kTraceApiCall, webrtc::kTraceVideo, - ViEId(shared_data_->instance_id(), videoChannel), - "%s(channel: %d, usage:%d SSRC: 0x%x)", - __FUNCTION__, usage, videoChannel, SSRC); + LOG_F(LS_INFO) << "channel: " << videoChannel + << " usage: " << static_cast(usage) << " ssrc: " << SSRC; // Get the channel ViEChannelManagerScoped cs(*(shared_data_->channel_manager())); ViEChannel* ptrViEChannel = cs.Channel(videoChannel); if (ptrViEChannel == NULL) { - // The channel doesn't exists - WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo, - ViEId(shared_data_->instance_id(), videoChannel), - "%s: Channel %d doesn't exist", - __FUNCTION__, videoChannel); shared_data_->SetLastError(kViERtpRtcpInvalidChannelId); return -1; } @@ -171,15 +147,9 @@ int ViERTP_RTCPImpl::SetRemoteSSRCType(const int videoChannel, int ViERTP_RTCPImpl::GetLocalSSRC(const int video_channel, unsigned int& SSRC) const { - WEBRTC_TRACE(kTraceApiCall, kTraceVideo, - ViEId(shared_data_->instance_id(), video_channel), - "%s(channel: %d, SSRC: %d)", __FUNCTION__, video_channel, SSRC); ViEChannelManagerScoped cs(*(shared_data_->channel_manager())); ViEChannel* vie_channel = cs.Channel(video_channel); if (!vie_channel) { - WEBRTC_TRACE(kTraceError, kTraceVideo, - ViEId(shared_data_->instance_id(), video_channel), - "%s: Channel %d doesn't exist", __FUNCTION__, video_channel); shared_data_->SetLastError(kViERtpRtcpInvalidChannelId); return -1; } @@ -193,15 +163,9 @@ int ViERTP_RTCPImpl::GetLocalSSRC(const int video_channel, int ViERTP_RTCPImpl::GetRemoteSSRC(const int video_channel, unsigned int& SSRC) const { - WEBRTC_TRACE(kTraceApiCall, kTraceVideo, - ViEId(shared_data_->instance_id(), video_channel), - "%s(channel: %d)", __FUNCTION__, video_channel, SSRC); ViEChannelManagerScoped cs(*(shared_data_->channel_manager())); ViEChannel* vie_channel = cs.Channel(video_channel); if (!vie_channel) { - WEBRTC_TRACE(kTraceError, kTraceVideo, - ViEId(shared_data_->instance_id(), video_channel), - "%s: Channel %d doesn't exist", __FUNCTION__, video_channel); shared_data_->SetLastError(kViERtpRtcpInvalidChannelId); return -1; } @@ -214,15 +178,9 @@ int ViERTP_RTCPImpl::GetRemoteSSRC(const int video_channel, int ViERTP_RTCPImpl::GetRemoteCSRCs(const int video_channel, unsigned int CSRCs[kRtpCsrcSize]) const { - WEBRTC_TRACE(kTraceApiCall, kTraceVideo, - ViEId(shared_data_->instance_id(), video_channel), - "%s(channel: %d)", __FUNCTION__, video_channel); ViEChannelManagerScoped cs(*(shared_data_->channel_manager())); ViEChannel* vie_channel = cs.Channel(video_channel); if (!vie_channel) { - WEBRTC_TRACE(kTraceError, kTraceVideo, - ViEId(shared_data_->instance_id(), video_channel), - "%s: Channel %d doesn't exist", __FUNCTION__, video_channel); shared_data_->SetLastError(kViERtpRtcpInvalidChannelId); return -1; } @@ -235,15 +193,11 @@ int ViERTP_RTCPImpl::GetRemoteCSRCs(const int video_channel, int ViERTP_RTCPImpl::SetRtxSendPayloadType(const int video_channel, const uint8_t payload_type) { - WEBRTC_TRACE(kTraceApiCall, kTraceVideo, - ViEId(shared_data_->instance_id(), video_channel), - "%s(channel: %d)", __FUNCTION__, video_channel); + LOG_F(LS_INFO) << "channel: " << video_channel + << " payload_type: " << payload_type; ViEChannelManagerScoped cs(*(shared_data_->channel_manager())); ViEChannel* vie_channel = cs.Channel(video_channel); if (!vie_channel) { - WEBRTC_TRACE(kTraceError, kTraceVideo, - ViEId(shared_data_->instance_id(), video_channel), - "%s: Channel %d doesn't exist", __FUNCTION__, video_channel); shared_data_->SetLastError(kViERtpRtcpInvalidChannelId); return -1; } @@ -255,15 +209,11 @@ int ViERTP_RTCPImpl::SetRtxSendPayloadType(const int video_channel, int ViERTP_RTCPImpl::SetRtxReceivePayloadType(const int video_channel, const uint8_t payload_type) { - WEBRTC_TRACE(kTraceApiCall, kTraceVideo, - ViEId(shared_data_->instance_id(), video_channel), - "%s(channel: %d)", __FUNCTION__, video_channel); + LOG_F(LS_INFO) << "channel: " << video_channel + << " payload_type: " << payload_type; ViEChannelManagerScoped cs(*(shared_data_->channel_manager())); ViEChannel* vie_channel = cs.Channel(video_channel); if (!vie_channel) { - WEBRTC_TRACE(kTraceError, kTraceVideo, - ViEId(shared_data_->instance_id(), video_channel), - "%s: Channel %d doesn't exist", __FUNCTION__, video_channel); shared_data_->SetLastError(kViERtpRtcpInvalidChannelId); return -1; } @@ -273,24 +223,14 @@ int ViERTP_RTCPImpl::SetRtxReceivePayloadType(const int video_channel, int ViERTP_RTCPImpl::SetStartSequenceNumber(const int video_channel, uint16_t sequence_number) { - WEBRTC_TRACE(kTraceApiCall, kTraceVideo, - ViEId(shared_data_->instance_id(), video_channel), - "%s(channel: %d, sequence_number: %u)", __FUNCTION__, - video_channel, sequence_number); ViEChannelManagerScoped cs(*(shared_data_->channel_manager())); ViEChannel* vie_channel = cs.Channel(video_channel); if (!vie_channel) { - WEBRTC_TRACE(kTraceError, kTraceVideo, - ViEId(shared_data_->instance_id(), video_channel), - "%s: Channel %d doesn't exist", __FUNCTION__, video_channel); shared_data_->SetLastError(kViERtpRtcpInvalidChannelId); return -1; } if (vie_channel->Sending()) { - WEBRTC_TRACE(kTraceError, kTraceVideo, - ViEId(shared_data_->instance_id(), video_channel), - "%s: Channel %d already sending.", __FUNCTION__, - video_channel); + LOG_F(LS_ERROR) << "channel " << video_channel << " is already sending."; shared_data_->SetLastError(kViERtpRtcpAlreadySending); return -1; } @@ -303,16 +243,11 @@ int ViERTP_RTCPImpl::SetStartSequenceNumber(const int video_channel, int ViERTP_RTCPImpl::SetRTCPStatus(const int video_channel, const ViERTCPMode rtcp_mode) { - WEBRTC_TRACE(kTraceApiCall, kTraceVideo, - ViEId(shared_data_->instance_id(), video_channel), - "%s(channel: %d, mode: %d)", __FUNCTION__, video_channel, - rtcp_mode); + LOG_F(LS_INFO) << "channel: " << video_channel + << " mode: " << static_cast(rtcp_mode); ViEChannelManagerScoped cs(*(shared_data_->channel_manager())); ViEChannel* vie_channel = cs.Channel(video_channel); if (!vie_channel) { - WEBRTC_TRACE(kTraceError, kTraceVideo, - ViEId(shared_data_->instance_id(), video_channel), - "%s: Channel %d doesn't exist", __FUNCTION__, video_channel); shared_data_->SetLastError(kViERtpRtcpInvalidChannelId); return -1; } @@ -327,23 +262,14 @@ int ViERTP_RTCPImpl::SetRTCPStatus(const int video_channel, int ViERTP_RTCPImpl::GetRTCPStatus(const int video_channel, ViERTCPMode& rtcp_mode) const { - WEBRTC_TRACE(kTraceApiCall, kTraceVideo, - ViEId(shared_data_->instance_id(), video_channel), - "%s(channel: %d)", __FUNCTION__, video_channel, rtcp_mode); ViEChannelManagerScoped cs(*(shared_data_->channel_manager())); ViEChannel* vie_channel = cs.Channel(video_channel); if (!vie_channel) { - WEBRTC_TRACE(kTraceError, kTraceVideo, - ViEId(shared_data_->instance_id(), video_channel), - "%s: Channel %d doesn't exist", __FUNCTION__, video_channel); shared_data_->SetLastError(kViERtpRtcpInvalidChannelId); return -1; } RTCPMethod module_mode = kRtcpOff; if (vie_channel->GetRTCPMode(&module_mode) != 0) { - WEBRTC_TRACE(kTraceError, kTraceVideo, - ViEId(shared_data_->instance_id(), video_channel), - "%s: could not get current RTCP mode", __FUNCTION__); shared_data_->SetLastError(kViERtpRtcpUnknownError); return -1; } @@ -353,24 +279,16 @@ int ViERTP_RTCPImpl::GetRTCPStatus(const int video_channel, int ViERTP_RTCPImpl::SetRTCPCName(const int video_channel, const char rtcp_cname[KMaxRTCPCNameLength]) { - WEBRTC_TRACE(kTraceApiCall, kTraceVideo, - ViEId(shared_data_->instance_id(), video_channel), - "%s(channel: %d, name: %s)", __FUNCTION__, video_channel, - rtcp_cname); + LOG_F(LS_INFO) << "channel: " << video_channel + << " rtcp_cname: " << rtcp_cname; ViEChannelManagerScoped cs(*(shared_data_->channel_manager())); ViEChannel* vie_channel = cs.Channel(video_channel); if (!vie_channel) { - WEBRTC_TRACE(kTraceError, kTraceVideo, - ViEId(shared_data_->instance_id(), video_channel), - "%s: Channel %d doesn't exist", __FUNCTION__, video_channel); shared_data_->SetLastError(kViERtpRtcpInvalidChannelId); return -1; } if (vie_channel->Sending()) { - WEBRTC_TRACE(kTraceError, kTraceVideo, - ViEId(shared_data_->instance_id(), video_channel), - "%s: Channel %d already sending.", __FUNCTION__, - video_channel); + LOG_F(LS_ERROR) << "channel " << video_channel << " is already sending."; shared_data_->SetLastError(kViERtpRtcpAlreadySending); return -1; } @@ -383,15 +301,9 @@ int ViERTP_RTCPImpl::SetRTCPCName(const int video_channel, int ViERTP_RTCPImpl::GetRTCPCName(const int video_channel, char rtcp_cname[KMaxRTCPCNameLength]) const { - WEBRTC_TRACE(kTraceApiCall, kTraceVideo, - ViEId(shared_data_->instance_id(), video_channel), - "%s(channel: %d)", __FUNCTION__, video_channel); ViEChannelManagerScoped cs(*(shared_data_->channel_manager())); ViEChannel* vie_channel = cs.Channel(video_channel); if (!vie_channel) { - WEBRTC_TRACE(kTraceError, kTraceVideo, - ViEId(shared_data_->instance_id(), video_channel), - "%s: Channel %d doesn't exist", __FUNCTION__, video_channel); shared_data_->SetLastError(kViERtpRtcpInvalidChannelId); return -1; } @@ -405,15 +317,9 @@ int ViERTP_RTCPImpl::GetRTCPCName(const int video_channel, int ViERTP_RTCPImpl::GetRemoteRTCPCName( const int video_channel, char rtcp_cname[KMaxRTCPCNameLength]) const { - WEBRTC_TRACE(kTraceApiCall, kTraceVideo, - ViEId(shared_data_->instance_id(), video_channel), - "%s(channel: %d)", __FUNCTION__, video_channel); ViEChannelManagerScoped cs(*(shared_data_->channel_manager())); ViEChannel* vie_channel = cs.Channel(video_channel); if (!vie_channel) { - WEBRTC_TRACE(kTraceError, kTraceVideo, - ViEId(shared_data_->instance_id(), video_channel), - "%s: Channel %d doesn't exist", __FUNCTION__, video_channel); shared_data_->SetLastError(kViERtpRtcpInvalidChannelId); return -1; } @@ -430,33 +336,18 @@ int ViERTP_RTCPImpl::SendApplicationDefinedRTCPPacket( unsigned int name, const char* data, uint16_t data_length_in_bytes) { - WEBRTC_TRACE(kTraceApiCall, kTraceVideo, - ViEId(shared_data_->instance_id(), video_channel), - "%s(channel: %d, sub_type: %c, name: %d, data: x, length: %u)", - __FUNCTION__, video_channel, sub_type, name, - data_length_in_bytes); ViEChannelManagerScoped cs(*(shared_data_->channel_manager())); ViEChannel* vie_channel = cs.Channel(video_channel); if (!vie_channel) { - WEBRTC_TRACE(kTraceError, kTraceVideo, - ViEId(shared_data_->instance_id(), video_channel), - "%s: Channel %d doesn't exist", __FUNCTION__, video_channel); shared_data_->SetLastError(kViERtpRtcpInvalidChannelId); return -1; } if (!vie_channel->Sending()) { - WEBRTC_TRACE(kTraceError, kTraceVideo, - ViEId(shared_data_->instance_id(), video_channel), - "%s: Channel %d not sending", __FUNCTION__, video_channel); shared_data_->SetLastError(kViERtpRtcpNotSending); return -1; } RTCPMethod method; if (vie_channel->GetRTCPMode(&method) != 0 || method == kRtcpOff) { - WEBRTC_TRACE(kTraceError, kTraceVideo, - ViEId(shared_data_->instance_id(), video_channel), - "%s: RTCP disabled on channel %d.", __FUNCTION__, - video_channel); shared_data_->SetLastError(kViERtpRtcpRtcpDisabled); return -1; } @@ -470,23 +361,15 @@ int ViERTP_RTCPImpl::SendApplicationDefinedRTCPPacket( } int ViERTP_RTCPImpl::SetNACKStatus(const int video_channel, const bool enable) { - WEBRTC_TRACE(kTraceApiCall, kTraceVideo, - ViEId(shared_data_->instance_id(), video_channel), - "%s(channel: %d, enable: %d)", __FUNCTION__, video_channel, - enable); + LOG_F(LS_INFO) << "channel: " << video_channel << " " + << (enable ? "on" : "off"); ViEChannelManagerScoped cs(*(shared_data_->channel_manager())); ViEChannel* vie_channel = cs.Channel(video_channel); if (!vie_channel) { - WEBRTC_TRACE(kTraceError, kTraceVideo, - ViEId(shared_data_->instance_id(), video_channel), - "%s: Channel %d doesn't exist", __FUNCTION__, video_channel); shared_data_->SetLastError(kViERtpRtcpInvalidChannelId); return -1; } if (vie_channel->SetNACKStatus(enable) != 0) { - WEBRTC_TRACE(kTraceError, kTraceVideo, - ViEId(shared_data_->instance_id(), video_channel), - "%s: failed for channel %d", __FUNCTION__, video_channel); shared_data_->SetLastError(kViERtpRtcpUnknownError); return -1; } @@ -494,10 +377,6 @@ int ViERTP_RTCPImpl::SetNACKStatus(const int video_channel, const bool enable) { // Update the encoder ViEEncoder* vie_encoder = cs.Encoder(video_channel); if (!vie_encoder) { - WEBRTC_TRACE(kTraceError, kTraceVideo, - ViEId(shared_data_->instance_id(), video_channel), - "%s: Could not get encoder for channel %d", __FUNCTION__, - video_channel); shared_data_->SetLastError(kViERtpRtcpUnknownError); return -1; } @@ -508,37 +387,24 @@ int ViERTP_RTCPImpl::SetNACKStatus(const int video_channel, const bool enable) { int ViERTP_RTCPImpl::SetFECStatus(const int video_channel, const bool enable, const unsigned char payload_typeRED, const unsigned char payload_typeFEC) { - WEBRTC_TRACE(kTraceApiCall, kTraceVideo, - ViEId(shared_data_->instance_id(), video_channel), - "%s(channel: %d, enable: %d, payload_typeRED: %u, " - "payloadTypeFEC: %u)", - __FUNCTION__, video_channel, enable, payload_typeRED, - payload_typeFEC); + LOG_F(LS_INFO) << "channel: " << video_channel + << " enable: " << (enable ? "on" : "off") + << " payload_typeRED: " << payload_typeRED + << " payload_typeFEC: " << payload_typeFEC; ViEChannelManagerScoped cs(*(shared_data_->channel_manager())); ViEChannel* vie_channel = cs.Channel(video_channel); if (!vie_channel) { - WEBRTC_TRACE(kTraceError, kTraceVideo, - ViEId(shared_data_->instance_id(), video_channel), - "%s: Channel %d doesn't exist", __FUNCTION__, - video_channel); shared_data_->SetLastError(kViERtpRtcpInvalidChannelId); return -1; } if (vie_channel->SetFECStatus(enable, payload_typeRED, payload_typeFEC) != 0) { - WEBRTC_TRACE(kTraceError, kTraceVideo, - ViEId(shared_data_->instance_id(), video_channel), - "%s: failed for channel %d", __FUNCTION__, video_channel); shared_data_->SetLastError(kViERtpRtcpUnknownError); return -1; } // Update the encoder. ViEEncoder* vie_encoder = cs.Encoder(video_channel); if (!vie_encoder) { - WEBRTC_TRACE(kTraceError, kTraceVideo, - ViEId(shared_data_->instance_id(), video_channel), - "%s: Could not get encoder for channel %d", __FUNCTION__, - video_channel); shared_data_->SetLastError(kViERtpRtcpUnknownError); return -1; } @@ -551,18 +417,13 @@ int ViERTP_RTCPImpl::SetHybridNACKFECStatus( const bool enable, const unsigned char payload_typeRED, const unsigned char payload_typeFEC) { - WEBRTC_TRACE(kTraceApiCall, kTraceVideo, - ViEId(shared_data_->instance_id(), video_channel), - "%s(channel: %d, enable: %d, payload_typeRED: %u, " - "payloadTypeFEC: %u)", - __FUNCTION__, video_channel, enable, payload_typeRED, - payload_typeFEC); + LOG_F(LS_INFO) << "channel: " << video_channel + << " enable: " << (enable ? "on" : "off") + << " payload_typeRED: " << payload_typeRED + << " payload_typeFEC: " << payload_typeFEC; ViEChannelManagerScoped cs(*(shared_data_->channel_manager())); ViEChannel* vie_channel = cs.Channel(video_channel); if (!vie_channel) { - WEBRTC_TRACE(kTraceError, kTraceVideo, - ViEId(shared_data_->instance_id(), video_channel), - "%s: Channel %d doesn't exist", __FUNCTION__, video_channel); shared_data_->SetLastError(kViERtpRtcpInvalidChannelId); return -1; } @@ -570,9 +431,6 @@ int ViERTP_RTCPImpl::SetHybridNACKFECStatus( // Update the channel status with hybrid NACK FEC mode. if (vie_channel->SetHybridNACKFECStatus(enable, payload_typeRED, payload_typeFEC) != 0) { - WEBRTC_TRACE(kTraceError, kTraceVideo, - ViEId(shared_data_->instance_id(), video_channel), - "%s: failed for channel %d", __FUNCTION__, video_channel); shared_data_->SetLastError(kViERtpRtcpUnknownError); return -1; } @@ -580,10 +438,6 @@ int ViERTP_RTCPImpl::SetHybridNACKFECStatus( // Update the encoder. ViEEncoder* vie_encoder = cs.Encoder(video_channel); if (!vie_encoder) { - WEBRTC_TRACE(kTraceError, kTraceVideo, - ViEId(shared_data_->instance_id(), video_channel), - "%s: Could not get encoder for channel %d", __FUNCTION__, - video_channel); shared_data_->SetLastError(kViERtpRtcpUnknownError); return -1; } @@ -592,35 +446,23 @@ int ViERTP_RTCPImpl::SetHybridNACKFECStatus( } int ViERTP_RTCPImpl::SetSenderBufferingMode(int video_channel, - int target_delay_ms) { - WEBRTC_TRACE(kTraceApiCall, kTraceVideo, - ViEId(shared_data_->instance_id(), video_channel), - "%s(channel: %d, sender target_delay: %d)", - __FUNCTION__, video_channel, target_delay_ms); + int target_delay_ms) { + LOG_F(LS_INFO) << "channel: " << video_channel + << " target_delay_ms: " << target_delay_ms; ViEChannelManagerScoped cs(*(shared_data_->channel_manager())); ViEChannel* vie_channel = cs.Channel(video_channel); if (!vie_channel) { - WEBRTC_TRACE(kTraceError, kTraceVideo, - ViEId(shared_data_->instance_id(), video_channel), - "%s: Channel %d doesn't exist", __FUNCTION__, video_channel); shared_data_->SetLastError(kViERtpRtcpInvalidChannelId); return -1; } ViEEncoder* vie_encoder = cs.Encoder(video_channel); if (!vie_encoder) { - WEBRTC_TRACE(kTraceError, kTraceVideo, - ViEId(shared_data_->instance_id(), video_channel), - "%s: Could not get encoder for channel %d", __FUNCTION__, - video_channel); shared_data_->SetLastError(kViERtpRtcpInvalidChannelId); return -1; } // Update the channel with buffering mode settings. if (vie_channel->SetSenderBufferingMode(target_delay_ms) != 0) { - WEBRTC_TRACE(kTraceError, kTraceVideo, - ViEId(shared_data_->instance_id(), video_channel), - "%s: failed for channel %d", __FUNCTION__, video_channel); shared_data_->SetLastError(kViERtpRtcpUnknownError); return -1; } @@ -631,26 +473,18 @@ int ViERTP_RTCPImpl::SetSenderBufferingMode(int video_channel, } int ViERTP_RTCPImpl::SetReceiverBufferingMode(int video_channel, - int target_delay_ms) { - WEBRTC_TRACE(kTraceApiCall, kTraceVideo, - ViEId(shared_data_->instance_id(), video_channel), - "%s(channel: %d, receiver target_delay: %d)", - __FUNCTION__, video_channel, target_delay_ms); + int target_delay_ms) { + LOG_F(LS_INFO) << "channel: " << video_channel + << " target_delay_ms: " << target_delay_ms; ViEChannelManagerScoped cs(*(shared_data_->channel_manager())); ViEChannel* vie_channel = cs.Channel(video_channel); if (!vie_channel) { - WEBRTC_TRACE(kTraceError, kTraceVideo, - ViEId(shared_data_->instance_id(), video_channel), - "%s: Channel %d doesn't exist", __FUNCTION__, video_channel); shared_data_->SetLastError(kViERtpRtcpInvalidChannelId); return -1; } // Update the channel with buffering mode settings. if (vie_channel->SetReceiverBufferingMode(target_delay_ms) != 0) { - WEBRTC_TRACE(kTraceError, kTraceVideo, - ViEId(shared_data_->instance_id(), video_channel), - "%s: failed for channel %d", __FUNCTION__, video_channel); shared_data_->SetLastError(kViERtpRtcpUnknownError); return -1; } @@ -660,18 +494,12 @@ int ViERTP_RTCPImpl::SetReceiverBufferingMode(int video_channel, int ViERTP_RTCPImpl::SetKeyFrameRequestMethod( const int video_channel, const ViEKeyFrameRequestMethod method) { - WEBRTC_TRACE(kTraceApiCall, kTraceVideo, - ViEId(shared_data_->instance_id(), video_channel), - "%s(channel: %d, method: %d)", __FUNCTION__, video_channel, - method); + LOG_F(LS_INFO) << "channel: " << video_channel + << " method: " << static_cast(method); - // Get the channel. ViEChannelManagerScoped cs(*(shared_data_->channel_manager())); ViEChannel* vie_channel = cs.Channel(video_channel); if (!vie_channel) { - WEBRTC_TRACE(kTraceError, kTraceVideo, - ViEId(shared_data_->instance_id(), video_channel), - "%s: Channel %d doesn't exist", __FUNCTION__, video_channel); shared_data_->SetLastError(kViERtpRtcpInvalidChannelId); return -1; } @@ -685,16 +513,11 @@ int ViERTP_RTCPImpl::SetKeyFrameRequestMethod( int ViERTP_RTCPImpl::SetTMMBRStatus(const int video_channel, const bool enable) { - WEBRTC_TRACE(kTraceApiCall, kTraceVideo, - ViEId(shared_data_->instance_id(), video_channel), - "%s(channel: %d, enable: %d)", __FUNCTION__, video_channel, - enable); + LOG_F(LS_INFO) << "channel: " << video_channel + << "enable: " << (enable ? "on" : "off"); ViEChannelManagerScoped cs(*(shared_data_->channel_manager())); ViEChannel* vie_channel = cs.Channel(video_channel); if (!vie_channel) { - WEBRTC_TRACE(kTraceError, kTraceVideo, - ViEId(shared_data_->instance_id(), video_channel), - "%s: Channel %d doesn't exist", __FUNCTION__, video_channel); shared_data_->SetLastError(kViERtpRtcpInvalidChannelId); return -1; } @@ -705,12 +528,12 @@ int ViERTP_RTCPImpl::SetTMMBRStatus(const int video_channel, return 0; } -int ViERTP_RTCPImpl::SetRembStatus(int video_channel, bool sender, +int ViERTP_RTCPImpl::SetRembStatus(int video_channel, + bool sender, bool receiver) { - WEBRTC_TRACE(kTraceApiCall, kTraceVideo, - ViEId(shared_data_->instance_id(), video_channel), - "ViERTP_RTCPImpl::SetRembStatus(%d, %d, %d)", video_channel, - sender, receiver); + LOG_F(LS_INFO) << "channel: " << video_channel + << " sender: " << (sender ? "on" : "off") + << " receiver: " << (receiver ? "on" : "off"); if (!shared_data_->channel_manager()->SetRembStatus(video_channel, sender, receiver)) { return -1; @@ -721,17 +544,12 @@ int ViERTP_RTCPImpl::SetRembStatus(int video_channel, bool sender, int ViERTP_RTCPImpl::SetSendTimestampOffsetStatus(int video_channel, bool enable, int id) { - WEBRTC_TRACE(kTraceApiCall, kTraceVideo, - ViEId(shared_data_->instance_id(), video_channel), - "ViERTP_RTCPImpl::SetSendTimestampOffsetStatus(%d, %d, %d)", - video_channel, enable, id); + LOG_F(LS_INFO) << "channel: " << video_channel + << "enable: " << (enable ? "on" : "off") << " id: " << id; ViEChannelManagerScoped cs(*(shared_data_->channel_manager())); ViEChannel* vie_channel = cs.Channel(video_channel); if (!vie_channel) { - WEBRTC_TRACE(kTraceError, kTraceVideo, - ViEId(shared_data_->instance_id(), video_channel), - "%s: Channel %d doesn't exist", __FUNCTION__, video_channel); shared_data_->SetLastError(kViERtpRtcpInvalidChannelId); return -1; } @@ -745,16 +563,11 @@ int ViERTP_RTCPImpl::SetSendTimestampOffsetStatus(int video_channel, int ViERTP_RTCPImpl::SetReceiveTimestampOffsetStatus(int video_channel, bool enable, int id) { - WEBRTC_TRACE(kTraceApiCall, kTraceVideo, - ViEId(shared_data_->instance_id(), video_channel), - "ViERTP_RTCPImpl::SetReceiveTimestampOffsetStatus(%d, %d, %d)", - video_channel, enable, id); + LOG_F(LS_INFO) << "channel: " << video_channel + << "enable: " << (enable ? "on" : "off") << " id: " << id; ViEChannelManagerScoped cs(*(shared_data_->channel_manager())); ViEChannel* vie_channel = cs.Channel(video_channel); if (!vie_channel) { - WEBRTC_TRACE(kTraceError, kTraceVideo, - ViEId(shared_data_->instance_id(), video_channel), - "%s: Channel %d doesn't exist", __FUNCTION__, video_channel); shared_data_->SetLastError(kViERtpRtcpInvalidChannelId); return -1; } @@ -768,17 +581,12 @@ int ViERTP_RTCPImpl::SetReceiveTimestampOffsetStatus(int video_channel, int ViERTP_RTCPImpl::SetSendAbsoluteSendTimeStatus(int video_channel, bool enable, int id) { - WEBRTC_TRACE(kTraceApiCall, kTraceVideo, - ViEId(shared_data_->instance_id(), video_channel), - "ViERTP_RTCPImpl::SetSendAbsoluteSendTimeStatus(%d, %d, %d)", - video_channel, enable, id); + LOG_F(LS_INFO) << "channel: " << video_channel + << "enable: " << (enable ? "on" : "off") << " id: " << id; ViEChannelManagerScoped cs(*(shared_data_->channel_manager())); ViEChannel* vie_channel = cs.Channel(video_channel); if (!vie_channel) { - WEBRTC_TRACE(kTraceError, kTraceVideo, - ViEId(shared_data_->instance_id(), video_channel), - "%s: Channel %d doesn't exist", __FUNCTION__, video_channel); shared_data_->SetLastError(kViERtpRtcpInvalidChannelId); return -1; } @@ -792,16 +600,11 @@ int ViERTP_RTCPImpl::SetSendAbsoluteSendTimeStatus(int video_channel, int ViERTP_RTCPImpl::SetReceiveAbsoluteSendTimeStatus(int video_channel, bool enable, int id) { - WEBRTC_TRACE(kTraceApiCall, kTraceVideo, - ViEId(shared_data_->instance_id(), video_channel), - "ViERTP_RTCPImpl::SetReceiveAbsoluteSendTimeStatus(%d, %d, %d)", - video_channel, enable, id); + LOG_F(LS_INFO) << "channel: " << video_channel + << "enable: " << (enable ? "on" : "off") << " id: " << id; ViEChannelManagerScoped cs(*(shared_data_->channel_manager())); ViEChannel* vie_channel = cs.Channel(video_channel); if (!vie_channel) { - WEBRTC_TRACE(kTraceError, kTraceVideo, - ViEId(shared_data_->instance_id(), video_channel), - "%s: Channel %d doesn't exist", __FUNCTION__, video_channel); shared_data_->SetLastError(kViERtpRtcpInvalidChannelId); return -1; } @@ -813,17 +616,12 @@ int ViERTP_RTCPImpl::SetReceiveAbsoluteSendTimeStatus(int video_channel, } int ViERTP_RTCPImpl::SetRtcpXrRrtrStatus(int video_channel, bool enable) { - WEBRTC_TRACE(kTraceApiCall, kTraceVideo, - ViEId(shared_data_->instance_id(), video_channel), - "ViERTP_RTCPImpl::SetRtcpXrRrtrStatus(%d, %d)", - video_channel, enable); + LOG_F(LS_INFO) << "channel: " << video_channel + << " enable: " << (enable ? "on" : "off"); ViEChannelManagerScoped cs(*(shared_data_->channel_manager())); ViEChannel* vie_channel = cs.Channel(video_channel); if (!vie_channel) { - WEBRTC_TRACE(kTraceError, kTraceVideo, - ViEId(shared_data_->instance_id(), video_channel), - "%s: Channel %d doesn't exist", __FUNCTION__, video_channel); shared_data_->SetLastError(kViERtpRtcpInvalidChannelId); return -1; } @@ -833,16 +631,11 @@ int ViERTP_RTCPImpl::SetRtcpXrRrtrStatus(int video_channel, bool enable) { int ViERTP_RTCPImpl::SetTransmissionSmoothingStatus(int video_channel, bool enable) { - WEBRTC_TRACE(kTraceApiCall, kTraceVideo, - ViEId(shared_data_->instance_id(), video_channel), - "%s(channel: %d, enble: %d)", __FUNCTION__, video_channel, - enable); + LOG_F(LS_INFO) << "channel: " << video_channel + << " enable: " << (enable ? "on" : "off"); ViEChannelManagerScoped cs(*(shared_data_->channel_manager())); ViEChannel* vie_channel = cs.Channel(video_channel); if (!vie_channel) { - WEBRTC_TRACE(kTraceError, kTraceVideo, - ViEId(shared_data_->instance_id(), video_channel), - "%s: Channel %d doesn't exist", __FUNCTION__, video_channel); shared_data_->SetLastError(kViERtpRtcpInvalidChannelId); return -1; } @@ -852,6 +645,8 @@ int ViERTP_RTCPImpl::SetTransmissionSmoothingStatus(int video_channel, int ViERTP_RTCPImpl::SetMinTransmitBitrate(int video_channel, int min_transmit_bitrate_kbps) { + LOG_F(LS_INFO) << "channel: " << video_channel + << " min_transmit_bitrate_kbps: " << min_transmit_bitrate_kbps; ViEChannelManagerScoped cs(*(shared_data_->channel_manager())); ViEEncoder* vie_encoder = cs.Encoder(video_channel); if (vie_encoder == NULL) @@ -862,10 +657,9 @@ int ViERTP_RTCPImpl::SetMinTransmitBitrate(int video_channel, int ViERTP_RTCPImpl::SetReservedTransmitBitrate( int video_channel, unsigned int reserved_transmit_bitrate_bps) { - WEBRTC_TRACE(kTraceApiCall, kTraceVideo, - ViEId(shared_data_->instance_id(), video_channel), - "ViERTP_RTCPImpl::SetReservedTransmitBitrate(%d, %d)", - video_channel, reserved_transmit_bitrate_bps); + LOG_F(LS_INFO) << "channel: " << video_channel + << " reserved_transmit_bitrate_bps: " + << reserved_transmit_bitrate_bps; if (!shared_data_->channel_manager()->SetReservedTransmitBitrate( video_channel, reserved_transmit_bitrate_bps)) { return -1; @@ -877,15 +671,9 @@ int ViERTP_RTCPImpl::GetReceiveChannelRtcpStatistics( const int video_channel, RtcpStatistics& basic_stats, int& rtt_ms) const { - WEBRTC_TRACE(kTraceApiCall, kTraceVideo, - ViEId(shared_data_->instance_id(), video_channel), - "%s(channel: %d)", __FUNCTION__, video_channel); ViEChannelManagerScoped cs(*(shared_data_->channel_manager())); ViEChannel* vie_channel = cs.Channel(video_channel); if (!vie_channel) { - WEBRTC_TRACE(kTraceError, kTraceVideo, - ViEId(shared_data_->instance_id(), video_channel), - "%s: Channel %d doesn't exist", __FUNCTION__, video_channel); shared_data_->SetLastError(kViERtpRtcpInvalidChannelId); return -1; } @@ -908,15 +696,9 @@ int ViERTP_RTCPImpl::GetReceiveChannelRtcpStatistics( int ViERTP_RTCPImpl::GetSendChannelRtcpStatistics(const int video_channel, RtcpStatistics& basic_stats, int& rtt_ms) const { - WEBRTC_TRACE(kTraceApiCall, kTraceVideo, - ViEId(shared_data_->instance_id(), video_channel), - "%s(channel: %d)", __FUNCTION__, video_channel); ViEChannelManagerScoped cs(*(shared_data_->channel_manager())); ViEChannel* vie_channel = cs.Channel(video_channel); if (!vie_channel) { - WEBRTC_TRACE(kTraceError, kTraceVideo, - ViEId(shared_data_->instance_id(), video_channel), - "%s: Channel %d doesn't exist", __FUNCTION__, video_channel); shared_data_->SetLastError(kViERtpRtcpInvalidChannelId); return -1; } @@ -939,15 +721,9 @@ int ViERTP_RTCPImpl::GetSendChannelRtcpStatistics(const int video_channel, int ViERTP_RTCPImpl::GetRtpStatistics(const int video_channel, StreamDataCounters& sent, StreamDataCounters& received) const { - WEBRTC_TRACE(kTraceApiCall, kTraceVideo, - ViEId(shared_data_->instance_id(), video_channel), - "%s(channel: %d)", __FUNCTION__, video_channel); ViEChannelManagerScoped cs(*(shared_data_->channel_manager())); ViEChannel* vie_channel = cs.Channel(video_channel); if (!vie_channel) { - WEBRTC_TRACE(kTraceError, kTraceVideo, - ViEId(shared_data_->instance_id(), video_channel), - "%s: Channel %d doesn't exist", __FUNCTION__, video_channel); shared_data_->SetLastError(kViERtpRtcpInvalidChannelId); return -1; } @@ -968,9 +744,6 @@ int ViERTP_RTCPImpl::GetRtcpPacketTypeCounters( ViEChannelManagerScoped cs(*(shared_data_->channel_manager())); ViEChannel* vie_channel = cs.Channel(video_channel); if (!vie_channel) { - WEBRTC_TRACE(kTraceError, kTraceVideo, - ViEId(shared_data_->instance_id(), video_channel), - "%s: Channel %d doesn't exist", __FUNCTION__, video_channel); shared_data_->SetLastError(kViERtpRtcpInvalidChannelId); return -1; } @@ -983,15 +756,9 @@ int ViERTP_RTCPImpl::GetBandwidthUsage(const int video_channel, unsigned int& video_bitrate_sent, unsigned int& fec_bitrate_sent, unsigned int& nackBitrateSent) const { - WEBRTC_TRACE(kTraceApiCall, kTraceVideo, - ViEId(shared_data_->instance_id(), video_channel), - "%s(channel: %d)", __FUNCTION__, video_channel); ViEChannelManagerScoped cs(*(shared_data_->channel_manager())); ViEChannel* vie_channel = cs.Channel(video_channel); if (!vie_channel) { - WEBRTC_TRACE(kTraceError, kTraceVideo, - ViEId(shared_data_->instance_id(), video_channel), - "%s: Channel %d doesn't exist", __FUNCTION__, video_channel); shared_data_->SetLastError(kViERtpRtcpInvalidChannelId); return -1; } @@ -1005,9 +772,6 @@ int ViERTP_RTCPImpl::GetBandwidthUsage(const int video_channel, int ViERTP_RTCPImpl::GetEstimatedSendBandwidth( const int video_channel, unsigned int* estimated_bandwidth) const { - WEBRTC_TRACE(kTraceApiCall, kTraceVideo, - ViEId(shared_data_->instance_id(), video_channel), - "%s(channel: %d)", __FUNCTION__, video_channel); if (!shared_data_->channel_manager()->GetEstimatedSendBandwidth( video_channel, estimated_bandwidth)) { return -1; @@ -1018,9 +782,6 @@ int ViERTP_RTCPImpl::GetEstimatedSendBandwidth( int ViERTP_RTCPImpl::GetEstimatedReceiveBandwidth( const int video_channel, unsigned int* estimated_bandwidth) const { - WEBRTC_TRACE(kTraceApiCall, kTraceVideo, - ViEId(shared_data_->instance_id(), video_channel), - "%s(channel: %d)", __FUNCTION__, video_channel); if (!shared_data_->channel_manager()->GetEstimatedReceiveBandwidth( video_channel, estimated_bandwidth)) { return -1; @@ -1031,16 +792,9 @@ int ViERTP_RTCPImpl::GetEstimatedReceiveBandwidth( int ViERTP_RTCPImpl::GetReceiveBandwidthEstimatorStats( const int video_channel, ReceiveBandwidthEstimatorStats* output) const { - WEBRTC_TRACE(kTraceApiCall, kTraceVideo, - ViEId(shared_data_->instance_id(), video_channel), - "%s(channel: %d)", __FUNCTION__, video_channel); ViEChannelManagerScoped cs(*(shared_data_->channel_manager())); ViEChannel* vie_channel = cs.Channel(video_channel); if (!vie_channel) { - WEBRTC_TRACE(kTraceError, kTraceVideo, - ViEId(shared_data_->instance_id(), video_channel), - "%s: Could not get channel %d", __FUNCTION__, - video_channel); shared_data_->SetLastError(kViERtpRtcpInvalidChannelId); return -1; } @@ -1050,16 +804,9 @@ int ViERTP_RTCPImpl::GetReceiveBandwidthEstimatorStats( int ViERTP_RTCPImpl::GetPacerQueuingDelayMs( const int video_channel, int* delay_ms) const { - WEBRTC_TRACE(kTraceApiCall, kTraceVideo, - ViEId(shared_data_->instance_id(), video_channel), - "%s(channel: %d)", __FUNCTION__, video_channel); ViEChannelManagerScoped cs(*(shared_data_->channel_manager())); ViEEncoder* vie_encoder = cs.Encoder(video_channel); if (!vie_encoder) { - WEBRTC_TRACE(kTraceError, kTraceVideo, - ViEId(shared_data_->instance_id(), video_channel), - "%s: Could not get encoder for channel %d", __FUNCTION__, - video_channel); shared_data_->SetLastError(kViERtpRtcpInvalidChannelId); return -1; } @@ -1070,17 +817,13 @@ int ViERTP_RTCPImpl::GetPacerQueuingDelayMs( int ViERTP_RTCPImpl::StartRTPDump(const int video_channel, const char file_nameUTF8[1024], RTPDirections direction) { - WEBRTC_TRACE(kTraceApiCall, kTraceVideo, - ViEId(shared_data_->instance_id(), video_channel), - "%s(channel: %d, file_name: %s, direction: %d)", __FUNCTION__, - video_channel, file_nameUTF8, direction); + LOG_F(LS_INFO) << "channel: " << video_channel + << " filename: " << file_nameUTF8 + << " direction: " << static_cast(direction); assert(FileWrapper::kMaxFileNameSize == 1024); ViEChannelManagerScoped cs(*(shared_data_->channel_manager())); ViEChannel* vie_channel = cs.Channel(video_channel); if (!vie_channel) { - WEBRTC_TRACE(kTraceError, kTraceVideo, - ViEId(shared_data_->instance_id(), video_channel), - "%s: Channel %d doesn't exist", __FUNCTION__, video_channel); shared_data_->SetLastError(kViERtpRtcpInvalidChannelId); return -1; } @@ -1093,16 +836,11 @@ int ViERTP_RTCPImpl::StartRTPDump(const int video_channel, int ViERTP_RTCPImpl::StopRTPDump(const int video_channel, RTPDirections direction) { - WEBRTC_TRACE(kTraceApiCall, kTraceVideo, - ViEId(shared_data_->instance_id(), video_channel), - "%s(channel: %d, direction: %d)", __FUNCTION__, video_channel, - direction); + LOG_F(LS_INFO) << "channel: " << video_channel + << " direction: " << static_cast(direction); ViEChannelManagerScoped cs(*(shared_data_->channel_manager())); ViEChannel* vie_channel = cs.Channel(video_channel); if (!vie_channel) { - WEBRTC_TRACE(kTraceError, kTraceVideo, - ViEId(shared_data_->instance_id(), video_channel), - "%s: Channel %d doesn't exist", __FUNCTION__, video_channel); shared_data_->SetLastError(kViERtpRtcpInvalidChannelId); return -1; } @@ -1115,15 +853,10 @@ int ViERTP_RTCPImpl::StopRTPDump(const int video_channel, int ViERTP_RTCPImpl::RegisterRTPObserver(const int video_channel, ViERTPObserver& observer) { - WEBRTC_TRACE(kTraceApiCall, kTraceVideo, - ViEId(shared_data_->instance_id(), video_channel), - "%s(channel: %d)", __FUNCTION__, video_channel); + LOG_F(LS_INFO) << "channel " << video_channel; ViEChannelManagerScoped cs(*(shared_data_->channel_manager())); ViEChannel* vie_channel = cs.Channel(video_channel); if (!vie_channel) { - WEBRTC_TRACE(kTraceError, kTraceVideo, - ViEId(shared_data_->instance_id(), video_channel), - "%s: Channel %d doesn't exist", __FUNCTION__, video_channel); shared_data_->SetLastError(kViERtpRtcpInvalidChannelId); return -1; } @@ -1135,15 +868,10 @@ int ViERTP_RTCPImpl::RegisterRTPObserver(const int video_channel, } int ViERTP_RTCPImpl::DeregisterRTPObserver(const int video_channel) { - WEBRTC_TRACE(kTraceApiCall, kTraceVideo, - ViEId(shared_data_->instance_id(), video_channel), - "%s(channel: %d)", __FUNCTION__, video_channel); + LOG_F(LS_INFO) << "channel " << video_channel; ViEChannelManagerScoped cs(*(shared_data_->channel_manager())); ViEChannel* vie_channel = cs.Channel(video_channel); if (!vie_channel) { - WEBRTC_TRACE(kTraceError, kTraceVideo, - ViEId(shared_data_->instance_id(), video_channel), - "%s: Channel %d doesn't exist", __FUNCTION__, video_channel); shared_data_->SetLastError(kViERtpRtcpInvalidChannelId); return -1; } @@ -1156,15 +884,10 @@ int ViERTP_RTCPImpl::DeregisterRTPObserver(const int video_channel) { int ViERTP_RTCPImpl::RegisterRTCPObserver(const int video_channel, ViERTCPObserver& observer) { - WEBRTC_TRACE(kTraceApiCall, kTraceVideo, - ViEId(shared_data_->instance_id(), video_channel), - "%s(channel: %d)", __FUNCTION__, video_channel); + LOG_F(LS_INFO) << "channel " << video_channel; ViEChannelManagerScoped cs(*(shared_data_->channel_manager())); ViEChannel* vie_channel = cs.Channel(video_channel); if (!vie_channel) { - WEBRTC_TRACE(kTraceError, kTraceVideo, - ViEId(shared_data_->instance_id(), video_channel), - "%s: Channel %d doesn't exist", __FUNCTION__, video_channel); shared_data_->SetLastError(kViERtpRtcpInvalidChannelId); return -1; } @@ -1176,15 +899,10 @@ int ViERTP_RTCPImpl::RegisterRTCPObserver(const int video_channel, } int ViERTP_RTCPImpl::DeregisterRTCPObserver(const int video_channel) { - WEBRTC_TRACE(kTraceApiCall, kTraceVideo, - ViEId(shared_data_->instance_id(), video_channel), - "%s(channel: %d)", __FUNCTION__, video_channel); + LOG_F(LS_INFO) << "channel " << video_channel; ViEChannelManagerScoped cs(*(shared_data_->channel_manager())); ViEChannel* vie_channel = cs.Channel(video_channel); if (!vie_channel) { - WEBRTC_TRACE(kTraceError, kTraceVideo, - ViEId(shared_data_->instance_id(), video_channel), - "%s: Channel %d doesn't exist", __FUNCTION__, video_channel); shared_data_->SetLastError(kViERtpRtcpInvalidChannelId); return -1; } @@ -1197,15 +915,10 @@ int ViERTP_RTCPImpl::DeregisterRTCPObserver(const int video_channel) { int ViERTP_RTCPImpl::RegisterSendChannelRtcpStatisticsCallback( int video_channel, RtcpStatisticsCallback* callback) { - WEBRTC_TRACE(kTraceApiCall, kTraceVideo, - ViEId(shared_data_->instance_id(), video_channel), - "%s(channel: %d)", __FUNCTION__, video_channel); + LOG_F(LS_INFO) << "channel " << video_channel; ViEChannelManagerScoped cs(*(shared_data_->channel_manager())); ViEChannel* vie_channel = cs.Channel(video_channel); if (!vie_channel) { - WEBRTC_TRACE(kTraceError, kTraceVideo, - ViEId(shared_data_->instance_id(), video_channel), - "%s: Channel %d doesn't exist", __FUNCTION__, video_channel); shared_data_->SetLastError(kViERtpRtcpInvalidChannelId); return -1; } @@ -1215,15 +928,10 @@ int ViERTP_RTCPImpl::RegisterSendChannelRtcpStatisticsCallback( int ViERTP_RTCPImpl::DeregisterSendChannelRtcpStatisticsCallback( int video_channel, RtcpStatisticsCallback* callback) { - WEBRTC_TRACE(kTraceApiCall, kTraceVideo, - ViEId(shared_data_->instance_id(), video_channel), - "%s(channel: %d)", __FUNCTION__, video_channel); + LOG_F(LS_INFO) << "channel " << video_channel; ViEChannelManagerScoped cs(*(shared_data_->channel_manager())); ViEChannel* vie_channel = cs.Channel(video_channel); if (!vie_channel) { - WEBRTC_TRACE(kTraceError, kTraceVideo, - ViEId(shared_data_->instance_id(), video_channel), - "%s: Channel %d doesn't exist", __FUNCTION__, video_channel); shared_data_->SetLastError(kViERtpRtcpInvalidChannelId); return -1; } @@ -1234,12 +942,7 @@ int ViERTP_RTCPImpl::DeregisterSendChannelRtcpStatisticsCallback( int ViERTP_RTCPImpl::RegisterReceiveChannelRtcpStatisticsCallback( const int video_channel, RtcpStatisticsCallback* callback) { - WEBRTC_TRACE(kTraceApiCall, - kTraceVideo, - ViEId(shared_data_->instance_id(), video_channel), - "%s(channel: %d)", - __FUNCTION__, - video_channel); + LOG_F(LS_INFO) << "channel " << video_channel; ViEChannelManagerScoped cs(*(shared_data_->channel_manager())); ViEChannel* vie_channel = cs.Channel(video_channel); assert(vie_channel != NULL); @@ -1250,12 +953,7 @@ int ViERTP_RTCPImpl::RegisterReceiveChannelRtcpStatisticsCallback( int ViERTP_RTCPImpl::DeregisterReceiveChannelRtcpStatisticsCallback( const int video_channel, RtcpStatisticsCallback* callback) { - WEBRTC_TRACE(kTraceApiCall, - kTraceVideo, - ViEId(shared_data_->instance_id(), video_channel), - "%s(channel: %d)", - __FUNCTION__, - video_channel); + LOG_F(LS_INFO) << "channel " << video_channel; ViEChannelManagerScoped cs(*(shared_data_->channel_manager())); ViEChannel* vie_channel = cs.Channel(video_channel); assert(vie_channel != NULL); @@ -1265,9 +963,7 @@ int ViERTP_RTCPImpl::DeregisterReceiveChannelRtcpStatisticsCallback( int ViERTP_RTCPImpl::RegisterSendChannelRtpStatisticsCallback( int video_channel, StreamDataCountersCallback* callback) { - WEBRTC_TRACE(kTraceApiCall, kTraceVideo, - ViEId(shared_data_->instance_id(), video_channel), - "%s(channel: %d)", __FUNCTION__, video_channel); + LOG_F(LS_INFO) << "channel " << video_channel; ViEChannelManagerScoped cs(*(shared_data_->channel_manager())); ViEChannel* vie_channel = cs.Channel(video_channel); assert(vie_channel != NULL); @@ -1277,9 +973,7 @@ int ViERTP_RTCPImpl::RegisterSendChannelRtpStatisticsCallback( int ViERTP_RTCPImpl::DeregisterSendChannelRtpStatisticsCallback( int video_channel, StreamDataCountersCallback* callback) { - WEBRTC_TRACE(kTraceApiCall, kTraceVideo, - ViEId(shared_data_->instance_id(), video_channel), - "%s(channel: %d)", __FUNCTION__, video_channel); + LOG_F(LS_INFO) << "channel " << video_channel; ViEChannelManagerScoped cs(*(shared_data_->channel_manager())); ViEChannel* vie_channel = cs.Channel(video_channel); assert(vie_channel != NULL); @@ -1290,12 +984,7 @@ int ViERTP_RTCPImpl::DeregisterSendChannelRtpStatisticsCallback( int ViERTP_RTCPImpl::RegisterReceiveChannelRtpStatisticsCallback( const int video_channel, StreamDataCountersCallback* callback) { - WEBRTC_TRACE(kTraceApiCall, - kTraceVideo, - ViEId(shared_data_->instance_id(), video_channel), - "%s(channel: %d)", - __FUNCTION__, - video_channel); + LOG_F(LS_INFO) << "channel " << video_channel; ViEChannelManagerScoped cs(*(shared_data_->channel_manager())); ViEChannel* vie_channel = cs.Channel(video_channel); assert(vie_channel != NULL); @@ -1306,12 +995,7 @@ int ViERTP_RTCPImpl::RegisterReceiveChannelRtpStatisticsCallback( int ViERTP_RTCPImpl::DeregisterReceiveChannelRtpStatisticsCallback( const int video_channel, StreamDataCountersCallback* callback) { - WEBRTC_TRACE(kTraceApiCall, - kTraceVideo, - ViEId(shared_data_->instance_id(), video_channel), - "%s(channel: %d)", - __FUNCTION__, - video_channel); + LOG_F(LS_INFO) << "channel " << video_channel; ViEChannelManagerScoped cs(*(shared_data_->channel_manager())); ViEChannel* vie_channel = cs.Channel(video_channel); assert(vie_channel != NULL); @@ -1323,12 +1007,7 @@ int ViERTP_RTCPImpl::DeregisterReceiveChannelRtpStatisticsCallback( int ViERTP_RTCPImpl::RegisterSendBitrateObserver( const int video_channel, BitrateStatisticsObserver* observer) { - WEBRTC_TRACE(kTraceApiCall, - kTraceVideo, - ViEId(shared_data_->instance_id(), video_channel), - "%s(channel: %d)", - __FUNCTION__, - video_channel); + LOG_F(LS_INFO) << "channel " << video_channel; ViEChannelManagerScoped cs(*(shared_data_->channel_manager())); ViEChannel* vie_channel = cs.Channel(video_channel); assert(vie_channel != NULL); @@ -1339,12 +1018,7 @@ int ViERTP_RTCPImpl::RegisterSendBitrateObserver( int ViERTP_RTCPImpl::DeregisterSendBitrateObserver( const int video_channel, BitrateStatisticsObserver* observer) { - WEBRTC_TRACE(kTraceApiCall, - kTraceVideo, - ViEId(shared_data_->instance_id(), video_channel), - "%s(channel: %d)", - __FUNCTION__, - video_channel); + LOG_F(LS_INFO) << "channel " << video_channel; ViEChannelManagerScoped cs(*(shared_data_->channel_manager())); ViEChannel* vie_channel = cs.Channel(video_channel); assert(vie_channel != NULL); @@ -1354,15 +1028,10 @@ int ViERTP_RTCPImpl::DeregisterSendBitrateObserver( int ViERTP_RTCPImpl::RegisterSendFrameCountObserver( int video_channel, FrameCountObserver* callback) { - WEBRTC_TRACE(kTraceApiCall, kTraceVideo, - ViEId(shared_data_->instance_id(), video_channel), - "%s(channel: %d)", __FUNCTION__, video_channel); + LOG_F(LS_INFO) << "channel " << video_channel; ViEChannelManagerScoped cs(*(shared_data_->channel_manager())); ViEChannel* vie_channel = cs.Channel(video_channel); if (!vie_channel) { - WEBRTC_TRACE(kTraceError, kTraceVideo, - ViEId(shared_data_->instance_id(), video_channel), - "%s: Channel %d doesn't exist", __FUNCTION__, video_channel); shared_data_->SetLastError(kViERtpRtcpInvalidChannelId); return -1; } @@ -1372,15 +1041,10 @@ int ViERTP_RTCPImpl::RegisterSendFrameCountObserver( int ViERTP_RTCPImpl::DeregisterSendFrameCountObserver( int video_channel, FrameCountObserver* callback) { - WEBRTC_TRACE(kTraceApiCall, kTraceVideo, - ViEId(shared_data_->instance_id(), video_channel), - "%s(channel: %d)", __FUNCTION__, video_channel); + LOG_F(LS_INFO) << "channel " << video_channel; ViEChannelManagerScoped cs(*(shared_data_->channel_manager())); ViEChannel* vie_channel = cs.Channel(video_channel); if (!vie_channel) { - WEBRTC_TRACE(kTraceError, kTraceVideo, - ViEId(shared_data_->instance_id(), video_channel), - "%s: Channel %d doesn't exist", __FUNCTION__, video_channel); shared_data_->SetLastError(kViERtpRtcpInvalidChannelId); return -1; } diff --git a/webrtc/video_engine/vie_sender.cc b/webrtc/video_engine/vie_sender.cc index b83c681a5..349bc72fb 100644 --- a/webrtc/video_engine/vie_sender.cc +++ b/webrtc/video_engine/vie_sender.cc @@ -59,16 +59,12 @@ int ViESender::StartRTPDump(const char file_nameUTF8[1024]) { } else { rtp_dump_ = RtpDump::CreateRtpDump(); if (rtp_dump_ == NULL) { - WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo, channel_id_, - "StartSRTPDump: Failed to create RTP dump"); return -1; } } if (rtp_dump_->Start(file_nameUTF8) != 0) { RtpDump::DestroyRtpDump(rtp_dump_); rtp_dump_ = NULL; - WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo, channel_id_, - "StartRTPDump: Failed to start RTP dump"); return -1; } return 0; @@ -79,15 +75,10 @@ int ViESender::StopRTPDump() { if (rtp_dump_) { if (rtp_dump_->IsActive()) { rtp_dump_->Stop(); - } else { - WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo, channel_id_, - "StopRTPDump: Dump not active"); } RtpDump::DestroyRtpDump(rtp_dump_); rtp_dump_ = NULL; } else { - WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo, channel_id_, - "StopRTPDump: RTP dump not started"); return -1; } return 0; @@ -106,12 +97,7 @@ int ViESender::SendPacket(int vie_id, const void* data, int len) { static_cast(len)); } - const int bytes_sent = transport_->SendPacket(channel_id_, data, len); - if (bytes_sent != len) { - WEBRTC_TRACE(webrtc::kTraceWarning, webrtc::kTraceVideo, channel_id_, - "ViESender::SendPacket - Transport failed to send RTP packet"); - } - return bytes_sent; + return transport_->SendPacket(channel_id_, data, len); } int ViESender::SendRTCPPacket(int vie_id, const void* data, int len) { @@ -126,14 +112,7 @@ int ViESender::SendRTCPPacket(int vie_id, const void* data, int len) { static_cast(len)); } - const int bytes_sent = transport_->SendRTCPPacket(channel_id_, data, len); - if (bytes_sent != len) { - WEBRTC_TRACE( - webrtc::kTraceWarning, webrtc::kTraceVideo, channel_id_, - "ViESender::SendRTCPPacket - Transport failed to send RTCP packet" - " (%d vs %d)", bytes_sent, len); - } - return bytes_sent; + return transport_->SendRTCPPacket(channel_id_, data, len); } } // namespace webrtc diff --git a/webrtc/video_engine/vie_sync_module.cc b/webrtc/video_engine/vie_sync_module.cc index 31a7a6d49..a5ca6520d 100644 --- a/webrtc/video_engine/vie_sync_module.cc +++ b/webrtc/video_engine/vie_sync_module.cc @@ -14,7 +14,7 @@ #include "webrtc/modules/rtp_rtcp/interface/rtp_rtcp.h" #include "webrtc/modules/video_coding/main/interface/video_coding.h" #include "webrtc/system_wrappers/interface/critical_section_wrapper.h" -#include "webrtc/system_wrappers/interface/trace.h" +#include "webrtc/system_wrappers/interface/logging.h" #include "webrtc/system_wrappers/interface/trace_event.h" #include "webrtc/video_engine/stream_synchronization.h" #include "webrtc/video_engine/vie_channel.h" @@ -103,8 +103,6 @@ int32_t ViESyncModule::Process() { last_sync_time_ = TickTime::Now(); const int current_video_delay_ms = vcm_->Delay(); - WEBRTC_TRACE(webrtc::kTraceInfo, webrtc::kTraceVideo, vie_channel_->Id(), - "Video delay (JB + decoder) is %d ms", current_video_delay_ms); if (voe_channel_id_ == -1) { return 0; @@ -117,11 +115,6 @@ int32_t ViESyncModule::Process() { if (voe_sync_interface_->GetDelayEstimate(voe_channel_id_, &audio_jitter_buffer_delay_ms, &playout_buffer_delay_ms) != 0) { - // Could not get VoE delay value, probably not a valid channel Id or - // the channel have not received enough packets. - WEBRTC_TRACE(webrtc::kTraceStream, webrtc::kTraceVideo, vie_channel_->Id(), - "%s: VE_GetDelayEstimate error for voice_channel %d", - __FUNCTION__, voe_channel_id_); return 0; } const int current_audio_delay_ms = audio_jitter_buffer_delay_ms + @@ -167,15 +160,9 @@ int32_t ViESyncModule::Process() { return 0; } - WEBRTC_TRACE(webrtc::kTraceInfo, webrtc::kTraceVideo, vie_channel_->Id(), - "Set delay current(a=%d v=%d rel=%d) target(a=%d v=%d)", - current_audio_delay_ms, current_video_delay_ms, - relative_delay_ms, - target_audio_delay_ms, target_video_delay_ms); if (voe_sync_interface_->SetMinimumPlayoutDelay( voe_channel_id_, target_audio_delay_ms) == -1) { - WEBRTC_TRACE(webrtc::kTraceDebug, webrtc::kTraceVideo, vie_channel_->Id(), - "Error setting voice delay"); + LOG(LS_ERROR) << "Error setting voice delay."; } vcm_->SetMinimumPlayoutDelay(target_video_delay_ms); return 0; @@ -183,9 +170,8 @@ int32_t ViESyncModule::Process() { int ViESyncModule::SetTargetBufferingDelay(int target_delay_ms) { CriticalSectionScoped cs(data_cs_.get()); - if (!voe_sync_interface_) { - WEBRTC_TRACE(webrtc::kTraceInfo, webrtc::kTraceVideo, vie_channel_->Id(), - "voe_sync_interface_ NULL, can't set playout delay."); + if (!voe_sync_interface_) { + LOG(LS_ERROR) << "voe_sync_interface_ NULL, can't set playout delay."; return -1; } sync_->SetTargetBufferingDelay(target_delay_ms);