Cleanup inside IncomingVideoStream.

Removes logging, thread annotates members (finding 2 bugs where
variables were not protected by the correct critsect) and adds consts
and scoped_ptrs.

BUG=
R=mflodman@webrtc.org, stefan@webrtc.org

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

Cr-Commit-Position: refs/heads/master@{#9078}
This commit is contained in:
Peter Boström
2015-04-24 13:54:27 +02:00
parent a9ae0dfe12
commit c043afc605
4 changed files with 87 additions and 198 deletions

View File

@ -420,27 +420,9 @@ ModuleVideoRenderImpl::AddIncomingRenderStream(const uint32_t streamId,
}
// Create platform independant code
IncomingVideoStream* ptrIncomingStream = new IncomingVideoStream(_id,
streamId);
if (ptrIncomingStream == NULL)
{
WEBRTC_TRACE(kTraceError, kTraceVideoRenderer, _id,
"%s: Can't create incoming stream", __FUNCTION__);
return NULL;
}
if (ptrIncomingStream->SetRenderCallback(ptrRenderCallback) == -1)
{
WEBRTC_TRACE(kTraceError, kTraceVideoRenderer, _id,
"%s: Can't set render callback", __FUNCTION__);
delete ptrIncomingStream;
_ptrRenderer->DeleteIncomingRenderStream(streamId);
return NULL;
}
VideoRenderCallback* moduleCallback =
ptrIncomingStream->ModuleCallback();
IncomingVideoStream* ptrIncomingStream = new IncomingVideoStream(streamId);
ptrIncomingStream->SetRenderCallback(ptrRenderCallback);
VideoRenderCallback* moduleCallback = ptrIncomingStream->ModuleCallback();
// Store the stream
_streamRenderMap[streamId] = ptrIncomingStream;
@ -496,7 +478,8 @@ int32_t ModuleVideoRenderImpl::AddExternalRenderCallback(
"%s: could not get stream", __FUNCTION__);
return -1;
}
return item->second->SetExternalCallback(renderObject);
item->second->SetExternalCallback(renderObject);
return 0;
}
int32_t ModuleVideoRenderImpl::GetIncomingRenderStreamProperties(