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

Side by Side Diff: media/base/android/stream_texture_wrapper.h

Issue 2556983002: Fix SetStreamTextureSize crash (Closed)
Patch Set: Addressed comments Created 4 years 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 | « content/renderer/media/android/stream_texture_wrapper_impl.cc ('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
1 // Copyright 2016 The Chromium Authors. All rights reserved. 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 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 #ifndef MEDIA_BASE_ANDROID_STREAM_TEXTURE_WRAPPER_H_ 5 #ifndef MEDIA_BASE_ANDROID_STREAM_TEXTURE_WRAPPER_H_
6 #define MEDIA_BASE_ANDROID_STREAM_TEXTURE_WRAPPER_H_ 6 #define MEDIA_BASE_ANDROID_STREAM_TEXTURE_WRAPPER_H_
7 7
8 #include "base/single_thread_task_runner.h" 8 #include "base/single_thread_task_runner.h"
9 #include "base/unguessable_token.h" 9 #include "base/unguessable_token.h"
10 #include "media/base/video_frame.h" 10 #include "media/base/video_frame.h"
11 11
12 namespace media { 12 namespace media {
13 13
14 // StreamTextureWrapper encapsulates a StreamTexture's creation, initialization 14 // StreamTextureWrapper encapsulates a StreamTexture's creation, initialization
15 // and registration for later retrieval (in the Browser process). 15 // and registration for later retrieval (in the Browser process).
16 class MEDIA_EXPORT StreamTextureWrapper { 16 class MEDIA_EXPORT StreamTextureWrapper {
17 public: 17 public:
18 using StreamTextureWrapperInitCB = base::Callback<void(bool)>;
19
18 StreamTextureWrapper() {} 20 StreamTextureWrapper() {}
19 21
20 // Initialize the underlying StreamTexture. 22 // Initialize the underlying StreamTexture.
21 // See StreamTextureWrapperImpl. 23 // See StreamTextureWrapperImpl.
22 virtual void Initialize( 24 virtual void Initialize(
23 const base::Closure& received_frame_cb, 25 const base::Closure& received_frame_cb,
24 const gfx::Size& natural_size, 26 const gfx::Size& natural_size,
25 scoped_refptr<base::SingleThreadTaskRunner> compositor_task_runner, 27 scoped_refptr<base::SingleThreadTaskRunner> compositor_task_runner,
26 const base::Closure& init_cb) = 0; 28 const StreamTextureWrapperInitCB& init_cb) = 0;
27 29
28 // Called whenever the video's natural size changes. 30 // Called whenever the video's natural size changes.
29 // See StreamTextureWrapperImpl. 31 // See StreamTextureWrapperImpl.
30 virtual void UpdateTextureSize(const gfx::Size& natural_size) = 0; 32 virtual void UpdateTextureSize(const gfx::Size& natural_size) = 0;
31 33
32 // Returns the latest frame. 34 // Returns the latest frame.
33 // See StreamTextureWrapperImpl. 35 // See StreamTextureWrapperImpl.
34 virtual scoped_refptr<VideoFrame> GetCurrentFrame() = 0; 36 virtual scoped_refptr<VideoFrame> GetCurrentFrame() = 0;
35 37
36 // Sends the StreamTexture to the browser process, to fulfill the request 38 // Sends the StreamTexture to the browser process, to fulfill the request
(...skipping 13 matching lines...) Expand all
50 // See StreamTextureWrapperImpl. 52 // See StreamTextureWrapperImpl.
51 virtual void Destroy() = 0; 53 virtual void Destroy() = 0;
52 }; 54 };
53 55
54 typedef std::unique_ptr<StreamTextureWrapper, StreamTextureWrapper::Deleter> 56 typedef std::unique_ptr<StreamTextureWrapper, StreamTextureWrapper::Deleter>
55 ScopedStreamTextureWrapper; 57 ScopedStreamTextureWrapper;
56 58
57 } // namespace media 59 } // namespace media
58 60
59 #endif // MEDIA_BASE_ANDROID_STREAM_TEXTURE_WRAPPER_H_ 61 #endif // MEDIA_BASE_ANDROID_STREAM_TEXTURE_WRAPPER_H_
OLDNEW
« no previous file with comments | « content/renderer/media/android/stream_texture_wrapper_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698