Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(61)

Unified Diff: media/engine/webrtcmediaengine.cc

Issue 3004353002: Expose new video codec factories in the PeerConnectionFactory API (Closed)
Patch Set: Add build dependency Created 3 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « media/engine/webrtcmediaengine.h ('k') | pc/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/engine/webrtcmediaengine.cc
diff --git a/media/engine/webrtcmediaengine.cc b/media/engine/webrtcmediaengine.cc
index 99b6041a185123347eb0971431dc9b0a3f33ff79..888b6a9d985e39a995c66f3d55935a1c0ed60cc1 100644
--- a/media/engine/webrtcmediaengine.cc
+++ b/media/engine/webrtcmediaengine.cc
@@ -14,6 +14,8 @@
#include "api/audio_codecs/builtin_audio_decoder_factory.h"
#include "api/audio_codecs/builtin_audio_encoder_factory.h"
+#include "api/video_codecs/video_decoder_factory.h"
+#include "api/video_codecs/video_encoder_factory.h"
#include "media/engine/webrtcvoiceengine.h"
#ifdef HAVE_WEBRTC_VIDEO
@@ -121,6 +123,32 @@ MediaEngineInterface* WebRtcMediaEngineFactory::Create(
video_decoder_factory, audio_mixer, audio_processing);
}
+std::unique_ptr<MediaEngineInterface> WebRtcMediaEngineFactory::Create(
+ rtc::scoped_refptr<webrtc::AudioDeviceModule> adm,
+ rtc::scoped_refptr<webrtc::AudioEncoderFactory> audio_encoder_factory,
+ rtc::scoped_refptr<webrtc::AudioDecoderFactory> audio_decoder_factory,
+ std::unique_ptr<webrtc::VideoEncoderFactory> video_encoder_factory,
+ std::unique_ptr<webrtc::VideoDecoderFactory> video_decoder_factory,
+ rtc::scoped_refptr<webrtc::AudioMixer> audio_mixer,
+ rtc::scoped_refptr<webrtc::AudioProcessing> audio_processing) {
+#ifdef HAVE_WEBRTC_VIDEO
+ typedef WebRtcVideoEngine VideoEngine;
+ std::tuple<std::unique_ptr<webrtc::VideoEncoderFactory>,
+ std::unique_ptr<webrtc::VideoDecoderFactory>>
+ video_args(std::move(video_encoder_factory),
+ std::move(video_decoder_factory));
+#else
+ typedef NullWebRtcVideoEngine VideoEngine;
+ std::tuple<> video_args;
+#endif
+ return std::unique_ptr<MediaEngineInterface>(
+ new CompositeMediaEngine<WebRtcVoiceEngine, VideoEngine>(
+ std::forward_as_tuple(adm, audio_encoder_factory,
+ audio_decoder_factory, audio_mixer,
+ audio_processing),
+ std::move(video_args)));
+}
+
namespace {
// Remove mutually exclusive extensions with lower priority.
void DiscardRedundantExtensions(
« no previous file with comments | « media/engine/webrtcmediaengine.h ('k') | pc/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698