Commit f4cb214c authored by Marcin Kolny's avatar Marcin Kolny

Gst::Message: update Message API

    * examples/media_player_gtkmm/player_window.cc: fix warning.
    * gstreamer/src/message.{ccg|hg}: parse() method name for MessageError,
      add some methods to MessageProgress.
parent 2945d079
......@@ -217,8 +217,7 @@ void PlayerWindow::on_video_changed()
}
}
Gst::PadProbeReturn PlayerWindow::on_video_pad_got_buffer(const Glib::RefPtr<Gst::Pad>& pad,
const Gst::PadProbeInfo& data)
Gst::PadProbeReturn PlayerWindow::on_video_pad_got_buffer(const Glib::RefPtr<Gst::Pad>& pad, const Gst::PadProbeInfo& /* data */)
{
int width_value;
int height_value;
......
......@@ -140,7 +140,7 @@ void MessageInfo::parse(Glib::Error& error, std::string& debug) const
error = Glib::Error(c_error);
}
Glib::Error MessageInfo::parse() const
Glib::Error MessageInfo::parse_error() const
{
GError* c_error = nullptr;
gst_message_parse_info(const_cast<GstMessage*>(gobj()), &c_error, nullptr);
......@@ -683,7 +683,7 @@ void MessageToc::parse(Glib::RefPtr<Gst::Toc>& toc, bool& updated) const
updated = updated;
}
void MessageProgress::parse(Gst::ProgressType& type, Glib::ustring code, Glib::ustring& text) const
void MessageProgress::parse(Gst::ProgressType& type, Glib::ustring& code, Glib::ustring& text) const
{
GstProgressType c_type;
gchar* c_code, * c_text;
......@@ -697,4 +697,46 @@ void MessageProgress::parse(Gst::ProgressType& type, Glib::ustring code, Glib::u
type = static_cast<Gst::ProgressType>(c_type);
}
Gst::ProgressType MessageProgress::parse_type() const
{
GstProgressType c_type;
gst_message_parse_progress(const_cast<GstMessage*>(gobj()),
&c_type, nullptr, nullptr);
return static_cast<Gst::ProgressType>(c_type);
}
Glib::ustring MessageProgress::parse_code() const
{
gchar* c_code;
Glib::ustring code;
gst_message_parse_progress(const_cast<GstMessage*>(gobj()),
nullptr, &c_code, nullptr);
code = c_code;
if(c_code)
g_free(c_code);
return code;
}
Glib::ustring MessageProgress::parse_text() const
{
gchar* c_text;
Glib::ustring text;
gst_message_parse_progress(const_cast<GstMessage*>(gobj()),
nullptr, nullptr, &c_text);
text = c_text;
if(c_text)
g_free(c_text);
return text;
}
} //namespace Gst
......@@ -231,7 +231,7 @@ public:
*
* @return The Glib::Error.
*/
Glib::Error parse() const;
Glib::Error parse_error() const;
/** Extracts and returns the debug message from the Gst::MessageInfo.
*
......@@ -1187,8 +1187,26 @@ public:
* @param code A code.
* @param text A text.
*/
void parse(Gst::ProgressType& type, Glib::ustring code, Glib::ustring& text) const;
void parse(Gst::ProgressType& type, Glib::ustring& code, Glib::ustring& text) const;
_IGNORE(gst_message_parse_progress)
/** Extracts and returns the ProgressType from the Gst::MessageProgress.
*
* @return The ProgressType.
*/
Gst::ProgressType parse_type() const;
/** Extracts and returns the code from the Gst::MessageProgress.
*
* @return The code.
*/
Glib::ustring parse_code() const;
/** Extracts and returns the text from the Gst::MessageProgress.
*
* @return The text.
*/
Glib::ustring parse_text() const;
};
} //namespace Gst
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment