summaryrefslogtreecommitdiffstats
path: root/content/renderer/media/webmediasource_impl.h
blob: 42d5eef9405b5f92c846d8caad605eb82161d7d5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
// 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 CONTENT_RENDERER_MEDIA_WEBMEDIASOURCE_IMPL_H_
#define CONTENT_RENDERER_MEDIA_WEBMEDIASOURCE_IMPL_H_

#include <string>
#include <vector>

#include "media/base/media_log.h"
#include "third_party/WebKit/public/platform/WebMediaSource.h"

namespace media {
class ChunkDemuxer;
}

namespace content {

class WebMediaSourceImpl : public blink::WebMediaSource {
 public:
  WebMediaSourceImpl(media::ChunkDemuxer* demuxer, media::LogCB log_cb);
  virtual ~WebMediaSourceImpl();

  // blink::WebMediaSource implementation.
  virtual AddStatus addSourceBuffer(
      const blink::WebString& type,
      const blink::WebVector<blink::WebString>& codecs,
      blink::WebSourceBuffer** source_buffer) OVERRIDE;
  virtual double duration() OVERRIDE;
  virtual void setDuration(double duration) OVERRIDE;
  virtual void markEndOfStream(EndOfStreamStatus status) OVERRIDE;
  virtual void unmarkEndOfStream() OVERRIDE;

 private:
  media::ChunkDemuxer* demuxer_;  // Owned by WebMediaPlayerImpl.
  media::LogCB log_cb_;

  DISALLOW_COPY_AND_ASSIGN(WebMediaSourceImpl);
};

}  // namespace content

#endif  // CONTENT_RENDERER_MEDIA_WEBMEDIASOURCE_IMPL_H_