1 // Copyright (c) 2012 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 // Implements the Demuxer interface. DummyDemuxer returns corresponding
6 // DummyDemuxerStream as signal for media pipeline to construct correct
7 // playback channels. Used in WebRTC local video capture pipeline, where
8 // demuxing is not needed.
10 #ifndef MEDIA_FILTERS_DUMMY_DEMUXER_H_
11 #define MEDIA_FILTERS_DUMMY_DEMUXER_H_
15 #include "media/base/audio_decoder_config.h"
16 #include "media/base/demuxer.h"
17 #include "media/base/video_decoder_config.h"
21 class DummyDemuxerStream
: public DemuxerStream
{
23 explicit DummyDemuxerStream(Type type
);
25 // DemuxerStream implementation.
26 virtual void Read(const ReadCB
& read_cb
) OVERRIDE
;
27 virtual Type
type() OVERRIDE
;
28 virtual const AudioDecoderConfig
& audio_decoder_config() OVERRIDE
;
29 virtual const VideoDecoderConfig
& video_decoder_config() OVERRIDE
;
30 virtual void EnableBitstreamConverter() OVERRIDE
;
32 virtual ~DummyDemuxerStream();
36 AudioDecoderConfig audio_config_
;
37 VideoDecoderConfig video_config_
;
39 DISALLOW_COPY_AND_ASSIGN(DummyDemuxerStream
);
42 class MEDIA_EXPORT DummyDemuxer
: public Demuxer
{
44 DummyDemuxer(bool has_video
, bool has_audio
);
46 // Demuxer implementation.
47 virtual void Initialize(DemuxerHost
* host
,
48 const PipelineStatusCB
& status_cb
) OVERRIDE
;
49 virtual scoped_refptr
<DemuxerStream
> GetStream(
50 DemuxerStream::Type type
) OVERRIDE
;
51 virtual base::TimeDelta
GetStartTime() const OVERRIDE
;
54 virtual ~DummyDemuxer();
57 std::vector
< scoped_refptr
<DummyDemuxerStream
> > streams_
;
59 DISALLOW_COPY_AND_ASSIGN(DummyDemuxer
);
64 #endif // MEDIA_FILTERS_DUMMY_DEMUXER_H_