Remove VCMEncoderDataBase and put remaining code into VideoStreamEncoder

Since this "data base" only holds a single encoder instance it just
serves to confuse object ownership. Removing it and giving ownership
of generic encoder instance to VideoStreamEncoder.

This CL also removes VideoSender interface from video_coding_impl.h,
which is mostly a leftover from
https://webrtc-review.googlesource.com/c/src/+/123540

Bug: webrtc:10164
Change-Id: I9b7fec940dbcbccf3aa1278c2555da3bd5169ae1
Reviewed-on: https://webrtc-review.googlesource.com/c/123920
Commit-Queue: Erik Språng <sprang@webrtc.org>
Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26835}
This commit is contained in:
Erik Språng
2019-02-25 11:18:24 +01:00
committed by Commit Bot
parent 2b08e3188e
commit 715c4765b1
7 changed files with 119 additions and 319 deletions

View File

@ -19,7 +19,6 @@
#include "absl/types/optional.h"
#include "modules/video_coding/decoder_database.h"
#include "modules/video_coding/encoder_database.h"
#include "modules/video_coding/frame_buffer.h"
#include "modules/video_coding/generic_decoder.h"
#include "modules/video_coding/generic_encoder.h"
@ -57,47 +56,6 @@ class VCMProcessTimer {
int64_t _latestMs;
};
class VideoSender {
public:
typedef VideoCodingModule::SenderNackMode SenderNackMode;
VideoSender(Clock* clock, EncodedImageCallback* post_encode_callback);
~VideoSender();
// Register the send codec to be used.
// This method must be called on the construction thread.
int32_t RegisterSendCodec(const VideoCodec* sendCodec,
uint32_t numberOfCores,
uint32_t maxPayloadSize);
void RegisterExternalEncoder(VideoEncoder* externalEncoder,
bool internalSource);
// Update the the encoder with new bitrate allocation and framerate.
int32_t SetChannelParameters(const VideoBitrateAllocation& bitrate_allocation,
uint32_t framerate_fps);
int32_t AddVideoFrame(const VideoFrame& videoFrame,
const CodecSpecificInfo* codecSpecificInfo,
absl::optional<VideoEncoder::EncoderInfo> encoder_info);
int32_t IntraFrameRequest(size_t stream_index);
private:
rtc::CriticalSection encoder_crit_;
VCMGenericEncoder* _encoder;
VCMEncodedFrameCallback _encodedFrameCallback RTC_GUARDED_BY(encoder_crit_);
VCMEncoderDataBase _codecDataBase RTC_GUARDED_BY(encoder_crit_);
// Must be accessed on the construction thread of VideoSender.
VideoCodec current_codec_;
rtc::SequencedTaskChecker sequenced_checker_;
rtc::CriticalSection params_crit_;
bool encoder_has_internal_source_ RTC_GUARDED_BY(params_crit_);
std::vector<FrameType> next_frame_types_ RTC_GUARDED_BY(params_crit_);
};
class VideoReceiver : public Module {
public:
VideoReceiver(Clock* clock,