(Auto)update libjingle 62364298-> 62368661

git-svn-id: http://webrtc.googlecode.com/svn/trunk@5629 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
henrike@webrtc.org 2014-03-03 16:47:01 +00:00
parent 10adbeff78
commit 31413dc635
6 changed files with 61 additions and 8 deletions

View File

@ -1,3 +1,4 @@
set noparent
hellner@google.com
juberti@google.com
mallinath@google.com

View File

@ -45,9 +45,6 @@
#include "talk/examples/call/console.h"
#include "talk/examples/call/mediaenginefactory.h"
#include "talk/p2p/base/constants.h"
#ifdef ANDROID
#include "talk/media/other/androidmediaengine.h"
#endif
#include "talk/session/media/mediasessionclient.h"
#include "talk/session/media/srtpfilter.h"
#include "talk/xmpp/xmppauth.h"
@ -185,7 +182,7 @@ static const int DEFAULT_PORT = 5222;
static std::vector<cricket::AudioCodec> codecs;
static const cricket::AudioCodec ISAC(103, "ISAC", 40000, 16000, 1, 0);
cricket::MediaEngine *AndroidMediaEngineFactory() {
cricket::MediaEngineInterface *CreateAndroidMediaEngine() {
cricket::FakeMediaEngine *engine = new cricket::FakeMediaEngine();
codecs.push_back(ISAC);
@ -438,7 +435,7 @@ int main(int argc, char **argv) {
}
#ifdef ANDROID
InitAndroidMediaEngineFactory(AndroidMediaEngineFactory);
MediaEngineFactory::SetCreateFunction(&CreateAndroidMediaEngine);
#endif
#if WIN32

View File

@ -42,6 +42,13 @@ const int MediaEngineInterface::kDefaultAudioDelayOffset = 0;
#if defined(HAVE_WEBRTC_VIDEO)
#include "talk/media/webrtc/webrtcvideoengine.h"
#endif // HAVE_WEBRTC_VIDEO
#if defined(HAVE_LMI)
#include "talk/media/base/hybridvideoengine.h"
#include "talk/media/lmi/lmimediaengine.h"
#endif // HAVE_LMI
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif // HAVE_CONFIG
namespace cricket {
#if defined(HAVE_WEBRTC_VOICE)
@ -51,22 +58,59 @@ namespace cricket {
#endif
#if defined(HAVE_WEBRTC_VIDEO)
#if !defined(HAVE_LMI)
template<>
CompositeMediaEngine<WebRtcVoiceEngine, WebRtcVideoEngine>::
CompositeMediaEngine() {
video_.SetVoiceEngine(&voice_);
}
#define VIDEO_ENG_NAME WebRtcVideoEngine
#else
// If we have both WebRtcVideoEngine and LmiVideoEngine, enable dual-stack.
// This small class here allows us to hook the WebRtcVideoChannel up to
// the capturer owned by the LMI engine, without infecting the rest of the
// HybridVideoEngine classes with this abstraction violation.
class WebRtcLmiHybridVideoEngine
: public HybridVideoEngine<WebRtcVideoEngine, LmiVideoEngine> {
public:
void SetVoiceEngine(WebRtcVoiceEngine* engine) {
video1_.SetVoiceEngine(engine);
}
};
template<>
CompositeMediaEngine<WebRtcVoiceEngine, WebRtcLmiHybridVideoEngine>::
CompositeMediaEngine() {
video_.SetVoiceEngine(&voice_);
}
#define VIDEO_ENG_NAME WebRtcLmiHybridVideoEngine
#endif
#elif defined(HAVE_LMI)
#define VIDEO_ENG_NAME LmiVideoEngine
#else
#define VIDEO_ENG_NAME NullVideoEngine
#endif
MediaEngineFactory::MediaEngineCreateFunction
MediaEngineFactory::create_function_ = NULL;
MediaEngineFactory::MediaEngineCreateFunction
MediaEngineFactory::SetCreateFunction(MediaEngineCreateFunction function) {
MediaEngineCreateFunction old_function = create_function_;
create_function_ = function;
return old_function;
};
MediaEngineInterface* MediaEngineFactory::Create() {
if (create_function_) {
return create_function_();
} else {
#if defined(HAVE_LINPHONE)
return new LinphoneMediaEngine("", "");
return new LinphoneMediaEngine("", "");
#elif defined(AUDIO_ENG_NAME) && defined(VIDEO_ENG_NAME)
return new CompositeMediaEngine<AUDIO_ENG_NAME, VIDEO_ENG_NAME>();
return new CompositeMediaEngine<AUDIO_ENG_NAME, VIDEO_ENG_NAME>();
#else
return new NullMediaEngine();
return new NullMediaEngine();
#endif
}
}
}; // namespace cricket

View File

@ -157,7 +157,18 @@ class MediaEngineInterface {
#if !defined(DISABLE_MEDIA_ENGINE_FACTORY)
class MediaEngineFactory {
public:
typedef cricket::MediaEngineInterface* (*MediaEngineCreateFunction)();
// Creates a media engine, using either the compiled system default or the
// creation function specified in SetCreateFunction, if specified.
static MediaEngineInterface* Create();
// Sets the function used when calling Create. If unset, the compiled system
// default will be used. Returns the old create function, or NULL if one
// wasn't set. Likewise, NULL can be used as the |function| parameter to
// reset to the default behavior.
static MediaEngineCreateFunction SetCreateFunction(
MediaEngineCreateFunction function);
private:
static MediaEngineCreateFunction create_function_;
};
#endif

View File

View File