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

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

Issue 7361010: Enable fire-and-forget Destroy of HW video decoder, and misc other improvements. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: vrk CR responses. Created 9 years, 5 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/omx_video_decode_accelerator.h
diff --git a/content/common/gpu/media/omx_video_decode_accelerator.h b/content/common/gpu/media/omx_video_decode_accelerator.h
index 4c246d0553482f244ea416cbf8bd3f03d7bddd4c..edced282a9248fa982c0325214f219cfd1b90743 100644
--- a/content/common/gpu/media/omx_video_decode_accelerator.h
+++ b/content/common/gpu/media/omx_video_decode_accelerator.h
@@ -15,7 +15,9 @@
#include "base/bind.h"
#include "base/callback.h"
+#include "base/compiler_specific.h"
#include "base/logging.h"
+#include "base/memory/ref_counted.h"
#include "base/message_loop.h"
#include "base/shared_memory.h"
#include "media/video/video_decode_accelerator.h"
@@ -31,12 +33,13 @@
//
// This class lives on a single thread and DCHECKs that it is never accessed
// from any other. OMX callbacks are trampolined from the OMX component's
-// thread to maintain this invariant.
+// thread to maintain this invariant. The only exception to thread-unsafety is
+// that references can be added from any thread (practically used only by the
+// OMX thread).
class OmxVideoDecodeAccelerator : public media::VideoDecodeAccelerator {
public:
// Does not take ownership of |client| which must outlive |*this|.
OmxVideoDecodeAccelerator(media::VideoDecodeAccelerator::Client* client);
- virtual ~OmxVideoDecodeAccelerator();
// media::VideoDecodeAccelerator implementation.
bool Initialize(const std::vector<uint32>& config) OVERRIDE;
@@ -51,6 +54,8 @@ class OmxVideoDecodeAccelerator : public media::VideoDecodeAccelerator {
void SetEglState(EGLDisplay egl_display, EGLContext egl_context);
private:
+ virtual ~OmxVideoDecodeAccelerator();
+
// Because OMX state-transitions are described solely by the "state reached"
// (3.1.2.9.1, table 3-7 of the spec), we track what transition was requested
// using this enum. Note that it is an error to request a transition while
@@ -84,7 +89,6 @@ class OmxVideoDecodeAccelerator : public media::VideoDecodeAccelerator {
// Create the Component for OMX. Handles all OMX initialization.
bool CreateComponent();
- void ShutdownComponent();
// Buffer allocation/free methods for input and output buffers.
bool AllocateInputBuffers();
bool AllocateOutputBuffers();
@@ -110,6 +114,8 @@ class OmxVideoDecodeAccelerator : public media::VideoDecodeAccelerator {
void OnReachedLoadedInDestroying();
void OnReachedEOSInFlushing();
void OnReachedInvalidInErroring();
+ void ShutdownComponent();
+ void BusyLoopInDestroying();
// Port-flushing helpers.
void FlushIOPorts();

Powered by Google App Engine
This is Rietveld 408576698