/* * Copyright (c) 2013 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.
*/
class FakeEncoder : public VideoEncoder { public: explicit FakeEncoder(const Environment& env_); virtual ~FakeEncoder() = default;
// Sets max bitrate. Not thread-safe, call before registering the encoder. void SetMaxBitrate(int max_kbps) RTC_LOCKS_EXCLUDED(mutex_); void SetQp(int qp) RTC_LOCKS_EXCLUDED(mutex_);
protected: struct FrameInfo { bool keyframe; struct SpatialLayer {
SpatialLayer() = default;
SpatialLayer(int size, int temporal_id)
: size(size), temporal_id(temporal_id) {} // Size of a current frame in the layer. int size = 0; // Temporal index of a current frame in the layer. int temporal_id = 0;
};
std::vector<SpatialLayer> layers;
};
// Called before the frame is passed to callback_->OnEncodedImage, to let // subclasses fill out CodecSpecificInfo, possibly modify `encoded_image` or // `buffer`. virtual CodecSpecificInfo EncodeHook(
EncodedImage& encoded_image,
rtc::scoped_refptr<EncodedImageBuffer> buffer);
private: int delay_ms_ RTC_GUARDED_BY(sequence_checker_);
SequenceChecker sequence_checker_;
};
// This class implements a multi-threaded fake encoder by posting // FakeH264Encoder::Encode(.) tasks to `queue1_` and `queue2_`, in an // alternating fashion. The class itself does not need to be thread safe, // as it is called from the task queue in VideoStreamEncoder. class MultithreadedFakeH264Encoder : public test::FakeH264Encoder { public: explicit MultithreadedFakeH264Encoder(const Environment& env); virtual ~MultithreadedFakeH264Encoder() = default;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.