|
This post was updated on .
Hello,
I have a pipeline:
constexpr char kSenderPipeline[] =
"alsasrc ! "
"deinterleave name=d d.src_1 ! "
"audio/x-raw,format=S16LE,channels=1 ! "
"audioresample ! "
"opusenc bandwidth=narrowband ! "
"rtpopuspay ! "
"udpsink name=ptt_udpsink";
Depending on network availability I want to be able to change IP addrress on udpsink element. Right now I'm doing it like this:
// Updates an IP address on udpsink element. The audio stream will be sent to
// different IP address.
void UpdateUdpsinkHostAddress(const gpointer udpsink,
const ::std::string &host) {
g_object_set(udpsink, "host", host.c_str(), "port", kPort, nullptr);
}
This function could be called from different threads, and I'm using mutex to ensure that only one thread can call it at a time.
But I don't know what happens with a thread that runs udpsink. Is it safe to do so without stopping pipeline?
|