| 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_MOJO_PULL_MODE_PRODUCER_H_ | 5 #ifndef SERVICES_MEDIA_FRAMEWORK_MOJO_MOJO_PULL_MODE_PRODUCER_H_ |
| 6 #define SERVICES_MEDIA_FRAMEWORK_MOJO_MOJO_PULL_MODE_PRODUCER_H_ | 6 #define SERVICES_MEDIA_FRAMEWORK_MOJO_MOJO_PULL_MODE_PRODUCER_H_ |
| 7 | 7 |
| 8 #include <deque> | 8 #include <deque> |
| 9 | 9 |
| 10 #include "base/synchronization/lock.h" | 10 #include "base/synchronization/lock.h" |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 | 71 |
| 72 DemandCallback demand_callback_; | 72 DemandCallback demand_callback_; |
| 73 | 73 |
| 74 // Allocates from the shared buffer. | 74 // Allocates from the shared buffer. |
| 75 MojoAllocator mojo_allocator_; | 75 MojoAllocator mojo_allocator_; |
| 76 | 76 |
| 77 mutable base::Lock lock_; | 77 mutable base::Lock lock_; |
| 78 // THE FIELDS BELOW SHOULD ONLY BE ACCESSED WITH lock_ TAKEN. | 78 // THE FIELDS BELOW SHOULD ONLY BE ACCESSED WITH lock_ TAKEN. |
| 79 MediaState state_; | 79 MediaState state_; |
| 80 Demand demand_; | 80 Demand demand_; |
| 81 int64_t presentation_time_; | 81 int64_t pts_; |
| 82 | 82 |
| 83 // pending_pulls_ contains the callbacks for the pull requests that have yet | 83 // pending_pulls_ contains the callbacks for the pull requests that have yet |
| 84 // to be satisfied. unreleased_packets_ contains the packets that have been | 84 // to be satisfied. unreleased_packets_ contains the packets that have been |
| 85 // delivered via pull but have not yet been released. cached_packet_ is a | 85 // delivered via pull but have not yet been released. cached_packet_ is a |
| 86 // packet waiting for a pull (we keep one ready so we can be preparing a | 86 // packet waiting for a pull (we keep one ready so we can be preparing a |
| 87 // packet between pulls). If cached_packet_ isn't nullptr, pending_pulls_ | 87 // packet between pulls). If cached_packet_ isn't nullptr, pending_pulls_ |
| 88 // should be empty. We signal positive demand when cached_packet_ is nullptr | 88 // should be empty. We signal positive demand when cached_packet_ is nullptr |
| 89 // and negative demand when it isn't. | 89 // and negative demand when it isn't. |
| 90 std::deque<PullPacketCallback> pending_pulls_; | 90 std::deque<PullPacketCallback> pending_pulls_; |
| 91 std::deque<PacketPtr> unreleased_packets_; | 91 std::deque<PacketPtr> unreleased_packets_; |
| 92 PacketPtr cached_packet_; | 92 PacketPtr cached_packet_; |
| 93 // THE FIELDS ABOVE SHOULD ONLY BE ACCESSED WITH lock_ TAKEN. | 93 // THE FIELDS ABOVE SHOULD ONLY BE ACCESSED WITH lock_ TAKEN. |
| 94 }; | 94 }; |
| 95 | 95 |
| 96 } // namespace media | 96 } // namespace media |
| 97 } // namespace mojo | 97 } // namespace mojo |
| 98 | 98 |
| 99 #endif // SERVICES_MEDIA_FRAMEWORK_MOJO_MOJO_PULL_MODE_PRODUCER_H_ | 99 #endif // SERVICES_MEDIA_FRAMEWORK_MOJO_MOJO_PULL_MODE_PRODUCER_H_ |
| OLD | NEW |