Skip to content

Commit

Permalink
Set initial buffer size to 1 MB.
Browse files Browse the repository at this point in the history
  • Loading branch information
dchapyshev committed Dec 10, 2023
1 parent b6c37ff commit ae5ee38
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 5 additions & 1 deletion source/base/codec/video_encoder.cc
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,15 @@

namespace base {

//--------------------------------------------------------------------------------------------------
// static
const size_t VideoEncoder::kInitialEncodeBufferSize = 1 * 1024 * 1024; // 1 MB

//--------------------------------------------------------------------------------------------------
VideoEncoder::VideoEncoder(proto::VideoEncoding encoding)
: encoding_(encoding)
{
// Nothing
encode_buffer_.reserve(kInitialEncodeBufferSize);
}

//--------------------------------------------------------------------------------------------------
Expand Down
2 changes: 2 additions & 0 deletions source/base/codec/video_encoder.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ class Frame;
class VideoEncoder
{
public:
static const size_t kInitialEncodeBufferSize;

explicit VideoEncoder(proto::VideoEncoding encoding);
virtual ~VideoEncoder() = default;

Expand Down

0 comments on commit ae5ee38

Please sign in to comment.