Merge branch 'master' into 0.11

Conflicts:
	ext/flac/gstflacdec.c
	ext/jpeg/gstjpegenc.c
	ext/pulse/pulsesink.c
	sys/v4l2/gstv4l2src.c
This commit is contained in:
Sebastian Dröge 2012-01-25 12:49:11 +01:00
commit 10554b271f
25 changed files with 117 additions and 63 deletions

View file

@ -73,6 +73,8 @@ AG_GST_GETTEXT([gst-plugins-good-$GST_MAJORMINOR])
dnl *** check for arguments to configure ***
AG_GST_ARG_DISABLE_FATAL_WARNINGS
AG_GST_ARG_DEBUG
AG_GST_ARG_PROFILING
AG_GST_ARG_VALGRIND
@ -277,7 +279,7 @@ AG_GST_SET_PACKAGE_RELEASE_DATETIME_WITH_NANO([$PACKAGE_VERSION_NANO],
dnl define an ERROR_CFLAGS Makefile variable
dnl -Wundef: too many broken headers
if test "x$HAVE_OSX_VIDEO" != "xyes"; then
AG_GST_SET_ERROR_CFLAGS($GST_GIT, [
AG_GST_SET_ERROR_CFLAGS($FATAL_WARNINGS, [
-Wmissing-declarations -Wmissing-prototypes -Wredundant-decls
-Wwrite-strings -Wold-style-definition -Waggregate-return
-Winit-self -Wmissing-include-dirs -Waddress -Wno-multichar
@ -286,7 +288,7 @@ else
dnl work-around for us passing GST_CFLAGS to the ObjC-compiler, which
dnl doesn't understand all warning flags that the C compiler knows about
dnl (e.g. -Waddress) or causes problems with some flags (-Waggregate-return)
AG_GST_SET_ERROR_CFLAGS($GST_GIT, [
AG_GST_SET_ERROR_CFLAGS($FATAL_WARNINGS, [
-Wmissing-declarations -Wmissing-prototypes -Wredundant-decls
-Wwrite-strings -Wold-style-definition
-Winit-self -Wmissing-include-dirs -Wno-multichar
@ -294,7 +296,7 @@ else
fi
dnl define an ERROR_CXXFLAGS Makefile variable
AG_GST_SET_ERROR_CXXFLAGS($GST_GIT, [
AG_GST_SET_ERROR_CXXFLAGS($FATAL_WARNINGS, [
-Wmissing-declarations -Wredundant-decls
-Wwrite-strings
-Winit-self -Wmissing-include-dirs -Waddress -Wno-multichar ])

View file

@ -2863,8 +2863,11 @@ gst_pulsesink_change_state (GstElement * element, GstStateChange transition)
GST_INFO_OBJECT (element, "new pa main loop thread");
if (!(mainloop = pa_threaded_mainloop_new ()))
goto mainloop_failed;
if (pa_threaded_mainloop_start (mainloop) < 0) {
pa_threaded_mainloop_free (mainloop);
goto mainloop_start_failed;
}
mainloop_ref_ct = 1;
pa_threaded_mainloop_start (mainloop);
g_mutex_unlock (&pa_shared_resource_mutex);
} else {
GST_INFO_OBJECT (element, "reusing pa main loop thread");
@ -2910,6 +2913,13 @@ mainloop_failed:
("pa_threaded_mainloop_new() failed"), (NULL));
return GST_STATE_CHANGE_FAILURE;
}
mainloop_start_failed:
{
g_mutex_unlock (&pa_shared_resource_mutex);
GST_ELEMENT_ERROR (pulsesink, RESOURCE, FAILED,
("pa_threaded_mainloop_start() failed"), (NULL));
return GST_STATE_CHANGE_FAILURE;
}
state_failure:
{
if (transition == GST_STATE_CHANGE_NULL_TO_READY) {

View file

@ -1116,7 +1116,7 @@ gst_pulsesrc_delay (GstAudioSrc * asrc)
pa_threaded_mainloop_unlock (pulsesrc->mainloop);
if (res > 0) {
if (res < 0) {
GST_DEBUG_OBJECT (pulsesrc, "could not get latency");
result = 0;
} else {
@ -1610,10 +1610,13 @@ gst_pulsesrc_change_state (GstElement * element, GstStateChange transition)
switch (transition) {
case GST_STATE_CHANGE_NULL_TO_READY:
this->mainloop = pa_threaded_mainloop_new ();
g_assert (this->mainloop);
pa_threaded_mainloop_start (this->mainloop);
if (!(this->mainloop = pa_threaded_mainloop_new ()))
goto mainloop_failed;
if (pa_threaded_mainloop_start (this->mainloop) < 0) {
pa_threaded_mainloop_free (this->mainloop);
this->mainloop = NULL;
goto mainloop_start_failed;
}
if (!this->mixer)
this->mixer =
@ -1663,4 +1666,18 @@ gst_pulsesrc_change_state (GstElement * element, GstStateChange transition)
}
return ret;
/* ERRORS */
mainloop_failed:
{
GST_ELEMENT_ERROR (this, RESOURCE, FAILED,
("pa_threaded_mainloop_new() failed"), (NULL));
return GST_STATE_CHANGE_FAILURE;
}
mainloop_start_failed:
{
GST_ELEMENT_ERROR (this, RESOURCE, FAILED,
("pa_threaded_mainloop_start() failed"), (NULL));
return GST_STATE_CHANGE_FAILURE;
}
}

View file

@ -292,7 +292,6 @@ transform_ayuv_ayuv (GstVideoFrame * frame, const gint * matrix)
u = (data[1] * uc[0] + data[2] * uc[1] + data[3] * uc[2] + uc[3]) >> 8;
v = (data[1] * vc[0] + data[2] * vc[1] + data[3] * vc[2] + vc[3]) >> 8;
data[0] = data[0];
data[1] = y;
data[2] = u;
data[3] = v;

View file

@ -522,7 +522,7 @@ gst_avi_demux_handle_src_query (GstPad * pad, GstObject * parent,
GST_DEBUG_OBJECT (query, "total frames is %" G_GUINT32_FORMAT,
stream->idx_n);
if (stream->idx_n >= 0)
if (stream->idx_n > 0)
gst_query_set_duration (query, fmt, stream->idx_n);
else if (gst_pad_query_convert (pad, GST_FORMAT_TIME,
duration, fmt, &dur))

View file

@ -185,9 +185,6 @@ static GstMessage *
gst_cutter_message_new (GstCutter * c, gboolean above, GstClockTime timestamp)
{
GstStructure *s;
GValue v = { 0, };
g_value_init (&v, GST_TYPE_LIST);
s = gst_structure_new ("cutter",
"above", G_TYPE_BOOLEAN, above,

View file

@ -1002,9 +1002,10 @@ gst_deinterlace_get_interlacing_method (const GstCaps * caps)
GstDeinterlaceInterlacingMethod method = 0;
gboolean interlaced;
/* check interlaced cap */
gst_structure_get_boolean (gst_caps_get_structure (caps, 0), "interlaced",
&interlaced);
/* check interlaced cap, defaulting to FALSE */
if (!gst_structure_get_boolean (gst_caps_get_structure (caps, 0),
"interlaced", &interlaced))
interlaced = FALSE;
method =
interlaced ? GST_DEINTERLACE_INTERLACED : GST_DEINTERLACE_PROGRESSIVE;
@ -1707,8 +1708,8 @@ restart:
gst_buffer_set_caps (outbuf, GST_PAD_CAPS (self->srcpad));
}
g_return_val_if_fail (self->history_count - 1 -
gst_deinterlace_method_get_latency (self->method) >= 0, GST_FLOW_ERROR);
g_return_val_if_fail (self->history_count >=
1 + gst_deinterlace_method_get_latency (self->method), GST_FLOW_ERROR);
buf =
self->field_history[self->history_count - 1 -

View file

@ -395,6 +395,7 @@ gst_image_freeze_convert (GstImageFreeze * self,
default:
break;
}
break;
}
case GST_FORMAT_TIME:{
switch (*dest_format) {
@ -409,7 +410,7 @@ gst_image_freeze_convert (GstImageFreeze * self,
default:
break;
}
break;
}
default:
break;
@ -467,12 +468,14 @@ gst_image_freeze_src_query (GstPad * pad, GstQuery * query)
position = self->offset;
g_mutex_unlock (self->lock);
ret = TRUE;
break;
}
case GST_FORMAT_TIME:{
g_mutex_lock (self->lock);
position = self->segment.last_stop;
g_mutex_unlock (self->lock);
ret = TRUE;
break;
}
default:
break;
@ -499,6 +502,7 @@ gst_image_freeze_src_query (GstPad * pad, GstQuery * query)
duration = self->segment.stop;
g_mutex_unlock (self->lock);
ret = TRUE;
break;
}
case GST_FORMAT_DEFAULT:{
g_mutex_lock (self->lock);
@ -509,6 +513,7 @@ gst_image_freeze_src_query (GstPad * pad, GstQuery * query)
GST_SECOND * self->fps_d);
g_mutex_unlock (self->lock);
ret = TRUE;
break;
}
default:
break;

View file

@ -686,6 +686,13 @@ moov_recov_file_create (FILE * file, GError ** err)
goto fail;
}
/* sanity check */
if (moovrf->num_traks > 1024) {
g_set_error (err, ATOMS_RECOV_QUARK, ATOMS_RECOV_ERR_PARSING,
"Unsupported number of traks");
goto fail;
}
/* init the traks */
moovrf->traks_rd = g_new0 (TrakRecovData, moovrf->num_traks);
for (i = 0; i < moovrf->num_traks; i++) {

View file

@ -1712,7 +1712,6 @@ gst_matroska_demux_search_pos (GstMatroskaDemux * demux, GstClockTime time)
gint64 opos, newpos, startpos = 0, current_offset;
gint64 prev_cluster_offset = -1, current_cluster_offset, cluster_offset;
const guint chunk = 64 * 1024;
GstBuffer *buf = NULL;
GstFlowReturn ret;
guint64 length;
guint32 id;
@ -1877,8 +1876,6 @@ retry:
", pos %" G_GUINT64_FORMAT, GST_TIME_ARGS (entry->time), entry->pos);
exit:
if (buf)
gst_buffer_unref (buf);
/* restore some state */
demux->cluster_offset = current_cluster_offset;

View file

@ -233,7 +233,7 @@ gst_rtp_h263p_pay_sink_getcaps (GstRTPBasePayload * payload, GstPad * pad,
GstCaps * filter)
{
GstRtpH263PPay *rtph263ppay;
GstCaps *caps = gst_caps_new_empty ();
GstCaps *caps = NULL;
GstCaps *peercaps = NULL;
GstCaps *intersect = NULL;
guint i;
@ -254,6 +254,7 @@ gst_rtp_h263p_pay_sink_getcaps (GstRTPBasePayload * payload, GstPad * pad,
if (gst_caps_is_empty (intersect))
return intersect;
caps = gst_caps_new_empty ();
for (i = 0; i < gst_caps_get_size (intersect); i++) {
GstStructure *s = gst_caps_get_structure (intersect, i);
const gchar *encoding_name = gst_structure_get_string (s, "encoding-name");

View file

@ -124,7 +124,7 @@ gst_rtp_mp4a_depay_finalize (GObject * object)
}
static const guint aac_sample_rates[] = { 96000, 88200, 64000, 48000,
44100, 32000, 24000, 22050, 16000, 12000, 11025, 8000
44100, 32000, 24000, 22050, 16000, 12000, 11025, 8000, 7350
};
static gboolean
@ -239,6 +239,8 @@ gst_rtp_mp4a_depay_setcaps (GstRTPBaseDepayload * depayload, GstCaps * caps)
/* index of 15 means we get the rate in the next 24 bits */
if (!gst_bit_reader_get_bits_uint32 (&br, &rate, 24))
goto bad_config;
} else if (sr_idx >= G_N_ELEMENTS (aac_sample_rates)) {
goto bad_config;
} else {
/* else use the rate from the table */
rate = aac_sample_rates[sr_idx];

View file

@ -324,10 +324,6 @@ gst_rtp_theora_depay_setcaps (GstRTPBaseDepayload * depayload, GstCaps * caps)
guint8 *data;
gsize size;
/* configure string should be in the caps */
if (configuration == NULL)
goto no_configuration;
/* deserialize base64 to buffer */
data = g_base64_decode (configuration, &size);
@ -350,11 +346,6 @@ gst_rtp_theora_depay_setcaps (GstRTPBaseDepayload * depayload, GstCaps * caps)
return res;
/* ERRORS */
no_configuration:
{
GST_ERROR_OBJECT (rtptheoradepay, "no configuration specified");
return FALSE;
}
invalid_configuration:
{
GST_ERROR_OBJECT (rtptheoradepay, "invalid configuration specified");

View file

@ -1188,8 +1188,11 @@ gst_rtp_bin_associate (GstRtpBin * bin, GstRtpBinStream * stream, guint8 len,
* now equating rtptime obtained from RTP-Info,
* where the large time represent the otherwise irrelevant npt/ntp time */
stream->rtp_delta = (GST_SECOND << 28) - rtp_clock_base;
} else {
clock_base = rtp_clock_base;
}
all_sync = TRUE;
for (walk = client->streams; walk; walk = g_slist_next (walk)) {
GstRtpBinStream *ostream = (GstRtpBinStream *) walk->data;
@ -1215,7 +1218,7 @@ gst_rtp_bin_associate (GstRtpBin * bin, GstRtpBinStream * stream, guint8 len,
/* arrange to re-sync for each stream upon significant change,
* e.g. post-seek */
all_sync = (stream->clock_base == clock_base);
all_sync = all_sync && (stream->clock_base == clock_base);
stream->clock_base = clock_base;
/* may need init performed above later on, but nothing more to do now */
@ -1880,7 +1883,7 @@ gst_rtp_bin_class_init (GstRtpBinClass * klass)
static void
gst_rtp_bin_init (GstRtpBin * rtpbin)
{
gchar *str;
gchar *cname;
rtpbin->priv = GST_RTP_BIN_GET_PRIVATE (rtpbin);
g_mutex_init (&rtpbin->priv->bin_lock);
@ -1898,12 +1901,10 @@ gst_rtp_bin_init (GstRtpBin * rtpbin)
rtpbin->use_pipeline_clock = DEFAULT_USE_PIPELINE_CLOCK;
/* some default SDES entries */
str = g_strdup_printf ("%s@%s", g_get_user_name (), g_get_host_name ());
cname = g_strdup_printf ("user%u@x-%u.net", g_random_int (), g_random_int ());
rtpbin->sdes = gst_structure_new ("application/x-rtp-source-sdes",
"cname", G_TYPE_STRING, str,
"name", G_TYPE_STRING, g_get_real_name (),
"tool", G_TYPE_STRING, "GStreamer", NULL);
g_free (str);
"cname", G_TYPE_STRING, cname, "tool", G_TYPE_STRING, "GStreamer", NULL);
g_free (cname);
}
static void

View file

@ -304,7 +304,7 @@ gst_rtp_pt_demux_chain (GstPad * pad, GstObject * parent, GstBuffer * buf)
GstPad *srcpad;
GstRtpPtDemuxPad *rtpdemuxpad;
GstCaps *caps;
GstRTPBuffer rtp = {NULL};
GstRTPBuffer rtp = { NULL };
rtpdemux = GST_RTP_PT_DEMUX (parent);
@ -324,6 +324,10 @@ gst_rtp_pt_demux_chain (GstPad * pad, GstObject * parent, GstBuffer * buf)
GstPadTemplate *templ;
gchar *padname;
caps = gst_rtp_pt_demux_get_caps (rtpdemux, pt);
if (!caps)
goto no_caps;
klass = GST_ELEMENT_GET_CLASS (rtpdemux);
templ = gst_element_class_get_pad_template (klass, "src_%u");
padname = g_strdup_printf ("src_%u", pt);
@ -332,10 +336,6 @@ gst_rtp_pt_demux_chain (GstPad * pad, GstObject * parent, GstBuffer * buf)
g_free (padname);
gst_pad_set_event_function (srcpad, gst_rtp_pt_demux_src_event);
caps = gst_rtp_pt_demux_get_caps (rtpdemux, pt);
if (!caps)
goto no_caps;
caps = gst_caps_make_writable (caps);
gst_caps_set_simple (caps, "payload", G_TYPE_INT, pt, NULL);
gst_pad_set_caps (srcpad, caps);

View file

@ -486,12 +486,19 @@ rtp_session_init (RTPSession * sess)
sess->mtu = DEFAULT_RTCP_MTU;
/* some default SDES entries */
str = g_strdup_printf ("%s@%s", g_get_user_name (), g_get_host_name ());
/* we do not want to leak details like the username or hostname here */
str = g_strdup_printf ("user%u@x-%u.net", g_random_int (), g_random_int ());
rtp_source_set_sdes_string (sess->source, GST_RTCP_SDES_CNAME, str);
g_free (str);
rtp_source_set_sdes_string (sess->source, GST_RTCP_SDES_NAME,
g_get_real_name ());
#if 0
/* we do not want to leak the user's real name here */
str = g_strdup_printf ("Anon%u", g_random_int ());
rtp_source_set_sdes_string (sess->source, GST_RTCP_SDES_NAME, str);
g_free (str);
#endif
rtp_source_set_sdes_string (sess->source, GST_RTCP_SDES_TOOL, "GStreamer");
sess->first_rtcp = TRUE;

View file

@ -1950,13 +1950,9 @@ static gboolean
gst_rtspsrc_handle_internal_src_event (GstPad * pad, GstObject * parent,
GstEvent * event)
{
GstRTSPSrc *src;
gboolean res;
src = GST_RTSPSRC_CAST (gst_pad_get_element_private (pad));
GST_DEBUG_OBJECT (src, "pad %s:%s received event %s",
GST_DEBUG_PAD_NAME (pad), GST_EVENT_TYPE_NAME (event));
GST_DEBUG_OBJECT (pad, "received event %s", GST_EVENT_TYPE_NAME (event));
switch (GST_EVENT_TYPE (event)) {
case GST_EVENT_SEEK:
@ -4256,7 +4252,8 @@ gst_rtspsrc_parse_digest_challenge (GstRTSPConnection * conn,
} else
value = NULL;
if ((strcmp (item, "stale") == 0) && (strcmp (value, "TRUE") == 0))
if (item && (strcmp (item, "stale") == 0) &&
value && (strcmp (value, "TRUE") == 0))
*stale = TRUE;
gst_rtsp_connection_set_auth_param (conn, item, value);
g_free (item);

View file

@ -391,7 +391,7 @@ gst_oss4_sink_getcaps (GstBaseSink * bsink)
oss = GST_OSS4_SINK (bsink);
if (oss->fd == -1) {
caps = gst_caps_copy (gst_oss4_audio_get_template_caps ());
caps = gst_oss4_audio_get_template_caps ();
} else if (oss->probed_caps) {
caps = gst_caps_copy (oss->probed_caps);
} else {
@ -476,7 +476,7 @@ gst_oss4_sink_open (GstAudioSink * asink, gboolean silent_errors)
if (ioctl (oss->fd, SNDCTL_DSP_GET_PLAYTGT_NAMES, &routings) != -1) {
GST_LOG_OBJECT (oss, "%u output routings (static list: %d)",
routings.nvalues, !!(routings.version == 0));
routings.nvalues, ! !(routings.version == 0));
for (i = 0; i < routings.nvalues; ++i) {
GST_LOG_OBJECT (oss, " output routing %d: %s", i,
&routings.strings[routings.strindex[i]]);

View file

@ -273,7 +273,7 @@ gst_oss4_source_getcaps (GstBaseSrc * bsrc)
oss = GST_OSS4_SOURCE (bsrc);
if (oss->fd == -1) {
caps = gst_caps_copy (gst_oss4_audio_get_template_caps ());
caps = gst_oss4_audio_get_template_caps ();
} else if (oss->probed_caps) {
caps = gst_caps_copy (oss->probed_caps);
} else {

View file

@ -128,6 +128,7 @@
}
self = [super initWithFrame: frame pixelFormat:fmt];
[fmt release];
actualContext = [self openGLContext];
[actualContext makeCurrentContext];

View file

@ -388,11 +388,12 @@ gst_v4l2src_negotiate (GstBaseSrc * basesrc)
}
}
gst_caps_unref (thiscaps);
gst_caps_unref (peercaps);
} else {
/* no peer or peer have ANY caps, work with our own caps then */
caps = thiscaps;
}
if (peercaps)
gst_caps_unref (peercaps);
if (caps) {
caps = gst_caps_make_writable (caps);
gst_caps_truncate (caps);

View file

@ -76,8 +76,8 @@ GstCaps *gst_waveform_sink_create_caps (gint rate, gint channels,
gint bits_per_sample);
WAVEHDR *bufferpool_get_buffer (GstWaveFormSink * wfsink, gpointer data,
guint length);
void CALLBACK waveOutProc (HWAVEOUT hwo, UINT uMsg, unsigned long dwInstance,
DWORD dwParam1, DWORD dwParam2);
void CALLBACK waveOutProc (HWAVEOUT hwo, UINT uMsg, DWORD_PTR dwInstance,
DWORD_PTR dwParam1, DWORD_PTR dwParam2);
static GstStaticPadTemplate waveformsink_sink_factory =
GST_STATIC_PAD_TEMPLATE ("sink",
@ -374,7 +374,7 @@ gst_waveform_sink_prepare (GstAudioSink * asink, GstRingBufferSpec * spec)
/* open the default audio device with the given caps */
mmresult = waveOutOpen (&wfsink->hwaveout, WAVE_MAPPER,
&wfx, (DWORD) waveOutProc, (DWORD) wfsink, CALLBACK_FUNCTION);
&wfx, (DWORD_PTR) waveOutProc, (DWORD_PTR) wfsink, CALLBACK_FUNCTION);
if (mmresult != MMSYSERR_NOERROR) {
waveOutGetErrorText (mmresult, wfsink->error_string, ERROR_LENGTH - 1);
GST_ELEMENT_ERROR (wfsink, RESOURCE, OPEN_WRITE,
@ -569,7 +569,7 @@ gst_waveform_sink_create_caps (gint rate, gint channels, gint bits_per_sample)
void CALLBACK
waveOutProc (HWAVEOUT hwo,
UINT uMsg, unsigned long dwInstance, DWORD dwParam1, DWORD dwParam2)
UINT uMsg, DWORD_PTR dwInstance, DWORD_PTR dwParam1, DWORD_PTR dwParam2)
{
GstWaveFormSink *wfsink = (GstWaveFormSink *) dwInstance;

View file

@ -28,10 +28,21 @@
#include <windows.h>
#include <mmsystem.h>
#ifndef WAVE_FORMAT_96M08
#define WAVE_FORMAT_96M08 0x00001000 /* 96 kHz, Mono, 8-bit */
#endif
#ifndef WAVE_FORMAT_96S08
#define WAVE_FORMAT_96S08 0x00002000 /* 96 kHz, Stereo, 8-bit */
#endif
#ifndef WAVE_FORMAT_96M16
#define WAVE_FORMAT_96M16 0x00004000 /* 96 kHz, Mono, 16-bit */
#endif
#ifndef WAVE_FORMAT_96S16
#define WAVE_FORMAT_96S16 0x00008000 /* 96 kHz, Stereo, 16-bit */
#endif
#define ERROR_LENGTH MAXERRORLENGTH+50
#define BUFFER_COUNT 20

View file

@ -49,6 +49,12 @@ GST_START_TEST (test_autovideosink_ghostpad_error_case)
/* this should fail, there's no such format */
state_ret = gst_element_set_state (pipeline, GST_STATE_PAUSED);
if (state_ret == GST_STATE_CHANGE_ASYNC) {
/* make sure we wait for the actual success/failure to happen */
GstState state;
state_ret =
gst_element_get_state (pipeline, &state, &state, GST_CLOCK_TIME_NONE);
}
fail_unless (state_ret == GST_STATE_CHANGE_FAILURE,
"pipeline _set_state() to PAUSED succeeded but should have failed");

View file

@ -299,6 +299,7 @@ GST_START_TEST (test_crop_to_1x1)
if (g_strcmp0 (gst_structure_get_name (s), "video/x-raw-gray") == 0) {
/* videotestsrc does not support this format */
gst_caps_unref (caps);
continue;
}