Allow the NumberOfCodecs and GetCodec be called before the engine Init.
VoE has the similar behavior, see VoECodecImpl::NumOfCodecs and VoECodecImpl::GetCode. Review URL: http://webrtc-codereview.appspot.com/101005 git-svn-id: http://webrtc.googlecode.com/svn/trunk@340 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
parent
c68434d6a3
commit
1a023c95d8
@ -111,15 +111,6 @@ int ViECodecImpl::NumberOfCodecs() const
|
||||
{
|
||||
WEBRTC_TRACE(webrtc::kTraceApiCall, webrtc::kTraceVideo, ViEId(_instanceId), "%s",
|
||||
__FUNCTION__);
|
||||
|
||||
if (!IsInitialized())
|
||||
{
|
||||
SetLastError(kViENotInitialized);
|
||||
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo, ViEId(_instanceId),
|
||||
"%s - ViE instance %d not initialized", __FUNCTION__,
|
||||
_instanceId);
|
||||
return -1;
|
||||
}
|
||||
// +2 because of FEC(RED and ULPFEC)
|
||||
return (int) (VideoCodingModule::NumberOfCodecs() + 2);
|
||||
}
|
||||
@ -136,14 +127,6 @@ int ViECodecImpl::GetCodec(const unsigned char listNumber,
|
||||
WEBRTC_TRACE(webrtc::kTraceApiCall, webrtc::kTraceVideo, ViEId(_instanceId),
|
||||
"%s(listNumber: %d, codecType: %d)", __FUNCTION__,
|
||||
listNumber, videoCodec.codecType);
|
||||
if (!IsInitialized())
|
||||
{
|
||||
SetLastError(kViENotInitialized);
|
||||
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo, ViEId(_instanceId),
|
||||
"%s - ViE instance %d not initialized", __FUNCTION__,
|
||||
_instanceId);
|
||||
return -1;
|
||||
}
|
||||
if (listNumber == VideoCodingModule::NumberOfCodecs())
|
||||
{
|
||||
memset(&videoCodec, 0, sizeof(webrtc::VideoCodec));
|
||||
|
Loading…
x
Reference in New Issue
Block a user