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

Unified Diff: content/common/gpu/media/gpu_video_decode_accelerator.h

Issue 24762003: Set the texture to cleared in VideoDecodeAccelerator::PictureReady. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address review comments Created 7 years, 3 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
Index: content/common/gpu/media/gpu_video_decode_accelerator.h
diff --git a/content/common/gpu/media/gpu_video_decode_accelerator.h b/content/common/gpu/media/gpu_video_decode_accelerator.h
index e085c537232496a3273d193583f9f50992056e0e..009f112ab40454757171d87589f4a92603a9f7ed 100644
--- a/content/common/gpu/media/gpu_video_decode_accelerator.h
+++ b/content/common/gpu/media/gpu_video_decode_accelerator.h
@@ -5,6 +5,7 @@
#ifndef CONTENT_COMMON_GPU_MEDIA_GPU_VIDEO_DECODE_ACCELERATOR_H_
#define CONTENT_COMMON_GPU_MEDIA_GPU_VIDEO_DECODE_ACCELERATOR_H_
+#include <map>
#include <vector>
#include "base/compiler_specific.h"
@@ -12,6 +13,7 @@
#include "base/memory/shared_memory.h"
#include "content/common/gpu/gpu_command_buffer_stub.h"
#include "content/common/gpu/media/video_decode_accelerator_impl.h"
+#include "gpu/command_buffer/service/texture_manager.h"
#include "ipc/ipc_listener.h"
#include "ipc/ipc_sender.h"
#include "media/video/video_decode_accelerator.h"
@@ -81,6 +83,9 @@ class GpuVideoDecodeAccelerator
// Called on IO thread when |filter_| has been removed.
void OnFilterRemoved();
+ // Sets the texture to cleared. Returns false if an error has occurred.
+ bool SetTextureCleared(const media::Picture& picture);
+
// Message to Send() when initialization is done. Is only non-NULL during
// initialization and is owned by the IPC channel underlying the
// GpuCommandBufferStub.
@@ -117,6 +122,13 @@ class GpuVideoDecodeAccelerator
// Weak pointers will be invalidated on IO thread.
base::WeakPtrFactory<Client> weak_factory_for_io_;
+ // Protects |uncleared_texture_| when DCHECK is on. This is for debugging
Ami GONE FROM CHROMIUM 2013/09/30 18:03:03 s/uncleared_texture_/uncleared_textures_/
wuchengli 2013/10/01 03:49:43 Done.
+ // only. We don't want to hold a lock on IO thread.
Ami GONE FROM CHROMIUM 2013/09/30 18:03:03 You should explicate that the reason this is ok is
wuchengli 2013/10/01 03:49:43 Done.
+ base::Lock lock_;
Ami GONE FROM CHROMIUM 2013/09/30 18:03:03 s/lock_/debug_uncleared_textures_lock_/
wuchengli 2013/10/01 03:49:43 Done.
+
+ // A map from picture buffer ID to TextureRef that have not been cleared.
+ std::map<int32, scoped_refptr<gpu::gles2::TextureRef> > uncleared_textures_;
+
DISALLOW_IMPLICIT_CONSTRUCTORS(GpuVideoDecodeAccelerator);
};

Powered by Google App Engine
This is Rietveld 408576698