OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2004 The WebRTC Project Authors. All rights reserved. | 2 * Copyright 2004 The WebRTC Project Authors. All rights reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
(...skipping 723 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
734 return ReadOffsetLocked(buffer, bytes, offset, bytes_read); | 734 return ReadOffsetLocked(buffer, bytes, offset, bytes_read); |
735 } | 735 } |
736 | 736 |
737 StreamResult FifoBuffer::WriteOffset(const void* buffer, size_t bytes, | 737 StreamResult FifoBuffer::WriteOffset(const void* buffer, size_t bytes, |
738 size_t offset, size_t* bytes_written) { | 738 size_t offset, size_t* bytes_written) { |
739 CritScope cs(&crit_); | 739 CritScope cs(&crit_); |
740 return WriteOffsetLocked(buffer, bytes, offset, bytes_written); | 740 return WriteOffsetLocked(buffer, bytes, offset, bytes_written); |
741 } | 741 } |
742 | 742 |
743 StreamState FifoBuffer::GetState() const { | 743 StreamState FifoBuffer::GetState() const { |
| 744 CritScope cs(&crit_); |
744 return state_; | 745 return state_; |
745 } | 746 } |
746 | 747 |
747 StreamResult FifoBuffer::Read(void* buffer, size_t bytes, | 748 StreamResult FifoBuffer::Read(void* buffer, size_t bytes, |
748 size_t* bytes_read, int* error) { | 749 size_t* bytes_read, int* error) { |
749 CritScope cs(&crit_); | 750 CritScope cs(&crit_); |
750 const bool was_writable = data_length_ < buffer_length_; | 751 const bool was_writable = data_length_ < buffer_length_; |
751 size_t copy = 0; | 752 size_t copy = 0; |
752 StreamResult result = ReadOffsetLocked(buffer, bytes, 0, ©); | 753 StreamResult result = ReadOffsetLocked(buffer, bytes, 0, ©); |
753 | 754 |
(...skipping 363 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1117 | 1118 |
1118 if (data_len) { | 1119 if (data_len) { |
1119 *data_len = 0; | 1120 *data_len = 0; |
1120 } | 1121 } |
1121 return SR_SUCCESS; | 1122 return SR_SUCCESS; |
1122 } | 1123 } |
1123 | 1124 |
1124 /////////////////////////////////////////////////////////////////////////////// | 1125 /////////////////////////////////////////////////////////////////////////////// |
1125 | 1126 |
1126 } // namespace rtc | 1127 } // namespace rtc |
OLD | NEW |