123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172 |
- #ifndef API_VIDEO_CODECS_VIDEO_CODEC_H_
- #define API_VIDEO_CODECS_VIDEO_CODEC_H_
- #include <stddef.h>
- #include <stdint.h>
- #include <string>
- #include "absl/types/optional.h"
- #include "api/video/video_bitrate_allocation.h"
- #include "api/video/video_codec_type.h"
- #include "api/video_codecs/spatial_layer.h"
- #include "rtc_base/system/rtc_export.h"
- namespace webrtc {
- enum class VideoCodecComplexity {
- kComplexityNormal = 0,
- kComplexityHigh = 1,
- kComplexityHigher = 2,
- kComplexityMax = 3
- };
- struct VideoCodecVP8 {
- bool operator==(const VideoCodecVP8& other) const;
- bool operator!=(const VideoCodecVP8& other) const {
- return !(*this == other);
- }
- VideoCodecComplexity complexity;
- unsigned char numberOfTemporalLayers;
- bool denoisingOn;
- bool automaticResizeOn;
- bool frameDroppingOn;
- int keyFrameInterval;
- };
- enum class InterLayerPredMode : int {
- kOff = 0,
- kOn = 1,
- kOnKeyPic = 2
- };
- struct VideoCodecVP9 {
- bool operator==(const VideoCodecVP9& other) const;
- bool operator!=(const VideoCodecVP9& other) const {
- return !(*this == other);
- }
- VideoCodecComplexity complexity;
- unsigned char numberOfTemporalLayers;
- bool denoisingOn;
- bool frameDroppingOn;
- int keyFrameInterval;
- bool adaptiveQpMode;
- bool automaticResizeOn;
- unsigned char numberOfSpatialLayers;
- bool flexibleMode;
- InterLayerPredMode interLayerPred;
- };
- struct VideoCodecH264 {
- bool operator==(const VideoCodecH264& other) const;
- bool operator!=(const VideoCodecH264& other) const {
- return !(*this == other);
- }
- bool frameDroppingOn;
- int keyFrameInterval;
- uint8_t numberOfTemporalLayers;
- };
- RTC_EXPORT const char* CodecTypeToPayloadString(VideoCodecType type);
- RTC_EXPORT VideoCodecType PayloadStringToCodecType(const std::string& name);
- union VideoCodecUnion {
- VideoCodecVP8 VP8;
- VideoCodecVP9 VP9;
- VideoCodecH264 H264;
- };
- enum class VideoCodecMode { kRealtimeVideo, kScreensharing };
- class RTC_EXPORT VideoCodec {
- public:
- VideoCodec();
-
- VideoCodecType codecType;
-
- uint16_t width;
- uint16_t height;
- unsigned int startBitrate;
- unsigned int maxBitrate;
- unsigned int minBitrate;
- uint32_t maxFramerate;
-
-
- bool active;
- unsigned int qpMax;
- unsigned char numberOfSimulcastStreams;
- SpatialLayer simulcastStream[kMaxSimulcastStreams];
- SpatialLayer spatialLayers[kMaxSpatialLayers];
- VideoCodecMode mode;
- bool expect_encode_from_texture;
-
-
-
-
- absl::optional<int> buffer_pool_size;
-
-
-
-
-
-
-
-
- struct TimingFrameTriggerThresholds {
- int64_t delay_ms;
- uint16_t outlier_ratio_percent;
- } timing_frame_thresholds;
-
- bool legacy_conference_mode;
- bool operator==(const VideoCodec& other) const = delete;
- bool operator!=(const VideoCodec& other) const = delete;
-
-
-
-
- VideoCodecVP8* VP8();
- const VideoCodecVP8& VP8() const;
- VideoCodecVP9* VP9();
- const VideoCodecVP9& VP9() const;
- VideoCodecH264* H264();
- const VideoCodecH264& H264() const;
- private:
-
-
- VideoCodecUnion codec_specific_;
- };
- }
- #endif
|