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

Unified 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 side-by-side diff with in-line comments
Download patch
« 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 »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/resources/video_resource_updater.h
diff --git a/cc/resources/video_resource_updater.h b/cc/resources/video_resource_updater.h
new file mode 100644
index 0000000000000000000000000000000000000000..fba59fca999e168e59ae83544fb632d798f89b1d
--- /dev/null
+++ b/cc/resources/video_resource_updater.h
@@ -0,0 +1,87 @@
+// Copyright 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CC_RESOURCES_VIDEO_RESOURCE_UPDATER_H_
+#define CC_RESOURCES_VIDEO_RESOURCE_UPDATER_H_
+
+#include <vector>
+
+#include "base/basictypes.h"
+#include "base/memory/ref_counted.h"
+#include "base/memory/scoped_ptr.h"
+#include "cc/resources/texture_mailbox.h"
+
+namespace media {
+class SkCanvasVideoRenderer;
+class VideoFrame;
+}
+
+namespace cc {
+class ResourceProvider;
+
+class VideoFrameExternalResources {
+ public:
+ // Specifies what type of data is contained in the mailboxes, as well as how
+ // many mailboxes will be present.
+ enum ResourceType {
+ NONE,
+ YUV_RESOURCE,
+ RGB_RESOURCE,
+ STREAM_TEXTURE_RESOURCE,
+ IO_SURFACE,
+
+#if defined(GOOGLE_TV)
+ // TODO(danakj): Implement this with a solid color layer instead of a video
+ // frame and video layer.
+ HOLE,
+#endif
+
+ // TODO(danakj): Remove this and abstract TextureMailbox into
+ // "ExternalResource" that can hold a hardware or software backing.
+ SOFTWARE_RESOURCE
+ };
+
+ ResourceType type;
+ std::vector<TextureMailbox> mailboxes;
+
+ // TODO(danakj): Remove these too.
+ std::vector<unsigned> software_resources;
+ TextureMailbox::ReleaseCallback software_release_callback;
+
+ VideoFrameExternalResources();
+ ~VideoFrameExternalResources();
+};
+
+// VideoResourceUpdater is by the video system to produce frame content as
+// resources consumable by the compositor.
+class VideoResourceUpdater {
+ public:
+ explicit VideoResourceUpdater(ResourceProvider* resource_provider);
+ ~VideoResourceUpdater();
+
+ VideoFrameExternalResources CreateForHardwarePlanes(
+ const scoped_refptr<media::VideoFrame>& video_frame,
+ const TextureMailbox::ReleaseCallback& release_callback);
+
+ VideoFrameExternalResources CreateForSoftwarePlanes(
+ const scoped_refptr<media::VideoFrame>& video_frame);
+
+ private:
+ bool VerifyFrame(const scoped_refptr<media::VideoFrame>& video_frame);
+
+ static void ReturnTexture(ResourceProvider* resource_provider,
+ TextureMailbox::ReleaseCallback callback,
+ unsigned texture_id,
+ gpu::Mailbox mailbox,
+ unsigned sync_point);
+
+ ResourceProvider* resource_provider_;
+ scoped_ptr<media::SkCanvasVideoRenderer> video_renderer_;
+
+ DISALLOW_COPY_AND_ASSIGN(VideoResourceUpdater);
+};
+
+} // namespace cc
+
+#endif // CC_RESOURCES_VIDEO_RESOURCE_UPDATER_H_
« 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