Upstream version 10.39.225.0
[platform/framework/web/crosswalk.git] / src / media / blink / webmediasource_impl.h
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.
4
5 #ifndef MEDIA_BLINK_WEBMEDIASOURCE_IMPL_H_
6 #define MEDIA_BLINK_WEBMEDIASOURCE_IMPL_H_
7
8 #include <string>
9 #include <vector>
10
11 #include "media/base/media_export.h"
12 #include "media/base/media_log.h"
13 #include "third_party/WebKit/public/platform/WebMediaSource.h"
14
15 namespace media {
16 class ChunkDemuxer;
17
18 class MEDIA_EXPORT WebMediaSourceImpl
19     : NON_EXPORTED_BASE(public blink::WebMediaSource) {
20  public:
21   WebMediaSourceImpl(ChunkDemuxer* demuxer, LogCB log_cb);
22   virtual ~WebMediaSourceImpl();
23
24   // blink::WebMediaSource implementation.
25   virtual AddStatus addSourceBuffer(
26       const blink::WebString& type,
27       const blink::WebVector<blink::WebString>& codecs,
28       blink::WebSourceBuffer** source_buffer);
29   virtual double duration();
30   virtual void setDuration(double duration);
31   virtual void markEndOfStream(EndOfStreamStatus status);
32   virtual void unmarkEndOfStream();
33
34  private:
35   ChunkDemuxer* demuxer_;  // Owned by WebMediaPlayerImpl.
36   LogCB log_cb_;
37
38   DISALLOW_COPY_AND_ASSIGN(WebMediaSourceImpl);
39 };
40
41 }  // namespace media
42
43 #endif  // MEDIA_BLINK_WEBMEDIASOURCE_IMPL_H_