/**
* @brief Pushes media packet to the media packet source.
* @since_tizen 6.5
+ * @remarks This function takes ownership of the @a packet.
* @param[in] webrtc WebRTC handle
* @param[in] source_id The media packet source id
* @param[in] packet The media packet
LOG_ERROR("failed to 'push-buffer', gst_ret[0x%x]", gst_ret);
return WEBRTC_ERROR_INVALID_OPERATION;
}
+ media_packet_destroy(packet);
return WEBRTC_ERROR_NONE;
}
exit:
gst_buffer_unref(new_buffer);
+ if (ret == WEBRTC_ERROR_NONE)
+ media_packet_destroy(packet);
return ret;
}
g_printerr("failed to 'push-buffer', gst_ret[0x%x]\n", gst_ret);
if (is_new_buffer)
gst_buffer_unref(buffer_from_packet);
+ media_packet_destroy(packet);
#else
- if (webrtc_media_packet_source_push_packet(packet_source->webrtc, packet_source->source_id, packet) != WEBRTC_ERROR_NONE)
+ if (webrtc_media_packet_source_push_packet(packet_source->webrtc, packet_source->source_id, packet) != WEBRTC_ERROR_NONE) {
g_printerr("failed to webrtc_media_packet_source_push_packet()\n");
+ media_packet_destroy(packet);
+ }
#endif
- media_packet_destroy(packet);
}
static GstCaps *__make_raw_caps(media_format_h format)