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 537 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
548 // when calling this method. | 548 // when calling this method. |
549 StreamResult WriteOffsetLocked(const void* buffer, size_t bytes, | 549 StreamResult WriteOffsetLocked(const void* buffer, size_t bytes, |
550 size_t offset, size_t* bytes_written); | 550 size_t offset, size_t* bytes_written); |
551 | 551 |
552 StreamState state_; // keeps the opened/closed state of the stream | 552 StreamState state_; // keeps the opened/closed state of the stream |
553 scoped_ptr<char[]> buffer_; // the allocated buffer | 553 scoped_ptr<char[]> buffer_; // the allocated buffer |
554 size_t buffer_length_; // size of the allocated buffer | 554 size_t buffer_length_; // size of the allocated buffer |
555 size_t data_length_; // amount of readable data in the buffer | 555 size_t data_length_; // amount of readable data in the buffer |
556 size_t read_position_; // offset to the readable data | 556 size_t read_position_; // offset to the readable data |
557 Thread* owner_; // stream callbacks are dispatched on this thread | 557 Thread* owner_; // stream callbacks are dispatched on this thread |
558 mutable CriticalSection crit_; // object lock | 558 CriticalSection crit_; // object lock |
559 RTC_DISALLOW_COPY_AND_ASSIGN(FifoBuffer); | 559 RTC_DISALLOW_COPY_AND_ASSIGN(FifoBuffer); |
560 }; | 560 }; |
561 | 561 |
562 /////////////////////////////////////////////////////////////////////////////// | 562 /////////////////////////////////////////////////////////////////////////////// |
563 | 563 |
564 class LoggingAdapter : public StreamAdapterInterface { | 564 class LoggingAdapter : public StreamAdapterInterface { |
565 public: | 565 public: |
566 LoggingAdapter(StreamInterface* stream, LoggingSeverity level, | 566 LoggingAdapter(StreamInterface* stream, LoggingSeverity level, |
567 const std::string& label, bool hex_mode = false); | 567 const std::string& label, bool hex_mode = false); |
568 | 568 |
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
694 // as a pass in parameter, it indicates data in buffer that should move to sink | 694 // as a pass in parameter, it indicates data in buffer that should move to sink |
695 StreamResult Flow(StreamInterface* source, | 695 StreamResult Flow(StreamInterface* source, |
696 char* buffer, size_t buffer_len, | 696 char* buffer, size_t buffer_len, |
697 StreamInterface* sink, size_t* data_len = NULL); | 697 StreamInterface* sink, size_t* data_len = NULL); |
698 | 698 |
699 /////////////////////////////////////////////////////////////////////////////// | 699 /////////////////////////////////////////////////////////////////////////////// |
700 | 700 |
701 } // namespace rtc | 701 } // namespace rtc |
702 | 702 |
703 #endif // WEBRTC_BASE_STREAM_H_ | 703 #endif // WEBRTC_BASE_STREAM_H_ |
OLD | NEW |