+2005-05-09 Andy Wingo <wingo@pobox.com>
+
+ * ext/alsa/gstalsasink.h:
+ * ext/gnomevfs/gstgnomevfssrc.c:
+ (gst_gnomevfssrc_get_icy_metadata):
+ * ext/ogg/gstoggdemux.c (gst_ogg_demux_perform_seek)
+ (gst_ogg_demux_read_chain, gst_ogg_demux_read_end_chain)
+ * ext/theora/theoradec.c (theora_dec_src_query)
+ (theora_dec_src_event, theora_dec_sink_event)
+ (theora_handle_comment_packet, theora_handle_data_packet):
+ * ext/theora/theoraenc.c (theora_enc_chain):
+ * ext/vorbis/vorbisdec.c (vorbis_dec_src_event)
+ (vorbis_dec_sink_event, vorbis_handle_comment_packet):
+ * gst/audioconvert/gstaudioconvert.c (gst_audio_convert_getcaps):
+ * gst/typefind/gsttypefindfunctions.c (mp3_type_find)
+ (qt_type_find):
+ * gst/videotestsrc/videotestsrc.c (paint_setup_I420)
+ (paint_setup_YV12, paint_setup_YUY2, paint_setup_UYVY)
+ (paint_setup_YVYU, paint_setup_IYU2, paint_setup_Y41B)
+ (paint_setup_Y42B, paint_setup_Y800, paint_setup_IMC1)
+ (paint_setup_IMC2, paint_setup_IMC3, paint_setup_IMC4)
+ (paint_setup_YVU9, paint_setup_YUV9, paint_setup_xRGB8888)
+ (paint_setup_xBGR8888, paint_setup_RGBx8888)
+ (paint_setup_BGRx8888, paint_setup_RGB888, paint_setup_BGR888)
+ (paint_setup_RGB565, paint_setup_xRGB1555):
+ * gst/videotestsrc/videotestsrc.h:
+ * sys/ximage/ximagesink.c (gst_ximagesink_buffer_alloc):
+ * sys/xvimage/xvimagesink.c (gst_xvimagesink_get_xv_support)
+ (gst_xvimagesink_setcaps, gst_xvimagesink_buffer_alloc):
+ GCC4 fixes.
+
+ * ext/ogg/gstoggdemux.c (gst_ogg_demux_find_chains): Use the new
+ gst_pad_query_position. Fixes oggdemux.
+
2005-05-08 David Schleef <ds@schleef.org>
* configure.ac: Require liboil.
guint buffer_time;
guint period_time;
- snd_pcm_sframes_t buffer_size;
- snd_pcm_sframes_t period_size;
+ snd_pcm_uframes_t buffer_size;
+ snd_pcm_uframes_t period_size;
};
struct _GstAlsaSinkClass {
if (metadata_length == 0)
return;
- data = g_new (gchar, metadata_length + 1);
+ data = g_new (guchar, metadata_length + 1);
pos = data;
while (pos - data < metadata_length) {
}
data[metadata_length] = 0;
- tags = g_strsplit (data, "';", 0);
+ tags = g_strsplit ((gchar *) data, "';", 0);
for (i = 0; tags[i]; i++) {
if (!g_ascii_strncasecmp (tags[i], "StreamTitle=", 12)) {
continue;
gst_pad_convert (pad->elem_pad,
- GST_FORMAT_DEFAULT, granulepos, &format, &granuletime);
+ GST_FORMAT_DEFAULT, granulepos, &format, (gint64 *) & granuletime);
GST_DEBUG_OBJECT (ogg,
"found page with granule %" G_GINT64_FORMAT " and time %"
GstFormat target = GST_FORMAT_TIME;
gst_pad_convert (pad->elem_pad,
- GST_FORMAT_DEFAULT, pad->first_granule, &target, &pad->first_time);
+ GST_FORMAT_DEFAULT, pad->first_granule, &target,
+ (gint64 *) & pad->first_time);
pad->mode = GST_OGG_PAD_MODE_STREAMING;
pad->packetno = 0;
GstFormat target = GST_FORMAT_TIME;
gst_pad_convert (pad->elem_pad,
- GST_FORMAT_DEFAULT, pad->last_granule, &target, &pad->last_time);
+ GST_FORMAT_DEFAULT, pad->last_granule, &target,
+ (gint64 *) & pad->last_time);
}
return 0;
}
/* find length to read last page, we store this for later use. */
format = GST_FORMAT_BYTES;
- res = gst_pad_query (peer, GST_QUERY_TOTAL, &format, &ogg->length);
+ res = gst_pad_query_position (peer, &format, NULL, &ogg->length);
gst_object_unref (GST_OBJECT (peer));
if (!res)
goto no_length;
* intermediate step */
my_format = GST_FORMAT_TIME;
if (!theora_dec_sink_convert (dec->sinkpad, GST_FORMAT_DEFAULT, granulepos,
- &my_format, &time))
+ &my_format, (gint64 *) & time))
return FALSE;
if (!gst_pad_convert (pad, my_format, time, format, value))
return FALSE;
switch (GST_EVENT_TYPE (event)) {
case GST_EVENT_SEEK:{
- guint64 value;
+ gint64 value;
GstEvent *real_seek;
/* we have to ask our peer to seek to time here as we know
static gboolean
theora_dec_sink_event (GstPad * pad, GstEvent * event)
{
- guint64 start_value, end_value, time, bytes;
+ gint64 start_value, end_value, time, bytes;
gboolean ret = TRUE;
GstTheoraDec *dec;
GST_BUFFER_DATA (buf) = packet->packet;
GST_BUFFER_FLAG_SET (buf, GST_BUFFER_DONTFREE);
- list = gst_tag_list_from_vorbiscomment_buffer (buf, "\201theora", 7,
+ list =
+ gst_tag_list_from_vorbiscomment_buffer (buf, (guint8 *) "\201theora", 7,
&encoder);
gst_buffer_unref (buf);
* offset or size is odd (see above).
*/
{
- guint8 *dest_y, *src_y;
- guint8 *dest_u, *src_u;
- guint8 *dest_v, *src_v;
+ char *dest_y, *src_y;
+ char *dest_u, *src_u;
+ char *dest_v, *src_v;
- dest_y = GST_BUFFER_DATA (out);
+ dest_y = (char *) GST_BUFFER_DATA (out);
dest_u = dest_y + stride_y * height;
dest_v = dest_u + stride_uv * cheight;
/* easy case, no cropping/conversion needed */
pixels = GST_BUFFER_DATA (buffer);
- yuv.y = pixels;
+ yuv.y = (char *) pixels;
yuv.u = yuv.y + y_size;
yuv.v = yuv.u + y_size / 4;
} else {
GstBuffer *newbuf;
gint i;
- guint8 *dest_y, *src_y;
- guint8 *dest_u, *src_u;
- guint8 *dest_v, *src_v;
+ char *dest_y, *src_y;
+ char *dest_u, *src_u;
+ char *dest_v, *src_v;
gint src_y_stride, src_uv_stride;
gint dst_y_stride, dst_uv_stride;
gint width, height;
newbuf = gst_pad_alloc_buffer (enc->srcpad,
GST_BUFFER_OFFSET_NONE, y_size * 3 / 2, GST_PAD_CAPS (enc->srcpad));
- dest_y = yuv.y = GST_BUFFER_DATA (newbuf);
+ dest_y = yuv.y = (char *) GST_BUFFER_DATA (newbuf);
dest_u = yuv.u = yuv.y + y_size;
dest_v = yuv.v = yuv.u + y_size / 4;
- src_y = GST_BUFFER_DATA (buffer);
+ src_y = (char *) GST_BUFFER_DATA (buffer);
src_u = src_y + src_y_stride * ROUND_UP_2 (height);
src_v = src_u + src_uv_stride * ROUND_UP_2 (height) / 2;
switch (GST_EVENT_TYPE (event)) {
case GST_EVENT_SEEK:{
- guint64 value;
+ gint64 value;
GstFormat my_format = GST_FORMAT_TIME;
/* convert to time */
static gboolean
vorbis_dec_sink_event (GstPad * pad, GstEvent * event)
{
- guint64 start_value, end_value, time, bytes;
+ gint64 start_value, end_value, time, bytes;
gboolean ret = TRUE;
GstVorbisDec *dec;
GST_BUFFER_DATA (buf) = packet->packet;
GST_BUFFER_FLAG_SET (buf, GST_BUFFER_DONTFREE);
- list = gst_tag_list_from_vorbiscomment_buffer (buf, "\003vorbis", 7,
+ list =
+ gst_tag_list_from_vorbiscomment_buffer (buf, (guint8 *) "\003vorbis", 7,
&encoder);
gst_buffer_unref (buf);
}
if (*data == 0xFF) {
guint8 *head_data = NULL;
- guint layer, bitrate, samplerate, channels;
+ guint layer = 0, bitrate, samplerate, channels;
guint found = 0; /* number of valid headers found */
guint64 offset = skipped;
head = GST_READ_UINT32_BE (head_data);
if (!(length = mp3_type_frame_length_from_header (head, &layer,
&channels, &bitrate, &samplerate))) {
+
GST_LOG ("%d. header at offset %" G_GUINT64_FORMAT
" (0x%X) was not an mp3 header", found + 1, offset,
(guint) offset);
static GstStaticCaps qt_caps = GST_STATIC_CAPS ("video/quicktime");
#define QT_CAPS gst_static_caps_get(&qt_caps)
+#define STRNCMP(x,y,z) (strncmp ((char*)(x), (char*)(y), z))
+
static void
qt_type_find (GstTypeFind * tf, gpointer unused)
{
guint64 size;
while ((data = gst_type_find_peek (tf, offset, 8)) != NULL) {
- if (strncmp (&data[4], "wide", 4) != 0 &&
- strncmp (&data[4], "moov", 4) != 0 &&
- strncmp (&data[4], "mdat", 4) != 0 &&
- strncmp (&data[4], "pnot", 4) != 0 &&
- strncmp (&data[4], "PICT", 4) != 0 &&
- strncmp (&data[4], "ftyp", 4) != 0 &&
- strncmp (&data[4], "free", 4) != 0 &&
- strncmp (&data[4], "skip", 4) != 0) {
+ if (STRNCMP (&data[4], "wide", 4) != 0 &&
+ STRNCMP (&data[4], "moov", 4) != 0 &&
+ STRNCMP (&data[4], "mdat", 4) != 0 &&
+ STRNCMP (&data[4], "pnot", 4) != 0 &&
+ STRNCMP (&data[4], "PICT", 4) != 0 &&
+ STRNCMP (&data[4], "ftyp", 4) != 0 &&
+ STRNCMP (&data[4], "free", 4) != 0 &&
+ STRNCMP (&data[4], "skip", 4) != 0) {
tip = 0;
break;
}
#define TYPE_FIND_REGISTER_START_WITH(plugin,name,rank,ext,_data,_size,_probability)\
G_BEGIN_DECLS{ \
GstTypeFindData *sw_data = g_new (GstTypeFindData, 1); \
- sw_data->data = _data; \
+ sw_data->data = (gpointer)_data; \
sw_data->size = _size; \
sw_data->probability = _probability; \
sw_data->caps = gst_caps_new_simple (name, NULL); \
#define TYPE_FIND_REGISTER_RIFF(plugin,name,rank,ext,_data) \
G_BEGIN_DECLS{ \
GstTypeFindData *sw_data = g_new (GstTypeFindData, 1); \
- sw_data->data = _data; \
+ sw_data->data = (gpointer)_data; \
sw_data->size = 4; \
sw_data->probability = GST_TYPE_FIND_MAXIMUM; \
sw_data->caps = gst_caps_new_simple (name, NULL); \
#endif
-static void paint_setup_I420 (paintinfo * p, char *dest);
-static void paint_setup_YV12 (paintinfo * p, char *dest);
-static void paint_setup_YUY2 (paintinfo * p, char *dest);
-static void paint_setup_UYVY (paintinfo * p, char *dest);
-static void paint_setup_YVYU (paintinfo * p, char *dest);
-static void paint_setup_IYU2 (paintinfo * p, char *dest);
-static void paint_setup_Y41B (paintinfo * p, char *dest);
-static void paint_setup_Y42B (paintinfo * p, char *dest);
-static void paint_setup_Y800 (paintinfo * p, char *dest);
+static void paint_setup_I420 (paintinfo * p, unsigned char *dest);
+static void paint_setup_YV12 (paintinfo * p, unsigned char *dest);
+static void paint_setup_YUY2 (paintinfo * p, unsigned char *dest);
+static void paint_setup_UYVY (paintinfo * p, unsigned char *dest);
+static void paint_setup_YVYU (paintinfo * p, unsigned char *dest);
+static void paint_setup_IYU2 (paintinfo * p, unsigned char *dest);
+static void paint_setup_Y41B (paintinfo * p, unsigned char *dest);
+static void paint_setup_Y42B (paintinfo * p, unsigned char *dest);
+static void paint_setup_Y800 (paintinfo * p, unsigned char *dest);
#if 0
-static void paint_setup_IMC1 (paintinfo * p, char *dest);
-static void paint_setup_IMC2 (paintinfo * p, char *dest);
-static void paint_setup_IMC3 (paintinfo * p, char *dest);
-static void paint_setup_IMC4 (paintinfo * p, char *dest);
+static void paint_setup_IMC1 (paintinfo * p, unsigned char *dest);
+static void paint_setup_IMC2 (paintinfo * p, unsigned char *dest);
+static void paint_setup_IMC3 (paintinfo * p, unsigned char *dest);
+static void paint_setup_IMC4 (paintinfo * p, unsigned char *dest);
#endif
-static void paint_setup_YUV9 (paintinfo * p, char *dest);
-static void paint_setup_YVU9 (paintinfo * p, char *dest);
-static void paint_setup_xRGB8888 (paintinfo * p, char *dest);
-static void paint_setup_xBGR8888 (paintinfo * p, char *dest);
-static void paint_setup_RGBx8888 (paintinfo * p, char *dest);
-static void paint_setup_BGRx8888 (paintinfo * p, char *dest);
-static void paint_setup_RGB888 (paintinfo * p, char *dest);
-static void paint_setup_BGR888 (paintinfo * p, char *dest);
-static void paint_setup_RGB565 (paintinfo * p, char *dest);
-static void paint_setup_xRGB1555 (paintinfo * p, char *dest);
+static void paint_setup_YUV9 (paintinfo * p, unsigned char *dest);
+static void paint_setup_YVU9 (paintinfo * p, unsigned char *dest);
+static void paint_setup_xRGB8888 (paintinfo * p, unsigned char *dest);
+static void paint_setup_xBGR8888 (paintinfo * p, unsigned char *dest);
+static void paint_setup_RGBx8888 (paintinfo * p, unsigned char *dest);
+static void paint_setup_BGRx8888 (paintinfo * p, unsigned char *dest);
+static void paint_setup_RGB888 (paintinfo * p, unsigned char *dest);
+static void paint_setup_BGR888 (paintinfo * p, unsigned char *dest);
+static void paint_setup_RGB565 (paintinfo * p, unsigned char *dest);
+static void paint_setup_xRGB1555 (paintinfo * p, unsigned char *dest);
static void paint_hline_I420 (paintinfo * p, int x, int y, int w);
static void paint_hline_YUY2 (paintinfo * p, int x, int y, int w);
#define ROUND_UP_8(x) (((x)+7)&~7)
static void
-paint_setup_I420 (paintinfo * p, char *dest)
+paint_setup_I420 (paintinfo * p, unsigned char *dest)
{
p->yp = dest;
p->ystride = ROUND_UP_4 (p->width);
}
static void
-paint_setup_YV12 (paintinfo * p, char *dest)
+paint_setup_YV12 (paintinfo * p, unsigned char *dest)
{
p->yp = dest;
p->ystride = ROUND_UP_4 (p->width);
}
static void
-paint_setup_YUY2 (paintinfo * p, char *dest)
+paint_setup_YUY2 (paintinfo * p, unsigned char *dest)
{
p->yp = dest;
p->up = dest + 1;
}
static void
-paint_setup_UYVY (paintinfo * p, char *dest)
+paint_setup_UYVY (paintinfo * p, unsigned char *dest)
{
p->yp = dest + 1;
p->up = dest;
}
static void
-paint_setup_YVYU (paintinfo * p, char *dest)
+paint_setup_YVYU (paintinfo * p, unsigned char *dest)
{
p->yp = dest;
p->up = dest + 3;
}
static void
-paint_setup_IYU2 (paintinfo * p, char *dest)
+paint_setup_IYU2 (paintinfo * p, unsigned char *dest)
{
/* untested */
p->yp = dest + 1;
}
static void
-paint_setup_Y41B (paintinfo * p, char *dest)
+paint_setup_Y41B (paintinfo * p, unsigned char *dest)
{
p->yp = dest;
p->ystride = ROUND_UP_4 (p->width);
}
static void
-paint_setup_Y42B (paintinfo * p, char *dest)
+paint_setup_Y42B (paintinfo * p, unsigned char *dest)
{
p->yp = dest;
p->ystride = ROUND_UP_4 (p->width);
}
static void
-paint_setup_Y800 (paintinfo * p, char *dest)
+paint_setup_Y800 (paintinfo * p, unsigned char *dest)
{
/* untested */
p->yp = dest;
#if 0
static void
-paint_setup_IMC1 (paintinfo * p, char *dest)
+paint_setup_IMC1 (paintinfo * p, unsigned char *dest)
{
p->yp = dest;
p->up = dest + p->width * p->height;
}
static void
-paint_setup_IMC2 (paintinfo * p, char *dest)
+paint_setup_IMC2 (paintinfo * p, unsigned char *dest)
{
p->yp = dest;
p->vp = dest + p->width * p->height;
}
static void
-paint_setup_IMC3 (paintinfo * p, char *dest)
+paint_setup_IMC3 (paintinfo * p, unsigned char *dest)
{
p->yp = dest;
p->up = dest + p->width * p->height + p->width * p->height / 2;
}
static void
-paint_setup_IMC4 (paintinfo * p, char *dest)
+paint_setup_IMC4 (paintinfo * p, unsigned char *dest)
{
p->yp = dest;
p->vp = dest + p->width * p->height + p->width / 2;
#endif
static void
-paint_setup_YVU9 (paintinfo * p, char *dest)
+paint_setup_YVU9 (paintinfo * p, unsigned char *dest)
{
int h = ROUND_UP_4 (p->height);
}
static void
-paint_setup_YUV9 (paintinfo * p, char *dest)
+paint_setup_YUV9 (paintinfo * p, unsigned char *dest)
{
/* untested */
int h = ROUND_UP_4 (p->height);
}
static void
-paint_setup_xRGB8888 (paintinfo * p, char *dest)
+paint_setup_xRGB8888 (paintinfo * p, unsigned char *dest)
{
p->yp = dest + 1;
p->up = dest + 2;
}
static void
-paint_setup_xBGR8888 (paintinfo * p, char *dest)
+paint_setup_xBGR8888 (paintinfo * p, unsigned char *dest)
{
p->yp = dest + 3;
p->up = dest + 2;
}
static void
-paint_setup_RGBx8888 (paintinfo * p, char *dest)
+paint_setup_RGBx8888 (paintinfo * p, unsigned char *dest)
{
p->yp = dest + 0;
p->up = dest + 1;
}
static void
-paint_setup_BGRx8888 (paintinfo * p, char *dest)
+paint_setup_BGRx8888 (paintinfo * p, unsigned char *dest)
{
p->yp = dest + 2;
p->up = dest + 1;
}
static void
-paint_setup_RGB888 (paintinfo * p, char *dest)
+paint_setup_RGB888 (paintinfo * p, unsigned char *dest)
{
p->yp = dest + 0;
p->up = dest + 1;
}
static void
-paint_setup_BGR888 (paintinfo * p, char *dest)
+paint_setup_BGR888 (paintinfo * p, unsigned char *dest)
{
p->yp = dest + 2;
p->up = dest + 1;
}
static void
-paint_setup_RGB565 (paintinfo * p, char *dest)
+paint_setup_RGB565 (paintinfo * p, unsigned char *dest)
{
p->yp = dest;
p->ystride = ROUND_UP_4 (p->width * 2);
}
static void
-paint_setup_xRGB1555 (paintinfo * p, char *dest)
+paint_setup_xRGB1555 (paintinfo * p, unsigned char *dest)
{
p->yp = dest;
p->ystride = ROUND_UP_4 (p->width * 2);
char *fourcc;
char *name;
int bitspp;
- void (*paint_setup) (paintinfo * p, char *dest);
+ void (*paint_setup) (paintinfo * p, unsigned char *dest);
void (*paint_hline) (paintinfo * p, int x, int y, int w);
int ext_caps;
int depth;
/* Storing some pointers in the buffer */
GST_BUFFER_PRIVATE (buffer) = ximage;
- GST_BUFFER_DATA (buffer) = ximage->ximage->data;
+ GST_BUFFER_DATA (buffer) = (guchar *) ximage->ximage->data;
GST_BUFFER_FREE_DATA_FUNC (buffer) = gst_ximagesink_buffer_free;
GST_BUFFER_SIZE (buffer) = ximage->size;
return buffer;
gst_xvimagesink_get_xv_support (GstXvImageSink * xvimagesink,
GstXContext * xcontext)
{
- gint i, nb_adaptors;
+ gint i;
+ guint nb_adaptors;
XvAdaptorInfo *adaptors;
gint nb_formats;
XvImageFormatValues *formats = NULL;
xcontext->xv_port_id = 0;
- GST_DEBUG ("Found %d XV adaptor(s)", nb_adaptors);
+ GST_DEBUG ("Found %u XV adaptor(s)", nb_adaptors);
/* Now search for an adaptor that supports XvImageMask */
for (i = 0; i < nb_adaptors && !xcontext->xv_port_id; i++) {
{
GstXvImageSink *xvimagesink;
GstStructure *structure;
- gint im_format = 0;
+ guint32 im_format = 0;
gboolean ret;
gint video_width, video_height;
gint video_par_n, video_par_d; /* video's PAR */
/* Storing some pointers in the buffer */
GST_BUFFER_PRIVATE (buffer) = xvimage;
- GST_BUFFER_DATA (buffer) = xvimage->xvimage->data;
+ GST_BUFFER_DATA (buffer) = (guchar *) xvimage->xvimage->data;
GST_BUFFER_FREE_DATA_FUNC (buffer) = gst_xvimagesink_buffer_free;
GST_BUFFER_SIZE (buffer) = xvimage->size;
gst_buffer_set_caps (buffer, caps);