Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(395)

Side by Side Diff: media/mojo/services/mojo_demuxer_stream_adapter.h

Issue 1935873002: Implement disabling and enabling media tracks (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@track-control2
Patch Set: Updated comments + dchecks in ffmpeg demux stream Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef MEDIA_MOJO_SERVICES_MOJO_DEMUXER_STREAM_ADAPTER_H_ 5 #ifndef MEDIA_MOJO_SERVICES_MOJO_DEMUXER_STREAM_ADAPTER_H_
6 #define MEDIA_MOJO_SERVICES_MOJO_DEMUXER_STREAM_ADAPTER_H_ 6 #define MEDIA_MOJO_SERVICES_MOJO_DEMUXER_STREAM_ADAPTER_H_
7 7
8 #include <queue> 8 #include <queue>
9 9
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 23 matching lines...) Expand all
34 ~MojoDemuxerStreamAdapter() override; 34 ~MojoDemuxerStreamAdapter() override;
35 35
36 // DemuxerStream implementation. 36 // DemuxerStream implementation.
37 void Read(const ReadCB& read_cb) override; 37 void Read(const ReadCB& read_cb) override;
38 AudioDecoderConfig audio_decoder_config() override; 38 AudioDecoderConfig audio_decoder_config() override;
39 VideoDecoderConfig video_decoder_config() override; 39 VideoDecoderConfig video_decoder_config() override;
40 Type type() const override; 40 Type type() const override;
41 void EnableBitstreamConverter() override; 41 void EnableBitstreamConverter() override;
42 bool SupportsConfigChanges() override; 42 bool SupportsConfigChanges() override;
43 VideoRotation video_rotation() override; 43 VideoRotation video_rotation() override;
44 bool enabled() const override;
45 void set_enabled(bool enabled, base::TimeDelta timestamp) override;
44 46
45 private: 47 private:
46 void OnStreamReady(mojom::DemuxerStream::Type type, 48 void OnStreamReady(mojom::DemuxerStream::Type type,
47 mojo::ScopedDataPipeConsumerHandle pipe, 49 mojo::ScopedDataPipeConsumerHandle pipe,
48 mojom::AudioDecoderConfigPtr audio_config, 50 mojom::AudioDecoderConfigPtr audio_config,
49 mojom::VideoDecoderConfigPtr video_config); 51 mojom::VideoDecoderConfigPtr video_config);
50 52
51 // The callback from |demuxer_stream_| that a read operation has completed. 53 // The callback from |demuxer_stream_| that a read operation has completed.
52 // |read_cb| is a callback from the client who invoked Read() on |this|. 54 // |read_cb| is a callback from the client who invoked Read() on |this|.
53 void OnBufferReady(mojom::DemuxerStream::Status status, 55 void OnBufferReady(mojom::DemuxerStream::Status status,
(...skipping 14 matching lines...) Expand all
68 // date AudioDecoderConfig yet. In that case we can't forward the results 70 // date AudioDecoderConfig yet. In that case we can't forward the results
69 // on to the caller of Read() until OnAudioDecoderConfigChanged is observed. 71 // on to the caller of Read() until OnAudioDecoderConfigChanged is observed.
70 DemuxerStream::ReadCB read_cb_; 72 DemuxerStream::ReadCB read_cb_;
71 73
72 // The current config. 74 // The current config.
73 AudioDecoderConfig audio_config_; 75 AudioDecoderConfig audio_config_;
74 VideoDecoderConfig video_config_; 76 VideoDecoderConfig video_config_;
75 77
76 DemuxerStream::Type type_; 78 DemuxerStream::Type type_;
77 79
80 bool enabled_ = true;
chcunningham 2016/06/03 01:38:49 This class' style is to set defaults in the ctor
81
78 // DataPipe for deserializing the data section of DecoderBuffers from. 82 // DataPipe for deserializing the data section of DecoderBuffers from.
79 mojo::ScopedDataPipeConsumerHandle stream_pipe_; 83 mojo::ScopedDataPipeConsumerHandle stream_pipe_;
80 84
81 base::WeakPtrFactory<MojoDemuxerStreamAdapter> weak_factory_; 85 base::WeakPtrFactory<MojoDemuxerStreamAdapter> weak_factory_;
82 DISALLOW_COPY_AND_ASSIGN(MojoDemuxerStreamAdapter); 86 DISALLOW_COPY_AND_ASSIGN(MojoDemuxerStreamAdapter);
83 }; 87 };
84 88
85 } // namespace media 89 } // namespace media
86 90
87 #endif // MEDIA_MOJO_SERVICES_MOJO_DEMUXER_STREAM_ADAPTER_H_ 91 #endif // MEDIA_MOJO_SERVICES_MOJO_DEMUXER_STREAM_ADAPTER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698