mirror of
https://github.com/mollyim/webrtc.git
synced 2025-05-13 13:50:40 +01:00

The GetSvcConfig() call here[1] can result in resolution alignment due to [2], which gets propagated to the output VideoCodec due to [3]. This CL adds test coverage for this part. It also removes some comments that are no longer true and updates VideoCodecInitializerTest's SetUpFor() to make number of simulcast streams explicit. [1] https://source.chromium.org/chromium/chromium/src/+/main:third_party/webrtc/modules/video_coding/video_codec_initializer.cc;l=251;drc=e4a304ed4da869ab6131a06b3e8b7e985f50229d [2] https://source.chromium.org/chromium/chromium/src/+/main:third_party/webrtc/modules/video_coding/codecs/vp9/svc_config.cc;l=112;drc=31acc7339cf658ce82c7ec490ba38d67170920ed [3] https://source.chromium.org/chromium/chromium/src/+/main:third_party/webrtc/modules/video_coding/video_codec_initializer.cc;l=285;drc=e4a304ed4da869ab6131a06b3e8b7e985f50229d Bug: webrtc:14884 Change-Id: Id22e36aebab573f53d15dca688642d32c8c4be7a Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/296762 Commit-Queue: Henrik Boström <hbos@webrtc.org> Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org> Cr-Commit-Position: refs/heads/main@{#39514}
40 lines
1.2 KiB
C++
40 lines
1.2 KiB
C++
/*
|
|
* Copyright (c) 2016 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.
|
|
*/
|
|
|
|
#ifndef MODULES_VIDEO_CODING_INCLUDE_VIDEO_CODEC_INITIALIZER_H_
|
|
#define MODULES_VIDEO_CODING_INCLUDE_VIDEO_CODEC_INITIALIZER_H_
|
|
|
|
#include <memory>
|
|
#include <string>
|
|
#include <vector>
|
|
|
|
#include "video/config/video_encoder_config.h"
|
|
|
|
namespace webrtc {
|
|
|
|
class VideoCodec;
|
|
|
|
class VideoCodecInitializer {
|
|
public:
|
|
// Takes a VideoEncoderConfig and the VideoStream configuration and
|
|
// translates them into the old school VideoCodec type.
|
|
static bool SetupCodec(const VideoEncoderConfig& config,
|
|
const std::vector<VideoStream>& streams,
|
|
VideoCodec* codec);
|
|
|
|
private:
|
|
static VideoCodec VideoEncoderConfigToVideoCodec(
|
|
const VideoEncoderConfig& config,
|
|
const std::vector<VideoStream>& streams);
|
|
};
|
|
|
|
} // namespace webrtc
|
|
|
|
#endif // MODULES_VIDEO_CODING_INCLUDE_VIDEO_CODEC_INITIALIZER_H_
|