diff options
author | simonmorris@chromium.org <simonmorris@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-05-25 22:19:15 +0000 |
---|---|---|
committer | simonmorris@chromium.org <simonmorris@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-05-25 22:19:15 +0000 |
commit | d8631304fc6aca953f3cb9410a23c7cb3f12c70f (patch) | |
tree | 3c7c9b23c639dfcca15262bfe8c4f2bd5ec96311 /remoting/client | |
parent | d63d7b2c71f50509bdd41c648d8ac1b90683dc19 (diff) | |
download | chromium_src-d8631304fc6aca953f3cb9410a23c7cb3f12c70f.zip chromium_src-d8631304fc6aca953f3cb9410a23c7cb3f12c70f.tar.gz chromium_src-d8631304fc6aca953f3cb9410a23c7cb3f12c70f.tar.bz2 |
[Chromoting] Make the client plugin tell the webapp when the first video buffer arrives.
A follow-up CL will make the pyauto test wait until the first video buffer
arrives before declaring that a connection has succeeded.
BUG=129791
Review URL: https://chromiumcodereview.appspot.com/10444035
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@139131 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'remoting/client')
-rw-r--r-- | remoting/client/plugin/chromoting_instance.cc | 5 | ||||
-rw-r--r-- | remoting/client/plugin/chromoting_instance.h | 1 | ||||
-rw-r--r-- | remoting/client/plugin/pepper_view.cc | 7 | ||||
-rw-r--r-- | remoting/client/plugin/pepper_view.h | 3 |
4 files changed, 15 insertions, 1 deletions
diff --git a/remoting/client/plugin/chromoting_instance.cc b/remoting/client/plugin/chromoting_instance.cc index 6dc05c7..fec261e 100644 --- a/remoting/client/plugin/chromoting_instance.cc +++ b/remoting/client/plugin/chromoting_instance.cc @@ -385,6 +385,11 @@ void ChromotingInstance::SetConnectionState( GetScriptableObject()->SetConnectionStatus(state, error); } +void ChromotingInstance::OnFirstFrameReceived() { + scoped_ptr<base::DictionaryValue> data(new base::DictionaryValue()); + PostChromotingMessage("onFirstFrameReceived", data.Pass()); +} + ChromotingScriptableObject* ChromotingInstance::GetScriptableObject() { pp::VarPrivate object = GetInstanceObject(); if (!object.is_undefined()) { diff --git a/remoting/client/plugin/chromoting_instance.h b/remoting/client/plugin/chromoting_instance.h index ca86827..a489bde 100644 --- a/remoting/client/plugin/chromoting_instance.h +++ b/remoting/client/plugin/chromoting_instance.h @@ -132,6 +132,7 @@ class ChromotingInstance : // Called by PepperView. void SetDesktopSize(int width, int height); void SetConnectionState(ConnectionState state, ConnectionError error); + void OnFirstFrameReceived(); // Convenience wrapper to get the ChromotingScriptableObject. ChromotingScriptableObject* GetScriptableObject(); diff --git a/remoting/client/plugin/pepper_view.cc b/remoting/client/plugin/pepper_view.cc index 6b67eac..8aa9f11 100644 --- a/remoting/client/plugin/pepper_view.cc +++ b/remoting/client/plugin/pepper_view.cc @@ -78,7 +78,8 @@ PepperView::PepperView(ChromotingInstance* instance, clip_area_(SkIRect::MakeEmpty()), source_size_(SkISize::Make(0, 0)), flush_pending_(false), - is_initialized_(false) { + is_initialized_(false), + frame_received_(false) { } PepperView::~PepperView() { @@ -185,6 +186,10 @@ void PepperView::ApplyBuffer(const SkISize& view_size, const SkRegion& region) { DCHECK(context_->main_message_loop()->BelongsToCurrentThread()); + if (!frame_received_) { + instance_->OnFirstFrameReceived(); + frame_received_ = true; + } // Currently we cannot use the data in the buffer is scale factor has changed // already. // TODO(alexeypa): We could rescale and draw it (or even draw it without diff --git a/remoting/client/plugin/pepper_view.h b/remoting/client/plugin/pepper_view.h index 03e02b1..4aa1857 100644 --- a/remoting/client/plugin/pepper_view.h +++ b/remoting/client/plugin/pepper_view.h @@ -115,6 +115,9 @@ class PepperView : public ChromotingView, // True after Initialize() has been called, until TearDown(). bool is_initialized_; + // True after the first call to ApplyBuffer(). + bool frame_received_; + DISALLOW_COPY_AND_ASSIGN(PepperView); }; |