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

Unified Diff: media/filters/in_memory_url_protocol.h

Issue 7203002: Adding ChunkDemuxer implementation. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixing more CR comments Created 9 years, 6 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: media/filters/in_memory_url_protocol.h
diff --git a/media/filters/in_memory_url_protocol.h b/media/filters/in_memory_url_protocol.h
new file mode 100644
index 0000000000000000000000000000000000000000..6516e943ce78b94e170bec72e73c144007ff8fb4
--- /dev/null
+++ b/media/filters/in_memory_url_protocol.h
@@ -0,0 +1,42 @@
+// Copyright (c) 2011 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 MEDIA_FILTERS_IN_MEMORY_URL_PROTOCOL_H_
+#define MEDIA_FILTERS_IN_MEMORY_URL_PROTOCOL_H_
+
+#include "media/filters/ffmpeg_glue.h"
+
+#include "base/basictypes.h"
+
+namespace media {
+
+// Simple FFmpegURLProtocol that reads from a buffer.
+// NOTE: This object does not copy the buffer so the
+// buffer pointer passed into the constructor
+// needs to remain valid for the entire lifetime of
+// this object.
+class InMemoryUrlProtocol : public FFmpegURLProtocol {
+ public:
+ InMemoryUrlProtocol(const char* buf, int64 size, bool streaming);
scherkus (not reviewing) 2011/06/23 23:31:17 mind making this a uint8*? I believe crogers' cod
acolwell GONE FROM CHROMIUM 2011/06/24 16:49:38 Done.
+ virtual ~InMemoryUrlProtocol();
+
+ // FFmpegURLProtocol methods.
+ virtual int Read(int size, uint8* data);
+ virtual bool GetPosition(int64* position_out);
+ virtual bool SetPosition(int64 position);
+ virtual bool GetSize(int64* size_out);
+ virtual bool IsStreaming();
+
+ private:
+ const char* data_;
scherkus (not reviewing) 2011/06/23 23:31:17 ditto
acolwell GONE FROM CHROMIUM 2011/06/24 16:49:38 Done.
+ int64 size_;
+ int64 position_;
+ bool streaming_;
+
+ DISALLOW_IMPLICIT_CONSTRUCTORS(InMemoryUrlProtocol);
+};
+
+} // namespace media
+
+#endif // MEDIA_FILTERS_IN_MEMORY_URL_PROTOCOL_H_

Powered by Google App Engine
This is Rietveld 408576698