diff --git a/webrtc/modules/video_capture/device_info_impl.cc b/webrtc/modules/video_capture/device_info_impl.cc index 2d2bc7fb54..7db6103fec 100644 --- a/webrtc/modules/video_capture/device_info_impl.cc +++ b/webrtc/modules/video_capture/device_info_impl.cc @@ -8,11 +8,12 @@ * be found in the AUTHORS file in the root of the source tree. */ +#include #include #include "webrtc/modules/video_capture/device_info_impl.h" #include "webrtc/modules/video_capture/video_capture_config.h" -#include "webrtc/system_wrappers/interface/trace.h" +#include "webrtc/system_wrappers/interface/logging.h" #ifndef abs #define abs(a) (a>=0?a:-a) @@ -75,13 +76,8 @@ int32_t DeviceInfoImpl::GetCapability(const char* deviceUniqueIdUTF8, const uint32_t deviceCapabilityNumber, VideoCaptureCapability& capability) { + assert(deviceUniqueIdUTF8 != NULL); - if (!deviceUniqueIdUTF8) - { - WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideoCapture, _id, - "deviceUniqueIdUTF8 parameter not set in call to GetCapability"); - return -1; - } ReadLockScoped cs(_apiLock); if ((_lastUsedDeviceNameLength != strlen((char*) deviceUniqueIdUTF8)) @@ -111,9 +107,9 @@ int32_t DeviceInfoImpl::GetCapability(const char* deviceUniqueIdUTF8, // Make sure the number is valid if (deviceCapabilityNumber >= (unsigned int) _captureCapabilities.size()) { - WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideoCapture, _id, - "deviceCapabilityNumber %d is invalid in call to GetCapability", - deviceCapabilityNumber); + LOG(LS_ERROR) << "Invalid deviceCapabilityNumber " + << deviceCapabilityNumber << ">= number of capabilities (" + << _captureCapabilities.size() << ")."; return -1; } @@ -266,9 +262,9 @@ int32_t DeviceInfoImpl::GetBestMatchedCapability( }// else height not good }//end for - WEBRTC_TRACE(webrtc::kTraceInfo, webrtc::kTraceVideoCapture, _id, - "Best camera format: Width %d, Height %d, Frame rate %d, Color format %d", - bestWidth, bestHeight, bestFrameRate, bestRawType); + LOG(LS_VERBOSE) << "Best camera format: " << bestWidth << "x" << bestHeight + << "@" << bestFrameRate + << "fps, color format: " << bestRawType; // Copy the capability if (bestformatIndex < 0) @@ -343,11 +339,10 @@ int32_t DeviceInfoImpl::GetExpectedCaptureDelay( } if (bestDelay > kMaxCaptureDelay) { - WEBRTC_TRACE(webrtc::kTraceWarning, webrtc::kTraceVideoCapture, _id, - "Expected capture delay too high. %dms, will use %d", bestDelay, - kMaxCaptureDelay); + LOG(LS_WARNING) << "Expected capture delay (" << bestDelay + << " ms) too high, using " << kMaxCaptureDelay + << " ms."; bestDelay = kMaxCaptureDelay; - } return bestDelay; diff --git a/webrtc/modules/video_capture/video_capture_impl.cc b/webrtc/modules/video_capture/video_capture_impl.cc index e83c7a469c..d413f50484 100644 --- a/webrtc/modules/video_capture/video_capture_impl.cc +++ b/webrtc/modules/video_capture/video_capture_impl.cc @@ -17,9 +17,9 @@ #include "webrtc/modules/video_capture/video_capture_config.h" #include "webrtc/system_wrappers/interface/clock.h" #include "webrtc/system_wrappers/interface/critical_section_wrapper.h" +#include "webrtc/system_wrappers/interface/logging.h" #include "webrtc/system_wrappers/interface/ref_count.h" #include "webrtc/system_wrappers/interface/tick_util.h" -#include "webrtc/system_wrappers/interface/trace.h" #include "webrtc/system_wrappers/interface/trace_event.h" namespace webrtc @@ -260,10 +260,6 @@ int32_t VideoCaptureImpl::IncomingFrame( const VideoCaptureCapability& frameInfo, int64_t captureTime/*=0*/) { - WEBRTC_TRACE(webrtc::kTraceStream, webrtc::kTraceVideoCapture, _id, - "IncomingFrame width %d, height %d", (int) frameInfo.width, - (int) frameInfo.height); - CriticalSectionScoped cs(&_callBackCs); const int32_t width = frameInfo.width; @@ -281,8 +277,7 @@ int32_t VideoCaptureImpl::IncomingFrame( CalcBufferSize(commonVideoType, width, abs(height)) != videoFrameLength) { - WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideoCapture, _id, - "Wrong incoming frame length."); + LOG(LS_ERROR) << "Wrong incoming frame length."; return -1; } @@ -306,8 +301,8 @@ int32_t VideoCaptureImpl::IncomingFrame( stride_uv, stride_uv); if (ret < 0) { - WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideoCapture, _id, - "Failed to allocate I420 frame."); + LOG(LS_ERROR) << "Failed to create empty frame, this should only " + "happen due to bad parameters."; return -1; } const int conversionResult = ConvertToI420(commonVideoType, @@ -319,9 +314,8 @@ int32_t VideoCaptureImpl::IncomingFrame( &_captureFrame); if (conversionResult < 0) { - WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideoCapture, _id, - "Failed to convert capture frame from type %d to I420", - frameInfo.rawType); + LOG(LS_ERROR) << "Failed to convert capture frame from type " + << frameInfo.rawType << "to I420."; return -1; } DeliverCapturedFrame(_captureFrame, captureTime);