};
guint rowstride = GST_ROUND_UP_4 (WIDTH * 3);
GstBuffer *buf;
- gpointer buf_data;
- gsize size;
+ GstMapInfo info;
buf = gst_buffer_new_and_alloc (HEIGHT * rowstride);
- buf_data = gst_buffer_map (buf, &size, NULL, GST_MAP_READWRITE);
- fail_unless_equals_int (size, sizeof (rgb24_3x4_img));
- memcpy (buf_data, rgb24_3x4_img, sizeof (rgb24_3x4_img));
+ gst_buffer_map (buf, &info, GST_MAP_READWRITE);
+ fail_unless_equals_int (info.size, sizeof (rgb24_3x4_img));
+ memcpy (info.data, rgb24_3x4_img, sizeof (rgb24_3x4_img));
- gst_buffer_unmap (buf, buf_data, size);
+ gst_buffer_unmap (buf, &info);
return buf;
}
};
guint rowstride = WIDTH * 4;
GstBuffer *buf;
- gpointer buf_data;
- gsize size;
+ GstMapInfo map;
buf = gst_buffer_new_and_alloc (HEIGHT * rowstride);
- buf_data = gst_buffer_map (buf, &size, NULL, GST_MAP_READWRITE);
- fail_unless_equals_int (size, sizeof (rgba32_3x4_img));
- memcpy (buf_data, rgba32_3x4_img, sizeof (rgba32_3x4_img));
+ gst_buffer_map (buf, &map, GST_MAP_READWRITE);
+ fail_unless_equals_int (map.size, sizeof (rgba32_3x4_img));
+ memcpy (map.data, rgba32_3x4_img, sizeof (rgba32_3x4_img));
- gst_buffer_unmap (buf, buf_data, size);
+ gst_buffer_unmap (buf, &map);
return buf;
}
GstCaps *incaps;
guint8 *ayuv;
guint outlength;
- gpointer buf_data;
- gsize size;
+ GstMapInfo map;
incaps = create_caps_rgba32 ();
alphacolor = setup_alphacolor ();
ASSERT_BUFFER_REFCOUNT (outbuffer, "outbuffer", 1);
outlength = WIDTH * HEIGHT * 4; /* output is AYUV */
- buf_data = gst_buffer_map (outbuffer, &size, NULL, GST_MAP_READ);
- fail_unless_equals_int (size, outlength);
+ gst_buffer_map (outbuffer, &map, GST_MAP_READ);
+ fail_unless_equals_int (map.size, outlength);
- ayuv = buf_data;
+ ayuv = map.data;
/* check alpha values (0x00 = totally transparent, 0xff = totally opaque) */
fail_unless_ayuv_pixel_has_alpha (ayuv, 0, 0, 0xff);
/* we don't check the YUV data, because apparently results differ slightly
* depending on whether we run in valgrind or not */
- gst_buffer_unmap (outbuffer, buf_data, size);
+ gst_buffer_unmap (outbuffer, &map);
buffers = g_list_remove (buffers, outbuffer);
gst_buffer_unref (outbuffer);
GST_STATIC_CAPS ("audio/x-raw, "
"channels = (int) 1, "
"rate = (int) 44100, "
- "format = (string) { "
- GST_AUDIO_NE(F32) ", "
- GST_AUDIO_NE(F64) " }"));
+ "format = (string) { "
+ GST_AUDIO_NE (F32) ", " GST_AUDIO_NE (F64) " }"));
static GstStaticPadTemplate srctemplate = GST_STATIC_PAD_TEMPLATE ("src",
GST_PAD_SRC,
GST_PAD_ALWAYS,
GST_STATIC_CAPS ("audio/x-raw, "
"channels = (int) 1, "
"rate = (int) 44100, "
- "format = (string) { "
- GST_AUDIO_NE(F32) ", "
- GST_AUDIO_NE(F64) " }"));
+ "format = (string) { "
+ GST_AUDIO_NE (F32) ", " GST_AUDIO_NE (F64) " }"));
static GstElement *
setup_audiochebband (void)
GstCaps *caps;
gfloat *in, *res, rms;
gint i;
+ GstMapInfo map;
audiochebband = setup_audiochebband ();
/* Set to bandpass */
g_object_set (G_OBJECT (audiochebband), "upper-frequency",
44100 / 4.0 + 1000, NULL);
inbuffer = gst_buffer_new_allocate (NULL, 1024 * sizeof (gfloat), 0);
- in = gst_buffer_map (inbuffer, NULL, NULL, GST_MAP_WRITE);
+ gst_buffer_map (inbuffer, &map, GST_MAP_WRITE);
+ in = (gfloat *) map.data;
for (i = 0; i < 1024; i++)
in[i] = 1.0;
- gst_buffer_unmap (inbuffer, in, -1);
+ gst_buffer_unmap (inbuffer, &map);
caps = gst_caps_from_string (BUFFER_CAPS_STRING_32);
fail_unless (gst_pad_set_caps (mysrcpad, caps));
fail_unless_equals_int (g_list_length (buffers), 1);
fail_if ((outbuffer = (GstBuffer *) buffers->data) == NULL);
- res = gst_buffer_map (outbuffer, NULL, NULL, GST_MAP_READ);
+ gst_buffer_map (outbuffer, &map, GST_MAP_READ);
+ res = (gfloat *) map.data;
rms = 0.0;
for (i = 0; i < 1024; i++)
rms = sqrt (rms / 1024.0);
fail_unless (rms <= 0.1);
- gst_buffer_unmap (outbuffer, res, -1);
+ gst_buffer_unmap (outbuffer, &map);
/* cleanup */
cleanup_audiochebband (audiochebband);
GstCaps *caps;
gfloat *in, *res, rms;
gint i;
+ GstMapInfo map;
audiochebband = setup_audiochebband ();
/* Set to bandpass */
g_object_set (G_OBJECT (audiochebband), "upper-frequency",
44100 / 4.0 + 1000, NULL);
inbuffer = gst_buffer_new_allocate (NULL, 1024 * sizeof (gfloat), 0);
- in = gst_buffer_map (inbuffer, NULL, NULL, GST_MAP_WRITE);
+ gst_buffer_map (inbuffer, &map, GST_MAP_WRITE);
+ in = (gfloat *) map.data;
for (i = 0; i < 1024; i += 4) {
in[i] = 0.0;
in[i + 1] = 1.0;
in[i + 2] = 0.0;
in[i + 3] = -1.0;
}
- gst_buffer_unmap (inbuffer, in, -1);
+ gst_buffer_unmap (inbuffer, &map);
caps = gst_caps_from_string (BUFFER_CAPS_STRING_32);
fail_unless (gst_pad_set_caps (mysrcpad, caps));
fail_unless_equals_int (g_list_length (buffers), 1);
fail_if ((outbuffer = (GstBuffer *) buffers->data) == NULL);
- res = gst_buffer_map (outbuffer, NULL, NULL, GST_MAP_READ);
+ gst_buffer_map (outbuffer, &map, GST_MAP_READ);
+ res = (gfloat *) map.data;
rms = 0.0;
for (i = 0; i < 1024; i++)
rms = sqrt (rms / 1024.0);
fail_unless (rms >= 0.6);
- gst_buffer_unmap (outbuffer, res, -1);
+ gst_buffer_unmap (outbuffer, &map);
/* cleanup */
cleanup_audiochebband (audiochebband);
GstCaps *caps;
gfloat *in, *res, rms;
gint i;
+ GstMapInfo map;
audiochebband = setup_audiochebband ();
/* Set to bandpass */
g_object_set (G_OBJECT (audiochebband), "upper-frequency",
44100 / 4.0 + 1000, NULL);
inbuffer = gst_buffer_new_allocate (NULL, 1024 * sizeof (gfloat), 0);
- in = gst_buffer_map (inbuffer, NULL, NULL, GST_MAP_WRITE);
+ gst_buffer_map (inbuffer, &map, GST_MAP_WRITE);
+ in = (gfloat *) map.data;
for (i = 0; i < 1024; i += 2) {
in[i] = 1.0;
in[i + 1] = -1.0;
}
- gst_buffer_unmap (inbuffer, in, -1);
+ gst_buffer_unmap (inbuffer, &map);
caps = gst_caps_from_string (BUFFER_CAPS_STRING_32);
fail_unless (gst_pad_set_caps (mysrcpad, caps));
fail_unless_equals_int (g_list_length (buffers), 1);
fail_if ((outbuffer = (GstBuffer *) buffers->data) == NULL);
- res = gst_buffer_map (outbuffer, NULL, NULL, GST_MAP_READ);
+ gst_buffer_map (outbuffer, &map, GST_MAP_READ);
+ res = (gfloat *) map.data;
rms = 0.0;
for (i = 0; i < 1024; i++)
rms = sqrt (rms / 1024.0);
fail_unless (rms <= 0.1);
- gst_buffer_unmap (outbuffer, res, -1);
+ gst_buffer_unmap (outbuffer, &map);
/* cleanup */
cleanup_audiochebband (audiochebband);
GstCaps *caps;
gfloat *in, *res, rms;
gint i;
+ GstMapInfo map;
audiochebband = setup_audiochebband ();
/* Set to bandreject */
g_object_set (G_OBJECT (audiochebband), "upper-frequency",
44100 / 4.0 + 1000, NULL);
inbuffer = gst_buffer_new_allocate (NULL, 1024 * sizeof (gfloat), 0);
- in = gst_buffer_map (inbuffer, NULL, NULL, GST_MAP_WRITE);
+ gst_buffer_map (inbuffer, &map, GST_MAP_WRITE);
+ in = (gfloat *) map.data;
for (i = 0; i < 1024; i++)
in[i] = 1.0;
- gst_buffer_unmap (inbuffer, in, -1);
+ gst_buffer_unmap (inbuffer, &map);
caps = gst_caps_from_string (BUFFER_CAPS_STRING_32);
fail_unless (gst_pad_set_caps (mysrcpad, caps));
fail_unless_equals_int (g_list_length (buffers), 1);
fail_if ((outbuffer = (GstBuffer *) buffers->data) == NULL);
- res = gst_buffer_map (outbuffer, NULL, NULL, GST_MAP_READ);
+ gst_buffer_map (outbuffer, &map, GST_MAP_READ);
+ res = (gfloat *) map.data;
rms = 0.0;
for (i = 0; i < 1024; i++)
rms = sqrt (rms / 1024.0);
fail_unless (rms >= 0.9);
- gst_buffer_unmap (outbuffer, res, -1);
+ gst_buffer_unmap (outbuffer, &map);
/* cleanup */
cleanup_audiochebband (audiochebband);
GstCaps *caps;
gfloat *in, *res, rms;
gint i;
+ GstMapInfo map;
audiochebband = setup_audiochebband ();
/* Set to bandreject */
g_object_set (G_OBJECT (audiochebband), "upper-frequency",
44100 / 4.0 + 1000, NULL);
inbuffer = gst_buffer_new_allocate (NULL, 1024 * sizeof (gfloat), 0);
- in = gst_buffer_map (inbuffer, NULL, NULL, GST_MAP_WRITE);
+ gst_buffer_map (inbuffer, &map, GST_MAP_WRITE);
+ in = (gfloat *) map.data;
for (i = 0; i < 1024; i += 4) {
in[i] = 0.0;
in[i + 1] = 1.0;
in[i + 2] = 0.0;
in[i + 3] = -1.0;
}
- gst_buffer_unmap (inbuffer, in, -1);
+ gst_buffer_unmap (inbuffer, &map);
caps = gst_caps_from_string (BUFFER_CAPS_STRING_32);
fail_unless (gst_pad_set_caps (mysrcpad, caps));
fail_unless_equals_int (g_list_length (buffers), 1);
fail_if ((outbuffer = (GstBuffer *) buffers->data) == NULL);
- res = gst_buffer_map (outbuffer, NULL, NULL, GST_MAP_READ);
+ gst_buffer_map (outbuffer, &map, GST_MAP_READ);
+ res = (gfloat *) map.data;
rms = 0.0;
for (i = 0; i < 1024; i++)
rms = sqrt (rms / 1024.0);
fail_unless (rms <= 0.1);
- gst_buffer_unmap (outbuffer, res, -1);
+ gst_buffer_unmap (outbuffer, &map);
/* cleanup */
cleanup_audiochebband (audiochebband);
GstCaps *caps;
gfloat *in, *res, rms;
gint i;
+ GstMapInfo map;
audiochebband = setup_audiochebband ();
/* Set to bandreject */
g_object_set (G_OBJECT (audiochebband), "upper-frequency",
44100 / 4.0 + 1000, NULL);
inbuffer = gst_buffer_new_allocate (NULL, 1024 * sizeof (gfloat), 0);
- in = gst_buffer_map (inbuffer, NULL, NULL, GST_MAP_WRITE);
+ gst_buffer_map (inbuffer, &map, GST_MAP_WRITE);
+ in = (gfloat *) map.data;
for (i = 0; i < 1024; i += 2) {
in[i] = 1.0;
in[i + 1] = -1.0;
}
- gst_buffer_unmap (inbuffer, in, -1);
+ gst_buffer_unmap (inbuffer, &map);
caps = gst_caps_from_string (BUFFER_CAPS_STRING_32);
fail_unless (gst_pad_set_caps (mysrcpad, caps));
fail_unless_equals_int (g_list_length (buffers), 1);
fail_if ((outbuffer = (GstBuffer *) buffers->data) == NULL);
- res = gst_buffer_map (outbuffer, NULL, NULL, GST_MAP_READ);
+ gst_buffer_map (outbuffer, &map, GST_MAP_READ);
+ res = (gfloat *) map.data;
rms = 0.0;
for (i = 0; i < 1024; i++)
rms = sqrt (rms / 1024.0);
fail_unless (rms >= 0.9);
- gst_buffer_unmap (outbuffer, res, -1);
+ gst_buffer_unmap (outbuffer, &map);
/* cleanup */
cleanup_audiochebband (audiochebband);
GstCaps *caps;
gdouble *in, *res, rms;
gint i;
+ GstMapInfo map;
audiochebband = setup_audiochebband ();
/* Set to bandpass */
g_object_set (G_OBJECT (audiochebband), "upper-frequency",
44100 / 4.0 + 1000, NULL);
inbuffer = gst_buffer_new_and_alloc (1024 * sizeof (gdouble));
- in = gst_buffer_map (inbuffer, NULL, NULL, GST_MAP_WRITE);
+ gst_buffer_map (inbuffer, &map, GST_MAP_WRITE);
+ in = (gdouble *) map.data;
for (i = 0; i < 1024; i++)
in[i] = 1.0;
- gst_buffer_unmap (inbuffer, in, -1);
+ gst_buffer_unmap (inbuffer, &map);
caps = gst_caps_from_string (BUFFER_CAPS_STRING_64);
fail_unless (gst_pad_set_caps (mysrcpad, caps));
fail_unless_equals_int (g_list_length (buffers), 1);
fail_if ((outbuffer = (GstBuffer *) buffers->data) == NULL);
- res = gst_buffer_map (outbuffer, NULL, NULL, GST_MAP_READ);
+ gst_buffer_map (outbuffer, &map, GST_MAP_READ);
+ res = (gdouble *) map.data;
rms = 0.0;
for (i = 0; i < 1024; i++)
rms = sqrt (rms / 1024.0);
fail_unless (rms <= 0.1);
- gst_buffer_unmap (outbuffer, res, -1);
+ gst_buffer_unmap (outbuffer, &map);
/* cleanup */
cleanup_audiochebband (audiochebband);
GstCaps *caps;
gdouble *in, *res, rms;
gint i;
+ GstMapInfo map;
audiochebband = setup_audiochebband ();
/* Set to bandpass */
g_object_set (G_OBJECT (audiochebband), "upper-frequency",
44100 / 4.0 + 1000, NULL);
inbuffer = gst_buffer_new_and_alloc (1024 * sizeof (gdouble));
- in = gst_buffer_map (inbuffer, NULL, NULL, GST_MAP_WRITE);
+ gst_buffer_map (inbuffer, &map, GST_MAP_WRITE);
+ in = (gdouble *) map.data;
for (i = 0; i < 1024; i += 4) {
in[i] = 0.0;
in[i + 1] = 1.0;
in[i + 2] = 0.0;
in[i + 3] = -1.0;
}
- gst_buffer_unmap (inbuffer, in, -1);
+ gst_buffer_unmap (inbuffer, &map);
caps = gst_caps_from_string (BUFFER_CAPS_STRING_64);
fail_unless (gst_pad_set_caps (mysrcpad, caps));
fail_unless_equals_int (g_list_length (buffers), 1);
fail_if ((outbuffer = (GstBuffer *) buffers->data) == NULL);
- res = gst_buffer_map (outbuffer, NULL, NULL, GST_MAP_READ);
+ gst_buffer_map (outbuffer, &map, GST_MAP_READ);
+ res = (gdouble *) map.data;
rms = 0.0;
for (i = 0; i < 1024; i++)
rms = sqrt (rms / 1024.0);
fail_unless (rms >= 0.6);
- gst_buffer_unmap (outbuffer, res, -1);
+ gst_buffer_unmap (outbuffer, &map);
/* cleanup */
cleanup_audiochebband (audiochebband);
GstCaps *caps;
gdouble *in, *res, rms;
gint i;
+ GstMapInfo map;
audiochebband = setup_audiochebband ();
/* Set to bandpass */
g_object_set (G_OBJECT (audiochebband), "upper-frequency",
44100 / 4.0 + 1000, NULL);
inbuffer = gst_buffer_new_and_alloc (1024 * sizeof (gdouble));
- in = gst_buffer_map (inbuffer, NULL, NULL, GST_MAP_WRITE);
+ gst_buffer_map (inbuffer, &map, GST_MAP_WRITE);
+ in = (gdouble *) map.data;
for (i = 0; i < 1024; i += 2) {
in[i] = 1.0;
in[i + 1] = -1.0;
}
- gst_buffer_unmap (inbuffer, in, -1);
+ gst_buffer_unmap (inbuffer, &map);
caps = gst_caps_from_string (BUFFER_CAPS_STRING_64);
fail_unless (gst_pad_set_caps (mysrcpad, caps));
fail_unless_equals_int (g_list_length (buffers), 1);
fail_if ((outbuffer = (GstBuffer *) buffers->data) == NULL);
- res = gst_buffer_map (outbuffer, NULL, NULL, GST_MAP_READ);
+ gst_buffer_map (outbuffer, &map, GST_MAP_READ);
+ res = (gdouble *) map.data;
rms = 0.0;
for (i = 0; i < 1024; i++)
rms = sqrt (rms / 1024.0);
fail_unless (rms <= 0.1);
- gst_buffer_unmap (outbuffer, res, -1);
+ gst_buffer_unmap (outbuffer, &map);
/* cleanup */
cleanup_audiochebband (audiochebband);
GstCaps *caps;
gdouble *in, *res, rms;
gint i;
+ GstMapInfo map;
audiochebband = setup_audiochebband ();
/* Set to bandreject */
g_object_set (G_OBJECT (audiochebband), "upper-frequency",
44100 / 4.0 + 1000, NULL);
inbuffer = gst_buffer_new_and_alloc (1024 * sizeof (gdouble));
- in = gst_buffer_map (inbuffer, NULL, NULL, GST_MAP_WRITE);
+ gst_buffer_map (inbuffer, &map, GST_MAP_WRITE);
+ in = (gdouble *) map.data;
for (i = 0; i < 1024; i++)
in[i] = 1.0;
- gst_buffer_unmap (inbuffer, in, -1);
+ gst_buffer_unmap (inbuffer, &map);
caps = gst_caps_from_string (BUFFER_CAPS_STRING_64);
fail_unless (gst_pad_set_caps (mysrcpad, caps));
fail_unless_equals_int (g_list_length (buffers), 1);
fail_if ((outbuffer = (GstBuffer *) buffers->data) == NULL);
- res = gst_buffer_map (outbuffer, NULL, NULL, GST_MAP_READ);
+ gst_buffer_map (outbuffer, &map, GST_MAP_READ);
+ res = (gdouble *) map.data;
rms = 0.0;
for (i = 0; i < 1024; i++)
rms = sqrt (rms / 1024.0);
fail_unless (rms >= 0.9);
- gst_buffer_unmap (outbuffer, res, -1);
+ gst_buffer_unmap (outbuffer, &map);
/* cleanup */
cleanup_audiochebband (audiochebband);
GstCaps *caps;
gdouble *in, *res, rms;
gint i;
+ GstMapInfo map;
audiochebband = setup_audiochebband ();
/* Set to bandreject */
g_object_set (G_OBJECT (audiochebband), "upper-frequency",
44100 / 4.0 + 1000, NULL);
inbuffer = gst_buffer_new_and_alloc (1024 * sizeof (gdouble));
- in = gst_buffer_map (inbuffer, NULL, NULL, GST_MAP_WRITE);
+ gst_buffer_map (inbuffer, &map, GST_MAP_WRITE);
+ in = (gdouble *) map.data;
for (i = 0; i < 1024; i += 4) {
in[i] = 0.0;
in[i + 1] = 1.0;
in[i + 2] = 0.0;
in[i + 3] = -1.0;
}
- gst_buffer_unmap (inbuffer, in, -1);
+ gst_buffer_unmap (inbuffer, &map);
caps = gst_caps_from_string (BUFFER_CAPS_STRING_64);
fail_unless (gst_pad_set_caps (mysrcpad, caps));
fail_unless_equals_int (g_list_length (buffers), 1);
fail_if ((outbuffer = (GstBuffer *) buffers->data) == NULL);
- res = gst_buffer_map (outbuffer, NULL, NULL, GST_MAP_READ);
+ gst_buffer_map (outbuffer, &map, GST_MAP_READ);
+ res = (gdouble *) map.data;
rms = 0.0;
for (i = 0; i < 1024; i++)
rms = sqrt (rms / 1024.0);
fail_unless (rms <= 0.1);
- gst_buffer_unmap (outbuffer, res, -1);
+ gst_buffer_unmap (outbuffer, &map);
/* cleanup */
cleanup_audiochebband (audiochebband);
GstCaps *caps;
gdouble *in, *res, rms;
gint i;
+ GstMapInfo map;
audiochebband = setup_audiochebband ();
/* Set to bandreject */
g_object_set (G_OBJECT (audiochebband), "upper-frequency",
44100 / 4.0 + 1000, NULL);
inbuffer = gst_buffer_new_and_alloc (1024 * sizeof (gdouble));
- in = gst_buffer_map (inbuffer, NULL, NULL, GST_MAP_WRITE);
+ gst_buffer_map (inbuffer, &map, GST_MAP_WRITE);
+ in = (gdouble *) map.data;
for (i = 0; i < 1024; i += 2) {
in[i] = 1.0;
in[i + 1] = -1.0;
}
- gst_buffer_unmap (inbuffer, in, -1);
+ gst_buffer_unmap (inbuffer, &map);
caps = gst_caps_from_string (BUFFER_CAPS_STRING_64);
fail_unless (gst_pad_set_caps (mysrcpad, caps));
fail_unless_equals_int (g_list_length (buffers), 1);
fail_if ((outbuffer = (GstBuffer *) buffers->data) == NULL);
- res = gst_buffer_map (outbuffer, NULL, NULL, GST_MAP_READ);
+ gst_buffer_map (outbuffer, &map, GST_MAP_READ);
+ res = (gdouble *) map.data;
rms = 0.0;
for (i = 0; i < 1024; i++)
rms = sqrt (rms / 1024.0);
fail_unless (rms >= 0.9);
- gst_buffer_unmap (outbuffer, res, -1);
+ gst_buffer_unmap (outbuffer, &map);
/* cleanup */
cleanup_audiochebband (audiochebband);
GstCaps *caps;
gfloat *in, *res, rms;
gint i;
+ GstMapInfo map;
audiochebband = setup_audiochebband ();
/* Set to bandpass */
g_object_set (G_OBJECT (audiochebband), "upper-frequency",
44100 / 4.0 + 1000, NULL);
inbuffer = gst_buffer_new_allocate (NULL, 1024 * sizeof (gfloat), 0);
- in = gst_buffer_map (inbuffer, NULL, NULL, GST_MAP_WRITE);
+ gst_buffer_map (inbuffer, &map, GST_MAP_WRITE);
+ in = (gfloat *) map.data;
for (i = 0; i < 1024; i++)
in[i] = 1.0;
- gst_buffer_unmap (inbuffer, in, -1);
+ gst_buffer_unmap (inbuffer, &map);
caps = gst_caps_from_string (BUFFER_CAPS_STRING_32);
fail_unless (gst_pad_set_caps (mysrcpad, caps));
fail_unless_equals_int (g_list_length (buffers), 1);
fail_if ((outbuffer = (GstBuffer *) buffers->data) == NULL);
- res = gst_buffer_map (outbuffer, NULL, NULL, GST_MAP_READ);
+ gst_buffer_map (outbuffer, &map, GST_MAP_READ);
+ res = (gfloat *) map.data;
rms = 0.0;
for (i = 0; i < 1024; i++)
rms = sqrt (rms / 1024.0);
fail_unless (rms <= 0.1);
- gst_buffer_unmap (outbuffer, res, -1);
+ gst_buffer_unmap (outbuffer, &map);
/* cleanup */
cleanup_audiochebband (audiochebband);
GstCaps *caps;
gfloat *in, *res, rms;
gint i;
+ GstMapInfo map;
audiochebband = setup_audiochebband ();
/* Set to bandpass */
g_object_set (G_OBJECT (audiochebband), "upper-frequency",
44100 / 4.0 + 1000, NULL);
inbuffer = gst_buffer_new_allocate (NULL, 1024 * sizeof (gfloat), 0);
- in = gst_buffer_map (inbuffer, NULL, NULL, GST_MAP_WRITE);
+ gst_buffer_map (inbuffer, &map, GST_MAP_WRITE);
+ in = (gfloat *) map.data;
for (i = 0; i < 1024; i += 4) {
in[i] = 0.0;
in[i + 1] = 1.0;
in[i + 2] = 0.0;
in[i + 3] = -1.0;
}
- gst_buffer_unmap (inbuffer, in, -1);
+ gst_buffer_unmap (inbuffer, &map);
caps = gst_caps_from_string (BUFFER_CAPS_STRING_32);
fail_unless (gst_pad_set_caps (mysrcpad, caps));
fail_unless_equals_int (g_list_length (buffers), 1);
fail_if ((outbuffer = (GstBuffer *) buffers->data) == NULL);
- res = gst_buffer_map (outbuffer, NULL, NULL, GST_MAP_READ);
+ gst_buffer_map (outbuffer, &map, GST_MAP_READ);
+ res = (gfloat *) map.data;
rms = 0.0;
for (i = 0; i < 1024; i++)
rms = sqrt (rms / 1024.0);
fail_unless (rms >= 0.6);
- gst_buffer_unmap (outbuffer, res, -1);
+ gst_buffer_unmap (outbuffer, &map);
/* cleanup */
cleanup_audiochebband (audiochebband);
GstCaps *caps;
gfloat *in, *res, rms;
gint i;
+ GstMapInfo map;
audiochebband = setup_audiochebband ();
/* Set to bandpass */
g_object_set (G_OBJECT (audiochebband), "upper-frequency",
44100 / 4.0 + 1000, NULL);
inbuffer = gst_buffer_new_allocate (NULL, 1024 * sizeof (gfloat), 0);
- in = gst_buffer_map (inbuffer, NULL, NULL, GST_MAP_WRITE);
+ gst_buffer_map (inbuffer, &map, GST_MAP_WRITE);
+ in = (gfloat *) map.data;
for (i = 0; i < 1024; i += 2) {
in[i] = 1.0;
in[i + 1] = -1.0;
}
- gst_buffer_unmap (inbuffer, in, -1);
+ gst_buffer_unmap (inbuffer, &map);
caps = gst_caps_from_string (BUFFER_CAPS_STRING_32);
fail_unless (gst_pad_set_caps (mysrcpad, caps));
fail_unless_equals_int (g_list_length (buffers), 1);
fail_if ((outbuffer = (GstBuffer *) buffers->data) == NULL);
- res = gst_buffer_map (outbuffer, NULL, NULL, GST_MAP_READ);
+ gst_buffer_map (outbuffer, &map, GST_MAP_READ);
+ res = (gfloat *) map.data;
rms = 0.0;
for (i = 0; i < 1024; i++)
rms = sqrt (rms / 1024.0);
fail_unless (rms <= 0.1);
- gst_buffer_unmap (outbuffer, res, -1);
+ gst_buffer_unmap (outbuffer, &map);
/* cleanup */
cleanup_audiochebband (audiochebband);
GstCaps *caps;
gfloat *in, *res, rms;
gint i;
+ GstMapInfo map;
audiochebband = setup_audiochebband ();
/* Set to bandreject */
g_object_set (G_OBJECT (audiochebband), "upper-frequency",
44100 / 4.0 + 1000, NULL);
inbuffer = gst_buffer_new_allocate (NULL, 1024 * sizeof (gfloat), 0);
- in = gst_buffer_map (inbuffer, NULL, NULL, GST_MAP_WRITE);
+ gst_buffer_map (inbuffer, &map, GST_MAP_WRITE);
+ in = (gfloat *) map.data;
for (i = 0; i < 1024; i++)
in[i] = 1.0;
- gst_buffer_unmap (inbuffer, in, -1);
+ gst_buffer_unmap (inbuffer, &map);
caps = gst_caps_from_string (BUFFER_CAPS_STRING_32);
fail_unless (gst_pad_set_caps (mysrcpad, caps));
fail_unless_equals_int (g_list_length (buffers), 1);
fail_if ((outbuffer = (GstBuffer *) buffers->data) == NULL);
- res = gst_buffer_map (outbuffer, NULL, NULL, GST_MAP_READ);
+ gst_buffer_map (outbuffer, &map, GST_MAP_READ);
+ res = (gfloat *) map.data;
rms = 0.0;
for (i = 0; i < 1024; i++)
rms = sqrt (rms / 1024.0);
fail_unless (rms >= 0.9);
- gst_buffer_unmap (outbuffer, res, -1);
+ gst_buffer_unmap (outbuffer, &map);
/* cleanup */
cleanup_audiochebband (audiochebband);
GstCaps *caps;
gfloat *in, *res, rms;
gint i;
+ GstMapInfo map;
audiochebband = setup_audiochebband ();
/* Set to bandreject */
g_object_set (G_OBJECT (audiochebband), "upper-frequency",
44100 / 4.0 + 1000, NULL);
inbuffer = gst_buffer_new_allocate (NULL, 1024 * sizeof (gfloat), 0);
- in = gst_buffer_map (inbuffer, NULL, NULL, GST_MAP_WRITE);
+ gst_buffer_map (inbuffer, &map, GST_MAP_WRITE);
+ in = (gfloat *) map.data;
for (i = 0; i < 1024; i += 4) {
in[i] = 0.0;
in[i + 1] = 1.0;
in[i + 2] = 0.0;
in[i + 3] = -1.0;
}
- gst_buffer_unmap (inbuffer, in, -1);
+ gst_buffer_unmap (inbuffer, &map);
caps = gst_caps_from_string (BUFFER_CAPS_STRING_32);
fail_unless (gst_pad_set_caps (mysrcpad, caps));
fail_unless_equals_int (g_list_length (buffers), 1);
fail_if ((outbuffer = (GstBuffer *) buffers->data) == NULL);
- res = gst_buffer_map (outbuffer, NULL, NULL, GST_MAP_READ);
+ gst_buffer_map (outbuffer, &map, GST_MAP_READ);
+ res = (gfloat *) map.data;
rms = 0.0;
for (i = 0; i < 1024; i++)
rms = sqrt (rms / 1024.0);
fail_unless (rms <= 0.1);
- gst_buffer_unmap (outbuffer, res, -1);
+ gst_buffer_unmap (outbuffer, &map);
/* cleanup */
cleanup_audiochebband (audiochebband);
GstCaps *caps;
gfloat *in, *res, rms;
gint i;
+ GstMapInfo map;
audiochebband = setup_audiochebband ();
/* Set to bandreject */
g_object_set (G_OBJECT (audiochebband), "upper-frequency",
44100 / 4.0 + 1000, NULL);
inbuffer = gst_buffer_new_allocate (NULL, 1024 * sizeof (gfloat), 0);
- in = gst_buffer_map (inbuffer, NULL, NULL, GST_MAP_WRITE);
+ gst_buffer_map (inbuffer, &map, GST_MAP_WRITE);
+ in = (gfloat *) map.data;
for (i = 0; i < 1024; i += 2) {
in[i] = 1.0;
in[i + 1] = -1.0;
}
- gst_buffer_unmap (inbuffer, in, -1);
+ gst_buffer_unmap (inbuffer, &map);
caps = gst_caps_from_string (BUFFER_CAPS_STRING_32);
fail_unless (gst_pad_set_caps (mysrcpad, caps));
fail_unless_equals_int (g_list_length (buffers), 1);
fail_if ((outbuffer = (GstBuffer *) buffers->data) == NULL);
- res = gst_buffer_map (outbuffer, NULL, NULL, GST_MAP_READ);
+ gst_buffer_map (outbuffer, &map, GST_MAP_READ);
+ res = (gfloat *) map.data;
rms = 0.0;
for (i = 0; i < 1024; i++)
rms = sqrt (rms / 1024.0);
fail_unless (rms >= 0.9);
- gst_buffer_unmap (outbuffer, res, -1);
+ gst_buffer_unmap (outbuffer, &map);
/* cleanup */
cleanup_audiochebband (audiochebband);
GstCaps *caps;
gdouble *in, *res, rms;
gint i;
+ GstMapInfo map;
audiochebband = setup_audiochebband ();
/* Set to bandpass */
g_object_set (G_OBJECT (audiochebband), "upper-frequency",
44100 / 4.0 + 1000, NULL);
inbuffer = gst_buffer_new_and_alloc (1024 * sizeof (gdouble));
- in = gst_buffer_map (inbuffer, NULL, NULL, GST_MAP_WRITE);
+ gst_buffer_map (inbuffer, &map, GST_MAP_WRITE);
+ in = (gdouble *) map.data;
for (i = 0; i < 1024; i++)
in[i] = 1.0;
- gst_buffer_unmap (inbuffer, in, -1);
+ gst_buffer_unmap (inbuffer, &map);
caps = gst_caps_from_string (BUFFER_CAPS_STRING_64);
fail_unless (gst_pad_set_caps (mysrcpad, caps));
fail_unless_equals_int (g_list_length (buffers), 1);
fail_if ((outbuffer = (GstBuffer *) buffers->data) == NULL);
- res = gst_buffer_map (outbuffer, NULL, NULL, GST_MAP_READ);
+ gst_buffer_map (outbuffer, &map, GST_MAP_READ);
+ res = (gdouble *) map.data;
rms = 0.0;
for (i = 0; i < 1024; i++)
rms = sqrt (rms / 1024.0);
fail_unless (rms <= 0.1);
- gst_buffer_unmap (outbuffer, res, -1);
+ gst_buffer_unmap (outbuffer, &map);
/* cleanup */
cleanup_audiochebband (audiochebband);
GstCaps *caps;
gdouble *in, *res, rms;
gint i;
+ GstMapInfo map;
audiochebband = setup_audiochebband ();
/* Set to bandpass */
g_object_set (G_OBJECT (audiochebband), "upper-frequency",
44100 / 4.0 + 1000, NULL);
inbuffer = gst_buffer_new_and_alloc (1024 * sizeof (gdouble));
- in = gst_buffer_map (inbuffer, NULL, NULL, GST_MAP_WRITE);
+ gst_buffer_map (inbuffer, &map, GST_MAP_WRITE);
+ in = (gdouble *) map.data;
for (i = 0; i < 1024; i += 4) {
in[i] = 0.0;
in[i + 1] = 1.0;
in[i + 2] = 0.0;
in[i + 3] = -1.0;
}
- gst_buffer_unmap (inbuffer, in, -1);
+ gst_buffer_unmap (inbuffer, &map);
caps = gst_caps_from_string (BUFFER_CAPS_STRING_64);
fail_unless (gst_pad_set_caps (mysrcpad, caps));
fail_unless_equals_int (g_list_length (buffers), 1);
fail_if ((outbuffer = (GstBuffer *) buffers->data) == NULL);
- res = gst_buffer_map (outbuffer, NULL, NULL, GST_MAP_READ);
+ gst_buffer_map (outbuffer, &map, GST_MAP_READ);
+ res = (gdouble *) map.data;
rms = 0.0;
for (i = 0; i < 1024; i++)
rms = sqrt (rms / 1024.0);
fail_unless (rms >= 0.6);
- gst_buffer_unmap (outbuffer, res, -1);
+ gst_buffer_unmap (outbuffer, &map);
/* cleanup */
cleanup_audiochebband (audiochebband);
GstCaps *caps;
gdouble *in, *res, rms;
gint i;
+ GstMapInfo map;
audiochebband = setup_audiochebband ();
/* Set to bandpass */
g_object_set (G_OBJECT (audiochebband), "upper-frequency",
44100 / 4.0 + 1000, NULL);
inbuffer = gst_buffer_new_and_alloc (1024 * sizeof (gdouble));
- in = gst_buffer_map (inbuffer, NULL, NULL, GST_MAP_WRITE);
+ gst_buffer_map (inbuffer, &map, GST_MAP_WRITE);
+ in = (gdouble *) map.data;
for (i = 0; i < 1024; i += 2) {
in[i] = 1.0;
in[i + 1] = -1.0;
}
- gst_buffer_unmap (inbuffer, in, -1);
+ gst_buffer_unmap (inbuffer, &map);
caps = gst_caps_from_string (BUFFER_CAPS_STRING_64);
fail_unless (gst_pad_set_caps (mysrcpad, caps));
fail_unless_equals_int (g_list_length (buffers), 1);
fail_if ((outbuffer = (GstBuffer *) buffers->data) == NULL);
- res = gst_buffer_map (outbuffer, NULL, NULL, GST_MAP_READ);
+ gst_buffer_map (outbuffer, &map, GST_MAP_READ);
+ res = (gdouble *) map.data;
rms = 0.0;
for (i = 0; i < 1024; i++)
rms = sqrt (rms / 1024.0);
fail_unless (rms <= 0.1);
- gst_buffer_unmap (outbuffer, res, -1);
+ gst_buffer_unmap (outbuffer, &map);
/* cleanup */
cleanup_audiochebband (audiochebband);
GstCaps *caps;
gdouble *in, *res, rms;
gint i;
+ GstMapInfo map;
audiochebband = setup_audiochebband ();
/* Set to bandreject */
g_object_set (G_OBJECT (audiochebband), "upper-frequency",
44100 / 4.0 + 1000, NULL);
inbuffer = gst_buffer_new_and_alloc (1024 * sizeof (gdouble));
- in = gst_buffer_map (inbuffer, NULL, NULL, GST_MAP_WRITE);
+ gst_buffer_map (inbuffer, &map, GST_MAP_WRITE);
+ in = (gdouble *) map.data;
for (i = 0; i < 1024; i++)
in[i] = 1.0;
- gst_buffer_unmap (inbuffer, in, -1);
+ gst_buffer_unmap (inbuffer, &map);
caps = gst_caps_from_string (BUFFER_CAPS_STRING_64);
fail_unless (gst_pad_set_caps (mysrcpad, caps));
fail_unless_equals_int (g_list_length (buffers), 1);
fail_if ((outbuffer = (GstBuffer *) buffers->data) == NULL);
- res = gst_buffer_map (outbuffer, NULL, NULL, GST_MAP_READ);
+ gst_buffer_map (outbuffer, &map, GST_MAP_READ);
+ res = (gdouble *) map.data;
rms = 0.0;
for (i = 0; i < 1024; i++)
rms = sqrt (rms / 1024.0);
fail_unless (rms >= 0.9);
- gst_buffer_unmap (outbuffer, res, -1);
+ gst_buffer_unmap (outbuffer, &map);
/* cleanup */
cleanup_audiochebband (audiochebband);
GstCaps *caps;
gdouble *in, *res, rms;
gint i;
+ GstMapInfo map;
audiochebband = setup_audiochebband ();
/* Set to bandreject */
g_object_set (G_OBJECT (audiochebband), "upper-frequency",
44100 / 4.0 + 1000, NULL);
inbuffer = gst_buffer_new_and_alloc (1024 * sizeof (gdouble));
- in = gst_buffer_map (inbuffer, NULL, NULL, GST_MAP_WRITE);
+ gst_buffer_map (inbuffer, &map, GST_MAP_WRITE);
+ in = (gdouble *) map.data;
for (i = 0; i < 1024; i += 4) {
in[i] = 0.0;
in[i + 1] = 1.0;
in[i + 2] = 0.0;
in[i + 3] = -1.0;
}
- gst_buffer_unmap (inbuffer, in, -1);
+ gst_buffer_unmap (inbuffer, &map);
caps = gst_caps_from_string (BUFFER_CAPS_STRING_64);
fail_unless (gst_pad_set_caps (mysrcpad, caps));
fail_unless_equals_int (g_list_length (buffers), 1);
fail_if ((outbuffer = (GstBuffer *) buffers->data) == NULL);
- res = gst_buffer_map (outbuffer, NULL, NULL, GST_MAP_READ);
+ gst_buffer_map (outbuffer, &map, GST_MAP_READ);
+ res = (gdouble *) map.data;
rms = 0.0;
for (i = 0; i < 1024; i++)
rms = sqrt (rms / 1024.0);
fail_unless (rms <= 0.1);
- gst_buffer_unmap (outbuffer, res, -1);
+ gst_buffer_unmap (outbuffer, &map);
/* cleanup */
cleanup_audiochebband (audiochebband);
GstCaps *caps;
gdouble *in, *res, rms;
gint i;
+ GstMapInfo map;
audiochebband = setup_audiochebband ();
/* Set to bandreject */
g_object_set (G_OBJECT (audiochebband), "upper-frequency",
44100 / 4.0 + 1000, NULL);
inbuffer = gst_buffer_new_and_alloc (1024 * sizeof (gdouble));
- in = gst_buffer_map (inbuffer, NULL, NULL, GST_MAP_WRITE);
+ gst_buffer_map (inbuffer, &map, GST_MAP_WRITE);
+ in = (gdouble *) map.data;
for (i = 0; i < 1024; i += 2) {
in[i] = 1.0;
in[i + 1] = -1.0;
}
- gst_buffer_unmap (inbuffer, in, -1);
+ gst_buffer_unmap (inbuffer, &map);
caps = gst_caps_from_string (BUFFER_CAPS_STRING_64);
fail_unless (gst_pad_set_caps (mysrcpad, caps));
fail_unless_equals_int (g_list_length (buffers), 1);
fail_if ((outbuffer = (GstBuffer *) buffers->data) == NULL);
- res = gst_buffer_map (outbuffer, NULL, NULL, GST_MAP_READ);
+ gst_buffer_map (outbuffer, &map, GST_MAP_READ);
+ res = (gdouble *) map.data;
rms = 0.0;
for (i = 0; i < 1024; i++)
rms = sqrt (rms / 1024.0);
fail_unless (rms >= 0.9);
- gst_buffer_unmap (outbuffer, res, -1);
+ gst_buffer_unmap (outbuffer, &map);
/* cleanup */
cleanup_audiochebband (audiochebband);
GST_STATIC_CAPS ("audio/x-raw, "
"channels = (int) 1, "
"rate = (int) 44100, "
- "format = (string) { "
- GST_AUDIO_NE(F32) ", "
- GST_AUDIO_NE(F64) " }"));
+ "format = (string) { "
+ GST_AUDIO_NE (F32) ", " GST_AUDIO_NE (F64) " }"));
static GstStaticPadTemplate srctemplate = GST_STATIC_PAD_TEMPLATE ("src",
GST_PAD_SRC,
GST_PAD_ALWAYS,
"channels = (int) 1, "
"rate = (int) 44100, "
"format = (string) { "
- GST_AUDIO_NE(F32) ", "
- GST_AUDIO_NE(F64) " }"));
+ GST_AUDIO_NE (F32) ", " GST_AUDIO_NE (F64) " }"));
static GstElement *
setup_audiocheblimit (void)
GstCaps *caps;
gfloat *in, *res, rms;
gint i;
+ GstMapInfo map;
audiocheblimit = setup_audiocheblimit ();
/* Set to lowpass */
g_object_set (G_OBJECT (audiocheblimit), "cutoff", 44100 / 4.0, NULL);
inbuffer = gst_buffer_new_allocate (NULL, 128 * sizeof (gfloat), 0);
- in = gst_buffer_map (inbuffer, NULL, NULL, GST_MAP_WRITE);
+ gst_buffer_map (inbuffer, &map, GST_MAP_WRITE);
+ in = (gfloat *) map.data;
for (i = 0; i < 128; i++)
in[i] = 1.0;
- gst_buffer_unmap (inbuffer, in, -1);
+ gst_buffer_unmap (inbuffer, &map);
caps = gst_caps_from_string (BUFFER_CAPS_STRING_32);
fail_unless (gst_pad_set_caps (mysrcpad, caps));
fail_unless_equals_int (g_list_length (buffers), 1);
fail_if ((outbuffer = (GstBuffer *) buffers->data) == NULL);
- res = gst_buffer_map (outbuffer, NULL, NULL, GST_MAP_READ);
+ gst_buffer_map (outbuffer, &map, GST_MAP_READ);
+ res = (gfloat *) map.data;
rms = 0.0;
for (i = 0; i < 128; i++)
rms = sqrt (rms / 128.0);
fail_unless (rms >= 0.9);
- gst_buffer_unmap (outbuffer, res, -1);
+ gst_buffer_unmap (outbuffer, &map);
/* cleanup */
cleanup_audiocheblimit (audiocheblimit);
GstCaps *caps;
gfloat *in, *res, rms;
gint i;
+ GstMapInfo map;
audiocheblimit = setup_audiocheblimit ();
/* Set to lowpass */
g_object_set (G_OBJECT (audiocheblimit), "cutoff", 44100 / 4.0, NULL);
inbuffer = gst_buffer_new_allocate (NULL, 128 * sizeof (gfloat), 0);
- in = gst_buffer_map (inbuffer, NULL, NULL, GST_MAP_WRITE);
+ gst_buffer_map (inbuffer, &map, GST_MAP_WRITE);
+ in = (gfloat *) map.data;
for (i = 0; i < 128; i += 2) {
in[i] = 1.0;
in[i + 1] = -1.0;
}
- gst_buffer_unmap (inbuffer, in, -1);
+ gst_buffer_unmap (inbuffer, &map);
caps = gst_caps_from_string (BUFFER_CAPS_STRING_32);
fail_unless (gst_pad_set_caps (mysrcpad, caps));
fail_unless_equals_int (g_list_length (buffers), 1);
fail_if ((outbuffer = (GstBuffer *) buffers->data) == NULL);
- res = gst_buffer_map (outbuffer, NULL, NULL, GST_MAP_READ);
+ gst_buffer_map (outbuffer, &map, GST_MAP_READ);
+ res = (gfloat *) map.data;
rms = 0.0;
for (i = 0; i < 128; i++)
rms = sqrt (rms / 128.0);
fail_unless (rms <= 0.1);
- gst_buffer_unmap (outbuffer, res, -1);
+ gst_buffer_unmap (outbuffer, &map);
/* cleanup */
cleanup_audiocheblimit (audiocheblimit);
GstCaps *caps;
gfloat *in, *res, rms;
gint i;
+ GstMapInfo map;
audiocheblimit = setup_audiocheblimit ();
/* Set to highpass */
g_object_set (G_OBJECT (audiocheblimit), "cutoff", 44100 / 4.0, NULL);
inbuffer = gst_buffer_new_allocate (NULL, 128 * sizeof (gfloat), 0);
- in = gst_buffer_map (inbuffer, NULL, NULL, GST_MAP_WRITE);
+ gst_buffer_map (inbuffer, &map, GST_MAP_WRITE);
+ in = (gfloat *) map.data;
for (i = 0; i < 128; i++)
in[i] = 1.0;
- gst_buffer_unmap (inbuffer, in, -1);
+ gst_buffer_unmap (inbuffer, &map);
caps = gst_caps_from_string (BUFFER_CAPS_STRING_32);
fail_unless (gst_pad_set_caps (mysrcpad, caps));
fail_unless_equals_int (g_list_length (buffers), 1);
fail_if ((outbuffer = (GstBuffer *) buffers->data) == NULL);
- res = gst_buffer_map (outbuffer, NULL, NULL, GST_MAP_READ);
+ gst_buffer_map (outbuffer, &map, GST_MAP_READ);
+ res = (gfloat *) map.data;
rms = 0.0;
for (i = 0; i < 128; i++)
rms = sqrt (rms / 128.0);
fail_unless (rms <= 0.1);
- gst_buffer_unmap (outbuffer, res, -1);
+ gst_buffer_unmap (outbuffer, &map);
/* cleanup */
cleanup_audiocheblimit (audiocheblimit);
GstCaps *caps;
gfloat *in, *res, rms;
gint i;
+ GstMapInfo map;
audiocheblimit = setup_audiocheblimit ();
/* Set to highpass */
g_object_set (G_OBJECT (audiocheblimit), "cutoff", 44100 / 4.0, NULL);
inbuffer = gst_buffer_new_allocate (NULL, 128 * sizeof (gfloat), 0);
- in = gst_buffer_map (inbuffer, NULL, NULL, GST_MAP_WRITE);
+ gst_buffer_map (inbuffer, &map, GST_MAP_WRITE);
+ in = (gfloat *) map.data;
for (i = 0; i < 128; i += 2) {
in[i] = 1.0;
in[i + 1] = -1.0;
}
- gst_buffer_unmap (inbuffer, in, -1);
+ gst_buffer_unmap (inbuffer, &map);
caps = gst_caps_from_string (BUFFER_CAPS_STRING_32);
fail_unless (gst_pad_set_caps (mysrcpad, caps));
fail_unless_equals_int (g_list_length (buffers), 1);
fail_if ((outbuffer = (GstBuffer *) buffers->data) == NULL);
- res = gst_buffer_map (outbuffer, NULL, NULL, GST_MAP_READ);
+ gst_buffer_map (outbuffer, &map, GST_MAP_READ);
+ res = (gfloat *) map.data;
rms = 0.0;
for (i = 0; i < 128; i++)
rms = sqrt (rms / 128.0);
fail_unless (rms >= 0.9);
- gst_buffer_unmap (outbuffer, res, -1);
+ gst_buffer_unmap (outbuffer, &map);
/* cleanup */
cleanup_audiocheblimit (audiocheblimit);
GstCaps *caps;
gdouble *in, *res, rms;
gint i;
+ GstMapInfo map;
audiocheblimit = setup_audiocheblimit ();
/* Set to lowpass */
g_object_set (G_OBJECT (audiocheblimit), "cutoff", 44100 / 4.0, NULL);
inbuffer = gst_buffer_new_allocate (NULL, 128 * sizeof (gdouble), 0);
- in = gst_buffer_map (inbuffer, NULL, NULL, GST_MAP_WRITE);
+ gst_buffer_map (inbuffer, &map, GST_MAP_WRITE);
+ in = (gdouble *) map.data;
for (i = 0; i < 128; i++)
in[i] = 1.0;
- gst_buffer_unmap (inbuffer, in, -1);
+ gst_buffer_unmap (inbuffer, &map);
caps = gst_caps_from_string (BUFFER_CAPS_STRING_64);
fail_unless (gst_pad_set_caps (mysrcpad, caps));
fail_unless_equals_int (g_list_length (buffers), 1);
fail_if ((outbuffer = (GstBuffer *) buffers->data) == NULL);
- res = gst_buffer_map (outbuffer, NULL, NULL, GST_MAP_READ);
+ gst_buffer_map (outbuffer, &map, GST_MAP_READ);
+ res = (gdouble *) map.data;
rms = 0.0;
for (i = 0; i < 128; i++)
rms = sqrt (rms / 128.0);
fail_unless (rms >= 0.9);
- gst_buffer_unmap (outbuffer, res, -1);
+ gst_buffer_unmap (outbuffer, &map);
/* cleanup */
cleanup_audiocheblimit (audiocheblimit);
GstCaps *caps;
gdouble *in, *res, rms;
gint i;
+ GstMapInfo map;
audiocheblimit = setup_audiocheblimit ();
/* Set to lowpass */
g_object_set (G_OBJECT (audiocheblimit), "cutoff", 44100 / 4.0, NULL);
inbuffer = gst_buffer_new_allocate (NULL, 128 * sizeof (gdouble), 0);
- in = gst_buffer_map (inbuffer, NULL, NULL, GST_MAP_WRITE);
+ gst_buffer_map (inbuffer, &map, GST_MAP_WRITE);
+ in = (gdouble *) map.data;
for (i = 0; i < 128; i += 2) {
in[i] = 1.0;
in[i + 1] = -1.0;
}
- gst_buffer_unmap (inbuffer, in, -1);
+ gst_buffer_unmap (inbuffer, &map);
caps = gst_caps_from_string (BUFFER_CAPS_STRING_64);
fail_unless (gst_pad_set_caps (mysrcpad, caps));
fail_unless_equals_int (g_list_length (buffers), 1);
fail_if ((outbuffer = (GstBuffer *) buffers->data) == NULL);
- res = gst_buffer_map (outbuffer, NULL, NULL, GST_MAP_READ);
+ gst_buffer_map (outbuffer, &map, GST_MAP_READ);
+ res = (gdouble *) map.data;
rms = 0.0;
for (i = 0; i < 128; i++)
rms = sqrt (rms / 128.0);
fail_unless (rms <= 0.1);
- gst_buffer_unmap (outbuffer, res, -1);
+ gst_buffer_unmap (outbuffer, &map);
/* cleanup */
cleanup_audiocheblimit (audiocheblimit);
GstCaps *caps;
gdouble *in, *res, rms;
gint i;
+ GstMapInfo map;
audiocheblimit = setup_audiocheblimit ();
/* Set to highpass */
g_object_set (G_OBJECT (audiocheblimit), "cutoff", 44100 / 4.0, NULL);
inbuffer = gst_buffer_new_allocate (NULL, 128 * sizeof (gdouble), 0);
- in = gst_buffer_map (inbuffer, NULL, NULL, GST_MAP_WRITE);
+ gst_buffer_map (inbuffer, &map, GST_MAP_WRITE);
+ in = (gdouble *) map.data;
for (i = 0; i < 128; i++)
in[i] = 1.0;
- gst_buffer_unmap (inbuffer, in, -1);
+ gst_buffer_unmap (inbuffer, &map);
caps = gst_caps_from_string (BUFFER_CAPS_STRING_64);
fail_unless (gst_pad_set_caps (mysrcpad, caps));
fail_unless_equals_int (g_list_length (buffers), 1);
fail_if ((outbuffer = (GstBuffer *) buffers->data) == NULL);
- res = gst_buffer_map (outbuffer, NULL, NULL, GST_MAP_READ);
+ gst_buffer_map (outbuffer, &map, GST_MAP_READ);
+ res = (gdouble *) map.data;
rms = 0.0;
for (i = 0; i < 128; i++)
rms = sqrt (rms / 128.0);
fail_unless (rms <= 0.1);
- gst_buffer_unmap (outbuffer, res, -1);
+ gst_buffer_unmap (outbuffer, &map);
/* cleanup */
cleanup_audiocheblimit (audiocheblimit);
GstCaps *caps;
gdouble *in, *res, rms;
gint i;
+ GstMapInfo map;
audiocheblimit = setup_audiocheblimit ();
/* Set to highpass */
g_object_set (G_OBJECT (audiocheblimit), "cutoff", 44100 / 4.0, NULL);
inbuffer = gst_buffer_new_allocate (NULL, 128 * sizeof (gdouble), 0);
- in = gst_buffer_map (inbuffer, NULL, NULL, GST_MAP_WRITE);
+ gst_buffer_map (inbuffer, &map, GST_MAP_WRITE);
+ in = (gdouble *) map.data;
for (i = 0; i < 128; i += 2) {
in[i] = 1.0;
in[i + 1] = -1.0;
}
- gst_buffer_unmap (inbuffer, in, -1);
+ gst_buffer_unmap (inbuffer, &map);
caps = gst_caps_from_string (BUFFER_CAPS_STRING_64);
fail_unless (gst_pad_set_caps (mysrcpad, caps));
fail_unless_equals_int (g_list_length (buffers), 1);
fail_if ((outbuffer = (GstBuffer *) buffers->data) == NULL);
- res = gst_buffer_map (outbuffer, NULL, NULL, GST_MAP_READ);
+ gst_buffer_map (outbuffer, &map, GST_MAP_READ);
+ res = (gdouble *) map.data;
rms = 0.0;
for (i = 0; i < 128; i++)
rms = sqrt (rms / 128.0);
fail_unless (rms >= 0.9);
- gst_buffer_unmap (outbuffer, res, -1);
+ gst_buffer_unmap (outbuffer, &map);
/* cleanup */
cleanup_audiocheblimit (audiocheblimit);
GstCaps *caps;
gfloat *in, *res, rms;
gint i;
+ GstMapInfo map;
audiocheblimit = setup_audiocheblimit ();
/* Set to lowpass */
g_object_set (G_OBJECT (audiocheblimit), "cutoff", 44100 / 4.0, NULL);
inbuffer = gst_buffer_new_allocate (NULL, 128 * sizeof (gfloat), 0);
- in = gst_buffer_map (inbuffer, NULL, NULL, GST_MAP_WRITE);
+ gst_buffer_map (inbuffer, &map, GST_MAP_WRITE);
+ in = (gfloat *) map.data;
for (i = 0; i < 128; i++)
in[i] = 1.0;
- gst_buffer_unmap (inbuffer, in, -1);
+ gst_buffer_unmap (inbuffer, &map);
caps = gst_caps_from_string (BUFFER_CAPS_STRING_32);
fail_unless (gst_pad_set_caps (mysrcpad, caps));
fail_unless_equals_int (g_list_length (buffers), 1);
fail_if ((outbuffer = (GstBuffer *) buffers->data) == NULL);
- res = gst_buffer_map (outbuffer, NULL, NULL, GST_MAP_READ);
+ gst_buffer_map (outbuffer, &map, GST_MAP_READ);
+ res = (gfloat *) map.data;
rms = 0.0;
for (i = 0; i < 128; i++)
rms = sqrt (rms / 128.0);
fail_unless (rms >= 0.9);
- gst_buffer_unmap (outbuffer, res, -1);
+ gst_buffer_unmap (outbuffer, &map);
/* cleanup */
cleanup_audiocheblimit (audiocheblimit);
GstCaps *caps;
gfloat *in, *res, rms;
gint i;
+ GstMapInfo map;
audiocheblimit = setup_audiocheblimit ();
/* Set to lowpass */
g_object_set (G_OBJECT (audiocheblimit), "cutoff", 44100 / 4.0, NULL);
inbuffer = gst_buffer_new_allocate (NULL, 128 * sizeof (gfloat), 0);
- in = gst_buffer_map (inbuffer, NULL, NULL, GST_MAP_WRITE);
+ gst_buffer_map (inbuffer, &map, GST_MAP_WRITE);
+ in = (gfloat *) map.data;
for (i = 0; i < 128; i += 2) {
in[i] = 1.0;
in[i + 1] = -1.0;
}
- gst_buffer_unmap (inbuffer, in, -1);
+ gst_buffer_unmap (inbuffer, &map);
caps = gst_caps_from_string (BUFFER_CAPS_STRING_32);
fail_unless (gst_pad_set_caps (mysrcpad, caps));
fail_unless_equals_int (g_list_length (buffers), 1);
fail_if ((outbuffer = (GstBuffer *) buffers->data) == NULL);
- res = gst_buffer_map (outbuffer, NULL, NULL, GST_MAP_READ);
+ gst_buffer_map (outbuffer, &map, GST_MAP_READ);
+ res = (gfloat *) map.data;
rms = 0.0;
for (i = 0; i < 128; i++)
rms = sqrt (rms / 128.0);
fail_unless (rms <= 0.1);
- gst_buffer_unmap (outbuffer, res, -1);
+ gst_buffer_unmap (outbuffer, &map);
/* cleanup */
cleanup_audiocheblimit (audiocheblimit);
GstCaps *caps;
gfloat *in, *res, rms;
gint i;
+ GstMapInfo map;
audiocheblimit = setup_audiocheblimit ();
/* Set to highpass */
g_object_set (G_OBJECT (audiocheblimit), "cutoff", 44100 / 4.0, NULL);
inbuffer = gst_buffer_new_allocate (NULL, 128 * sizeof (gfloat), 0);
- in = gst_buffer_map (inbuffer, NULL, NULL, GST_MAP_WRITE);
+ gst_buffer_map (inbuffer, &map, GST_MAP_WRITE);
+ in = (gfloat *) map.data;
for (i = 0; i < 128; i++)
in[i] = 1.0;
- gst_buffer_unmap (inbuffer, in, -1);
+ gst_buffer_unmap (inbuffer, &map);
caps = gst_caps_from_string (BUFFER_CAPS_STRING_32);
fail_unless (gst_pad_set_caps (mysrcpad, caps));
fail_unless_equals_int (g_list_length (buffers), 1);
fail_if ((outbuffer = (GstBuffer *) buffers->data) == NULL);
- res = gst_buffer_map (outbuffer, NULL, NULL, GST_MAP_READ);
+ gst_buffer_map (outbuffer, &map, GST_MAP_READ);
+ res = (gfloat *) map.data;
rms = 0.0;
for (i = 0; i < 128; i++)
rms = sqrt (rms / 128.0);
fail_unless (rms <= 0.1);
- gst_buffer_unmap (outbuffer, res, -1);
+ gst_buffer_unmap (outbuffer, &map);
/* cleanup */
cleanup_audiocheblimit (audiocheblimit);
GstCaps *caps;
gfloat *in, *res, rms;
gint i;
+ GstMapInfo map;
audiocheblimit = setup_audiocheblimit ();
/* Set to highpass */
g_object_set (G_OBJECT (audiocheblimit), "cutoff", 44100 / 4.0, NULL);
inbuffer = gst_buffer_new_allocate (NULL, 128 * sizeof (gfloat), 0);
- in = gst_buffer_map (inbuffer, NULL, NULL, GST_MAP_WRITE);
+ gst_buffer_map (inbuffer, &map, GST_MAP_WRITE);
+ in = (gfloat *) map.data;
for (i = 0; i < 128; i += 2) {
in[i] = 1.0;
in[i + 1] = -1.0;
}
- gst_buffer_unmap (inbuffer, in, -1);
+ gst_buffer_unmap (inbuffer, &map);
caps = gst_caps_from_string (BUFFER_CAPS_STRING_32);
fail_unless (gst_pad_set_caps (mysrcpad, caps));
fail_unless_equals_int (g_list_length (buffers), 1);
fail_if ((outbuffer = (GstBuffer *) buffers->data) == NULL);
- res = gst_buffer_map (outbuffer, NULL, NULL, GST_MAP_READ);
+ gst_buffer_map (outbuffer, &map, GST_MAP_READ);
+ res = (gfloat *) map.data;
rms = 0.0;
for (i = 0; i < 128; i++)
rms = sqrt (rms / 128.0);
fail_unless (rms >= 0.9);
- gst_buffer_unmap (outbuffer, res, -1);
+ gst_buffer_unmap (outbuffer, &map);
/* cleanup */
cleanup_audiocheblimit (audiocheblimit);
GstCaps *caps;
gdouble *in, *res, rms;
gint i;
+ GstMapInfo map;
audiocheblimit = setup_audiocheblimit ();
/* Set to lowpass */
g_object_set (G_OBJECT (audiocheblimit), "cutoff", 44100 / 4.0, NULL);
inbuffer = gst_buffer_new_and_alloc (128 * sizeof (gdouble));
- in = gst_buffer_map (inbuffer, NULL, NULL, GST_MAP_WRITE);
+ gst_buffer_map (inbuffer, &map, GST_MAP_WRITE);
+ in = (gdouble *) map.data;
for (i = 0; i < 128; i++)
in[i] = 1.0;
- gst_buffer_unmap (inbuffer, in, -1);
+ gst_buffer_unmap (inbuffer, &map);
caps = gst_caps_from_string (BUFFER_CAPS_STRING_64);
fail_unless (gst_pad_set_caps (mysrcpad, caps));
fail_unless_equals_int (g_list_length (buffers), 1);
fail_if ((outbuffer = (GstBuffer *) buffers->data) == NULL);
- res = gst_buffer_map (outbuffer, NULL, NULL, GST_MAP_READ);
+ gst_buffer_map (outbuffer, &map, GST_MAP_READ);
+ res = (gdouble *) map.data;
rms = 0.0;
for (i = 0; i < 128; i++)
rms = sqrt (rms / 128.0);
fail_unless (rms >= 0.9);
- gst_buffer_unmap (outbuffer, res, -1);
+ gst_buffer_unmap (outbuffer, &map);
/* cleanup */
cleanup_audiocheblimit (audiocheblimit);
GstCaps *caps;
gdouble *in, *res, rms;
gint i;
+ GstMapInfo map;
audiocheblimit = setup_audiocheblimit ();
/* Set to lowpass */
g_object_set (G_OBJECT (audiocheblimit), "cutoff", 44100 / 4.0, NULL);
inbuffer = gst_buffer_new_and_alloc (128 * sizeof (gdouble));
- in = gst_buffer_map (inbuffer, NULL, NULL, GST_MAP_WRITE);
+ gst_buffer_map (inbuffer, &map, GST_MAP_WRITE);
+ in = (gdouble *) map.data;
for (i = 0; i < 128; i += 2) {
in[i] = 1.0;
in[i + 1] = -1.0;
}
- gst_buffer_unmap (inbuffer, in, -1);
+ gst_buffer_unmap (inbuffer, &map);
caps = gst_caps_from_string (BUFFER_CAPS_STRING_64);
fail_unless (gst_pad_set_caps (mysrcpad, caps));
fail_unless_equals_int (g_list_length (buffers), 1);
fail_if ((outbuffer = (GstBuffer *) buffers->data) == NULL);
- res = gst_buffer_map (outbuffer, NULL, NULL, GST_MAP_READ);
+ gst_buffer_map (outbuffer, &map, GST_MAP_READ);
+ res = (gdouble *) map.data;
rms = 0.0;
for (i = 0; i < 128; i++)
rms = sqrt (rms / 128.0);
fail_unless (rms <= 0.1);
- gst_buffer_unmap (outbuffer, res, -1);
+ gst_buffer_unmap (outbuffer, &map);
/* cleanup */
cleanup_audiocheblimit (audiocheblimit);
GstCaps *caps;
gdouble *in, *res, rms;
gint i;
+ GstMapInfo map;
audiocheblimit = setup_audiocheblimit ();
/* Set to highpass */
g_object_set (G_OBJECT (audiocheblimit), "cutoff", 44100 / 4.0, NULL);
inbuffer = gst_buffer_new_and_alloc (128 * sizeof (gdouble));
- in = gst_buffer_map (inbuffer, NULL, NULL, GST_MAP_WRITE);
+ gst_buffer_map (inbuffer, &map, GST_MAP_WRITE);
+ in = (gdouble *) map.data;
for (i = 0; i < 128; i++)
in[i] = 1.0;
- gst_buffer_unmap (inbuffer, in, -1);
+ gst_buffer_unmap (inbuffer, &map);
caps = gst_caps_from_string (BUFFER_CAPS_STRING_64);
fail_unless (gst_pad_set_caps (mysrcpad, caps));
fail_unless_equals_int (g_list_length (buffers), 1);
fail_if ((outbuffer = (GstBuffer *) buffers->data) == NULL);
- res = gst_buffer_map (outbuffer, NULL, NULL, GST_MAP_READ);
+ gst_buffer_map (outbuffer, &map, GST_MAP_READ);
+ res = (gdouble *) map.data;
rms = 0.0;
for (i = 0; i < 128; i++)
rms = sqrt (rms / 128.0);
fail_unless (rms <= 0.1);
- gst_buffer_unmap (outbuffer, res, -1);
+ gst_buffer_unmap (outbuffer, &map);
/* cleanup */
cleanup_audiocheblimit (audiocheblimit);
GstCaps *caps;
gdouble *in, *res, rms;
gint i;
+ GstMapInfo map;
audiocheblimit = setup_audiocheblimit ();
/* Set to highpass */
g_object_set (G_OBJECT (audiocheblimit), "cutoff", 44100 / 4.0, NULL);
inbuffer = gst_buffer_new_and_alloc (128 * sizeof (gdouble));
- in = gst_buffer_map (inbuffer, NULL, NULL, GST_MAP_WRITE);
+ gst_buffer_map (inbuffer, &map, GST_MAP_WRITE);
+ in = (gdouble *) map.data;
for (i = 0; i < 128; i += 2) {
in[i] = 1.0;
in[i + 1] = -1.0;
}
- gst_buffer_unmap (inbuffer, in, -1);
+ gst_buffer_unmap (inbuffer, &map);
caps = gst_caps_from_string (BUFFER_CAPS_STRING_64);
fail_unless (gst_pad_set_caps (mysrcpad, caps));
fail_unless_equals_int (g_list_length (buffers), 1);
fail_if ((outbuffer = (GstBuffer *) buffers->data) == NULL);
- res = gst_buffer_map (outbuffer, NULL, NULL, GST_MAP_READ);
+ gst_buffer_map (outbuffer, &map, GST_MAP_READ);
+ res = (gdouble *) map.data;
rms = 0.0;
for (i = 0; i < 128; i++)
rms = sqrt (rms / 128.0);
fail_unless (rms >= 0.9);
- gst_buffer_unmap (outbuffer, res, -1);
+ gst_buffer_unmap (outbuffer, &map);
/* cleanup */
cleanup_audiocheblimit (audiocheblimit);
gpointer user_data)
{
if (!have_data) {
- gsize size;
+ GstMapInfo map;
gdouble *data;
- data = gst_buffer_map (buffer, &size, NULL, GST_MAP_READ);
+ gst_buffer_map (buffer, &map, GST_MAP_READ);
+ data = (gdouble *) map.data;
- fail_unless (size > 5 * sizeof (gdouble));
+ fail_unless (map.size > 5 * sizeof (gdouble));
fail_unless (data[0] == 0.0);
fail_unless (data[1] == 0.0);
fail_unless (data[2] == 0.0);
fail_unless (data[4] == 0.0);
fail_unless (data[5] != 0.0);
- gst_buffer_unmap (buffer, data, size);
+ gst_buffer_unmap (buffer, &map);
have_data = TRUE;
}
}
gpointer user_data)
{
if (!have_data) {
- gsize size;
+ GstMapInfo map;
gdouble *data;
- data = gst_buffer_map (buffer, &size, NULL, GST_MAP_READ);
+ gst_buffer_map (buffer, &map, GST_MAP_READ);
+ data = (gdouble *) map.data;
- fail_unless (size > 5 * sizeof (gdouble));
+ fail_unless (map.size > 5 * sizeof (gdouble));
fail_unless (data[0] == 0.0);
fail_unless (data[1] == 0.0);
fail_unless (data[2] == 0.0);
fail_unless (data[4] == 0.0);
fail_unless (data[5] != 0.0);
- gst_buffer_unmap (buffer, data, size);
+ gst_buffer_unmap (buffer, &map);
have_data = TRUE;
}
}
GstCaps *caps;
gint16 in[4] = { 16384, -256, 128, -512 };
gint16 *res;
+ GstMapInfo map;
invert = setup_invert ();
fail_unless (gst_element_set_state (invert,
fail_unless_equals_int (g_list_length (buffers), 1);
fail_if ((outbuffer = (GstBuffer *) buffers->data) == NULL);
- res = gst_buffer_map (outbuffer, NULL, NULL, GST_MAP_READ);
+ gst_buffer_map (outbuffer, &map, GST_MAP_READ);
+ res = (gint16 *) map.data;
GST_INFO ("expected %+5d %+5d %+5d %+5d real %+5d %+5d %+5d %+5d",
in[0], in[1], in[2], in[3], res[0], res[1], res[2], res[3]);
- gst_buffer_unmap (outbuffer, res, -1);
+ gst_buffer_unmap (outbuffer, &map);
fail_unless (gst_buffer_memcmp (outbuffer, 0, in, 8) == 0);
gint16 in[4] = { 16384, -256, 128, -512 };
gint16 out[4] = { 0, 0, 0, 0 };
gint16 *res;
+ GstMapInfo map;
invert = setup_invert ();
g_object_set (G_OBJECT (invert), "degree", 0.5, NULL);
fail_unless_equals_int (g_list_length (buffers), 1);
fail_if ((outbuffer = (GstBuffer *) buffers->data) == NULL);
- res = gst_buffer_map (outbuffer, NULL, NULL, GST_MAP_READ);
+ gst_buffer_map (outbuffer, &map, GST_MAP_READ);
+ res = (gint16 *) map.data;
GST_INFO ("expected %+5d %+5d %+5d %+5d real %+5d %+5d %+5d %+5d",
out[0], out[1], out[2], out[3], res[0], res[1], res[2], res[3]);
- gst_buffer_unmap (outbuffer, res, -1);
+ gst_buffer_unmap (outbuffer, &map);
fail_unless (gst_buffer_memcmp (outbuffer, 0, out, 8) == 0);
gint16 in[4] = { 16384, -256, 128, -512 };
gint16 out[4] = { -16385, 255, -129, 511 };
gint16 *res;
+ GstMapInfo map;
invert = setup_invert ();
g_object_set (G_OBJECT (invert), "degree", 1.0, NULL);
fail_unless_equals_int (g_list_length (buffers), 1);
fail_if ((outbuffer = (GstBuffer *) buffers->data) == NULL);
- res = gst_buffer_map (outbuffer, NULL, NULL, GST_MAP_READ);
+ gst_buffer_map (outbuffer, &map, GST_MAP_READ);
+ res = (gint16 *) map.data;
GST_INFO ("expected %+5d %+5d %+5d %+5d real %+5d %+5d %+5d %+5d",
out[0], out[1], out[2], out[3], res[0], res[1], res[2], res[3]);
- gst_buffer_unmap (outbuffer, res, -1);
+ gst_buffer_unmap (outbuffer, &map);
fail_unless (gst_buffer_memcmp (outbuffer, 0, out, 8) == 0);
gint16 in[4] = { 16384, -256, 128, -512 };
gint16 out[4] = { 8191, -128, 63, -256 };
gint16 *res;
+ GstMapInfo map;
invert = setup_invert ();
g_object_set (G_OBJECT (invert), "degree", 0.25, NULL);
fail_unless_equals_int (g_list_length (buffers), 1);
fail_if ((outbuffer = (GstBuffer *) buffers->data) == NULL);
- res = gst_buffer_map (outbuffer, NULL, NULL, GST_MAP_READ);
+ gst_buffer_map (outbuffer, &map, GST_MAP_READ);
+ res = (gint16 *) map.data;
GST_INFO ("expected %+5d %+5d %+5d %+5d real %+5d %+5d %+5d %+5d",
out[0], out[1], out[2], out[3], res[0], res[1], res[2], res[3]);
- gst_buffer_unmap (outbuffer, res, -1);
+ gst_buffer_unmap (outbuffer, &map);
fail_unless (gst_buffer_memcmp (outbuffer, 0, out, 8) == 0);
GstCaps *caps;
gfloat *in, *res, rms;
gint i;
+ GstMapInfo map;
GList *node;
audiowsincband = setup_audiowsincband ();
inbuffer = gst_buffer_new_and_alloc (1024 * sizeof (gfloat));
GST_BUFFER_TIMESTAMP (inbuffer) = 0;
- in = gst_buffer_map (inbuffer, NULL, NULL, GST_MAP_WRITE);
+ gst_buffer_map (inbuffer, &map, GST_MAP_WRITE);
+ in = (gfloat *) map.data;
for (i = 0; i < 1024; i++)
in[i] = 1.0;
- gst_buffer_unmap (inbuffer, in, -1);
+ gst_buffer_unmap (inbuffer, &map);
caps = gst_caps_from_string (AUDIO_WSINC_BAND_CAPS_STRING_32);
gst_pad_set_caps (mysrcpad, caps);
for (node = buffers; node; node = node->next) {
gint buffer_length;
- gsize size;
fail_if ((outbuffer = (GstBuffer *) node->data) == NULL);
- res = gst_buffer_map (outbuffer, &size, NULL, GST_MAP_READ);
- buffer_length = size / sizeof (gfloat);
+ gst_buffer_map (outbuffer, &map, GST_MAP_READ);
+ res = (gfloat *) map.data;
+ buffer_length = map.size / sizeof (gfloat);
rms = 0.0;
for (i = 0; i < buffer_length; i++)
rms += res[i] * res[i];
rms = sqrt (rms / buffer_length);
fail_unless (rms <= 0.1);
+
+ gst_buffer_unmap (outbuffer, &map);
}
/* cleanup */
GstCaps *caps;
gfloat *in, *res, rms;
gint i;
+ GstMapInfo map;
GList *node;
audiowsincband = setup_audiowsincband ();
44100 / 4.0 + 1000, NULL);
inbuffer = gst_buffer_new_and_alloc (1024 * sizeof (gfloat));
GST_BUFFER_TIMESTAMP (inbuffer) = 0;
- in = gst_buffer_map (inbuffer, NULL, NULL, GST_MAP_WRITE);
+ gst_buffer_map (inbuffer, &map, GST_MAP_WRITE);
+ in = (gfloat *) map.data;
for (i = 0; i < 1024; i += 4) {
in[i] = 0.0;
in[i + 1] = 1.0;
in[i + 2] = 0.0;
in[i + 3] = -1.0;
}
- gst_buffer_unmap (inbuffer, in, -1);
+ gst_buffer_unmap (inbuffer, &map);
caps = gst_caps_from_string (AUDIO_WSINC_BAND_CAPS_STRING_32);
gst_pad_set_caps (mysrcpad, caps);
for (node = buffers; node; node = node->next) {
gint buffer_length;
- gsize size;
fail_if ((outbuffer = (GstBuffer *) node->data) == NULL);
- res = gst_buffer_map (outbuffer, &size, NULL, GST_MAP_READ);
- buffer_length = size / sizeof (gfloat);
+ gst_buffer_map (outbuffer, &map, GST_MAP_READ);
+ res = (gfloat *) map.data;
+ buffer_length = map.size / sizeof (gfloat);
rms = 0.0;
for (i = 0; i < buffer_length; i++)
rms += res[i] * res[i];
GstCaps *caps;
gfloat *in, *res, rms;
gint i;
+ GstMapInfo map;
GList *node;
audiowsincband = setup_audiowsincband ();
44100 / 4.0 + 1000, NULL);
inbuffer = gst_buffer_new_and_alloc (1024 * sizeof (gfloat));
GST_BUFFER_TIMESTAMP (inbuffer) = 0;
- in = gst_buffer_map (inbuffer, NULL, NULL, GST_MAP_WRITE);
+ gst_buffer_map (inbuffer, &map, GST_MAP_WRITE);
+ in = (gfloat *) map.data;
for (i = 0; i < 1024; i += 2) {
in[i] = 1.0;
in[i + 1] = -1.0;
}
- gst_buffer_unmap (inbuffer, in, -1);
+ gst_buffer_unmap (inbuffer, &map);
caps = gst_caps_from_string (AUDIO_WSINC_BAND_CAPS_STRING_32);
gst_pad_set_caps (mysrcpad, caps);
for (node = buffers; node; node = node->next) {
gint buffer_length;
- gsize size;
fail_if ((outbuffer = (GstBuffer *) node->data) == NULL);
- res = gst_buffer_map (outbuffer, &size, NULL, GST_MAP_READ);
- buffer_length = size / sizeof (gfloat);
+ gst_buffer_map (outbuffer, &map, GST_MAP_READ);
+ res = (gfloat *) map.data;
+ buffer_length = map.size / sizeof (gfloat);
rms = 0.0;
for (i = 0; i < buffer_length; i++)
rms += res[i] * res[i];
GstCaps *caps;
gfloat *in, *res, rms;
gint i;
+ GstMapInfo map;
GList *node;
audiowsincband = setup_audiowsincband ();
44100 / 4.0 + 1000, NULL);
inbuffer = gst_buffer_new_and_alloc (1024 * sizeof (gfloat));
GST_BUFFER_TIMESTAMP (inbuffer) = 0;
- in = gst_buffer_map (inbuffer, NULL, NULL, GST_MAP_WRITE);
+ gst_buffer_map (inbuffer, &map, GST_MAP_WRITE);
+ in = (gfloat *) map.data;
for (i = 0; i < 1024; i++)
in[i] = 1.0;
- gst_buffer_unmap (inbuffer, in, -1);
+ gst_buffer_unmap (inbuffer, &map);
caps = gst_caps_from_string (AUDIO_WSINC_BAND_CAPS_STRING_32);
gst_pad_set_caps (mysrcpad, caps);
for (node = buffers; node; node = node->next) {
gint buffer_length;
- gsize size;
fail_if ((outbuffer = (GstBuffer *) node->data) == NULL);
- res = gst_buffer_map (outbuffer, &size, NULL, GST_MAP_READ);
- buffer_length = size / sizeof (gfloat);
+ gst_buffer_map (outbuffer, &map, GST_MAP_READ);
+ res = (gfloat *) map.data;
+ buffer_length = map.size / sizeof (gfloat);
rms = 0.0;
for (i = 0; i < buffer_length; i++)
rms += res[i] * res[i];
GstCaps *caps;
gfloat *in, *res, rms;
gint i;
+ GstMapInfo map;
GList *node;
audiowsincband = setup_audiowsincband ();
44100 / 4.0 + 1000, NULL);
inbuffer = gst_buffer_new_and_alloc (1024 * sizeof (gfloat));
GST_BUFFER_TIMESTAMP (inbuffer) = 0;
- in = gst_buffer_map (inbuffer, NULL, NULL, GST_MAP_WRITE);
+ gst_buffer_map (inbuffer, &map, GST_MAP_WRITE);
+ in = (gfloat *) map.data;
for (i = 0; i < 1024; i += 4) {
in[i] = 0.0;
in[i + 2] = 0.0;
in[i + 3] = -1.0;
}
- gst_buffer_unmap (inbuffer, in, -1);
+ gst_buffer_unmap (inbuffer, &map);
caps = gst_caps_from_string (AUDIO_WSINC_BAND_CAPS_STRING_32);
gst_pad_set_caps (mysrcpad, caps);
for (node = buffers; node; node = node->next) {
gint buffer_length;
- gsize size;
fail_if ((outbuffer = (GstBuffer *) node->data) == NULL);
- res = gst_buffer_map (outbuffer, &size, NULL, GST_MAP_READ);
- buffer_length = size / sizeof (gfloat);
+ gst_buffer_map (outbuffer, &map, GST_MAP_READ);
+ res = (gfloat *) map.data;
+ buffer_length = map.size / sizeof (gfloat);
rms = 0.0;
for (i = 0; i < buffer_length; i++)
rms += res[i] * res[i];
GstCaps *caps;
gfloat *in, *res, rms;
gint i;
+ GstMapInfo map;
GList *node;
audiowsincband = setup_audiowsincband ();
44100 / 4.0 + 1000, NULL);
inbuffer = gst_buffer_new_and_alloc (1024 * sizeof (gfloat));
GST_BUFFER_TIMESTAMP (inbuffer) = 0;
- in = gst_buffer_map (inbuffer, NULL, NULL, GST_MAP_WRITE);
+ gst_buffer_map (inbuffer, &map, GST_MAP_WRITE);
+ in = (gfloat *) map.data;
for (i = 0; i < 1024; i += 2) {
in[i] = 1.0;
in[i + 1] = -1.0;
}
- gst_buffer_unmap (inbuffer, in, -1);
+ gst_buffer_unmap (inbuffer, &map);
caps = gst_caps_from_string (AUDIO_WSINC_BAND_CAPS_STRING_32);
gst_pad_set_caps (mysrcpad, caps);
for (node = buffers; node; node = node->next) {
gint buffer_length;
- gsize size;
fail_if ((outbuffer = (GstBuffer *) node->data) == NULL);
- res = gst_buffer_map (outbuffer, &size, NULL, GST_MAP_READ);
- buffer_length = size / sizeof (gfloat);
+ gst_buffer_map (outbuffer, &map, GST_MAP_READ);
+ res = (gfloat *) map.data;
+ buffer_length = map.size / sizeof (gfloat);
rms = 0.0;
for (i = 0; i < buffer_length; i++)
rms += res[i] * res[i];
GstCaps *caps;
gfloat *in;
gint i;
+ GstMapInfo map;
audiowsincband = setup_audiowsincband ();
/* Set to bandpass */
44100 / 4.0 + 44100 / 16.0, NULL);
inbuffer = gst_buffer_new_and_alloc (20 * sizeof (gfloat));
GST_BUFFER_TIMESTAMP (inbuffer) = 0;
- in = gst_buffer_map (inbuffer, NULL, NULL, GST_MAP_WRITE);
+ gst_buffer_map (inbuffer, &map, GST_MAP_WRITE);
+ in = (gfloat *) map.data;
for (i = 0; i < 20; i++)
in[i] = 1.0;
- gst_buffer_unmap (inbuffer, in, -1);
+ gst_buffer_unmap (inbuffer, &map);
caps = gst_caps_from_string (AUDIO_WSINC_BAND_CAPS_STRING_32);
gst_pad_set_caps (mysrcpad, caps);
GstCaps *caps;
gdouble *in, *res, rms;
gint i;
+ GstMapInfo map;
GList *node;
audiowsincband = setup_audiowsincband ();
44100 / 4.0 + 1000, NULL);
inbuffer = gst_buffer_new_and_alloc (1024 * sizeof (gdouble));
GST_BUFFER_TIMESTAMP (inbuffer) = 0;
- in = gst_buffer_map (inbuffer, NULL, NULL, GST_MAP_WRITE);
+ gst_buffer_map (inbuffer, &map, GST_MAP_WRITE);
+ in = (gdouble *) map.data;
for (i = 0; i < 1024; i++)
in[i] = 1.0;
- gst_buffer_unmap (inbuffer, in, -1);
+ gst_buffer_unmap (inbuffer, &map);
caps = gst_caps_from_string (AUDIO_WSINC_BAND_CAPS_STRING_64);
gst_pad_set_caps (mysrcpad, caps);
for (node = buffers; node; node = node->next) {
gint buffer_length;
- gsize size;
fail_if ((outbuffer = (GstBuffer *) node->data) == NULL);
- res = gst_buffer_map (outbuffer, &size, NULL, GST_MAP_READ);
- buffer_length = size / sizeof (gfloat);
+ gst_buffer_map (outbuffer, &map, GST_MAP_READ);
+ res = (gdouble *) map.data;
+ buffer_length = map.size / sizeof (gdouble);
rms = 0.0;
for (i = 0; i < buffer_length; i++)
rms += res[i] * res[i];
GstCaps *caps;
gdouble *in, *res, rms;
gint i;
+ GstMapInfo map;
GList *node;
audiowsincband = setup_audiowsincband ();
44100 / 4.0 + 1000, NULL);
inbuffer = gst_buffer_new_and_alloc (1024 * sizeof (gdouble));
GST_BUFFER_TIMESTAMP (inbuffer) = 0;
- in = gst_buffer_map (inbuffer, NULL, NULL, GST_MAP_WRITE);
+ gst_buffer_map (inbuffer, &map, GST_MAP_WRITE);
+ in = (gdouble *) map.data;
for (i = 0; i < 1024; i += 4) {
in[i] = 0.0;
in[i + 1] = 1.0;
in[i + 2] = 0.0;
in[i + 3] = -1.0;
}
- gst_buffer_unmap (inbuffer, in, -1);
+ gst_buffer_unmap (inbuffer, &map);
caps = gst_caps_from_string (AUDIO_WSINC_BAND_CAPS_STRING_64);
gst_pad_set_caps (mysrcpad, caps);
for (node = buffers; node; node = node->next) {
gint buffer_length;
- gsize size;
fail_if ((outbuffer = (GstBuffer *) node->data) == NULL);
- res = gst_buffer_map (outbuffer, &size, NULL, GST_MAP_READ);
- buffer_length = size / sizeof (gfloat);
+ gst_buffer_map (outbuffer, &map, GST_MAP_READ);
+ res = (gdouble *) map.data;
+ buffer_length = map.size / sizeof (gdouble);
rms = 0.0;
for (i = 0; i < buffer_length; i++)
rms += res[i] * res[i];
GstCaps *caps;
gdouble *in, *res, rms;
gint i;
+ GstMapInfo map;
GList *node;
audiowsincband = setup_audiowsincband ();
44100 / 4.0 + 1000, NULL);
inbuffer = gst_buffer_new_and_alloc (1024 * sizeof (gdouble));
GST_BUFFER_TIMESTAMP (inbuffer) = 0;
- in = gst_buffer_map (inbuffer, NULL, NULL, GST_MAP_WRITE);
+ gst_buffer_map (inbuffer, &map, GST_MAP_WRITE);
+ in = (gdouble *) map.data;
for (i = 0; i < 1024; i += 2) {
in[i] = 1.0;
in[i + 1] = -1.0;
}
- gst_buffer_unmap (inbuffer, in, -1);
+ gst_buffer_unmap (inbuffer, &map);
caps = gst_caps_from_string (AUDIO_WSINC_BAND_CAPS_STRING_64);
gst_pad_set_caps (mysrcpad, caps);
for (node = buffers; node; node = node->next) {
gint buffer_length;
- gsize size;
fail_if ((outbuffer = (GstBuffer *) node->data) == NULL);
- res = gst_buffer_map (outbuffer, &size, NULL, GST_MAP_READ);
- buffer_length = size / sizeof (gfloat);
+ gst_buffer_map (outbuffer, &map, GST_MAP_READ);
+ res = (gdouble *) map.data;
+ buffer_length = map.size / sizeof (gdouble);
rms = 0.0;
for (i = 0; i < buffer_length; i++)
rms += res[i] * res[i];
GstCaps *caps;
gdouble *in, *res, rms;
gint i;
+ GstMapInfo map;
GList *node;
audiowsincband = setup_audiowsincband ();
44100 / 4.0 + 1000, NULL);
inbuffer = gst_buffer_new_and_alloc (1024 * sizeof (gdouble));
GST_BUFFER_TIMESTAMP (inbuffer) = 0;
- in = gst_buffer_map (inbuffer, NULL, NULL, GST_MAP_WRITE);
+ gst_buffer_map (inbuffer, &map, GST_MAP_WRITE);
+ in = (gdouble *) map.data;
for (i = 0; i < 1024; i++)
in[i] = 1.0;
- gst_buffer_unmap (inbuffer, in, -1);
+ gst_buffer_unmap (inbuffer, &map);
caps = gst_caps_from_string (AUDIO_WSINC_BAND_CAPS_STRING_64);
gst_pad_set_caps (mysrcpad, caps);
for (node = buffers; node; node = node->next) {
gint buffer_length;
- gsize size;
fail_if ((outbuffer = (GstBuffer *) node->data) == NULL);
- res = gst_buffer_map (outbuffer, &size, NULL, GST_MAP_READ);
- buffer_length = size / sizeof (gfloat);
+ gst_buffer_map (outbuffer, &map, GST_MAP_READ);
+ res = (gdouble *) map.data;
+ buffer_length = map.size / sizeof (gdouble);
rms = 0.0;
for (i = 0; i < buffer_length; i++)
rms += res[i] * res[i];
GstCaps *caps;
gdouble *in, *res, rms;
gint i;
+ GstMapInfo map;
GList *node;
audiowsincband = setup_audiowsincband ();
44100 / 4.0 + 1000, NULL);
inbuffer = gst_buffer_new_and_alloc (1024 * sizeof (gdouble));
GST_BUFFER_TIMESTAMP (inbuffer) = 0;
- in = gst_buffer_map (inbuffer, NULL, NULL, GST_MAP_WRITE);
+ gst_buffer_map (inbuffer, &map, GST_MAP_WRITE);
+ in = (gdouble *) map.data;
for (i = 0; i < 1024; i += 4) {
in[i] = 0.0;
in[i + 2] = 0.0;
in[i + 3] = -1.0;
}
- gst_buffer_unmap (inbuffer, in, -1);
+ gst_buffer_unmap (inbuffer, &map);
caps = gst_caps_from_string (AUDIO_WSINC_BAND_CAPS_STRING_64);
gst_pad_set_caps (mysrcpad, caps);
for (node = buffers; node; node = node->next) {
gint buffer_length;
- gsize size;
fail_if ((outbuffer = (GstBuffer *) node->data) == NULL);
- res = gst_buffer_map (outbuffer, &size, NULL, GST_MAP_READ);
- buffer_length = size / sizeof (gfloat);
+ gst_buffer_map (outbuffer, &map, GST_MAP_READ);
+ res = (gdouble *) map.data;
+ buffer_length = map.size / sizeof (gdouble);
rms = 0.0;
for (i = 0; i < buffer_length; i++)
rms += res[i] * res[i];
GstCaps *caps;
gdouble *in, *res, rms;
gint i;
+ GstMapInfo map;
GList *node;
audiowsincband = setup_audiowsincband ();
44100 / 4.0 + 1000, NULL);
inbuffer = gst_buffer_new_and_alloc (1024 * sizeof (gdouble));
GST_BUFFER_TIMESTAMP (inbuffer) = 0;
- in = gst_buffer_map (inbuffer, NULL, NULL, GST_MAP_WRITE);
+ gst_buffer_map (inbuffer, &map, GST_MAP_WRITE);
+ in = (gdouble *) map.data;
for (i = 0; i < 1024; i += 2) {
in[i] = 1.0;
in[i + 1] = -1.0;
}
- gst_buffer_unmap (inbuffer, in, -1);
+ gst_buffer_unmap (inbuffer, &map);
caps = gst_caps_from_string (AUDIO_WSINC_BAND_CAPS_STRING_64);
gst_pad_set_caps (mysrcpad, caps);
for (node = buffers; node; node = node->next) {
gint buffer_length;
- gsize size;
fail_if ((outbuffer = (GstBuffer *) node->data) == NULL);
- res = gst_buffer_map (outbuffer, &size, NULL, GST_MAP_READ);
- buffer_length = size / sizeof (gfloat);
+ gst_buffer_map (outbuffer, &map, GST_MAP_READ);
+ res = (gdouble *) map.data;
+ buffer_length = map.size / sizeof (gdouble);
rms = 0.0;
for (i = 0; i < buffer_length; i++)
rms += res[i] * res[i];
GstCaps *caps;
gdouble *in;
gint i;
+ GstMapInfo map;
audiowsincband = setup_audiowsincband ();
/* Set to bandpass */
44100 / 4.0 + 44100 / 16.0, NULL);
inbuffer = gst_buffer_new_and_alloc (20 * sizeof (gdouble));
GST_BUFFER_TIMESTAMP (inbuffer) = 0;
- in = gst_buffer_map (inbuffer, NULL, NULL, GST_MAP_WRITE);
+ gst_buffer_map (inbuffer, &map, GST_MAP_WRITE);
+ in = (gdouble *) map.data;
for (i = 0; i < 20; i++)
in[i] = 1.0;
- gst_buffer_unmap (inbuffer, in, -1);
+ gst_buffer_unmap (inbuffer, &map);
caps = gst_caps_from_string (AUDIO_WSINC_BAND_CAPS_STRING_64);
gst_pad_set_caps (mysrcpad, caps);
GstCaps *caps;
gfloat *in, *res, rms;
gint i;
+ GstMapInfo map;
GList *node;
audiowsinclimit = setup_audiowsinclimit ();
g_object_set (G_OBJECT (audiowsinclimit), "cutoff", 44100 / 4.0, NULL);
inbuffer = gst_buffer_new_and_alloc (128 * sizeof (gfloat));
GST_BUFFER_TIMESTAMP (inbuffer) = 0;
- in = gst_buffer_map (inbuffer, NULL, NULL, GST_MAP_WRITE);
+ gst_buffer_map (inbuffer, &map, GST_MAP_WRITE);
+ in = (gfloat *) map.data;
for (i = 0; i < 128; i++)
in[i] = 1.0;
- gst_buffer_unmap (inbuffer, in, -1);
+ gst_buffer_unmap (inbuffer, &map);
caps = gst_caps_from_string (AUDIO_WSINC_LIMIT_CAPS_STRING_32);
gst_pad_set_caps (mysrcpad, caps);
for (node = buffers; node; node = node->next) {
gint buffer_length;
- gsize size;
fail_if ((outbuffer = (GstBuffer *) node->data) == NULL);
- res = gst_buffer_map (outbuffer, &size, NULL, GST_MAP_READ);
- buffer_length = size / sizeof (gfloat);
+ gst_buffer_map (outbuffer, &map, GST_MAP_READ);
+ res = (gfloat *) map.data;
+ buffer_length = map.size / sizeof (gfloat);
rms = 0.0;
for (i = 0; i < buffer_length; i++)
rms += res[i] * res[i];
rms = sqrt (rms / buffer_length);
- gst_buffer_unmap (outbuffer, res, size);
+ gst_buffer_unmap (outbuffer, &map);
fail_unless (rms >= 0.9);
}
GstCaps *caps;
gfloat *in, *res, rms;
gint i;
+ GstMapInfo map;
GList *node;
audiowsinclimit = setup_audiowsinclimit ();
g_object_set (G_OBJECT (audiowsinclimit), "cutoff", 44100 / 4.0, NULL);
inbuffer = gst_buffer_new_and_alloc (128 * sizeof (gfloat));
GST_BUFFER_TIMESTAMP (inbuffer) = 0;
- in = gst_buffer_map (inbuffer, NULL, NULL, GST_MAP_WRITE);
+ gst_buffer_map (inbuffer, &map, GST_MAP_WRITE);
+ in = (gfloat *) map.data;
for (i = 0; i < 128; i += 2) {
in[i] = 1.0;
in[i + 1] = -1.0;
}
- gst_buffer_unmap (inbuffer, in, -1);
+ gst_buffer_unmap (inbuffer, &map);
caps = gst_caps_from_string (AUDIO_WSINC_LIMIT_CAPS_STRING_32);
gst_pad_set_caps (mysrcpad, caps);
for (node = buffers; node; node = node->next) {
gint buffer_length;
- gsize size;
fail_if ((outbuffer = (GstBuffer *) node->data) == NULL);
- res = gst_buffer_map (outbuffer, &size, NULL, GST_MAP_READ);
- buffer_length = size / sizeof (gfloat);
+ gst_buffer_map (outbuffer, &map, GST_MAP_READ);
+ res = (gfloat *) map.data;
+ buffer_length = map.size / sizeof (gfloat);
rms = 0.0;
for (i = 0; i < buffer_length; i++)
rms += res[i] * res[i];
rms = sqrt (rms / buffer_length);
- gst_buffer_unmap (outbuffer, res, size);
+ gst_buffer_unmap (outbuffer, &map);
fail_unless (rms <= 0.1);
}
GstCaps *caps;
gfloat *in, *res, rms;
gint i;
+ GstMapInfo map;
GList *node;
audiowsinclimit = setup_audiowsinclimit ();
g_object_set (G_OBJECT (audiowsinclimit), "cutoff", 44100 / 4.0, NULL);
inbuffer = gst_buffer_new_and_alloc (128 * sizeof (gfloat));
GST_BUFFER_TIMESTAMP (inbuffer) = 0;
- in = gst_buffer_map (inbuffer, NULL, NULL, GST_MAP_WRITE);
+ gst_buffer_map (inbuffer, &map, GST_MAP_WRITE);
+ in = (gfloat *) map.data;
for (i = 0; i < 128; i++)
in[i] = 1.0;
- gst_buffer_unmap (inbuffer, in, -1);
+ gst_buffer_unmap (inbuffer, &map);
caps = gst_caps_from_string (AUDIO_WSINC_LIMIT_CAPS_STRING_32);
gst_pad_set_caps (mysrcpad, caps);
for (node = buffers; node; node = node->next) {
gint buffer_length;
- gsize size;
fail_if ((outbuffer = (GstBuffer *) node->data) == NULL);
- res = gst_buffer_map (outbuffer, &size, NULL, GST_MAP_READ);
- buffer_length = size / sizeof (gfloat);
+ gst_buffer_map (outbuffer, &map, GST_MAP_READ);
+ res = (gfloat *) map.data;
+ buffer_length = map.size / sizeof (gfloat);
rms = 0.0;
for (i = 0; i < buffer_length; i++)
rms += res[i] * res[i];
rms = sqrt (rms / buffer_length);
- gst_buffer_unmap (outbuffer, res, size);
+ gst_buffer_unmap (outbuffer, &map);
fail_unless (rms <= 0.1);
}
GstCaps *caps;
gfloat *in, *res, rms;
gint i;
+ GstMapInfo map;
GList *node;
audiowsinclimit = setup_audiowsinclimit ();
g_object_set (G_OBJECT (audiowsinclimit), "cutoff", 44100 / 4.0, NULL);
inbuffer = gst_buffer_new_and_alloc (128 * sizeof (gfloat));
GST_BUFFER_TIMESTAMP (inbuffer) = 0;
- in = gst_buffer_map (inbuffer, NULL, NULL, GST_MAP_WRITE);
+ gst_buffer_map (inbuffer, &map, GST_MAP_WRITE);
+ in = (gfloat *) map.data;
for (i = 0; i < 128; i += 2) {
in[i] = 1.0;
in[i + 1] = -1.0;
}
- gst_buffer_unmap (inbuffer, in, -1);
+ gst_buffer_unmap (inbuffer, &map);
caps = gst_caps_from_string (AUDIO_WSINC_LIMIT_CAPS_STRING_32);
gst_pad_set_caps (mysrcpad, caps);
for (node = buffers; node; node = node->next) {
gint buffer_length;
- gsize size;
fail_if ((outbuffer = (GstBuffer *) node->data) == NULL);
- res = gst_buffer_map (outbuffer, &size, NULL, GST_MAP_READ);
- buffer_length = size / sizeof (gfloat);
+ gst_buffer_map (outbuffer, &map, GST_MAP_READ);
+ res = (gfloat *) map.data;
+ buffer_length = map.size / sizeof (gfloat);
rms = 0.0;
for (i = 0; i < buffer_length; i++)
rms += res[i] * res[i];
rms = sqrt (rms / buffer_length);
- gst_buffer_unmap (outbuffer, res, size);
+ gst_buffer_unmap (outbuffer, &map);
fail_unless (rms >= 0.9);
}
GstCaps *caps;
gfloat *in;
gint i;
+ GstMapInfo map;
audiowsinclimit = setup_audiowsinclimit ();
/* Set to lowpass */
g_object_set (G_OBJECT (audiowsinclimit), "cutoff", 44100 / 4.0, NULL);
inbuffer = gst_buffer_new_and_alloc (20 * sizeof (gfloat));
GST_BUFFER_TIMESTAMP (inbuffer) = 0;
- in = gst_buffer_map (inbuffer, NULL, NULL, GST_MAP_WRITE);
+ gst_buffer_map (inbuffer, &map, GST_MAP_WRITE);
+ in = (gfloat *) map.data;
for (i = 0; i < 20; i++)
in[i] = 1.0;
- gst_buffer_unmap (inbuffer, in, -1);
+ gst_buffer_unmap (inbuffer, &map);
caps = gst_caps_from_string (AUDIO_WSINC_LIMIT_CAPS_STRING_32);
gst_pad_set_caps (mysrcpad, caps);
GstCaps *caps;
gdouble *in, *res, rms;
gint i;
+ GstMapInfo map;
GList *node;
audiowsinclimit = setup_audiowsinclimit ();
g_object_set (G_OBJECT (audiowsinclimit), "cutoff", 44100 / 4.0, NULL);
inbuffer = gst_buffer_new_and_alloc (128 * sizeof (gdouble));
GST_BUFFER_TIMESTAMP (inbuffer) = 0;
- in = gst_buffer_map (inbuffer, NULL, NULL, GST_MAP_WRITE);
+ gst_buffer_map (inbuffer, &map, GST_MAP_WRITE);
+ in = (gdouble *) map.data;
for (i = 0; i < 128; i++)
in[i] = 1.0;
- gst_buffer_unmap (inbuffer, in, -1);
+ gst_buffer_unmap (inbuffer, &map);
caps = gst_caps_from_string (AUDIO_WSINC_LIMIT_CAPS_STRING_64);
gst_pad_set_caps (mysrcpad, caps);
for (node = buffers; node; node = node->next) {
gint buffer_length;
- gsize size;
fail_if ((outbuffer = (GstBuffer *) node->data) == NULL);
- res = gst_buffer_map (outbuffer, &size, NULL, GST_MAP_READ);
- buffer_length = size / sizeof (gfloat);
+ gst_buffer_map (outbuffer, &map, GST_MAP_READ);
+ res = (gdouble *) map.data;
+ buffer_length = map.size / sizeof (gdouble);
rms = 0.0;
for (i = 0; i < buffer_length; i++)
rms += res[i] * res[i];
rms = sqrt (rms / buffer_length);
- gst_buffer_unmap (outbuffer, res, size);
+ gst_buffer_unmap (outbuffer, &map);
fail_unless (rms >= 0.9);
}
GstCaps *caps;
gdouble *in, *res, rms;
gint i;
+ GstMapInfo map;
GList *node;
audiowsinclimit = setup_audiowsinclimit ();
g_object_set (G_OBJECT (audiowsinclimit), "cutoff", 44100 / 4.0, NULL);
inbuffer = gst_buffer_new_and_alloc (128 * sizeof (gdouble));
GST_BUFFER_TIMESTAMP (inbuffer) = 0;
- in = gst_buffer_map (inbuffer, NULL, NULL, GST_MAP_WRITE);
+ gst_buffer_map (inbuffer, &map, GST_MAP_WRITE);
+ in = (gdouble *) map.data;
for (i = 0; i < 128; i += 2) {
in[i] = 1.0;
in[i + 1] = -1.0;
}
- gst_buffer_unmap (inbuffer, in, -1);
+ gst_buffer_unmap (inbuffer, &map);
caps = gst_caps_from_string (AUDIO_WSINC_LIMIT_CAPS_STRING_64);
gst_pad_set_caps (mysrcpad, caps);
for (node = buffers; node; node = node->next) {
gint buffer_length;
- gsize size;
fail_if ((outbuffer = (GstBuffer *) node->data) == NULL);
- res = gst_buffer_map (outbuffer, &size, NULL, GST_MAP_READ);
- buffer_length = size / sizeof (gfloat);
+ gst_buffer_map (outbuffer, &map, GST_MAP_READ);
+ res = (gdouble *) map.data;
+ buffer_length = map.size / sizeof (gdouble);
rms = 0.0;
for (i = 0; i < buffer_length; i++)
rms += res[i] * res[i];
rms = sqrt (rms / buffer_length);
- gst_buffer_unmap (outbuffer, res, size);
+ gst_buffer_unmap (outbuffer, &map);
fail_unless (rms <= 0.1);
}
GstCaps *caps;
gdouble *in, *res, rms;
gint i;
+ GstMapInfo map;
GList *node;
audiowsinclimit = setup_audiowsinclimit ();
g_object_set (G_OBJECT (audiowsinclimit), "cutoff", 44100 / 4.0, NULL);
inbuffer = gst_buffer_new_and_alloc (128 * sizeof (gdouble));
GST_BUFFER_TIMESTAMP (inbuffer) = 0;
- in = gst_buffer_map (inbuffer, NULL, NULL, GST_MAP_WRITE);
+ gst_buffer_map (inbuffer, &map, GST_MAP_WRITE);
+ in = (gdouble *) map.data;
for (i = 0; i < 128; i++)
in[i] = 1.0;
- gst_buffer_unmap (inbuffer, in, -1);
+ gst_buffer_unmap (inbuffer, &map);
caps = gst_caps_from_string (AUDIO_WSINC_LIMIT_CAPS_STRING_64);
gst_pad_set_caps (mysrcpad, caps);
for (node = buffers; node; node = node->next) {
gint buffer_length;
- gsize size;
fail_if ((outbuffer = (GstBuffer *) node->data) == NULL);
- res = gst_buffer_map (outbuffer, &size, NULL, GST_MAP_READ);
- buffer_length = size / sizeof (gfloat);
+ gst_buffer_map (outbuffer, &map, GST_MAP_READ);
+ res = (gdouble *) map.data;
+ buffer_length = map.size / sizeof (gdouble);
rms = 0.0;
for (i = 0; i < buffer_length; i++)
rms += res[i] * res[i];
rms = sqrt (rms / buffer_length);
- gst_buffer_unmap (outbuffer, res, size);
+ gst_buffer_unmap (outbuffer, &map);
fail_unless (rms <= 0.1);
}
GstCaps *caps;
gdouble *in, *res, rms;
gint i;
+ GstMapInfo map;
GList *node;
audiowsinclimit = setup_audiowsinclimit ();
g_object_set (G_OBJECT (audiowsinclimit), "cutoff", 44100 / 4.0, NULL);
inbuffer = gst_buffer_new_and_alloc (128 * sizeof (gdouble));
GST_BUFFER_TIMESTAMP (inbuffer) = 0;
- in = gst_buffer_map (inbuffer, NULL, NULL, GST_MAP_WRITE);
+ gst_buffer_map (inbuffer, &map, GST_MAP_WRITE);
+ in = (gdouble *) map.data;
for (i = 0; i < 128; i += 2) {
in[i] = 1.0;
in[i + 1] = -1.0;
}
- gst_buffer_unmap (inbuffer, in, -1);
+ gst_buffer_unmap (inbuffer, &map);
caps = gst_caps_from_string (AUDIO_WSINC_LIMIT_CAPS_STRING_64);
gst_pad_set_caps (mysrcpad, caps);
for (node = buffers; node; node = node->next) {
gint buffer_length;
- gsize size;
fail_if ((outbuffer = (GstBuffer *) node->data) == NULL);
- res = gst_buffer_map (outbuffer, &size, NULL, GST_MAP_READ);
- buffer_length = size / sizeof (gfloat);
+ gst_buffer_map (outbuffer, &map, GST_MAP_READ);
+ res = (gdouble *) map.data;
+ buffer_length = map.size / sizeof (gdouble);
rms = 0.0;
for (i = 0; i < buffer_length; i++)
rms += res[i] * res[i];
rms = sqrt (rms / buffer_length);
- gst_buffer_unmap (outbuffer, res, size);
+ gst_buffer_unmap (outbuffer, &map);
fail_unless (rms >= 0.9);
}
GstCaps *caps;
gdouble *in;
gint i;
+ GstMapInfo map;
audiowsinclimit = setup_audiowsinclimit ();
/* Set to lowpass */
g_object_set (G_OBJECT (audiowsinclimit), "cutoff", 44100 / 4.0, NULL);
inbuffer = gst_buffer_new_and_alloc (20 * sizeof (gdouble));
GST_BUFFER_TIMESTAMP (inbuffer) = 0;
- in = gst_buffer_map (inbuffer, NULL, NULL, GST_MAP_WRITE);
+ gst_buffer_map (inbuffer, &map, GST_MAP_WRITE);
+ in = (gdouble *) map.data;
for (i = 0; i < 20; i++)
in[i] = 1.0;
- gst_buffer_unmap (inbuffer, in, -1);
+ gst_buffer_unmap (inbuffer, &map);
caps = gst_caps_from_string (AUDIO_WSINC_LIMIT_CAPS_STRING_64);
gst_pad_set_caps (mysrcpad, caps);
switch (i) {
case 0:{ /* check riff header */
/* avi header */
+ GstMapInfo map;
gsize size;
- guint8 *data, *orig;
+ guint8 *data;
- data = orig = gst_buffer_map (outbuffer, &size, NULL, GST_MAP_READ);
+ gst_buffer_map (outbuffer, &map, GST_MAP_READ);
+ data = map.data;
+ size = map.size;
fail_unless (memcmp (data, data0, sizeof (data0)) == 0);
fail_unless (memcmp (data + 8, data1, sizeof (data1)) == 0);
fail_unless (memcmp (data + 8, data4, sizeof (data4)) == 0);
fail_unless (memcmp (data + 76, data5, sizeof (data5)) == 0);
/* avi data header */
- data = orig;
+ data = map.data;
data += size - 12;
fail_unless (memcmp (data, data6, sizeof (data6)) == 0);
data += 8;
fail_unless (memcmp (data, data7, sizeof (data7)) == 0);
- gst_buffer_unmap (outbuffer, orig, size);
+ gst_buffer_unmap (outbuffer, &map);
break;
}
case 1: /* chunk header */
static gboolean
test_buffer_equals (GstBuffer * buf_a, GstBuffer * buf_b)
{
- gsize s1, s2;
- gpointer d1, d2;
+ GstMapInfo m1, m2;
gboolean res = FALSE;
- d1 = gst_buffer_map (buf_a, &s1, NULL, GST_MAP_READ);
- d2 = gst_buffer_map (buf_b, &s2, NULL, GST_MAP_READ);
+ gst_buffer_map (buf_a, &m1, GST_MAP_READ);
+ gst_buffer_map (buf_b, &m2, GST_MAP_READ);
- if (s1 == s2) {
- res = memcmp (d1, d2, s1) == 0;
+ if (m1.size == m2.size) {
+ res = memcmp (m1.data, m2.data, m1.size) == 0;
}
+ gst_buffer_unmap (buf_a, &m1);
+ gst_buffer_unmap (buf_b, &m2);
+
return res;
}
#include <stdio.h>
#include <gst/check/gstcheck.h>
+#include <gst/audio/audio.h>
GST_START_TEST (test_create_and_unref)
{
deinterleave_chain_func (GstPad * pad, GstObject * parent, GstBuffer * buffer)
{
gint i;
- gsize size;
+ GstMapInfo map;
gfloat *indata;
fail_unless (GST_IS_BUFFER (buffer));
- indata = gst_buffer_map (buffer, &size, NULL, GST_MAP_READ);
- fail_unless_equals_int (size, 48000 * sizeof (gfloat));
+ gst_buffer_map (buffer, &map, GST_MAP_READ);
+ indata = (gfloat *) map.data;
+ fail_unless_equals_int (map.size, 48000 * sizeof (gfloat));
fail_unless (indata != NULL);
if (strcmp (GST_PAD_NAME (pad), "sink0") == 0) {
} else {
g_assert_not_reached ();
}
- gst_buffer_unmap (buffer, indata, size);
+ gst_buffer_unmap (buffer, &map);
gst_buffer_unref (buffer);
return GST_FLOW_OK;
GstBuffer *inbuf;
GstCaps *caps;
gfloat *indata;
+ GstMapInfo map;
mysinkpads = g_new0 (GstPad *, 2);
nsinkpads = 0;
GST_STATE_PLAYING) == GST_STATE_CHANGE_SUCCESS);
inbuf = gst_buffer_new_and_alloc (2 * 48000 * sizeof (gfloat));
- indata = gst_buffer_map (inbuf, NULL, NULL, GST_MAP_WRITE);
+ gst_buffer_map (inbuf, &map, GST_MAP_WRITE);
+ indata = (gfloat *) map.data;
for (i = 0; i < 2 * 48000; i += 2) {
indata[i] = -1.0;
indata[i + 1] = 1.0;
}
- gst_buffer_unmap (inbuf, indata, -1);
+ gst_buffer_unmap (inbuf, &map);
gst_pad_set_caps (mysrcpad, caps);
fail_unless (gst_pad_push (mysrcpad, inbuf) == GST_FLOW_OK);
GstBuffer *inbuf;
GstCaps *caps;
gfloat *indata;
+ GstMapInfo map;
nsinkpads = 0;
mysinkpads = g_new0 (GstPad *, 2);
GST_STATE_PLAYING) == GST_STATE_CHANGE_SUCCESS);
inbuf = gst_buffer_new_and_alloc (2 * 48000 * sizeof (gfloat));
- indata = gst_buffer_map (inbuf, NULL, NULL, GST_MAP_WRITE);
+ gst_buffer_map (inbuf, &map, GST_MAP_WRITE);
+ indata = (gfloat *) map.data;
for (i = 0; i < 2 * 48000; i += 2) {
indata[i] = -1.0;
indata[i + 1] = 1.0;
}
- gst_buffer_unmap (inbuf, indata, -1);
+ gst_buffer_unmap (inbuf, &map);
gst_pad_set_caps (mysrcpad, caps);
fail_unless (gst_pad_push (mysrcpad, inbuf) == GST_FLOW_OK);
gint i;
GstBuffer *inbuf;
gfloat *indata;
+ GstMapInfo map;
nsinkpads = 0;
mysinkpads = g_new0 (GstPad *, 2);
GST_STATE_PLAYING) == GST_STATE_CHANGE_SUCCESS);
inbuf = gst_buffer_new_and_alloc (2 * 48000 * sizeof (gfloat));
- indata = gst_buffer_map (inbuf, NULL, NULL, GST_MAP_WRITE);
+ gst_buffer_map (inbuf, &map, GST_MAP_WRITE);
+ indata = (gfloat *) map.data;
for (i = 0; i < 2 * 48000; i += 2) {
indata[i] = -1.0;
indata[i + 1] = 1.0;
}
- gst_buffer_unmap (inbuf, indata, -1);
+ gst_buffer_unmap (inbuf, &map);
gst_pad_set_caps (mysrcpad, caps);
fail_unless (gst_pad_push (mysrcpad, inbuf) == GST_FLOW_OK);
gst_pad_set_caps (mysrcpad, caps2);
inbuf = gst_buffer_new_and_alloc (2 * 48000 * sizeof (gfloat));
- indata = gst_buffer_map (inbuf, NULL, NULL, GST_MAP_WRITE);
+ gst_buffer_map (inbuf, &map, GST_MAP_WRITE);
+ indata = (gfloat *) map.data;
for (i = 0; i < 2 * 48000; i += 2) {
indata[i] = -1.0;
indata[i + 1] = 1.0;
}
- gst_buffer_unmap (inbuf, indata, -1);
+ gst_buffer_unmap (inbuf, &map);
gst_pad_set_caps (mysrcpad, caps2);
/* Should work fine because the caps changed in a compatible way */
gst_pad_set_caps (mysrcpad, caps2);
inbuf = gst_buffer_new_and_alloc (3 * 48000 * sizeof (gfloat));
- indata = gst_buffer_map (inbuf, NULL, NULL, GST_MAP_WRITE);
+ gst_buffer_map (inbuf, &map, GST_MAP_WRITE);
+ indata = (gfloat *) map.data;
for (i = 0; i < 3 * 48000; i += 3) {
indata[i] = -1.0;
indata[i + 1] = 1.0;
indata[i + 2] = 0.0;
}
- gst_buffer_unmap (inbuf, indata, -1);
+ gst_buffer_unmap (inbuf, &map);
gst_pad_set_caps (mysrcpad, caps2);
/* Should break because the caps changed in an incompatible way */
set_channel_positions (GstCaps * caps, int channels,
GstAudioChannelPosition * channelpositions)
{
+#if 0
GValue chanpos = { 0 };
GValue pos = { 0 };
GstStructure *structure = gst_caps_get_structure (caps, 0);
gst_structure_set_value (structure, "channel-positions", &chanpos);
g_value_unset (&chanpos);
+#endif
}
static void
float_buffer_check_probe (GstPad * pad, GstPadProbeInfo * info,
gpointer userdata)
{
+ GstMapInfo map;
gfloat *data;
- gsize size;
guint padnum, numpads;
guint num, i;
GstCaps *caps;
GstStructure *s;
+#if 0
GstAudioChannelPosition *pos;
+#endif
gint channels;
GstBuffer *buffer = GST_PAD_PROBE_INFO_BUFFER (info);
fail_unless (gst_structure_get_int (s, "channels", &channels));
fail_unless_equals_int (channels, 1);
fail_unless (gst_structure_has_field (s, "channel-positions"));
+#if 0
pos = gst_audio_get_channel_positions (s);
fail_unless (pos != NULL && pos[0] == GST_AUDIO_CHANNEL_POSITION_NONE);
g_free (pos);
+#endif
gst_caps_unref (caps);
- data = gst_buffer_map (buffer, &size, NULL, GST_MAP_READ);
- num = size / sizeof (gfloat);
+ gst_buffer_map (buffer, &map, GST_MAP_READ);
+ data = (gfloat *) map.data;
+ num = map.size / sizeof (gfloat);
/* Check buffer content */
for (i = 0; i < num; ++i) {
/* check that the first channel is on pad src0, the second on src1 etc. */
fail_unless_equals_int (rest, padnum);
}
- gst_buffer_unmap (buffer, data, size);
+ gst_buffer_unmap (buffer, &map);
return GST_PAD_PROBE_OK; /* don't drop data */
}