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

Side by Side Diff: media/remoting/demuxer_stream_adapter.h

Issue 2750373002: Revert of Mojo: Armed Watchers (Closed)
Patch Set: Created 3 years, 9 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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_REMOTING_DEMUXER_STREAM_ADAPTER_H_ 5 #ifndef MEDIA_REMOTING_DEMUXER_STREAM_ADAPTER_H_
6 #define MEDIA_REMOTING_DEMUXER_STREAM_ADAPTER_H_ 6 #define MEDIA_REMOTING_DEMUXER_STREAM_ADAPTER_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <memory> 10 #include <memory>
11 #include <vector> 11 #include <vector>
12 12
13 #include "base/callback_forward.h" 13 #include "base/callback_forward.h"
14 #include "base/macros.h" 14 #include "base/macros.h"
15 #include "base/memory/weak_ptr.h" 15 #include "base/memory/weak_ptr.h"
16 #include "base/optional.h" 16 #include "base/optional.h"
17 #include "media/base/audio_decoder_config.h" 17 #include "media/base/audio_decoder_config.h"
18 #include "media/base/demuxer_stream.h" 18 #include "media/base/demuxer_stream.h"
19 #include "media/base/video_decoder_config.h" 19 #include "media/base/video_decoder_config.h"
20 #include "media/mojo/interfaces/remoting.mojom.h" 20 #include "media/mojo/interfaces/remoting.mojom.h"
21 #include "media/remoting/rpc_broker.h" 21 #include "media/remoting/rpc_broker.h"
22 #include "media/remoting/triggers.h" 22 #include "media/remoting/triggers.h"
23 #include "mojo/public/cpp/system/data_pipe.h" 23 #include "mojo/public/cpp/system/data_pipe.h"
24 #include "mojo/public/cpp/system/simple_watcher.h"
25 24
26 namespace base { 25 namespace base {
27 class SingleThreadTaskRunner; 26 class SingleThreadTaskRunner;
28 } 27 }
29 28
30 namespace media { 29 namespace media {
31 30
32 class DemuxerStream; 31 class DemuxerStream;
33 32
34 namespace remoting { 33 namespace remoting {
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
161 // aborted and data should be discarded when the value is true. 160 // aborted and data should be discarded when the value is true.
162 bool pending_flush_; 161 bool pending_flush_;
163 162
164 // Frame buffer and its information that is currently in process of writing to 163 // Frame buffer and its information that is currently in process of writing to
165 // Mojo data pipe. 164 // Mojo data pipe.
166 std::vector<uint8_t> pending_frame_; 165 std::vector<uint8_t> pending_frame_;
167 uint32_t current_pending_frame_offset_; 166 uint32_t current_pending_frame_offset_;
168 bool pending_frame_is_eos_; 167 bool pending_frame_is_eos_;
169 168
170 // Monitor if data pipe is available to write data. 169 // Monitor if data pipe is available to write data.
171 mojo::SimpleWatcher write_watcher_; 170 mojo::Watcher write_watcher_;
172 171
173 // Keeps latest demuxer stream status and audio/video decoder config. 172 // Keeps latest demuxer stream status and audio/video decoder config.
174 DemuxerStream::Status media_status_; 173 DemuxerStream::Status media_status_;
175 AudioDecoderConfig audio_config_; 174 AudioDecoderConfig audio_config_;
176 VideoDecoderConfig video_config_; 175 VideoDecoderConfig video_config_;
177 176
178 mojom::RemotingDataStreamSenderPtr stream_sender_; 177 mojom::RemotingDataStreamSenderPtr stream_sender_;
179 mojo::ScopedDataPipeProducerHandle producer_handle_; 178 mojo::ScopedDataPipeProducerHandle producer_handle_;
180 179
181 // Tracks the number of bytes written to the pipe. 180 // Tracks the number of bytes written to the pipe.
182 int64_t bytes_written_to_pipe_; 181 int64_t bytes_written_to_pipe_;
183 182
184 // WeakPtrFactory only for reading buffer from demuxer stream. This is used 183 // WeakPtrFactory only for reading buffer from demuxer stream. This is used
185 // for canceling all read callbacks provided to the |demuxer_stream_| before a 184 // for canceling all read callbacks provided to the |demuxer_stream_| before a
186 // flush. 185 // flush.
187 base::WeakPtrFactory<DemuxerStreamAdapter> request_buffer_weak_factory_; 186 base::WeakPtrFactory<DemuxerStreamAdapter> request_buffer_weak_factory_;
188 // WeakPtrFactory for normal usage. 187 // WeakPtrFactory for normal usage.
189 base::WeakPtrFactory<DemuxerStreamAdapter> weak_factory_; 188 base::WeakPtrFactory<DemuxerStreamAdapter> weak_factory_;
190 189
191 DISALLOW_COPY_AND_ASSIGN(DemuxerStreamAdapter); 190 DISALLOW_COPY_AND_ASSIGN(DemuxerStreamAdapter);
192 }; 191 };
193 192
194 } // namespace remoting 193 } // namespace remoting
195 } // namespace media 194 } // namespace media
196 195
197 #endif // MEDIA_REMOTING_DEMUXER_STREAM_ADAPTER_H_ 196 #endif // MEDIA_REMOTING_DEMUXER_STREAM_ADAPTER_H_
OLDNEW
« no previous file with comments | « media/mojo/common/mojo_decoder_buffer_converter.cc ('k') | media/remoting/demuxer_stream_adapter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698