void _removeElement(GstElements& elements, GstElement* removeElement);
GstElement*_createElement(std::string factory_name, std::string name ="");
void _connectAndAppendSignal(GList** signals, GObject* obj, const char* sig_name, GCallback cb, gpointer user_data);
+void _disconnectSignal(GList** signals, GObject* obj);
void _disconnectSignal(gpointer data);
bool _addNoTargetGhostpad(GstBin* bin, GstPad** new_pad, bool is_src);
bool _setGhostpadTarget(GstPad* ghost_pad, GstElement* target_element, bool is_src);
Name: capi-media-transporter
Summary: A Media Transporter library in Tizen Native API
-Version: 1.0.12
+Version: 1.0.13
Release: 0
Group: Multimedia/API
License: Apache-2.0
sig_name, sig_data->signal_id, GST_OBJECT_NAME(sig_data->obj));
}
+void gst::_disconnectSignal(GList** signals, GObject* obj)
+{
+ GList* tmp = *signals;
+
+ while (tmp) {
+ auto sig_data = static_cast<gst::mtprSignal*>(tmp->data);
+ RET_IF(!sig_data, "sig_data is NULL");
+
+ tmp = g_list_next(tmp);
+
+ if (sig_data->obj != obj)
+ continue;
+
+ *signals = g_list_remove(*signals, sig_data);
+ _disconnectSignal(sig_data);
+ }
+}
+
void gst::_disconnectSignal(gpointer data)
{
auto sig_data = static_cast<gst::mtprSignal*>(data);
g_object_set(G_OBJECT(element), "caps", newCaps, NULL);
gst_caps_unref(newCaps);
-}
\ No newline at end of file
+}
} catch (const MediaTransporterException& e) {
LOG_ERROR("%s", e.what());
+ gst::_disconnectSignal(&_gst.signals, G_OBJECT(tsdemux));
+
gst::_destroyElementFromParent(src);
gst::_destroyElementFromParent(rtpmp2tdepay);
gst::_destroyElementFromParent(queue);
ERROR:
if (decodebin) {
+ gst::_disconnectSignal(&rtsp->_gst.signals, G_OBJECT(decodebin));
+
gst_element_set_state(decodebin, GST_STATE_NULL);
if (!gst_bin_remove(GST_BIN(rtsp->_gst.pipeline), decodebin))
gst_object_unref(decodebin);
} catch (const MediaTransporterException& e) {
LOG_ERROR("%s", e.what());
+
+ gst::_disconnectSignal(&_gst.signals, G_OBJECT(src));
gst::_destroyElementFromParent(src);
throw;
}
} catch (const MediaTransporterException& e) {
LOG_ERROR("%s", e.what());
+ gst::_disconnectSignal(&_gst.signals, G_OBJECT(tsdemux));
+
gst::_destroyElementFromParent(src);
gst::_destroyElementFromParent(queue);
gst::_destroyElementFromParent(tsdemux);
} catch (const MediaTransporterException& e) {
LOG_ERROR("%s", e.what());
+ gst::_disconnectSignal(&_gst.signals, G_OBJECT(sink));
+
gst::_destroyElementFromParent(mux);
gst::_destroyElementFromParent(sink);