ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
BitmapTrackSource.cpp
Go to the documentation of this file.
1 // ----------------------------------------------------------------------------
2 // - CloudViewer: www.cloudViewer.org -
3 // ----------------------------------------------------------------------------
4 // Copyright (c) 2018-2024 www.cloudViewer.org
5 // SPDX-License-Identifier: MIT
6 // ----------------------------------------------------------------------------
7 // --------------------------------------------------------------------------
8 // Modified from: WebRTC src/pc/video_track_source.cc
9 //
10 // Copyright 2016 The WebRTC project authors. All Rights Reserved.
11 //
12 // Use of this source code is governed by a BSD-style license
13 // that can be found in the LICENSE file in the root of the source
14 // tree. An additional intellectual property rights grant can be found
15 // in the file PATENTS. All contributing project authors may
16 // be found in the AUTHORS file in the root of the source tree.
17 // ----------------------------------------------------------------------------
18 
20 
21 #include <pc/video_track_source.h>
22 #include <rtc_base/checks.h>
23 
24 namespace cloudViewer {
25 namespace visualization {
26 namespace webrtc_server {
27 
29  : state_(kInitializing), remote_(remote) {
30  worker_thread_checker_.Detach();
31 }
32 
34  webrtc::MediaSourceInterface::SourceState new_state) {
35  if (state_ != new_state) {
36  state_ = new_state;
37  FireOnChanged();
38  }
39 }
40 
42  rtc::VideoSinkInterface<webrtc::VideoFrame>* sink,
43  const rtc::VideoSinkWants& wants) {
44  RTC_DCHECK(worker_thread_checker_.IsCurrent());
45  source()->AddOrUpdateSink(sink, wants);
46 }
47 
49  rtc::VideoSinkInterface<webrtc::VideoFrame>* sink) {
50  RTC_DCHECK(worker_thread_checker_.IsCurrent());
51  source()->RemoveSink(sink);
52 }
53 
54 } // namespace webrtc_server
55 } // namespace visualization
56 } // namespace cloudViewer
void RemoveSink(rtc::VideoSinkInterface< webrtc::VideoFrame > *sink) override
void SetState(webrtc::MediaSourceInterface::SourceState new_state)
void AddOrUpdateSink(rtc::VideoSinkInterface< webrtc::VideoFrame > *sink, const rtc::VideoSinkWants &wants) override
virtual rtc::VideoSourceInterface< webrtc::VideoFrame > * source()=0
Generic file read and write utility for python interface.