&icc_compression_type, &icc_profile, &icc_proflen);
if ((ret & PNG_INFO_iCCP)) {
- gpointer gst_icc_prof = g_memdup (icc_profile, icc_proflen);
+ gpointer gst_icc_prof = g_memdup2 (icc_profile, icc_proflen);
GstBuffer *tagbuffer = NULL;
GstSample *tagsample = NULL;
GstTagList *taglist = NULL;
g_assert (frame != NULL);
/* FIXME : It would be nice to avoid the memory copy ... */
- buffer =
- gst_buffer_new_wrapped (g_memdup (pkt->data.frame.buf,
- pkt->data.frame.sz), pkt->data.frame.sz);
+ buffer = gst_buffer_new_memdup (pkt->data.frame.buf, pkt->data.frame.sz);
user_data = vpx_enc_class->process_frame_user_data (encoder, frame);
if (vpx_enc_class->get_frame_temporal_settings &&
GstMapInfo map;
gst_buffer_map (buffer, &map, GST_MAP_READ);
- enc->first_block = g_memdup (map.data, map.size);
+ enc->first_block = g_memdup2 (map.data, map.size);
enc->first_block_size = map.size;
gst_buffer_unmap (buffer, &map);
}
endif
endif
+if gio_dep.version().version_compare('< 2.67.4')
+ cdata.set('g_memdup2(ptr,sz)', '(G_LIKELY(((guint64)(sz)) < G_MAXUINT)) ? g_memdup(ptr,sz) : (g_abort(),NULL)')
+endif
+
configure_file(output : 'config.h', configuration : cdata)
run_command(python3, '-c', 'import shutil; shutil.copy("hooks/pre-commit.hook", ".git/hooks/pre-commit")')
* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
#include <gst/check/gstcheck.h>
#include <gst/check/gstharness.h>
#include <gst/audio/audio.h>
gst_harness_play (h);
size = sizeof (h264_16x16_black_bs);
- buf = gst_buffer_new_wrapped (g_memdup (h264_16x16_black_bs, size), size);
+ buf = gst_buffer_new_memdup (h264_16x16_black_bs, size);
fail_unless_equals_int (gst_harness_push (h, buf), GST_FLOW_OK);
fail_unless (gst_harness_push_event (h, gst_event_new_eos ()));
"application/x-rtp, media=audio, clock-rate=48000, encoding-name=OPUS, sprop-stereo=(string)0, encoding-params=(string)2, sprop-maxcapturerate=(string)48000, payload=96");
/* push first opus frame */
- buf =
- gst_buffer_new_wrapped (g_memdup (opus_frame, sizeof (opus_frame)),
- sizeof (opus_frame));
+ buf = gst_buffer_new_memdup (opus_frame, sizeof (opus_frame));
fail_unless_equals_int (gst_harness_push (h, buf), GST_FLOW_OK);
seq = pull_rtp_buffer (h, TRUE);
expected_seq = seq + 1;
/* push empty frame */
- buf =
- gst_buffer_new_wrapped (g_memdup (opus_empty, sizeof (opus_empty)),
- sizeof (opus_empty));
+ buf = gst_buffer_new_memdup (opus_empty, sizeof (opus_empty));
fail_unless_equals_int (gst_harness_push (h, buf), GST_FLOW_OK);
if (dtx) {
/* buffer is not transmitted if dtx is enabled */
}
/* push second opus frame */
- buf =
- gst_buffer_new_wrapped (g_memdup (opus_frame, sizeof (opus_frame)),
- sizeof (opus_frame));
+ buf = gst_buffer_new_memdup (opus_frame, sizeof (opus_frame));
fail_unless_equals_int (gst_harness_push (h, buf), GST_FLOW_OK);
seq = pull_rtp_buffer (h, dtx);
fail_unless_equals_int (seq, expected_seq);
* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
#include <gst/check/check.h>
#include <gst/app/app.h>
fail_unless (len >= 2 + packet_len);
flow = gst_app_src_push_buffer (GST_APP_SRC (src),
- gst_buffer_new_wrapped (g_memdup (pdata + 2, packet_len),
- packet_len));
+ gst_buffer_new_memdup (pdata + 2, packet_len));
fail_unless_equals_int (flow, GST_FLOW_OK);
* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
#include <gst/check/check.h>
#include <gst/app/app.h>
fail_unless (len >= 2 + packet_len);
flow = gst_app_src_push_buffer (GST_APP_SRC (src),
- gst_buffer_new_wrapped (g_memdup (pdata + 2, packet_len),
- packet_len));
+ gst_buffer_new_memdup (pdata + 2, packet_len));
fail_unless_equals_int (flow, GST_FLOW_OK);
* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
#include <gst/check/check.h>
#include <gst/check/gstharness.h>
#include <gst/rtp/gstrtpbuffer.h>
-#define buffer_from_array(a) gst_buffer_new_wrapped (g_memdup (a, G_N_ELEMENTS (a)), G_N_ELEMENTS (a));
+#define buffer_from_array(a) gst_buffer_new_memdup (a, G_N_ELEMENTS (a))
static guint8 opus_data[] = {
0xf8, 0xb5, 0x0e, 0x7d, 0x91, 0xcc, 0x05, 0x82,
* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
#include <gst/check/check.h>
#include <gst/check/gstharness.h>
#define RTP_VP8_CAPS_STR \
"application/x-rtp,media=video,encoding-name=VP8,clock-rate=90000,payload=96"
-#define gst_buffer_new_from_array(array) gst_buffer_new_wrapped ( \
- g_memdup (vp8_bitstream_payload, sizeof (vp8_bitstream_payload)), \
- sizeof (vp8_bitstream_payload))
+/* FIXME: array argument is unused! */
+#define gst_buffer_new_from_array(array) \
+ gst_buffer_new_memdup (vp8_bitstream_payload, sizeof (vp8_bitstream_payload))
static guint8 intra_picid6336_seqnum0[] = {
0x80, 0xe0, 0x00, 0x00, 0x9a, 0xbb, 0xe3, 0xb3, 0x8b, 0xe9, 0x1d, 0x61,
if (picid_bits == 0) {
size = sizeof (intra_nopicid_seqnum0);
- packet = g_memdup (intra_nopicid_seqnum0, size);
+ packet = g_memdup2 (intra_nopicid_seqnum0, size);
} else if (picid_bits == 7) {
size = sizeof (intra_picid24_seqnum0);
- packet = g_memdup (intra_picid24_seqnum0, size);
+ packet = g_memdup2 (intra_picid24_seqnum0, size);
packet[14] = picid & 0x7f;
} else {
size = sizeof (intra_picid6336_seqnum0);
- packet = g_memdup (intra_picid6336_seqnum0, size);
+ packet = g_memdup2 (intra_picid6336_seqnum0, size);
packet[14] = ((picid >> 8) & 0xff) | 0x80;
packet[15] = (picid >> 0) & 0xff;
}
g_object_set (h->element, "picture-id-mode", test_data->pid,
"picture-id-offset", 0x5A5A, NULL);
- buffer = gst_buffer_new_wrapped (g_memdup (vp8_bitstream_payload,
- sizeof (vp8_bitstream_payload)), sizeof (vp8_bitstream_payload));
+ buffer = gst_buffer_new_memdup (vp8_bitstream_payload,
+ sizeof (vp8_bitstream_payload));
/* set droppable if N flag set */
if ((test_data->vp8_payload_control_value & 0x20) != 0) {
"picture-id-offset", 0x5A5A, NULL);
/* Push a buffer in */
- buffer = gst_buffer_new_wrapped (g_memdup (vp8_bitstream_payload,
- sizeof (vp8_bitstream_payload)), sizeof (vp8_bitstream_payload));
+ buffer = gst_buffer_new_memdup (vp8_bitstream_payload,
+ sizeof (vp8_bitstream_payload));
add_vp8_meta (buffer, test_data->use_temporal_scaling, test_data->y_flag,
2, 255);
/* set droppable if N flag set */
* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
#include <gst/check/check.h>
#include <gst/check/gstharness.h>
*/
};
struct BufferTemplate *template = &templates[buffer_type];
- guint8 *packet = g_memdup (template->template, template->size);
+ guint8 *packet = g_memdup2 (template->template, template->size);
GstBuffer *ret;
packet[2] = (seqnum >> 8) & 0xff;
g_assert (pixdata_size == 24 + height * stride);
- pixels_copy = g_memdup (pixdata + 24, height * stride);
+ pixels_copy = g_memdup2 (pixdata + 24, height * stride);
pixbuf =
gdk_pixbuf_new_from_data (pixels_copy, GDK_COLORSPACE_RGB, TRUE, 8,