Bug 1058944 - Crash in webrtc::ViEInputManager::CreateCaptureDevice

This commit is contained in:
Matthew A. Miller 2014-08-26 17:10:42 -06:00
parent 6b95016a80
commit 644faa66e6
2 changed files with 7 additions and 5 deletions

View File

@ -351,7 +351,7 @@ VideoCaptureModule::DeviceInfo* DesktopCaptureImpl::CreateDeviceInfo(const int32
}
const char* DesktopCaptureImpl::CurrentDeviceName() const {
return _deviceUniqueId;
return _deviceUniqueId.c_str();
}
int32_t DesktopCaptureImpl::ChangeUniqueId(const int32_t id) {
@ -400,6 +400,8 @@ int32_t DesktopCaptureImpl::Init(const char* uniqueId,
MouseCursorMonitor *pMouseCursorMonitor = MouseCursorMonitor::CreateForWindow(webrtc::DesktopCaptureOptions::CreateDefault(), winId);
desktop_capturer_cursor_composer_.reset(new DesktopAndCursorComposer(pWindowCapturer, pMouseCursorMonitor));
}
_deviceUniqueId = uniqueId;
return 0;
}
@ -453,7 +455,7 @@ int32_t DesktopCaptureImpl::Process() {
DesktopCaptureImpl::DesktopCaptureImpl(const int32_t id)
: _id(id),
_deviceUniqueId(NULL),
_deviceUniqueId(""),
_apiCs(*CriticalSectionWrapper::CreateCriticalSection()),
_captureDelay(0),
_requestedCapability(),
@ -489,8 +491,6 @@ DesktopCaptureImpl::~DesktopCaptureImpl() {
DeRegisterCaptureCallback();
delete &_callBackCs;
delete &_apiCs;
delete[] _deviceUniqueId;
}
void DesktopCaptureImpl::RegisterCaptureDataCallback(

View File

@ -15,6 +15,8 @@
* video_capture_impl.h
*/
#include <string>
#include "webrtc/common_video/interface/i420_video_frame.h"
#include "webrtc/common_video/libyuv/include/webrtc_libyuv.h"
#include "webrtc/modules/desktop_capture/screen_capturer.h"
@ -218,7 +220,7 @@ protected:
int64_t capture_time);
int32_t _id; // Module ID
char* _deviceUniqueId; // current Device unique name;
std::string _deviceUniqueId; // current Device unique name;
CriticalSectionWrapper& _apiCs;
int32_t _captureDelay; // Current capture delay. May be changed of platform dependent parts.
VideoCaptureCapability _requestedCapability; // Should be set by platform dependent code in StartCapture.