diff --git a/modules/video_coding/BUILD.gn b/modules/video_coding/BUILD.gn index c83fd19289..cdf7efaa11 100644 --- a/modules/video_coding/BUILD.gn +++ b/modules/video_coding/BUILD.gn @@ -392,6 +392,7 @@ rtc_library("video_coding_utility") { "utility/frame_dropper.h", "utility/framerate_controller_deprecated.cc", "utility/framerate_controller_deprecated.h", + "utility/ivf_defines.h", "utility/ivf_file_reader.cc", "utility/ivf_file_reader.h", "utility/ivf_file_writer.cc", diff --git a/modules/video_coding/utility/ivf_defines.h b/modules/video_coding/utility/ivf_defines.h new file mode 100644 index 0000000000..83d6691b87 --- /dev/null +++ b/modules/video_coding/utility/ivf_defines.h @@ -0,0 +1,23 @@ +/* + * Copyright (c) 2021 The WebRTC project authors. All Rights Reserved. + * + * Use of this source code is governed by a BSD-style license + * that can be found in the LICENSE file in the root of the source + * tree. An additional intellectual property rights grant can be found + * in the file PATENTS. All contributing project authors may + * be found in the AUTHORS file in the root of the source tree. + */ + +/* + * This file contains definitions that are common to the IvfFileReader and + * IvfFileWriter classes. + */ + +#ifndef MODULES_VIDEO_CODING_UTILITY_IVF_DEFINES_H_ +#define MODULES_VIDEO_CODING_UTILITY_IVF_DEFINES_H_ + +namespace webrtc { +constexpr size_t kIvfHeaderSize = 32; +} // namespace webrtc + +#endif // MODULES_VIDEO_CODING_UTILITY_IVF_DEFINES_H_ diff --git a/modules/video_coding/utility/ivf_file_reader.cc b/modules/video_coding/utility/ivf_file_reader.cc index 63925702b5..85d1fa00d7 100644 --- a/modules/video_coding/utility/ivf_file_reader.cc +++ b/modules/video_coding/utility/ivf_file_reader.cc @@ -15,12 +15,12 @@ #include "api/video_codecs/video_codec.h" #include "modules/rtp_rtcp/source/byte_io.h" +#include "modules/video_coding/utility/ivf_defines.h" #include "rtc_base/logging.h" namespace webrtc { namespace { -constexpr size_t kIvfHeaderSize = 32; constexpr size_t kIvfFrameHeaderSize = 12; constexpr int kCodecTypeBytesCount = 4; diff --git a/modules/video_coding/utility/ivf_file_writer.cc b/modules/video_coding/utility/ivf_file_writer.cc index 77c90ee158..c1d84c00a0 100644 --- a/modules/video_coding/utility/ivf_file_writer.cc +++ b/modules/video_coding/utility/ivf_file_writer.cc @@ -14,6 +14,7 @@ #include "api/video_codecs/video_codec.h" #include "modules/rtp_rtcp/source/byte_io.h" +#include "modules/video_coding/utility/ivf_defines.h" #include "rtc_base/checks.h" #include "rtc_base/logging.h" @@ -22,8 +23,6 @@ namespace webrtc { -const size_t kIvfHeaderSize = 32; - IvfFileWriter::IvfFileWriter(FileWrapper file, size_t byte_limit) : codec_type_(kVideoCodecGeneric), bytes_written_(0),