| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "cc/layers/video_frame_provider_client_impl.h" | 5 #include "cc/layers/video_frame_provider_client_impl.h" |
| 6 | 6 |
| 7 #include "cc/base/math_util.h" | 7 #include "cc/base/math_util.h" |
| 8 #include "cc/layers/video_layer_impl.h" | 8 #include "cc/layers/video_layer_impl.h" |
| 9 #include "media/base/video_frame.h" | 9 #include "media/base/video_frame.h" |
| 10 | 10 |
| 11 namespace cc { | 11 namespace cc { |
| 12 | 12 |
| 13 // static | 13 // static |
| 14 scoped_refptr<VideoFrameProviderClientImpl> | 14 scoped_refptr<VideoFrameProviderClientImpl> |
| 15 VideoFrameProviderClientImpl::Create( | 15 VideoFrameProviderClientImpl::Create( |
| 16 VideoFrameProvider* provider) { | 16 VideoFrameProvider* provider) { |
| 17 return make_scoped_refptr( | 17 return make_scoped_refptr( |
| 18 new VideoFrameProviderClientImpl(provider)); | 18 new VideoFrameProviderClientImpl(provider)); |
| 19 } | 19 } |
| 20 | 20 |
| 21 VideoFrameProviderClientImpl::~VideoFrameProviderClientImpl() {} | 21 VideoFrameProviderClientImpl::~VideoFrameProviderClientImpl() {} |
| 22 | 22 |
| 23 VideoFrameProviderClientImpl::VideoFrameProviderClientImpl( | 23 VideoFrameProviderClientImpl::VideoFrameProviderClientImpl( |
| 24 VideoFrameProvider* provider) | 24 VideoFrameProvider* provider) |
| 25 : provider_(provider) { | 25 : active_video_layer_(NULL), provider_(provider) { |
| 26 // This only happens during a commit on the compositor thread while the main | 26 // This only happens during a commit on the compositor thread while the main |
| 27 // thread is blocked. That makes this a thread-safe call to set the video | 27 // thread is blocked. That makes this a thread-safe call to set the video |
| 28 // frame provider client that does not require a lock. The same is true of | 28 // frame provider client that does not require a lock. The same is true of |
| 29 // the call to Stop(). | 29 // the call to Stop(). |
| 30 provider_->SetVideoFrameProviderClient(this); | 30 provider_->SetVideoFrameProviderClient(this); |
| 31 | 31 |
| 32 // This matrix is the default transformation for stream textures, and flips | 32 // This matrix is the default transformation for stream textures, and flips |
| 33 // on the Y axis. | 33 // on the Y axis. |
| 34 stream_texture_matrix_ = gfx::Transform( | 34 stream_texture_matrix_ = gfx::Transform( |
| 35 1.0, 0.0, 0.0, 0.0, | 35 1.0, 0.0, 0.0, 0.0, |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 81 stream_texture_matrix_ = gfx::Transform( | 81 stream_texture_matrix_ = gfx::Transform( |
| 82 matrix[0], matrix[4], matrix[8], matrix[12], | 82 matrix[0], matrix[4], matrix[8], matrix[12], |
| 83 matrix[1], matrix[5], matrix[9], matrix[13], | 83 matrix[1], matrix[5], matrix[9], matrix[13], |
| 84 matrix[2], matrix[6], matrix[10], matrix[14], | 84 matrix[2], matrix[6], matrix[10], matrix[14], |
| 85 matrix[3], matrix[7], matrix[11], matrix[15]); | 85 matrix[3], matrix[7], matrix[11], matrix[15]); |
| 86 if (active_video_layer_) | 86 if (active_video_layer_) |
| 87 active_video_layer_->SetNeedsRedraw(); | 87 active_video_layer_->SetNeedsRedraw(); |
| 88 } | 88 } |
| 89 | 89 |
| 90 } // namespace cc | 90 } // namespace cc |
| OLD | NEW |