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

Unified Diff: remoting/client/plugin/chromoting_instance.cc

Issue 820823002: Implement video renderer based on VideoDecode API. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years 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
Index: remoting/client/plugin/chromoting_instance.cc
diff --git a/remoting/client/plugin/chromoting_instance.cc b/remoting/client/plugin/chromoting_instance.cc
index 25852106452e825d72ac38b5e4a45292e2d20733..9be7a574e1f1ff3bb066afc9ca6c6b6986e72d8d 100644
--- a/remoting/client/plugin/chromoting_instance.cc
+++ b/remoting/client/plugin/chromoting_instance.cc
@@ -44,6 +44,7 @@
#include "remoting/client/plugin/pepper_mouse_locker.h"
#include "remoting/client/plugin/pepper_port_allocator.h"
#include "remoting/client/plugin/pepper_video_renderer_2d.h"
+#include "remoting/client/plugin/pepper_video_renderer_3d.h"
#include "remoting/client/software_video_renderer.h"
#include "remoting/client/token_fetcher_proxy.h"
#include "remoting/protocol/connection_to_host.h"
@@ -383,6 +384,15 @@ bool ChromotingInstance::HandleInputEvent(const pp::InputEvent& event) {
return input_handler_.HandleInputEvent(event);
}
+void ChromotingInstance::OnVideoDecoderFailed() {
+ mouse_input_filter_.set_input_stub(NULL);
+ client_.reset();
+ video_renderer_.reset();
Wez 2014/12/24 17:11:13 These are the same steps we perform in HandleDisco
Sergey Ulanov 2015/01/06 01:16:31 Done.
+
+ OnConnectionState(protocol::ConnectionToHost::FAILED,
+ protocol::INCOMPATIBLE_PROTOCOL);
Wez 2014/12/24 17:11:13 nit: Please add a one-line comment to clarify that
Sergey Ulanov 2015/01/06 01:16:31 Done.
+}
+
void ChromotingInstance::OnVideoFirstFrameReceived() {
scoped_ptr<base::DictionaryValue> data(new base::DictionaryValue());
PostLegacyJsonMessage("onFirstFrameReceived", data.Pass());
@@ -624,10 +634,20 @@ void ChromotingInstance::HandleConnect(const base::DictionaryValue& data) {
#endif
input_handler_.set_input_stub(normalizing_input_filter_.get());
- video_renderer_.reset(new PepperVideoRenderer2D());
+ video_renderer_.reset(new PepperVideoRenderer3D());
bool initialized =
video_renderer_->Initialize(this, context_, this);
- CHECK(initialized);
+
+ // If we failed to initialize 3D renderer (because there is no hardware
+ // support on this machine) then use the 2D renderer.
+ if (!initialized) {
+ LOG(WARNING)
+ << "Failed to initialize 3D renderer. Using 2D renderer instead.";
+ video_renderer_.reset(new PepperVideoRenderer2D());
+ bool initialized =
+ video_renderer_->Initialize(this, context_, this);
+ CHECK(initialized);
+ }
if (!plugin_view_.is_null())
video_renderer_->OnViewChanged(plugin_view_);

Powered by Google App Engine
This is Rietveld 408576698