Open3D (C++ API)
0.19.0
Toggle main menu visibility
Loading...
Searching...
No Matches
cpp
open3d
visualization
webrtc_server
VideoFilter.h
Go to the documentation of this file.
1
// ----------------------------------------------------------------------------
2
// - Open3D: www.open3d.org -
3
// ----------------------------------------------------------------------------
4
// Copyright (c) 2018-2024 www.open3d.org
5
// SPDX-License-Identifier: MIT
6
// ----------------------------------------------------------------------------
7
// ----------------------------------------------------------------------------
8
// Contains source code from
9
// https://github.com/mpromonet/webrtc-streamer
10
//
11
// This software is in the public domain, furnished "as is", without technical
12
// support, and with no warranty, express or implied, as to its usefulness for
13
// any purpose.
14
// ----------------------------------------------------------------------------
15
//
16
// This is a private header. It shall be hidden from Open3D's public API. Do not
17
// put this in Open3D.h.in.
18
19
#pragma once
20
21
#include <pc/video_track_source.h>
22
23
#include "
open3d/visualization/webrtc_server/BitmapTrackSource.h
"
24
25
namespace
open3d
{
26
namespace
visualization
{
27
namespace
webrtc_server
{
28
34
template
<
class
T>
35
class
VideoFilter
:
public
BitmapTrackSource
{
36
public
:
37
static
rtc::scoped_refptr<VideoFilter>
Create
(
38
rtc::scoped_refptr<BitmapTrackSourceInterface> video_source,
39
const
std::map<std::string, std::string>& opts) {
40
std::unique_ptr<T> source = absl::WrapUnique(
new
T(video_source, opts));
41
if
(!source) {
42
return
nullptr
;
43
}
44
return
new
rtc::RefCountedObject<VideoFilter>(std::move(source));
45
}
46
47
protected
:
48
explicit
VideoFilter
(std::unique_ptr<T> source)
49
:
BitmapTrackSource
(
/*remote=*/
false), source_(
std
::move(source)) {}
50
51
SourceState
state
()
const override
{
return
kLive; }
52
bool
GetStats
(Stats* stats)
override
{
53
bool
result =
false
;
54
T* source = source_.get();
55
if
(source) {
56
stats->input_height = source->height();
57
stats->input_width = source->width();
58
result =
true
;
59
}
60
return
result;
61
}
62
63
private
:
64
rtc::VideoSourceInterface<webrtc::VideoFrame>*
source
()
override
{
65
return
source_.get();
66
}
67
std::unique_ptr<T> source_;
68
};
69
70
}
// namespace webrtc_server
71
}
// namespace visualization
72
}
// namespace open3d
BitmapTrackSource.h
open3d::visualization::webrtc_server::BitmapTrackSource::BitmapTrackSource
BitmapTrackSource(bool remote)
Definition
BitmapTrackSource.cpp:28
open3d::visualization::webrtc_server::BitmapTrackSource::source
virtual rtc::VideoSourceInterface< webrtc::VideoFrame > * source()=0
open3d::visualization::webrtc_server::VideoFilter::VideoFilter
VideoFilter(std::unique_ptr< T > source)
Definition
VideoFilter.h:48
open3d::visualization::webrtc_server::VideoFilter::state
SourceState state() const override
Definition
VideoFilter.h:51
open3d::visualization::webrtc_server::VideoFilter::Create
static rtc::scoped_refptr< VideoFilter > Create(rtc::scoped_refptr< BitmapTrackSourceInterface > video_source, const std::map< std::string, std::string > &opts)
Definition
VideoFilter.h:37
open3d::visualization::webrtc_server::VideoFilter::GetStats
bool GetStats(Stats *stats) override
Definition
VideoFilter.h:52
open3d::visualization::webrtc_server
Definition
BitmapTrackSource.cpp:26
open3d::visualization
Definition
ModelIO.h:14
open3d
Definition
PinholeCameraIntrinsic.cpp:16
std
Definition
Device.h:111
Generated by
1.17.0