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

Unified Diff: remoting/host/chromoting_host.cc

Issue 4229003: Add VideoReader and VideoWriter interfaces. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: - Created 10 years, 1 month 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 | « remoting/host/chromoting_host.h ('k') | remoting/host/client_connection.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/host/chromoting_host.cc
diff --git a/remoting/host/chromoting_host.cc b/remoting/host/chromoting_host.cc
index 21a95be29913d92467a572ce714eae1ce7b4ac6d..d77e23c6e80ddcc1270b86ae2087ade254b1bf7d 100644
--- a/remoting/host/chromoting_host.cc
+++ b/remoting/host/chromoting_host.cc
@@ -9,24 +9,26 @@
#include "build/build_config.h"
#include "remoting/base/constants.h"
#include "remoting/base/encoder.h"
+#include "remoting/base/encoder_verbatim.h"
+#include "remoting/base/encoder_vp8.h"
+#include "remoting/base/encoder_zlib.h"
#include "remoting/host/chromoting_host_context.h"
#include "remoting/host/capturer.h"
#include "remoting/host/event_executor.h"
#include "remoting/host/host_config.h"
#include "remoting/host/session_manager.h"
#include "remoting/protocol/jingle_chromotocol_server.h"
+#include "remoting/protocol/chromotocol_config.h"
namespace remoting {
ChromotingHost::ChromotingHost(ChromotingHostContext* context,
MutableHostConfig* config,
Capturer* capturer,
- Encoder* encoder,
EventExecutor* executor)
: context_(context),
config_(config),
capturer_(capturer),
- encoder_(encoder),
executor_(executor),
state_(kInitial) {
}
@@ -140,12 +142,14 @@ void ChromotingHost::OnClientConnected(ClientConnection* client) {
// Then we create a SessionManager passing the message loops that
// it should run on.
DCHECK(capturer_.get());
- DCHECK(encoder_.get());
+
+ Encoder* encoder = CreateEncoder(client->connection()->config());
+
session_ = new SessionManager(context_->capture_message_loop(),
context_->encode_message_loop(),
context_->main_message_loop(),
- capturer_.get(),
- encoder_.get());
+ capturer_.release(),
+ encoder);
}
// Immediately add the client and start the session.
@@ -285,4 +289,24 @@ void ChromotingHost::OnServerClosed() {
// Don't need to do anything here.
}
+// TODO(sergeyu): Move this to SessionManager?
+Encoder* ChromotingHost::CreateEncoder(const ChromotocolConfig* config) {
+ const ChannelConfig& video_config = config->video_config();
+
+ if (video_config.codec == ChannelConfig::CODEC_VERBATIM) {
+ return new remoting::EncoderVerbatim();
+ } else if (video_config.codec == ChannelConfig::CODEC_ZIP) {
+ return new remoting::EncoderZlib();
+ }
+ // TODO(sergeyu): Enable VP8 on ARM builds.
+#if !defined(ARCH_CPU_ARM_FAMILY)
+ else if (video_config.codec == ChannelConfig::CODEC_VP8) {
+ return new remoting::EncoderVp8();
+ }
+#endif
+
+ return NULL;
+}
+
+
} // namespace remoting
« no previous file with comments | « remoting/host/chromoting_host.h ('k') | remoting/host/client_connection.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698