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

Unified Diff: chromecast/media/cma/ipc/media_memory_chunk.h

Issue 529223003: IPC to pass media data using a lock free circular fifo. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Created 6 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
« no previous file with comments | « no previous file | chromecast/media/cma/ipc/media_memory_chunk.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chromecast/media/cma/ipc/media_memory_chunk.h
diff --git a/chromecast/media/cma/ipc/media_memory_chunk.h b/chromecast/media/cma/ipc/media_memory_chunk.h
new file mode 100644
index 0000000000000000000000000000000000000000..1b91c840a9d03aec0d870560868147edb4baecd3
--- /dev/null
+++ b/chromecast/media/cma/ipc/media_memory_chunk.h
@@ -0,0 +1,39 @@
+// Copyright 2014 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 CHROMECAST_MEDIA_CMA_IPC_MEDIA_MEMORY_CHUNK_H_
+#define CHROMECAST_MEDIA_CMA_IPC_MEDIA_MEMORY_CHUNK_H_
+
+#include "base/basictypes.h"
+
+namespace chromecast {
+namespace media {
+
+// MediaMemoryChunk represents a block of memory without doing any assumption
+// about the type of memory (e.g. shared memory) nor about the underlying
+// memory ownership.
+// The block of memory can be invalidated under the cover (e.g. if the derived
+// class does not own the underlying memory),
+// in that case, MediaMemoryChunk::valid() will return false.
+class MediaMemoryChunk {
+ public:
+ virtual ~MediaMemoryChunk();
+
+ // Returns the start of the block of memory.
+ virtual void* data() const = 0;
+
+ // Returns the size of the block of memory.
+ virtual size_t size() const = 0;
+
+ // Returns whether the underlying block of memory is valid.
+ // Since MediaMemoryChunk does not specify a memory ownership model,
+ // the underlying block of memory might be invalidated by a third party.
+ // In that case, valid() will return false.
+ virtual bool valid() const = 0;
+};
+
+} // namespace media
+} // namespace chromecast
+
+#endif // CHROMECAST_MEDIA_CMA_IPC_MEDIA_MEMORY_CHUNK_H_
« no previous file with comments | « no previous file | chromecast/media/cma/ipc/media_memory_chunk.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698