Repo created

This commit is contained in:
Fr4nz D13trich 2025-11-22 14:04:28 +01:00
parent 81b91f4139
commit f8c34fa5ee
22732 changed files with 4815320 additions and 2 deletions

View file

@ -0,0 +1,43 @@
#include "FakeInterface.h"
#include "api/video_codecs/builtin_video_encoder_factory.h"
#include "api/video_codecs/builtin_video_decoder_factory.h"
//#include "api/video_track_source_proxy.h"
namespace tgcalls {
std::unique_ptr<webrtc::VideoEncoderFactory> FakeInterface::makeVideoEncoderFactory(bool preferHardwareEncoding, bool isScreencast) {
return webrtc::CreateBuiltinVideoEncoderFactory();
}
std::unique_ptr<webrtc::VideoDecoderFactory> FakeInterface::makeVideoDecoderFactory() {
return webrtc::CreateBuiltinVideoDecoderFactory();
}
webrtc::scoped_refptr<webrtc::VideoTrackSourceInterface> FakeInterface::makeVideoSource(rtc::Thread *signalingThread,
rtc::Thread *workerThread) {
return nullptr;
}
bool FakeInterface::supportsEncoding(const std::string &codecName) {
return false;
//return (codecName == cricket::kH264CodecName) || (codecName == cricket::kVp8CodecName);
}
void FakeInterface::adaptVideoSource(webrtc::scoped_refptr<webrtc::VideoTrackSourceInterface> videoSource, int width,
int height, int fps) {
}
std::unique_ptr<VideoCapturerInterface> FakeInterface::makeVideoCapturer(
webrtc::scoped_refptr<webrtc::VideoTrackSourceInterface> source, std::string deviceId,
std::function<void(VideoState)> stateUpdated, std::function<void(PlatformCaptureInfo)> captureInfoUpdated,
std::shared_ptr<PlatformContext> platformContext, std::pair<int, int> &outResolution) {
return nullptr;
//return std::make_unique<VideoCapturerInterfaceImpl>(source, deviceId, stateUpdated, outResolution);
}
std::unique_ptr<PlatformInterface> CreatePlatformInterface() {
return std::make_unique<FakeInterface>();
}
} // namespace tgcalls

View file

@ -0,0 +1,24 @@
#pragma once
#include "platform/PlatformInterface.h"
#include "VideoCapturerInterface.h"
namespace tgcalls {
class FakeInterface : public PlatformInterface {
public:
std::unique_ptr<webrtc::VideoEncoderFactory> makeVideoEncoderFactory(bool preferHardwareEncoding, bool isScreencast) override;
std::unique_ptr<webrtc::VideoDecoderFactory> makeVideoDecoderFactory() override;
bool supportsEncoding(const std::string &codecName) override;
webrtc::scoped_refptr<webrtc::VideoTrackSourceInterface> makeVideoSource(rtc::Thread *signalingThread,
rtc::Thread *workerThread) override;
void adaptVideoSource(webrtc::scoped_refptr<webrtc::VideoTrackSourceInterface> videoSource, int width, int height,
int fps) override;
std::unique_ptr<VideoCapturerInterface> makeVideoCapturer(
webrtc::scoped_refptr<webrtc::VideoTrackSourceInterface> source, std::string deviceId,
std::function<void(VideoState)> stateUpdated, std::function<void(PlatformCaptureInfo)> captureInfoUpdated,
std::shared_ptr<PlatformContext> platformContext, std::pair<int, int> &outResolution) override;
};
} // namespace tgcalls