Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
ftl
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Nicolas Pope
ftl
Commits
8496afc0
Commit
8496afc0
authored
5 years ago
by
Nicolas Pope
Browse files
Options
Downloads
Patches
Plain Diff
Allow command line net sources
parent
e823755c
No related branches found
No related tags found
No related merge requests found
Pipeline
#22521
passed
5 years ago
Stage: all
Stage: deploy
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
applications/gui/src/src_window.cpp
+28
-17
28 additions, 17 deletions
applications/gui/src/src_window.cpp
applications/gui/src/src_window.hpp
+2
-1
2 additions, 1 deletion
applications/gui/src/src_window.hpp
components/streams/src/netstream.cpp
+1
-0
1 addition, 0 deletions
components/streams/src/netstream.cpp
with
31 additions
and
18 deletions
applications/gui/src/src_window.cpp
+
28
−
17
View file @
8496afc0
...
...
@@ -155,6 +155,11 @@ SourceWindow::SourceWindow(ftl::gui::Screen *screen)
}
else
if
(
path
.
rfind
(
"device:"
,
0
)
==
0
)
{
ftl
::
URI
uri
(
path
);
uri
.
to_json
(
screen
->
root
()
->
getConfig
()[
"sources"
].
emplace_back
());
}
else
{
ftl
::
URI
uri
(
path
);
if
(
uri
.
getScheme
()
==
ftl
::
URI
::
SCHEME_TCP
)
{
screen
->
net
()
->
connect
(
path
);
}
}
}
...
...
@@ -325,19 +330,35 @@ void SourceWindow::_updateCameras(const vector<string> &netcams) {
if
(
netcams
.
size
()
==
0
)
return
;
for
(
auto
s
:
netcams
)
{
LOG
(
INFO
)
<<
"ADDING CAMERA: "
<<
s
;
if
(
available_
.
count
(
s
)
==
0
)
{
auto
*
stream
=
ftl
::
create
<
ftl
::
stream
::
Net
>
(
screen_
->
root
(),
string
(
"netstream"
)
+
std
::
to_string
(
available_
.
size
()
-
1
),
screen_
->
net
());
available_
[
s
]
=
stream
;
stream
->
set
(
"uri"
,
s
);
bool
isspecial
=
(
stream
->
get
<
std
::
string
>
(
"uri"
)
==
screen_
->
root
()
->
value
(
"data_stream"
,
std
::
string
(
""
)));
stream_
->
add
(
stream
,
(
isspecial
)
?
1
:
0
);
LOG
(
INFO
)
<<
"Add Stream: "
<<
stream
->
value
(
"uri"
,
std
::
string
(
"NONE"
));
}
// FIXME: Check for already existing...
//if (streams_.find(s) == cameras_.end()) {
available_
.
push_back
(
s
);
json_t
srcjson
;
srcjson
[
"uri"
]
=
s
;
screen_
->
root
()
->
getConfig
()[
"streams"
].
push_back
(
srcjson
);
//available_.push_back(s);
//json_t srcjson;
//srcjson["uri"] = s;
//screen_->root()->getConfig()["streams"].push_back(srcjson);
//screen_->root()->getConfig()["receivers"].push_back(json_t{});
//}
}
std
::
vector
<
ftl
::
stream
::
Net
*>
strms
=
ftl
::
createArray
<
ftl
::
stream
::
Net
>
(
screen_
->
root
(),
"streams"
,
screen_
->
net
());
//stream_->reset();
stream_
->
begin
();
//std::vector<ftl::stream::Net*> strms = ftl::createArray<ftl::stream::Net>(screen_->root(), "streams", screen_->net());
for
(
int
i
=
0
;
i
<
strms
.
size
();
++
i
)
{
/*
for (int i=0; i<strms.size(); ++i) {
auto *stream = strms[i];
bool isspecial = (stream->get<std::string>("uri") == screen_->root()->value("data_stream",std::string("")));
if (isspecial) LOG(INFO) << "Adding special stream";
...
...
@@ -348,18 +369,8 @@ void SourceWindow::_updateCameras(const vector<string> &netcams) {
//Scene *scene = new Scene(receiver);
//scenes_.push_back(scene);
/*if (.find(src->getURI()) == cameras_.end()) {
LOG(INFO) << "Making camera: " << src->getURI();
// TODO: Need to have GUI wrapper for an entire stream... which
// manages a set of cameras.
auto *cam = new ftl::gui::Camera(screen_, src);
cameras_[src->getURI()] = cam;
} else {
//LOG(INFO) << "Camera already exists: " << s;
}*/
}
}*/
//refresh_thumbs_ = true;
//if (thumbs_.size() != available_.size()) {
...
...
This diff is collapsed.
Click to expand it.
applications/gui/src/src_window.hpp
+
2
−
1
View file @
8496afc0
...
...
@@ -9,6 +9,7 @@
#include
<ftl/threads.hpp>
#include
<vector>
#include
<map>
#include
<unordered_map>
#include
<string>
#include
"gltexture.hpp"
...
...
@@ -66,7 +67,7 @@ class SourceWindow : public nanogui::Window {
ftl
::
stream
::
Intercept
*
interceptor_
;
ftl
::
stream
::
File
*
recorder_
;
ftl
::
stream
::
Receiver
*
receiver_
;
std
::
vector
<
std
::
string
>
available_
;
std
::
unordered_map
<
std
::
string
,
ftl
::
stream
::
Stream
*
>
available_
;
std
::
vector
<
GLTexture
>
thumbs_
;
bool
refresh_thumbs_
;
nanogui
::
Widget
*
ipanel_
;
...
...
This diff is collapsed.
Click to expand it.
components/streams/src/netstream.cpp
+
1
−
0
View file @
8496afc0
...
...
@@ -133,6 +133,7 @@ bool Net::post(const ftl::codecs::StreamPacket &spkt, const ftl::codecs::Packet
}
bool
Net
::
begin
()
{
if
(
active_
)
return
true
;
if
(
!
get
<
string
>
(
"uri"
))
return
false
;
active_
=
true
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment