summaryrefslogtreecommitdiffstats
path: root/media/blink/websourcebuffer_impl.h
diff options
context:
space:
mode:
authoracolwell <acolwell@chromium.org>2014-09-06 12:01:32 -0700
committerCommit bot <commit-bot@chromium.org>2014-09-06 19:06:46 +0000
commit9e0840d0672da96350a1f33d684f2c64d2574f46 (patch)
tree6d72e3d50fcfd66f70a58c5d3583358055de4d9a /media/blink/websourcebuffer_impl.h
parent87a3ebac6b26918b151151efed3311d0ddc20d73 (diff)
downloadchromium_src-9e0840d0672da96350a1f33d684f2c64d2574f46.zip
chromium_src-9e0840d0672da96350a1f33d684f2c64d2574f46.tar.gz
chromium_src-9e0840d0672da96350a1f33d684f2c64d2574f46.tar.bz2
Move WebMediaPlayerImpl and its dependencies to media/blink.
Moving WebMediaPlayerImpl and related classes in content/renderer/media to media/blink so that they can be reused by Mojo code. BUG=408338 Review URL: https://codereview.chromium.org/495353003 Cr-Commit-Position: refs/heads/master@{#293628}
Diffstat (limited to 'media/blink/websourcebuffer_impl.h')
-rw-r--r--media/blink/websourcebuffer_impl.h54
1 files changed, 54 insertions, 0 deletions
diff --git a/media/blink/websourcebuffer_impl.h b/media/blink/websourcebuffer_impl.h
new file mode 100644
index 0000000..e938178
--- /dev/null
+++ b/media/blink/websourcebuffer_impl.h
@@ -0,0 +1,54 @@
+// 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 MEDIA_BLINK_WEBSOURCEBUFFER_IMPL_H_
+#define MEDIA_BLINK_WEBSOURCEBUFFER_IMPL_H_
+
+#include <string>
+
+#include "base/basictypes.h"
+#include "base/compiler_specific.h"
+#include "base/time/time.h"
+#include "third_party/WebKit/public/platform/WebSourceBuffer.h"
+
+namespace media {
+class ChunkDemuxer;
+
+class WebSourceBufferImpl : public blink::WebSourceBuffer {
+ public:
+ WebSourceBufferImpl(const std::string& id, ChunkDemuxer* demuxer);
+ virtual ~WebSourceBufferImpl();
+
+ // blink::WebSourceBuffer implementation.
+ virtual bool setMode(AppendMode mode);
+ virtual blink::WebTimeRanges buffered();
+ virtual void append(
+ const unsigned char* data,
+ unsigned length,
+ double* timestamp_offset);
+ virtual void abort();
+ virtual void remove(double start, double end);
+ virtual bool setTimestampOffset(double offset);
+ virtual void setAppendWindowStart(double start);
+ virtual void setAppendWindowEnd(double end);
+ virtual void removedFromMediaSource();
+
+ private:
+ std::string id_;
+ ChunkDemuxer* demuxer_; // Owned by WebMediaPlayerImpl.
+
+ // Controls the offset applied to timestamps when processing appended media
+ // segments. It is initially 0, which indicates that no offset is being
+ // applied. Both setTimestampOffset() and append() may update this value.
+ base::TimeDelta timestamp_offset_;
+
+ base::TimeDelta append_window_start_;
+ base::TimeDelta append_window_end_;
+
+ DISALLOW_COPY_AND_ASSIGN(WebSourceBufferImpl);
+};
+
+} // namespace media
+
+#endif // MEDIA_BLINK_WEBSOURCEBUFFER_IMPL_H_