BT_LIB_LOGD("Creating packet object: %![stream-]+s", stream);
packet = g_new0(struct bt_packet, 1);
if (!packet) {
BT_LIB_LOGD("Creating packet object: %![stream-]+s", stream);
packet = g_new0(struct bt_packet, 1);
if (!packet) {
&stream->class->packet_context_field_pool,
stream->class->packet_context_fc);
if (!packet->context_field) {
&stream->class->packet_context_field_pool,
stream->class->packet_context_fc);
if (!packet->context_field) {
BT_ASSERT_PRE_NON_NULL(stream, "Stream");
packet = bt_object_pool_create_object(&stream->packet_pool);
if (G_UNLIKELY(!packet)) {
BT_ASSERT_PRE_NON_NULL(stream, "Stream");
packet = bt_object_pool_create_object(&stream->packet_pool);
if (G_UNLIKELY(!packet)) {