Enable external encoders with internal picture source.

CL enables registering of external encoder with internal picture
source on API by adding simple passthrough parameter that is already
supported within video engine.

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

git-svn-id: http://webrtc.googlecode.com/svn/trunk@3344 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
stefan@webrtc.org 2013-01-09 08:35:40 +00:00
parent 658d423e81
commit fcd8585874
7 changed files with 18 additions and 11 deletions

View File

@ -27,7 +27,8 @@ class WEBRTC_DLLEXPORT ViEExternalCodec {
virtual int RegisterExternalSendCodec(const int video_channel,
const unsigned char pl_type,
VideoEncoder* encoder) = 0;
VideoEncoder* encoder,
bool internal_source) = 0;
virtual int DeRegisterExternalSendCodec(const int video_channel,
const unsigned char pl_type) = 0;

View File

@ -542,7 +542,7 @@ void ViEAutoTest::ViECodecExternalCodecTest() {
// Test to register on wrong channel.
error = vie_external_codec->RegisterExternalSendCodec(
channel.videoChannel + 5, codec.plType, &ext_encoder);
channel.videoChannel + 5, codec.plType, &ext_encoder, false);
number_of_errors += ViETest::TestError(error == -1,
"ERROR: %s at line %d",
__FUNCTION__, __LINE__);
@ -551,7 +551,7 @@ void ViEAutoTest::ViECodecExternalCodecTest() {
"ERROR: %s at line %d", __FUNCTION__, __LINE__);
error = vie_external_codec->RegisterExternalSendCodec(
channel.videoChannel, codec.plType, &ext_encoder);
channel.videoChannel, codec.plType, &ext_encoder, false);
number_of_errors += ViETest::TestError(error == 0, "ERROR: %s at line %d",
__FUNCTION__, __LINE__);
@ -653,7 +653,7 @@ void ViEAutoTest::ViECodecExternalCodecTest() {
__FUNCTION__, __LINE__);
error = vie_external_codec->RegisterExternalSendCodec(
channel.videoChannel, codec.plType, &ext_encoder);
channel.videoChannel, codec.plType, &ext_encoder, false);
number_of_errors += ViETest::TestError(error == 0, "ERROR: %s at line %d",
__FUNCTION__, __LINE__);

View File

@ -708,7 +708,7 @@ WebRtc_Word32 ViECapturer::PreEncodeToViEEncoder(const VideoCodec& codec,
vcm_ = VideoCodingModule::Create(capture_id_);
}
if (vie_encoder.RegisterExternalEncoder(this, codec.plType) != 0) {
if (vie_encoder.RegisterExternalEncoder(this, codec.plType, false) != 0) {
return -1;
}
if (vie_encoder.SetEncoder(codec) != 0) {

View File

@ -280,7 +280,8 @@ WebRtc_Word32 ViEEncoder::GetCodec(WebRtc_UWord8 list_index,
}
WebRtc_Word32 ViEEncoder::RegisterExternalEncoder(webrtc::VideoEncoder* encoder,
WebRtc_UWord8 pl_type) {
WebRtc_UWord8 pl_type,
bool internal_source) {
WEBRTC_TRACE(webrtc::kTraceInfo, webrtc::kTraceVideo,
ViEId(engine_id_, channel_id_), "%s: pltype %u", __FUNCTION__,
pl_type);
@ -288,7 +289,8 @@ WebRtc_Word32 ViEEncoder::RegisterExternalEncoder(webrtc::VideoEncoder* encoder,
if (encoder == NULL)
return -1;
if (vcm_.RegisterExternalEncoder(encoder, pl_type) != VCM_OK) {
if (vcm_.RegisterExternalEncoder(encoder, pl_type, internal_source) !=
VCM_OK) {
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo,
ViEId(engine_id_, channel_id_),
"Could not register external encoder");

View File

@ -70,7 +70,8 @@ class ViEEncoder
WebRtc_UWord8 NumberOfCodecs();
WebRtc_Word32 GetCodec(WebRtc_UWord8 list_index, VideoCodec* video_codec);
WebRtc_Word32 RegisterExternalEncoder(VideoEncoder* encoder,
WebRtc_UWord8 pl_type);
WebRtc_UWord8 pl_type,
bool internal_source);
WebRtc_Word32 DeRegisterExternalEncoder(WebRtc_UWord8 pl_type);
WebRtc_Word32 SetEncoder(const VideoCodec& video_codec);
WebRtc_Word32 GetEncoder(VideoCodec* video_codec);

View File

@ -67,7 +67,8 @@ ViEExternalCodecImpl::~ViEExternalCodecImpl() {
int ViEExternalCodecImpl::RegisterExternalSendCodec(const int video_channel,
const unsigned char pl_type,
VideoEncoder* encoder) {
VideoEncoder* encoder,
bool internal_source) {
WEBRTC_TRACE(kTraceApiCall, kTraceVideo, ViEId(shared_data_->instance_id()),
"%s channel %d pl_type %d encoder 0x%x", __FUNCTION__,
video_channel, pl_type, encoder);
@ -90,7 +91,8 @@ int ViEExternalCodecImpl::RegisterExternalSendCodec(const int video_channel,
return -1;
}
if (vie_encoder->RegisterExternalEncoder(encoder, pl_type) != 0) {
if (vie_encoder->RegisterExternalEncoder(encoder, pl_type, internal_source)
!= 0) {
shared_data_->SetLastError(kViECodecUnknownError);
return -1;
}

View File

@ -26,7 +26,8 @@ class ViEExternalCodecImpl
virtual int Release();
virtual int RegisterExternalSendCodec(const int video_channel,
const unsigned char pl_type,
VideoEncoder* encoder);
VideoEncoder* encoder,
bool internal_source = false);
virtual int DeRegisterExternalSendCodec(const int video_channel,
const unsigned char pl_type);
virtual int RegisterExternalReceiveCodec(const int video_channel,