ret = media_packet_new_alloc(format, NULL, NULL, &packet);
assert_eq(ret, MEDIA_PACKET_ERROR_NONE);
+ /* NOTE: the function below takes ownership of the packet.(no need to unref the packet, or make sure to ref/unref pair). */
ret = webrtc_media_packet_source_push_packet(g_webrtc, id, packet);
assert_eq(ret, WEBRTC_ERROR_NONE);
media_format_unref(format);
- media_packet_unref(packet);
return 0;
}
ret = media_packet_new_alloc(format, NULL, NULL, &packet);
assert_eq(ret, MEDIA_PACKET_ERROR_NONE);
+ /* NOTE: the function below takes ownership of the packet.(no need to unref the packet, or make sure to ref/unref pair). */
ret = webrtc_media_packet_source_push_packet(g_webrtc, id, packet);
assert_eq(ret, WEBRTC_ERROR_INVALID_OPERATION);
media_format_unref(format);
- media_packet_unref(packet);
return 0;
}
ret = media_packet_new_alloc(format, NULL, NULL, &packet);
assert_eq(ret, MEDIA_PACKET_ERROR_NONE);
+ /* NOTE: the function below takes ownership of the packet.(no need to unref the packet, or make sure to ref/unref pair). */
ret = webrtc_media_packet_source_push_packet(g_webrtc, id + 1, packet);
assert_eq(ret, WEBRTC_ERROR_INVALID_PARAMETER);
media_format_unref(format);
- media_packet_unref(packet);
return 0;
}
ret = media_packet_new_alloc(format, NULL, NULL, &packet);
assert_eq(ret, MEDIA_PACKET_ERROR_NONE);
+ /* NOTE: the function below takes ownership of the packet.(no need to unref the packet, or make sure to ref/unref pair). */
ret = webrtc_media_packet_source_push_packet(g_webrtc, id, packet);
assert_eq(ret, WEBRTC_ERROR_INVALID_OPERATION);
media_format_unref(format);
- media_packet_unref(packet);
return 0;
}