#include "third_party/blink/renderer/platform/peerconnection/rtc_encoded_video_stream_transformer.h"
#include <inttypes.h>
#include <utility>
#include "base/memory/ptr_util.h"
#include "base/strings/stringprintf.h"
#include "base/synchronization/lock.h"
#include "base/task/single_thread_task_runner.h"
#include "third_party/blink/public/platform/modules/webrtc/webrtc_logging.h"
#include "third_party/blink/renderer/platform/heap/persistent.h"
#include "third_party/blink/renderer/platform/peerconnection/rtc_scoped_refptr_cross_thread_copier.h"
#include "third_party/blink/renderer/platform/scheduler/public/post_cross_thread_task.h"
#include "third_party/blink/renderer/platform/wtf/cross_thread_copier_base.h"
#include "third_party/blink/renderer/platform/wtf/cross_thread_copier_std.h"
#include "third_party/blink/renderer/platform/wtf/cross_thread_functional.h"
#include "third_party/webrtc/api/frame_transformer_interface.h"
#include "third_party/webrtc/rtc_base/ref_counted_object.h"
namespace blink {
namespace {
Metronome;
const size_t kMaxBufferedFrames = …;
class RTCEncodedVideoStreamTransformerDelegate
: public webrtc::FrameTransformerInterface { … };
}
RTCEncodedVideoStreamTransformer::Broker::Broker(
RTCEncodedVideoStreamTransformer* transformer_)
: … { … }
void RTCEncodedVideoStreamTransformer::Broker::
RegisterTransformedFrameSinkCallback(
rtc::scoped_refptr<webrtc::TransformedFrameCallback>
send_frame_to_sink_callback,
uint32_t ssrc) { … }
void RTCEncodedVideoStreamTransformer::Broker::
UnregisterTransformedFrameSinkCallback(uint32_t ssrc) { … }
void RTCEncodedVideoStreamTransformer::Broker::TransformFrameOnSourceTaskRunner(
std::unique_ptr<webrtc::TransformableVideoFrameInterface> frame) { … }
void RTCEncodedVideoStreamTransformer::Broker::SetTransformerCallback(
TransformerCallback callback) { … }
void RTCEncodedVideoStreamTransformer::Broker::ResetTransformerCallback() { … }
void RTCEncodedVideoStreamTransformer::Broker::SetSourceTaskRunner(
scoped_refptr<base::SingleThreadTaskRunner> task_runner) { … }
void RTCEncodedVideoStreamTransformer::Broker::ClearTransformer() { … }
void RTCEncodedVideoStreamTransformer::Broker::SendFrameToSink(
std::unique_ptr<webrtc::TransformableVideoFrameInterface> frame) { … }
void RTCEncodedVideoStreamTransformer::Broker::StartShortCircuiting() { … }
RTCEncodedVideoStreamTransformer::RTCEncodedVideoStreamTransformer(
scoped_refptr<base::SingleThreadTaskRunner> realm_task_runner,
std::unique_ptr<Metronome> metronome)
: … { … }
RTCEncodedVideoStreamTransformer::~RTCEncodedVideoStreamTransformer() { … }
void RTCEncodedVideoStreamTransformer::RegisterTransformedFrameSinkCallback(
rtc::scoped_refptr<webrtc::TransformedFrameCallback> callback,
uint32_t ssrc) { … }
void RTCEncodedVideoStreamTransformer::UnregisterTransformedFrameSinkCallback(
uint32_t ssrc) { … }
void RTCEncodedVideoStreamTransformer::TransformFrame(
std::unique_ptr<webrtc::TransformableVideoFrameInterface> frame) { … }
void RTCEncodedVideoStreamTransformer::SendFrameToSink(
std::unique_ptr<webrtc::TransformableVideoFrameInterface> frame) { … }
void RTCEncodedVideoStreamTransformer::StartShortCircuiting() { … }
void RTCEncodedVideoStreamTransformer::SetTransformerCallback(
TransformerCallback callback) { … }
void RTCEncodedVideoStreamTransformer::ResetTransformerCallback() { … }
bool RTCEncodedVideoStreamTransformer::HasTransformerCallback() { … }
bool RTCEncodedVideoStreamTransformer::HasTransformedFrameSinkCallback(
uint32_t ssrc) const { … }
rtc::scoped_refptr<webrtc::FrameTransformerInterface>
RTCEncodedVideoStreamTransformer::Delegate() { … }
void RTCEncodedVideoStreamTransformer::SetSourceTaskRunner(
scoped_refptr<base::SingleThreadTaskRunner> realm_task_runner) { … }
scoped_refptr<RTCEncodedVideoStreamTransformer::Broker>
RTCEncodedVideoStreamTransformer::GetBroker() { … }
void RTCEncodedVideoStreamTransformer::LogMessage(const std::string& message) { … }
}