mirror of
https://github.com/mollyim/webrtc.git
synced 2025-05-13 13:50:40 +01:00

Remove VCMEncodedFrame from the inheritance chain of EncodedFrames by - moving getters for EncodedImage fields up to EncodedImage - copying other non-deprecated fields & Methods from VCMEncodedFrame over to EncodedFrame - Removing EncodedFrame's inheritance of VCMEncodedFrame We leave VCMEncodedFrame as part of the (near) deprecated VideoCodingModule code. The only place which needs to accept either is in the generic decoder. Bug: webrtc:9378, b:296992877 Change-Id: I60706aebbb6eacc7fd4b35ec90cc903efdbe14c8 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/317160 Reviewed-by: Åsa Persson <asapersson@webrtc.org> Auto-Submit: Tony Herre <herre@google.com> Commit-Queue: Tony Herre <herre@google.com> Reviewed-by: Philip Eliasson <philipel@webrtc.org> Cr-Commit-Position: refs/heads/main@{#40639}
67 lines
2.4 KiB
C++
67 lines
2.4 KiB
C++
/*
|
|
* 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_
|
|
|
|
#include <memory>
|
|
#include <vector>
|
|
|
|
#include "api/field_trials_view.h"
|
|
#include "api/sequence_checker.h"
|
|
#include "api/video/encoded_frame.h"
|
|
#include "api/video_codecs/video_decoder.h"
|
|
#include "modules/video_coding/decoder_database.h"
|
|
#include "modules/video_coding/generic_decoder.h"
|
|
#include "modules/video_coding/timing/timing.h"
|
|
#include "rtc_base/system/no_unique_address.h"
|
|
#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:
|
|
VideoReceiver2(Clock* clock,
|
|
VCMTiming* timing,
|
|
const FieldTrialsView& field_trials);
|
|
~VideoReceiver2();
|
|
|
|
void RegisterReceiveCodec(uint8_t payload_type,
|
|
const VideoDecoder::Settings& decoder_settings);
|
|
void DeregisterReceiveCodec(uint8_t payload_type);
|
|
void DeregisterReceiveCodecs();
|
|
|
|
void RegisterExternalDecoder(std::unique_ptr<VideoDecoder> decoder,
|
|
uint8_t payload_type);
|
|
|
|
bool IsExternalDecoderRegistered(uint8_t payload_type) const;
|
|
int32_t RegisterReceiveCallback(VCMReceiveCallback* receive_callback);
|
|
|
|
int32_t Decode(const EncodedFrame* frame);
|
|
|
|
private:
|
|
RTC_NO_UNIQUE_ADDRESS SequenceChecker construction_sequence_checker_;
|
|
RTC_NO_UNIQUE_ADDRESS SequenceChecker decoder_sequence_checker_;
|
|
Clock* const clock_;
|
|
VCMDecodedFrameCallback decoded_frame_callback_;
|
|
// Callbacks are set before the decoder thread starts.
|
|
// Once the decoder thread has been started, usage of `_codecDataBase` moves
|
|
// over to the decoder thread.
|
|
VCMDecoderDatabase codec_database_;
|
|
};
|
|
|
|
} // namespace webrtc
|
|
|
|
#endif // MODULES_VIDEO_CODING_VIDEO_RECEIVER2_H_
|