Remove WEBRTC_TRACE use in video_capture/

Does not touch platform-specific code.

BUG=3153
R=mflodman@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/11089004

git-svn-id: http://webrtc.googlecode.com/svn/trunk@6137 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
pbos@webrtc.org 2014-05-14 08:42:07 +00:00
parent 4e2806d85f
commit 3d5cb33da4
2 changed files with 18 additions and 29 deletions

View File

@ -8,11 +8,12 @@
* be found in the AUTHORS file in the root of the source tree. * be found in the AUTHORS file in the root of the source tree.
*/ */
#include <assert.h>
#include <stdlib.h> #include <stdlib.h>
#include "webrtc/modules/video_capture/device_info_impl.h" #include "webrtc/modules/video_capture/device_info_impl.h"
#include "webrtc/modules/video_capture/video_capture_config.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 #ifndef abs
#define abs(a) (a>=0?a:-a) #define abs(a) (a>=0?a:-a)
@ -75,13 +76,8 @@ int32_t DeviceInfoImpl::GetCapability(const char* deviceUniqueIdUTF8,
const uint32_t deviceCapabilityNumber, const uint32_t deviceCapabilityNumber,
VideoCaptureCapability& capability) 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); ReadLockScoped cs(_apiLock);
if ((_lastUsedDeviceNameLength != strlen((char*) deviceUniqueIdUTF8)) if ((_lastUsedDeviceNameLength != strlen((char*) deviceUniqueIdUTF8))
@ -111,9 +107,9 @@ int32_t DeviceInfoImpl::GetCapability(const char* deviceUniqueIdUTF8,
// Make sure the number is valid // Make sure the number is valid
if (deviceCapabilityNumber >= (unsigned int) _captureCapabilities.size()) if (deviceCapabilityNumber >= (unsigned int) _captureCapabilities.size())
{ {
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideoCapture, _id, LOG(LS_ERROR) << "Invalid deviceCapabilityNumber "
"deviceCapabilityNumber %d is invalid in call to GetCapability", << deviceCapabilityNumber << ">= number of capabilities ("
deviceCapabilityNumber); << _captureCapabilities.size() << ").";
return -1; return -1;
} }
@ -266,9 +262,9 @@ int32_t DeviceInfoImpl::GetBestMatchedCapability(
}// else height not good }// else height not good
}//end for }//end for
WEBRTC_TRACE(webrtc::kTraceInfo, webrtc::kTraceVideoCapture, _id, LOG(LS_VERBOSE) << "Best camera format: " << bestWidth << "x" << bestHeight
"Best camera format: Width %d, Height %d, Frame rate %d, Color format %d", << "@" << bestFrameRate
bestWidth, bestHeight, bestFrameRate, bestRawType); << "fps, color format: " << bestRawType;
// Copy the capability // Copy the capability
if (bestformatIndex < 0) if (bestformatIndex < 0)
@ -343,11 +339,10 @@ int32_t DeviceInfoImpl::GetExpectedCaptureDelay(
} }
if (bestDelay > kMaxCaptureDelay) if (bestDelay > kMaxCaptureDelay)
{ {
WEBRTC_TRACE(webrtc::kTraceWarning, webrtc::kTraceVideoCapture, _id, LOG(LS_WARNING) << "Expected capture delay (" << bestDelay
"Expected capture delay too high. %dms, will use %d", bestDelay, << " ms) too high, using " << kMaxCaptureDelay
kMaxCaptureDelay); << " ms.";
bestDelay = kMaxCaptureDelay; bestDelay = kMaxCaptureDelay;
} }
return bestDelay; return bestDelay;

View File

@ -17,9 +17,9 @@
#include "webrtc/modules/video_capture/video_capture_config.h" #include "webrtc/modules/video_capture/video_capture_config.h"
#include "webrtc/system_wrappers/interface/clock.h" #include "webrtc/system_wrappers/interface/clock.h"
#include "webrtc/system_wrappers/interface/critical_section_wrapper.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/ref_count.h"
#include "webrtc/system_wrappers/interface/tick_util.h" #include "webrtc/system_wrappers/interface/tick_util.h"
#include "webrtc/system_wrappers/interface/trace.h"
#include "webrtc/system_wrappers/interface/trace_event.h" #include "webrtc/system_wrappers/interface/trace_event.h"
namespace webrtc namespace webrtc
@ -260,10 +260,6 @@ int32_t VideoCaptureImpl::IncomingFrame(
const VideoCaptureCapability& frameInfo, const VideoCaptureCapability& frameInfo,
int64_t captureTime/*=0*/) 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); CriticalSectionScoped cs(&_callBackCs);
const int32_t width = frameInfo.width; const int32_t width = frameInfo.width;
@ -281,8 +277,7 @@ int32_t VideoCaptureImpl::IncomingFrame(
CalcBufferSize(commonVideoType, width, CalcBufferSize(commonVideoType, width,
abs(height)) != videoFrameLength) abs(height)) != videoFrameLength)
{ {
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideoCapture, _id, LOG(LS_ERROR) << "Wrong incoming frame length.";
"Wrong incoming frame length.");
return -1; return -1;
} }
@ -306,8 +301,8 @@ int32_t VideoCaptureImpl::IncomingFrame(
stride_uv, stride_uv); stride_uv, stride_uv);
if (ret < 0) if (ret < 0)
{ {
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideoCapture, _id, LOG(LS_ERROR) << "Failed to create empty frame, this should only "
"Failed to allocate I420 frame."); "happen due to bad parameters.";
return -1; return -1;
} }
const int conversionResult = ConvertToI420(commonVideoType, const int conversionResult = ConvertToI420(commonVideoType,
@ -319,9 +314,8 @@ int32_t VideoCaptureImpl::IncomingFrame(
&_captureFrame); &_captureFrame);
if (conversionResult < 0) if (conversionResult < 0)
{ {
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideoCapture, _id, LOG(LS_ERROR) << "Failed to convert capture frame from type "
"Failed to convert capture frame from type %d to I420", << frameInfo.rawType << "to I420.";
frameInfo.rawType);
return -1; return -1;
} }
DeliverCapturedFrame(_captureFrame, captureTime); DeliverCapturedFrame(_captureFrame, captureTime);