This cl move VideoEncoderConfig from api/ to video/config. VideoStreamEncoderInterface and VideoStreamEncoderObserver are moved as collateral. brandt@ think that the reason these were in api/ in the first place had to downstream project. Functionality wise, this is a NOP, but it makes it easier to modify the encoder (config). Bug: webrtc:14451 Change-Id: I2610d815aeb186298498e7102cac773ecac8cd36 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/277002 Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org> Reviewed-by: Rasmus Brandt <brandtr@webrtc.org> Reviewed-by: Artem Titov <titovartem@webrtc.org> Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org> Commit-Queue: Jonas Oreland <jonaso@webrtc.org> Cr-Commit-Position: refs/heads/main@{#38242}
73 lines
2.4 KiB
C++
73 lines
2.4 KiB
C++
/*
|
|
* Copyright (c) 2022 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 VIDEO_CONFIG_ENCODER_STREAM_FACTORY_H_
|
|
#define VIDEO_CONFIG_ENCODER_STREAM_FACTORY_H_
|
|
|
|
#include <string>
|
|
#include <vector>
|
|
|
|
#include "api/transport/field_trial_based_config.h"
|
|
#include "api/units/data_rate.h"
|
|
#include "video/config/video_encoder_config.h"
|
|
|
|
namespace cricket {
|
|
|
|
class EncoderStreamFactory
|
|
: public webrtc::VideoEncoderConfig::VideoStreamFactoryInterface {
|
|
public:
|
|
EncoderStreamFactory(std::string codec_name,
|
|
int max_qp,
|
|
bool is_screenshare,
|
|
bool conference_mode)
|
|
: EncoderStreamFactory(codec_name,
|
|
max_qp,
|
|
is_screenshare,
|
|
conference_mode,
|
|
nullptr) {}
|
|
|
|
EncoderStreamFactory(std::string codec_name,
|
|
int max_qp,
|
|
bool is_screenshare,
|
|
bool conference_mode,
|
|
const webrtc::FieldTrialsView* trials);
|
|
|
|
private:
|
|
std::vector<webrtc::VideoStream> CreateEncoderStreams(
|
|
int width,
|
|
int height,
|
|
const webrtc::VideoEncoderConfig& encoder_config) override;
|
|
|
|
std::vector<webrtc::VideoStream> CreateDefaultVideoStreams(
|
|
int width,
|
|
int height,
|
|
const webrtc::VideoEncoderConfig& encoder_config,
|
|
const absl::optional<webrtc::DataRate>& experimental_min_bitrate) const;
|
|
|
|
std::vector<webrtc::VideoStream>
|
|
CreateSimulcastOrConferenceModeScreenshareStreams(
|
|
int width,
|
|
int height,
|
|
const webrtc::VideoEncoderConfig& encoder_config,
|
|
const absl::optional<webrtc::DataRate>& experimental_min_bitrate) const;
|
|
|
|
const std::string codec_name_;
|
|
const int max_qp_;
|
|
const bool is_screenshare_;
|
|
// Allows a screenshare specific configuration, which enables temporal
|
|
// layering and various settings.
|
|
const bool conference_mode_;
|
|
const webrtc::FieldTrialBasedConfig fallback_trials_;
|
|
const webrtc::FieldTrialsView& trials_;
|
|
};
|
|
|
|
} // namespace cricket
|
|
|
|
#endif // VIDEO_CONFIG_ENCODER_STREAM_FACTORY_H_
|