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

Side by Side Diff: media/blink/stream_texture_wrapper.h

Issue 2136103010: Add StreamTextureWrapper/StreamTextureWrapperImpl (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Adding CONTENT_EXPORT to StreamTextureFactory Created 4 years, 4 months 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 unified diff | Download patch
« no previous file with comments | « media/blink/BUILD.gn ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(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_BLINK_STREAM_TEXTURE_WRAPPER_H_
6 #define MEDIA_BLINK_STREAM_TEXTURE_WRAPPER_H_
7
8 #include "cc/layers/video_frame_provider.h"
9 #include "media/base/video_frame.h"
10
11 namespace media {
12 class VideoFrame;
13
14 // StreamTextureWrapper encapsulates a StreamTexture's creation, initialization
15 // and registration for later retrieval (in the Browser process).
16 //
17 // TODO(tguilbert): Support registering the underlying SurfaceTexture so it can
18 // be used by a MediaPlayer in the browser process. See crbug.com/627658.
19 class MEDIA_EXPORT StreamTextureWrapper {
20 public:
21 StreamTextureWrapper() {}
22
23 // Initialize the underlying StreamTexture.
24 // See StreamTextureWrapperImpl.
25 virtual void Initialize(
26 cc::VideoFrameProvider::Client* client,
27 const gfx::Size& natural_size,
28 scoped_refptr<base::SingleThreadTaskRunner> compositor_task_runner,
29 const base::Closure& init_cb) = 0;
30
31 // Called whenever the video's natural size changes.
32 // See StreamTextureWrapperImpl.
33 virtual void UpdateTextureSize(const gfx::Size& natural_size) = 0;
34
35 // Returns the latest frame.
36 // See StreamTextureWrapperImpl.
37 virtual scoped_refptr<VideoFrame> GetCurrentFrame() = 0;
38
39 struct Deleter {
40 inline void operator()(StreamTextureWrapper* ptr) const { ptr->Destroy(); }
41 };
42
43 protected:
44 virtual ~StreamTextureWrapper() {}
45
46 // Safely destroys the StreamTextureWrapper.
47 // See StreamTextureWrapperImpl.
48 virtual void Destroy() = 0;
49 };
50
51 typedef std::unique_ptr<StreamTextureWrapper, StreamTextureWrapper::Deleter>
52 ScopedStreamTextureWrapper;
53
54 } // namespace media
55
56 #endif // MEDIA_BLINK_STREAM_TEXTURE_WRAPPER_H_
OLDNEW
« no previous file with comments | « media/blink/BUILD.gn ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698