A gstreamermm dynamic Gst::Pad example.
#include <gstreamermm.h>
#include <iostream>
int main(int argc, char *argv[])
{
try
{
pipeline->
add(source)->add(decodebin)->add(sink);
}
{
std::cerr <<
"Exception while adding: " << ex.what() <<
std::endl;
return 1;
}
try
{
}
{
std::cerr <<
"Exception while linking: " << ex.what() <<
std::endl;
}
{
break;
default:
break;
}
return true;
});
std::cout <<
"New pad added to " << decodebin->get_name() <<
std::endl;
{
std::cout <<
"Cannot link pads. Error: " << ret <<
std::endl;
}
else
{
std::cout <<
"Pads linked correctly!" <<
std::endl;
}
});
return 0;
}