2019-09-09 12:51:55 +02:00
|
|
|
/*
|
|
|
|
|
* Copyright (c) 2019 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 MODULES_VIDEO_CODING_VIDEO_RECEIVER2_H_
|
|
|
|
|
#define MODULES_VIDEO_CODING_VIDEO_RECEIVER2_H_
|
|
|
|
|
|
2022-08-22 12:56:38 +02:00
|
|
|
#include <memory>
|
|
|
|
|
#include <vector>
|
|
|
|
|
|
2022-03-29 11:04:48 +02:00
|
|
|
#include "api/field_trials_view.h"
|
2021-02-10 14:31:24 +01:00
|
|
|
#include "api/sequence_checker.h"
|
2021-08-13 16:50:37 +02:00
|
|
|
#include "api/video_codecs/video_decoder.h"
|
2019-09-09 12:51:55 +02:00
|
|
|
#include "modules/video_coding/decoder_database.h"
|
|
|
|
|
#include "modules/video_coding/encoded_frame.h"
|
|
|
|
|
#include "modules/video_coding/generic_decoder.h"
|
2022-05-25 12:03:35 +02:00
|
|
|
#include "modules/video_coding/timing/timing.h"
|
2022-09-29 12:24:02 +02:00
|
|
|
#include "rtc_base/system/no_unique_address.h"
|
2019-09-09 12:51:55 +02:00
|
|
|
#include "system_wrappers/include/clock.h"
|
|
|
|
|
|
|
|
|
|
namespace webrtc {
|
|
|
|
|
|
|
|
|
|
// This class is a copy of vcm::VideoReceiver, trimmed down to what's used by
|
|
|
|
|
// VideoReceive stream, with the aim to incrementally trim it down further and
|
|
|
|
|
// ultimately delete it. It's difficult to do this incrementally with the
|
|
|
|
|
// original VideoReceiver class, since it is used by the legacy
|
|
|
|
|
// VideoCodingModule api.
|
|
|
|
|
class VideoReceiver2 {
|
|
|
|
|
public:
|
2022-03-25 12:43:14 +01:00
|
|
|
VideoReceiver2(Clock* clock,
|
|
|
|
|
VCMTiming* timing,
|
2022-03-29 11:04:48 +02:00
|
|
|
const FieldTrialsView& field_trials);
|
2019-09-09 12:51:55 +02:00
|
|
|
~VideoReceiver2();
|
|
|
|
|
|
2021-08-13 18:15:55 +02:00
|
|
|
void RegisterReceiveCodec(uint8_t payload_type,
|
2021-08-13 16:50:37 +02:00
|
|
|
const VideoDecoder::Settings& decoder_settings);
|
2022-09-29 12:24:02 +02:00
|
|
|
void DeregisterReceiveCodec(uint8_t payload_type);
|
|
|
|
|
void DeregisterReceiveCodecs();
|
2019-09-09 12:51:55 +02:00
|
|
|
|
2022-08-22 12:56:38 +02:00
|
|
|
void RegisterExternalDecoder(std::unique_ptr<VideoDecoder> decoder,
|
|
|
|
|
uint8_t payload_type);
|
|
|
|
|
|
|
|
|
|
bool IsExternalDecoderRegistered(uint8_t payload_type) const;
|
|
|
|
|
int32_t RegisterReceiveCallback(VCMReceiveCallback* receive_callback);
|
2019-09-09 12:51:55 +02:00
|
|
|
|
2022-08-22 12:56:38 +02:00
|
|
|
int32_t Decode(const VCMEncodedFrame* frame);
|
2019-09-09 12:51:55 +02:00
|
|
|
|
|
|
|
|
private:
|
2022-09-29 12:24:02 +02:00
|
|
|
RTC_NO_UNIQUE_ADDRESS SequenceChecker construction_sequence_checker_;
|
|
|
|
|
RTC_NO_UNIQUE_ADDRESS SequenceChecker decoder_sequence_checker_;
|
2019-09-09 12:51:55 +02:00
|
|
|
Clock* const clock_;
|
2022-08-22 12:56:38 +02:00
|
|
|
VCMDecodedFrameCallback decoded_frame_callback_;
|
2019-09-09 12:51:55 +02:00
|
|
|
// Callbacks are set before the decoder thread starts.
|
2021-08-09 13:02:57 +02:00
|
|
|
// Once the decoder thread has been started, usage of `_codecDataBase` moves
|
2019-09-09 12:51:55 +02:00
|
|
|
// over to the decoder thread.
|
2022-09-29 14:13:15 +02:00
|
|
|
VCMDecoderDatabase codec_database_;
|
2019-09-09 12:51:55 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
} // namespace webrtc
|
|
|
|
|
|
|
|
|
|
#endif // MODULES_VIDEO_CODING_VIDEO_RECEIVER2_H_
|