blob: 9a9889a0844799ec29dfb2e9c17bb44c7af46f57 [file] [log] [blame]
Niels Möller213618e2018-07-24 09:29:58 +02001/*
2 * Copyright (c) 2018 The WebRTC project authors. All Rights Reserved.
3 *
4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree.
9 */
10
11#ifndef API_VIDEO_VIDEO_STREAM_ENCODER_SETTINGS_H_
12#define API_VIDEO_VIDEO_STREAM_ENCODER_SETTINGS_H_
13
Jiawei Ouc2ebe212018-11-08 10:02:56 -080014#include "api/video/video_bitrate_allocator_factory.h"
Elad Alon370f93a2019-06-11 14:57:57 +020015#include "api/video_codecs/video_encoder.h"
Niels Möller213618e2018-07-24 09:29:58 +020016#include "api/video_codecs/video_encoder_factory.h"
17
18namespace webrtc {
19
philipele8ed8302019-07-03 11:53:48 +020020class EncoderFailureCallback {
21 public:
22 virtual ~EncoderFailureCallback() {}
23 virtual void OnEncoderFailure() = 0;
24};
25
Niels Möller213618e2018-07-24 09:29:58 +020026struct VideoStreamEncoderSettings {
Elad Alon370f93a2019-06-11 14:57:57 +020027 explicit VideoStreamEncoderSettings(
28 const VideoEncoder::Capabilities& capabilities)
29 : capabilities(capabilities) {}
Niels Möller213618e2018-07-24 09:29:58 +020030
31 // Enables the new method to estimate the cpu load from encoding, used for
32 // cpu adaptation.
33 bool experiment_cpu_load_estimator = false;
34
35 // Ownership stays with WebrtcVideoEngine (delegated from PeerConnection).
36 VideoEncoderFactory* encoder_factory = nullptr;
Jiawei Ouc2ebe212018-11-08 10:02:56 -080037
philipele8ed8302019-07-03 11:53:48 +020038 // Notifies the WebRtcVideoChannel that the currently used encoder is broken.
39 EncoderFailureCallback* encoder_failure_callback = nullptr;
40
Jiawei Ouc2ebe212018-11-08 10:02:56 -080041 // Ownership stays with WebrtcVideoEngine (delegated from PeerConnection).
42 VideoBitrateAllocatorFactory* bitrate_allocator_factory = nullptr;
Elad Alon370f93a2019-06-11 14:57:57 +020043
44 // Negotiated capabilities which the VideoEncoder may expect the other
45 // side to use.
46 VideoEncoder::Capabilities capabilities;
Niels Möller213618e2018-07-24 09:29:58 +020047};
48
49} // namespace webrtc
50
51#endif // API_VIDEO_VIDEO_STREAM_ENCODER_SETTINGS_H_