1234567891011121314151617181920212223242526272829303132333435363738 |
- #include "overlay_video.h"
- COverlayVideo::COverlayVideo()
- {
- }
- void COverlayVideo::OnVideoData(const webrtc::VideoFrame& frame)
- {
- _broadcaster.OnFrame(frame);
- }
-
- void COverlayVideo::AddOrUpdateSink(rtc::VideoSinkInterface<webrtc::VideoFrame>* sink,
- const rtc::VideoSinkWants& wants)
- {
- _broadcaster.AddOrUpdateSink(sink, wants);
- }
- void COverlayVideo::RemoveSink(rtc::VideoSinkInterface<webrtc::VideoFrame>* sink)
- {
- _broadcaster.RemoveSink(sink);
- }
- rtc::scoped_refptr<webrtc::VideoTrackSourceInterface> OpenOverlayVideoTrack(IOverlayVideo* cap)
- {
- // ANativeWindow* window=(ANativeWindow *)data;
- auto capturer = dynamic_cast<COverlayVideo*>(cap);
- if (capturer == nullptr)
- {
-
- return { };
- }
- std::unique_ptr<COverlayVideo> video_capture(capturer);
- rtc::scoped_refptr<COverlayTrackSource> video_source = COverlayTrackSource::Create(std::move(video_capture));
- return video_source;
- }
- IOverlayVideo* CreateOverlayVideo()
- {
- return new COverlayVideo();
- }
|