-
Notifications
You must be signed in to change notification settings - Fork 689
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
Add dialog to display streams' audio details #5547
Add dialog to display streams' audio details #5547
Conversation
g_object_unref(discoverer_); | ||
} | ||
|
||
void StreamDiscoverer::discover(QString url) { |
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.
Please follow the style guide: https://google.github.io/styleguide/cppguide.html
e.g. Discover
not discover
and `const QString& url
qLog(Debug) << "Discover" << url; | ||
std::string url_std = url.toStdString(); | ||
const char* url_c = url_std.c_str(); | ||
if (!gst_discoverer_discover_uri_async(discoverer_, url_c)) { |
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.
inline url.toStdString().c_str()
if (!gst_discoverer_discover_uri_async(discoverer_, url_c)) { | ||
qLog(Error) << "Failed to start discovering" << url | ||
<< endl; | ||
g_object_unref(discoverer_); |
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.
This is done in the destructor anyway
} | ||
|
||
// Creating a loop and setting it to run. That way we can wait for signals. | ||
QEventLoop loop; |
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.
WaitForSignal(this, SIGNAL(DiscovererFinished()))
loop.exec(); | ||
} | ||
|
||
void StreamDiscoverer::on_discovered_cb(GstDiscoverer* discoverer, |
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.
OnDiscovered
// Get audio streams (we will only care about the first one, which should be the only one). | ||
GList* audio_streams = gst_discoverer_info_get_audio_streams(info); | ||
|
||
if (audio_streams != NULL) { |
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.
nullptr
private: | ||
GstDiscoverer* discoverer_; | ||
|
||
static const unsigned int kDiscoveryTimeoutS; |
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.
remove unsigned
static void on_finished_cb(GstDiscoverer* discoverer, gpointer instance); | ||
|
||
// Helper to return descriptive error messages: | ||
static QString gstDiscovererErrorMessage(GstDiscovererResult result); |
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.
GstDiscovererErrorMessage
void on_buttonBox_rejected(); | ||
|
||
private: | ||
Ui::StreamDetailsDialog* ui; |
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.
std::unique_ptr<Ui::StreamDetailsDialog> ui_
void setSampleRate(unsigned int); | ||
|
||
private slots: | ||
void on_buttonBox_rejected(); |
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.
Close()
struct StreamDetails { | ||
QString url; | ||
QString format; | ||
unsigned int bitrate; |
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.
unsigned
just makes it harder to read.
More info: #5455.