Update V8 to version 4.7.56.
[chromium-blink-merge.git] / media / blink / websourcebuffer_impl.h
blobb25d204ff6cde3b25eeabb2b24ee24e098a0f7af
1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef MEDIA_BLINK_WEBSOURCEBUFFER_IMPL_H_
6 #define MEDIA_BLINK_WEBSOURCEBUFFER_IMPL_H_
8 #include <string>
10 #include "base/basictypes.h"
11 #include "base/compiler_specific.h"
12 #include "base/time/time.h"
13 #include "third_party/WebKit/public/platform/WebSourceBuffer.h"
15 namespace media {
16 class ChunkDemuxer;
18 class WebSourceBufferImpl : public blink::WebSourceBuffer {
19 public:
20 WebSourceBufferImpl(const std::string& id, ChunkDemuxer* demuxer);
21 virtual ~WebSourceBufferImpl();
23 // blink::WebSourceBuffer implementation.
24 virtual void setClient(blink::WebSourceBufferClient* client);
25 virtual bool setMode(AppendMode mode);
26 virtual blink::WebTimeRanges buffered();
27 virtual bool evictCodedFrames(double currentPlaybackTime,
28 size_t newDataSize);
29 virtual void append(
30 const unsigned char* data,
31 unsigned length,
32 double* timestamp_offset);
33 // TODO(servolk): WebSourceBuffer::abort is being renamed into
34 // resetParserState and will be removed soon
35 virtual void abort();
36 virtual void resetParserState();
37 virtual void remove(double start, double end);
38 virtual bool setTimestampOffset(double offset);
39 virtual void setAppendWindowStart(double start);
40 virtual void setAppendWindowEnd(double end);
41 virtual void removedFromMediaSource();
43 private:
44 // Demuxer callback handler to process an initialization segment received
45 // during an append() call.
46 void InitSegmentReceived();
48 std::string id_;
49 ChunkDemuxer* demuxer_; // Owned by WebMediaPlayerImpl.
51 blink::WebSourceBufferClient* client_;
53 // Controls the offset applied to timestamps when processing appended media
54 // segments. It is initially 0, which indicates that no offset is being
55 // applied. Both setTimestampOffset() and append() may update this value.
56 base::TimeDelta timestamp_offset_;
58 base::TimeDelta append_window_start_;
59 base::TimeDelta append_window_end_;
61 DISALLOW_COPY_AND_ASSIGN(WebSourceBufferImpl);
64 } // namespace media
66 #endif // MEDIA_BLINK_WEBSOURCEBUFFER_IMPL_H_