-
Notifications
You must be signed in to change notification settings - Fork 27
add splash video #90
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
add splash video #90
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know gstreamer well enough to fully understand what's going on. Just added a few notes and questions
|
||
splash_enabled = config["splash"]["enabled"].as<bool>(false); | ||
splash_file = config["splash"]["file"].as<std::string>(""); | ||
splash_timeout = config["splash"]["timeout"].as<int>(3); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
might be better to pass splash config as arguments rather than extracting them from yaml
. This is to not "contaminate" the whole codebase with configuration file details. IMO it's better to extract all the data from YAML config in the main.cpp:main
function - this way we can detect config errors at early stage rather than crash somewhere deep
initGstreamerOrThrow(); | ||
splash_enabled = config["splash"]["enabled"].as<bool>(false); | ||
splash_file = config["splash"]["file"].as<std::string>(""); | ||
splash_timeout = config["splash"]["timeout"].as<int>(3); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the same comment - maybe pass those parameters from main
function?
<< "selector.sink_0 "; | ||
} | ||
|
||
// Banch 2: Backup filesrc |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
backup?
ss << "filesrc name=filesrc location=\"" << splash_file << "\" ! qtdemux ! " | ||
<< "queue max-size-buffers=0 max-size-time=0 max-size-bytes=0 ! " | ||
<< pipeline::create_parse_for_codec(m_video_codec) | ||
<< "selector.sink_1 "; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if I start a DVR while splash is playing, would it record the splash?
Also, if I lost the video link with the drone (it went out of range) would it mean the splash going to start?
if (!m_bus) return; | ||
|
||
GstMessage *msg = gst_bus_pop(m_bus); | ||
while (msg) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can it be while (msg = gst_bus_pop(m_bus)) {...
? Sorry if dumb, C is not my professional tool
This PR adds a splash video feature.
When no video is received it will play the configured video in a loop.
The feature is configurable in
pixelpilot.yaml
splash_demo.mp4