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.
*/
#include <assert.h>
#include <stdlib.h>
#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;

View File

@ -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);