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

Side by Side Diff: cc/resources/video_resource_updater.h

Issue 13445009: cc: Move video upload to VideoResourceUpdater. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: consume textures that were produced Created 7 years, 8 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 | Annotate | Revision Log
« no previous file with comments | « cc/quads/yuv_video_draw_quad.cc ('k') | cc/resources/video_resource_updater.cc » ('j') | 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 2013 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 CC_RESOURCES_VIDEO_RESOURCE_UPDATER_H_
6 #define CC_RESOURCES_VIDEO_RESOURCE_UPDATER_H_
7
8 #include <vector>
9
10 #include "base/basictypes.h"
11 #include "base/memory/ref_counted.h"
12 #include "base/memory/scoped_ptr.h"
13 #include "cc/resources/texture_mailbox.h"
14
15 namespace media {
16 class SkCanvasVideoRenderer;
17 class VideoFrame;
18 }
19
20 namespace cc {
21 class ResourceProvider;
22
23 class VideoFrameExternalResources {
24 public:
25 // Specifies what type of data is contained in the mailboxes, as well as how
26 // many mailboxes will be present.
27 enum ResourceType {
28 NONE,
29 YUV_RESOURCE,
30 RGB_RESOURCE,
31 STREAM_TEXTURE_RESOURCE,
32 IO_SURFACE,
33
34 #if defined(GOOGLE_TV)
35 // TODO(danakj): Implement this with a solid color layer instead of a video
36 // frame and video layer.
37 HOLE,
38 #endif
39
40 // TODO(danakj): Remove this and abstract TextureMailbox into
41 // "ExternalResource" that can hold a hardware or software backing.
42 SOFTWARE_RESOURCE
43 };
44
45 ResourceType type;
46 std::vector<TextureMailbox> mailboxes;
47
48 // TODO(danakj): Remove these too.
49 std::vector<unsigned> software_resources;
50 TextureMailbox::ReleaseCallback software_release_callback;
51
52 VideoFrameExternalResources();
53 ~VideoFrameExternalResources();
54 };
55
56 // VideoResourceUpdater is by the video system to produce frame content as
57 // resources consumable by the compositor.
58 class VideoResourceUpdater {
59 public:
60 explicit VideoResourceUpdater(ResourceProvider* resource_provider);
61 ~VideoResourceUpdater();
62
63 VideoFrameExternalResources CreateForHardwarePlanes(
64 const scoped_refptr<media::VideoFrame>& video_frame,
65 const TextureMailbox::ReleaseCallback& release_callback);
66
67 VideoFrameExternalResources CreateForSoftwarePlanes(
68 const scoped_refptr<media::VideoFrame>& video_frame);
69
70 private:
71 bool VerifyFrame(const scoped_refptr<media::VideoFrame>& video_frame);
72
73 static void ReturnTexture(ResourceProvider* resource_provider,
74 TextureMailbox::ReleaseCallback callback,
75 unsigned texture_id,
76 gpu::Mailbox mailbox,
77 unsigned sync_point);
78
79 ResourceProvider* resource_provider_;
80 scoped_ptr<media::SkCanvasVideoRenderer> video_renderer_;
81
82 DISALLOW_COPY_AND_ASSIGN(VideoResourceUpdater);
83 };
84
85 } // namespace cc
86
87 #endif // CC_RESOURCES_VIDEO_RESOURCE_UPDATER_H_
OLDNEW
« no previous file with comments | « cc/quads/yuv_video_draw_quad.cc ('k') | cc/resources/video_resource_updater.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698