VideoCapture now uses pointer constructor of CriticalSectionScoped.
BUG=184 TEST=video_capture_module compiles on all platforms when removing ref ctor of CriticalSectionScoped. Review URL: https://webrtc-codereview.appspot.com/434001 git-svn-id: http://webrtc.googlecode.com/svn/trunk@1855 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
parent
accf607b3e
commit
7845d07bf8
@ -475,7 +475,7 @@ VideoCaptureAndroid::~VideoCaptureAndroid()
|
||||
WebRtc_Word32 VideoCaptureAndroid::StartCapture(
|
||||
const VideoCaptureCapability& capability)
|
||||
{
|
||||
CriticalSectionScoped cs(_apiCs);
|
||||
CriticalSectionScoped cs(&_apiCs);
|
||||
WEBRTC_TRACE(webrtc::kTraceStateInfo, webrtc::kTraceVideoCapture, -1,
|
||||
"%s: ", __FUNCTION__);
|
||||
|
||||
@ -552,7 +552,7 @@ WebRtc_Word32 VideoCaptureAndroid::StartCapture(
|
||||
}
|
||||
WebRtc_Word32 VideoCaptureAndroid::StopCapture()
|
||||
{
|
||||
CriticalSectionScoped cs(_apiCs);
|
||||
CriticalSectionScoped cs(&_apiCs);
|
||||
WEBRTC_TRACE(webrtc::kTraceStateInfo, webrtc::kTraceVideoCapture, -1,
|
||||
"%s: ", __FUNCTION__);
|
||||
|
||||
@ -613,7 +613,7 @@ WebRtc_Word32 VideoCaptureAndroid::StopCapture()
|
||||
|
||||
bool VideoCaptureAndroid::CaptureStarted()
|
||||
{
|
||||
CriticalSectionScoped cs(_apiCs);
|
||||
CriticalSectionScoped cs(&_apiCs);
|
||||
WEBRTC_TRACE(webrtc::kTraceStateInfo, webrtc::kTraceVideoCapture, -1,
|
||||
"%s: ", __FUNCTION__);
|
||||
return _captureStarted;
|
||||
@ -621,7 +621,7 @@ bool VideoCaptureAndroid::CaptureStarted()
|
||||
WebRtc_Word32 VideoCaptureAndroid::CaptureSettings(
|
||||
VideoCaptureCapability& settings)
|
||||
{
|
||||
CriticalSectionScoped cs(_apiCs);
|
||||
CriticalSectionScoped cs(&_apiCs);
|
||||
WEBRTC_TRACE(webrtc::kTraceStateInfo, webrtc::kTraceVideoCapture, -1,
|
||||
"%s: ", __FUNCTION__);
|
||||
settings = _requestedCapability;
|
||||
@ -631,7 +631,7 @@ WebRtc_Word32 VideoCaptureAndroid::CaptureSettings(
|
||||
WebRtc_Word32 VideoCaptureAndroid::SetCaptureRotation(
|
||||
VideoCaptureRotation rotation)
|
||||
{
|
||||
CriticalSectionScoped cs(_apiCs);
|
||||
CriticalSectionScoped cs(&_apiCs);
|
||||
if (VideoCaptureImpl::SetCaptureRotation(rotation) == 0)
|
||||
{
|
||||
if (!g_jvm)
|
||||
|
@ -138,7 +138,7 @@ WebRtc_Word32 VideoCaptureModuleV4L2::StartCapture(
|
||||
}
|
||||
}
|
||||
|
||||
CriticalSectionScoped cs(*_captureCritSect);
|
||||
CriticalSectionScoped cs(_captureCritSect);
|
||||
//first open /dev/video device
|
||||
char device[20];
|
||||
sprintf(device, "/dev/video%d", (int) _deviceId);
|
||||
@ -254,7 +254,7 @@ WebRtc_Word32 VideoCaptureModuleV4L2::StopCapture()
|
||||
_captureThread->SetNotAlive();// Make sure the capture thread stop stop using the critsect.
|
||||
|
||||
|
||||
CriticalSectionScoped cs(*_captureCritSect);
|
||||
CriticalSectionScoped cs(_captureCritSect);
|
||||
|
||||
WEBRTC_TRACE(webrtc::kTraceInfo, webrtc::kTraceVideoCapture, -1, "StopCapture(), was running: %d",
|
||||
_captureStarted);
|
||||
|
@ -58,7 +58,7 @@ VideoCaptureMacQTKit::~VideoCaptureMacQTKit()
|
||||
WebRtc_Word32 VideoCaptureMacQTKit::Init(
|
||||
const WebRtc_Word32 id, const char* iDeviceUniqueIdUTF8)
|
||||
{
|
||||
CriticalSectionScoped cs(_apiCs);
|
||||
CriticalSectionScoped cs(&_apiCs);
|
||||
|
||||
|
||||
const WebRtc_Word32 nameLength =
|
||||
|
@ -155,7 +155,7 @@ WebRtc_Word32 VideoCaptureDS::Init(const WebRtc_Word32 id,
|
||||
WebRtc_Word32 VideoCaptureDS::StartCapture(
|
||||
const VideoCaptureCapability& capability)
|
||||
{
|
||||
CriticalSectionScoped cs(_apiCs);
|
||||
CriticalSectionScoped cs(&_apiCs);
|
||||
|
||||
if (capability != _requestedCapability)
|
||||
{
|
||||
@ -178,7 +178,7 @@ WebRtc_Word32 VideoCaptureDS::StartCapture(
|
||||
|
||||
WebRtc_Word32 VideoCaptureDS::StopCapture()
|
||||
{
|
||||
CriticalSectionScoped cs(_apiCs);
|
||||
CriticalSectionScoped cs(&_apiCs);
|
||||
|
||||
HRESULT hr = _mediaControl->Pause();
|
||||
if (FAILED(hr))
|
||||
|
@ -71,7 +71,7 @@ WebRtc_Word32 VideoCaptureImpl::TimeUntilNextProcess()
|
||||
// Process any pending tasks such as timeouts
|
||||
WebRtc_Word32 VideoCaptureImpl::Process()
|
||||
{
|
||||
CriticalSectionScoped cs(_callBackCs);
|
||||
CriticalSectionScoped cs(&_callBackCs);
|
||||
|
||||
const TickTime now = TickTime::Now();
|
||||
_lastProcessTime = TickTime::Now();
|
||||
@ -165,8 +165,8 @@ VideoCaptureImpl::~VideoCaptureImpl()
|
||||
WebRtc_Word32 VideoCaptureImpl::RegisterCaptureDataCallback(
|
||||
VideoCaptureDataCallback& dataCallBack)
|
||||
{
|
||||
CriticalSectionScoped cs(_apiCs);
|
||||
CriticalSectionScoped cs2(_callBackCs);
|
||||
CriticalSectionScoped cs(&_apiCs);
|
||||
CriticalSectionScoped cs2(&_callBackCs);
|
||||
_dataCallBack = &dataCallBack;
|
||||
|
||||
return 0;
|
||||
@ -174,37 +174,37 @@ WebRtc_Word32 VideoCaptureImpl::RegisterCaptureDataCallback(
|
||||
|
||||
WebRtc_Word32 VideoCaptureImpl::DeRegisterCaptureDataCallback()
|
||||
{
|
||||
CriticalSectionScoped cs(_apiCs);
|
||||
CriticalSectionScoped cs2(_callBackCs);
|
||||
CriticalSectionScoped cs(&_apiCs);
|
||||
CriticalSectionScoped cs2(&_callBackCs);
|
||||
_dataCallBack = NULL;
|
||||
return 0;
|
||||
}
|
||||
WebRtc_Word32 VideoCaptureImpl::RegisterCaptureCallback(VideoCaptureFeedBack& callBack)
|
||||
{
|
||||
|
||||
CriticalSectionScoped cs(_apiCs);
|
||||
CriticalSectionScoped cs2(_callBackCs);
|
||||
CriticalSectionScoped cs(&_apiCs);
|
||||
CriticalSectionScoped cs2(&_callBackCs);
|
||||
_captureCallBack = &callBack;
|
||||
return 0;
|
||||
}
|
||||
WebRtc_Word32 VideoCaptureImpl::DeRegisterCaptureCallback()
|
||||
{
|
||||
|
||||
CriticalSectionScoped cs(_apiCs);
|
||||
CriticalSectionScoped cs2(_callBackCs);
|
||||
CriticalSectionScoped cs(&_apiCs);
|
||||
CriticalSectionScoped cs2(&_callBackCs);
|
||||
_captureCallBack = NULL;
|
||||
return 0;
|
||||
|
||||
}
|
||||
WebRtc_Word32 VideoCaptureImpl::SetCaptureDelay(WebRtc_Word32 delayMS)
|
||||
{
|
||||
CriticalSectionScoped cs(_apiCs);
|
||||
CriticalSectionScoped cs(&_apiCs);
|
||||
_captureDelay = delayMS;
|
||||
return 0;
|
||||
}
|
||||
WebRtc_Word32 VideoCaptureImpl::CaptureDelay()
|
||||
{
|
||||
CriticalSectionScoped cs(_apiCs);
|
||||
CriticalSectionScoped cs(&_apiCs);
|
||||
return _setCaptureDelay;
|
||||
}
|
||||
|
||||
@ -259,7 +259,7 @@ WebRtc_Word32 VideoCaptureImpl::IncomingFrame(
|
||||
|
||||
TickTime startProcessTime = TickTime::Now();
|
||||
|
||||
CriticalSectionScoped cs(_callBackCs);
|
||||
CriticalSectionScoped cs(&_callBackCs);
|
||||
|
||||
const WebRtc_Word32 width = frameInfo.width;
|
||||
const WebRtc_Word32 height = frameInfo.height;
|
||||
@ -335,7 +335,7 @@ WebRtc_Word32 VideoCaptureImpl::IncomingFrame(
|
||||
WebRtc_Word32 VideoCaptureImpl::IncomingFrameI420(
|
||||
const VideoFrameI420& video_frame, WebRtc_Word64 captureTime) {
|
||||
|
||||
CriticalSectionScoped cs(_callBackCs);
|
||||
CriticalSectionScoped cs(&_callBackCs);
|
||||
|
||||
// Allocate I420 buffer
|
||||
int frame_size = CalcBufferSize(kI420,
|
||||
@ -388,8 +388,8 @@ WebRtc_Word32 VideoCaptureImpl::IncomingFrameI420(
|
||||
|
||||
WebRtc_Word32 VideoCaptureImpl::SetCaptureRotation(VideoCaptureRotation rotation)
|
||||
{
|
||||
CriticalSectionScoped cs(_apiCs);
|
||||
CriticalSectionScoped cs2(_callBackCs);
|
||||
CriticalSectionScoped cs(&_apiCs);
|
||||
CriticalSectionScoped cs2(&_callBackCs);
|
||||
switch (rotation)
|
||||
{
|
||||
case kCameraRotate0:
|
||||
@ -411,8 +411,8 @@ WebRtc_Word32 VideoCaptureImpl::SetCaptureRotation(VideoCaptureRotation rotation
|
||||
WebRtc_Word32 VideoCaptureImpl::StartSendImage(const VideoFrame& videoFrame,
|
||||
WebRtc_Word32 frameRate)
|
||||
{
|
||||
CriticalSectionScoped cs(_apiCs);
|
||||
CriticalSectionScoped cs2(_callBackCs);
|
||||
CriticalSectionScoped cs(&_apiCs);
|
||||
CriticalSectionScoped cs2(&_callBackCs);
|
||||
if (frameRate < 1 || frameRate > kMaxFrameRate)
|
||||
{
|
||||
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideoCapture, _id,
|
||||
@ -427,16 +427,16 @@ WebRtc_Word32 VideoCaptureImpl::StartSendImage(const VideoFrame& videoFrame,
|
||||
}
|
||||
WebRtc_Word32 VideoCaptureImpl::StopSendImage()
|
||||
{
|
||||
CriticalSectionScoped cs(_apiCs);
|
||||
CriticalSectionScoped cs2(_callBackCs);
|
||||
CriticalSectionScoped cs(&_apiCs);
|
||||
CriticalSectionScoped cs2(&_callBackCs);
|
||||
_startImageFrameIntervall = 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
WebRtc_Word32 VideoCaptureImpl::EnableFrameRateCallback(const bool enable)
|
||||
{
|
||||
CriticalSectionScoped cs(_apiCs);
|
||||
CriticalSectionScoped cs2(_callBackCs);
|
||||
CriticalSectionScoped cs(&_apiCs);
|
||||
CriticalSectionScoped cs2(&_callBackCs);
|
||||
_frameRateCallBack = enable;
|
||||
if (enable)
|
||||
{
|
||||
@ -447,8 +447,8 @@ WebRtc_Word32 VideoCaptureImpl::EnableFrameRateCallback(const bool enable)
|
||||
|
||||
WebRtc_Word32 VideoCaptureImpl::EnableNoPictureAlarm(const bool enable)
|
||||
{
|
||||
CriticalSectionScoped cs(_apiCs);
|
||||
CriticalSectionScoped cs2(_callBackCs);
|
||||
CriticalSectionScoped cs(&_apiCs);
|
||||
CriticalSectionScoped cs2(&_callBackCs);
|
||||
_noPictureAlarmCallBack = enable;
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user