// Copyright 2011 The Chromium Authors // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. // CompoundBuffer implements a data buffer that is composed of several pieces, // each stored in a refcounted IOBuffer. It is needed for encoding/decoding // video pipeline to represent data packet and minimize data copying. // It is particularly useful for splitting data between multiple RTP packets // and assembling them into one buffer on the receiving side. // // CompoundBufferInputStream implements ZeroCopyInputStream interface // to be used by protobuf to decode data stored in CompoundBuffer into // a protocol buffer message. // // Mutations to the buffer are not thread-safe. Immutability can be ensured // with the Lock() method. #ifndef REMOTING_BASE_COMPOUND_BUFFER_H_ #define REMOTING_BASE_COMPOUND_BUFFER_H_ #include <stddef.h> #include <stdint.h> #include "base/containers/circular_deque.h" #include "base/memory/raw_ptr.h" #include "base/memory/scoped_refptr.h" #include "google/protobuf/io/zero_copy_stream.h" namespace net { class IOBuffer; class IOBufferWithSize; } // namespace net namespace remoting { class CompoundBuffer { … }; class CompoundBufferInputStream : public google::protobuf::io::ZeroCopyInputStream { … }; } // namespace remoting #endif // REMOTING_BASE_COMPOUND_BUFFER_H_