Chromium Code Reviews| 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(); |
| + |
| + OnConnectionState(protocol::ConnectionToHost::FAILED, |
| + protocol::INCOMPATIBLE_PROTOCOL); |
|
Wez
2014/12/24 17:11:13
This seems a strange error to set in case of decod
Sergey Ulanov
2015/01/06 01:16:31
Added TODO to fix it.
|
| +} |
| + |
| 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 = |
|
Wez
2014/12/24 17:11:13
Rather than have this bool, it'd be more readable
Sergey Ulanov
2015/01/06 01:16:31
Done.
|
| 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); |
|
Wez
2014/12/24 17:11:13
Move this CHECK to after the if() block
Sergey Ulanov
2015/01/06 01:16:31
Done.
|
| + } |
| if (!plugin_view_.is_null()) |
| video_renderer_->OnViewChanged(plugin_view_); |