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 #ifndef SERVICES_MEDIA_FRAMEWORK_MOJO_PUSH_PRODUCER_BASE_H_ | 5 #ifndef SERVICES_MEDIA_FRAMEWORK_MOJO_PUSH_PRODUCER_BASE_H_ |
6 #define SERVICES_MEDIA_FRAMEWORK_MOJO_PUSH_PRODUCER_BASE_H_ | 6 #define SERVICES_MEDIA_FRAMEWORK_MOJO_PUSH_PRODUCER_BASE_H_ |
7 | 7 |
8 #include "base/single_thread_task_runner.h" | 8 #include "base/single_thread_task_runner.h" |
9 #include "base/synchronization/lock.h" | 9 #include "base/synchronization/lock.h" |
10 #include "base/task_runner.h" | 10 #include "base/task_runner.h" |
(...skipping 27 matching lines...) Expand all Loading... |
38 void PrimeConnection(const PrimeConnectionCallback& callback); | 38 void PrimeConnection(const PrimeConnectionCallback& callback); |
39 | 39 |
40 // Unprimes and tells the connected consumer to flush. | 40 // Unprimes and tells the connected consumer to flush. |
41 void FlushConnection(const FlushConnectionCallback& callback); | 41 void FlushConnection(const FlushConnectionCallback& callback); |
42 | 42 |
43 // Sets a callback for reporting status updates. | 43 // Sets a callback for reporting status updates. |
44 void SetStatusCallback(const StatusCallback& callback); | 44 void SetStatusCallback(const StatusCallback& callback); |
45 | 45 |
46 // Gets the first presentation time seen on any packet after the most recent | 46 // Gets the first presentation time seen on any packet after the most recent |
47 // flush or, if there has never been a flush, the first packet supplied. | 47 // flush or, if there has never been a flush, the first packet supplied. |
48 int64_t GetFirstPresentationTimeSinceFlush(); | 48 int64_t GetFirstPtsSinceFlush(); |
49 | 49 |
50 // ActiveSink implementation. | 50 // ActiveSink implementation. |
51 PayloadAllocator* allocator() override; | 51 PayloadAllocator* allocator() override; |
52 | 52 |
53 void SetDemandCallback(const DemandCallback& demand_callback) override; | 53 void SetDemandCallback(const DemandCallback& demand_callback) override; |
54 | 54 |
55 Demand SupplyPacket(PacketPtr packet) override; | 55 Demand SupplyPacket(PacketPtr packet) override; |
56 | 56 |
57 // MediaProducer implementation. | 57 // MediaProducer implementation. |
58 void Connect( | 58 void Connect( |
(...skipping 23 matching lines...) Expand all Loading... |
82 BindingSet<MediaProducer> bindings_; | 82 BindingSet<MediaProducer> bindings_; |
83 MediaConsumerPtr consumer_; | 83 MediaConsumerPtr consumer_; |
84 StatusCallback status_callback_; | 84 StatusCallback status_callback_; |
85 | 85 |
86 mutable base::Lock lock_; | 86 mutable base::Lock lock_; |
87 // THE FIELDS BELOW SHOULD ONLY BE ACCESSED WITH lock_ TAKEN. | 87 // THE FIELDS BELOW SHOULD ONLY BE ACCESSED WITH lock_ TAKEN. |
88 MediaState state_= MediaState::UNPREPARED; | 88 MediaState state_= MediaState::UNPREPARED; |
89 bool end_of_stream_= false; | 89 bool end_of_stream_= false; |
90 DemandCallback demand_callback_; | 90 DemandCallback demand_callback_; |
91 scoped_refptr<base::SingleThreadTaskRunner> task_runner_; | 91 scoped_refptr<base::SingleThreadTaskRunner> task_runner_; |
92 int64_t first_presentation_time_since_flush_ = | 92 int64_t first_pts_since_flush_ = Packet::kUnknownPts; |
93 Packet::kUnknownPresentationTime; | |
94 // TODO(dalesat): Base this logic on presentation time or duration. | 93 // TODO(dalesat): Base this logic on presentation time or duration. |
95 uint32_t max_pushes_outstanding_ = 0; | 94 uint32_t max_pushes_outstanding_ = 0; |
96 uint32_t current_pushes_outstanding_ = 0; | 95 uint32_t current_pushes_outstanding_ = 0; |
97 // THE FIELDS ABOVE SHOULD ONLY BE ACCESSED WITH lock_ TAKEN. | 96 // THE FIELDS ABOVE SHOULD ONLY BE ACCESSED WITH lock_ TAKEN. |
98 }; | 97 }; |
99 | 98 |
100 } // namespace media | 99 } // namespace media |
101 } // namespace mojo | 100 } // namespace mojo |
102 | 101 |
103 #endif // SERVICES_MEDIA_FRAMEWORK_MOJO_PUSH_PRODUCER_BASE_H_ | 102 #endif // SERVICES_MEDIA_FRAMEWORK_MOJO_PUSH_PRODUCER_BASE_H_ |
OLD | NEW |