#include <gstreamermm.h>
#include <glibmm/main.h>
int main(int argc, char *argv[])
{
Glib::RefPtr<Glib::MainLoop> main_loop = Glib::MainLoop::create();
try
{
pipeline->add(source)->add(decodebin)->add(sink);
}
{
return 1;
}
try
{
source->link(decodebin);
}
{
}
pipeline->get_bus()->add_watch([main_loop] (const Glib::RefPtr<Gst::Bus>&,
const Glib::RefPtr<Gst::Message>& message) {
switch (message->get_message_type())
{
case Gst::MESSAGE_EOS:
case Gst::MESSAGE_ERROR:
main_loop->quit();
break;
default:
break;
}
return true;
});
decodebin->signal_pad_added().connect([decodebin, sink] (const Glib::RefPtr<Gst::Pad>& pad) {
{
}
else
{
}
});
main_loop->run();
return 0;
}
basic_ostream< _CharT, _Traits > & endl(basic_ostream< _CharT, _Traits > &__os)
virtual const char * what() const _GLIBCXX_TXN_SAFE_DYN noexcept
static Glib::RefPtr< Gst::Element > create_element(const Glib::ustring &factory_name, const Glib::ustring &name)
Create a new element of the type defined by the given element factory.
static Glib::RefPtr< Pipeline > create()
Create a new pipeline with a unique generic name.
void init(int &argc, char **&argv)
Initializes gstreamermm parsing command line arguments.
@ STATE_NULL
The nullptr state or initial state of an element.
Definition: enums.h:96
@ STATE_PLAYING
The element is PLAYING, the Gst::Clock is running and the data is flowing.
Definition: enums.h:99
@ PAD_LINK_OK
Link succeeded.
Definition: pad.h:414