OLD | NEW |
(Empty) | |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef _MEDIA_BASE_ANDROID_STREAM_TEXTURE_WRAPPER_H_ |
| 6 #define _MEDIA_BASE_ANDROID_STREAM_TEXTURE_WRAPPER_H_ |
| 7 |
| 8 #include "media/base/video_frame.h" |
| 9 #include "media/blink/media_blink_export.h" |
| 10 |
| 11 namespace media { |
| 12 class VideoFrame; |
| 13 |
| 14 // Interface defining a class wrapping the initialization and registration |
| 15 // of a StreamTexture, along with a way to access the wrapped underlying Texture |
| 16 // via a VideoFrame. |
| 17 // |
| 18 // TODO(tguilbert): Support registering the underlying SurfaceTexture so it can |
| 19 // be used by a MediaPlayer in the browser process. See crbug.com/627658. |
| 20 class StreamTextureWrapper { |
| 21 public: |
| 22 StreamTextureWrapper() {} |
| 23 virtual ~StreamTextureWrapper() {} |
| 24 |
| 25 // TODO(tguilbert): Update comment for |main_task_runner| |
| 26 // Initialize and start providing frames if possible. |
| 27 // The provided |task_runner| will be used to "signal" new frames (and most |
| 28 // likely should be the compositor's TaskRunner). |
| 29 virtual void Initialize( |
| 30 cc::VideoFrameProvider::Client* client, |
| 31 const gfx::Size& natural_size, |
| 32 const scoped_refptr<base::SingleThreadTaskRunner>& media_task_runner, |
| 33 const base::Closure& init_cb) = 0; |
| 34 |
| 35 // Should be called whenever the Video's natural size changes. |
| 36 virtual void UpdateTextureSize(const gfx::Size& natural_size) = 0; |
| 37 |
| 38 // Returns the latest frame. |
| 39 virtual scoped_refptr<VideoFrame> GetCurrentFrame(); |
| 40 }; |
| 41 |
| 42 } // namespace media |
| 43 |
| 44 #endif // _MEDIA_BASE_ANDROID_STREAM_TEXTURE_WRAPPER_H_ |
OLD | NEW |