| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "base/logging.h" | 5 #include "base/logging.h" |
| 6 #include "services/media/common/media_pipe_base.h" | 6 #include "services/media/common/media_pipe_base.h" |
| 7 | 7 |
| 8 namespace mojo { | 8 namespace mojo { |
| 9 namespace media { | 9 namespace media { |
| 10 | 10 |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 130 DCHECK(packet->extra_payload); | 130 DCHECK(packet->extra_payload); |
| 131 r = &packet->extra_payload[i++]; | 131 r = &packet->extra_payload[i++]; |
| 132 } | 132 } |
| 133 | 133 |
| 134 // Looks good, send this packet up to the implementation layer. | 134 // Looks good, send this packet up to the implementation layer. |
| 135 MediaPacketStatePtr ptr(new MediaPacketState(packet.Pass(), buffer_, cbk)); | 135 MediaPacketStatePtr ptr(new MediaPacketState(packet.Pass(), buffer_, cbk)); |
| 136 OnPacketReceived(std::move(ptr)); | 136 OnPacketReceived(std::move(ptr)); |
| 137 } | 137 } |
| 138 | 138 |
| 139 void MediaPipeBase::Prime(const PrimeCallback& cbk) { | 139 void MediaPipeBase::Prime(const PrimeCallback& cbk) { |
| 140 cbk.Run(); | 140 OnPrimeRequested(cbk); |
| 141 } | 141 } |
| 142 | 142 |
| 143 void MediaPipeBase::Flush(const FlushCallback& cbk) { | 143 void MediaPipeBase::Flush(const FlushCallback& cbk) { |
| 144 // If we have not been successfully initialized, then we should not be getting | 144 // If we have not been successfully initialized, then we should not be getting |
| 145 // packets pushed to us. | 145 // packets pushed to us. |
| 146 if (!buffer_) { | 146 if (!buffer_) { |
| 147 LOG(ERROR) << "Flush called with no shared buffer established!"; | 147 LOG(ERROR) << "Flush called with no shared buffer established!"; |
| 148 Reset(); | 148 Reset(); |
| 149 return; | 149 return; |
| 150 } | 150 } |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 206 if (MOJO_RESULT_OK != res) { | 206 if (MOJO_RESULT_OK != res) { |
| 207 LOG(ERROR) << "Failed to map shared buffer of size " << size_ | 207 LOG(ERROR) << "Failed to map shared buffer of size " << size_ |
| 208 << " (res " << res << ")"; | 208 << " (res " << res << ")"; |
| 209 DCHECK(base_ == nullptr); | 209 DCHECK(base_ == nullptr); |
| 210 handle_.reset(); | 210 handle_.reset(); |
| 211 } | 211 } |
| 212 } | 212 } |
| 213 | 213 |
| 214 } // namespace media | 214 } // namespace media |
| 215 } // namespace mojo | 215 } // namespace mojo |
| OLD | NEW |