OLD | NEW |
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 #include "media/remoting/demuxer_stream_adapter.h" | 5 #include "media/remoting/demuxer_stream_adapter.h" |
6 | 6 |
7 #include "base/base64.h" | 7 #include "base/base64.h" |
8 #include "base/bind.h" | 8 #include "base/bind.h" |
9 #include "base/callback_helpers.h" | 9 #include "base/callback_helpers.h" |
10 #include "media/base/bind_to_current_loop.h" | 10 #include "media/base/bind_to_current_loop.h" |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 demuxer_stream_(demuxer_stream), | 50 demuxer_stream_(demuxer_stream), |
51 type_(demuxer_stream ? demuxer_stream->type() : DemuxerStream::UNKNOWN), | 51 type_(demuxer_stream ? demuxer_stream->type() : DemuxerStream::UNKNOWN), |
52 error_callback_(error_callback), | 52 error_callback_(error_callback), |
53 remote_callback_handle_(RpcBroker::kInvalidHandle), | 53 remote_callback_handle_(RpcBroker::kInvalidHandle), |
54 read_until_callback_handle_(RpcBroker::kInvalidHandle), | 54 read_until_callback_handle_(RpcBroker::kInvalidHandle), |
55 read_until_count_(0), | 55 read_until_count_(0), |
56 last_count_(0), | 56 last_count_(0), |
57 pending_flush_(false), | 57 pending_flush_(false), |
58 current_pending_frame_offset_(0), | 58 current_pending_frame_offset_(0), |
59 pending_frame_is_eos_(false), | 59 pending_frame_is_eos_(false), |
60 write_watcher_(FROM_HERE), | 60 write_watcher_(FROM_HERE, mojo::Watcher::ArmingPolicy::AUTOMATIC), |
61 media_status_(DemuxerStream::kOk), | 61 media_status_(DemuxerStream::kOk), |
62 producer_handle_(std::move(producer_handle)), | 62 producer_handle_(std::move(producer_handle)), |
63 bytes_written_to_pipe_(0), | 63 bytes_written_to_pipe_(0), |
64 request_buffer_weak_factory_(this), | 64 request_buffer_weak_factory_(this), |
65 weak_factory_(this) { | 65 weak_factory_(this) { |
66 DCHECK(main_task_runner_); | 66 DCHECK(main_task_runner_); |
67 DCHECK(media_task_runner_); | 67 DCHECK(media_task_runner_); |
68 DCHECK(media_task_runner_->BelongsToCurrentThread()); | 68 DCHECK(media_task_runner_->BelongsToCurrentThread()); |
69 DCHECK(demuxer_stream); | 69 DCHECK(demuxer_stream); |
70 DCHECK(!error_callback.is_null()); | 70 DCHECK(!error_callback.is_null()); |
(...skipping 363 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
434 if (write_watcher_.IsWatching()) { | 434 if (write_watcher_.IsWatching()) { |
435 DEMUXER_VLOG(2) << "Cancel mojo data pipe watcher"; | 435 DEMUXER_VLOG(2) << "Cancel mojo data pipe watcher"; |
436 write_watcher_.Cancel(); | 436 write_watcher_.Cancel(); |
437 } | 437 } |
438 | 438 |
439 base::ResetAndReturn(&error_callback_).Run(stop_trigger); | 439 base::ResetAndReturn(&error_callback_).Run(stop_trigger); |
440 } | 440 } |
441 | 441 |
442 } // namespace remoting | 442 } // namespace remoting |
443 } // namespace media | 443 } // namespace media |
OLD | NEW |