Disambiguate kIvfHeaderSize for Mozilla unified build

kIvfHeaderSize is defined both inside of ivf_file_writer.cc and
ivf_file_reader.cc. This patch moves its definition into a header.

Bug: webrtc:13463
Change-Id: Ia6b2fcc3434f69a1e30a7dae7bf0c90547f11d98
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/239722
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35540}
This commit is contained in:
Nico Grunbaum 2021-12-08 12:07:09 -08:00 committed by WebRTC LUCI CQ
parent d8f4df729f
commit d525e2d9f7
4 changed files with 26 additions and 3 deletions

View File

@ -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",

View File

@ -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_

View File

@ -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;

View File

@ -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),