Merge branch 'master' into 0.11

Conflicts:
	ext/pulse/pulsesink.c
This commit is contained in:
Mark Nauwelaerts 2011-07-04 11:48:13 +02:00
commit d59a00aa1c
18 changed files with 71 additions and 246 deletions

2
common

@ -1 +1 @@
Subproject commit 69b981f10caa234ad0ff639179d0fda8505bd94b
Subproject commit 605cd9a65ed61505f24b840d3fe8e252be72b151

View file

@ -800,27 +800,7 @@ AG_GST_CHECK_FEATURE(PULSE, [pulseaudio plug-in], pulseaudio, [
dnl used in ext/pulse/pulseutil.c
AC_CHECK_HEADERS([process.h])
AG_GST_PKG_CHECK_MODULES(PULSE, libpulse >= 0.9.10)
AG_GST_PKG_CHECK_MODULES(PULSE_0_9_11, libpulse >= 0.9.11)
if test x$HAVE_PULSE_0_9_11 = xyes; then
AC_DEFINE(HAVE_PULSE_0_9_11, 1, [defined if pulseaudio >= 0.9.11 is available])
fi
AG_GST_PKG_CHECK_MODULES(PULSE_0_9_12, libpulse >= 0.9.12)
if test x$HAVE_PULSE_0_9_12 = xyes; then
AC_DEFINE(HAVE_PULSE_0_9_12, 1, [defined if pulseaudio >= 0.9.12 is available])
fi
AG_GST_PKG_CHECK_MODULES(PULSE_0_9_13, libpulse >= 0.9.13)
if test x$HAVE_PULSE_0_9_13 = xyes; then
AC_DEFINE(HAVE_PULSE_0_9_13, 1, [defined if pulseaudio >= 0.9.13 is available])
fi
AG_GST_PKG_CHECK_MODULES(PULSE_0_9_15, libpulse >= 0.9.15)
if test x$HAVE_PULSE_0_9_15 = xyes; then
AC_DEFINE(HAVE_PULSE_0_9_15, 1, [defined if pulseaudio >= 0.9.15 is available])
fi
AG_GST_PKG_CHECK_MODULES(PULSE_0_9_16, libpulse >= 0.9.16)
if test x$HAVE_PULSE_0_9_16 = xyes; then
AC_DEFINE(HAVE_PULSE_0_9_16, 1, [defined if pulseaudio >= 0.9.16 is available])
fi
AG_GST_PKG_CHECK_MODULES(PULSE, libpulse >= 0.9.16)
AG_GST_PKG_CHECK_MODULES(PULSE_0_9_20, libpulse >= 0.9.20)
if test x$HAVE_PULSE_0_9_20 = xyes; then
AC_DEFINE(HAVE_PULSE_0_9_20, 1, [defined if pulseaudio >= 0.9.20 is available])
@ -882,12 +862,6 @@ dnl *** shout2 ***
translit(dnm, m, l) AM_CONDITIONAL(USE_SHOUT2, true)
AG_GST_CHECK_FEATURE(SHOUT2, [Shoutcast/Icecast client library], shout2, [
AG_GST_PKG_CHECK_MODULES(SHOUT2, shout >= 2.0)
if test $HAVE_SHOUT2 = no
then
AM_PATH_SHOUT2(HAVE_SHOUT2="yes")
AC_SUBST(SHOUT2_CFLAGS)
AC_SUBST(SHOUT2_LIBS)
fi
])
dnl *** soup ***

View file

@ -246,8 +246,7 @@ gst_jpegenc_term_destination (j_compress_ptr cinfo)
/* Trim the buffer size and push it. */
GST_BUFFER_SIZE (jpegenc->output_buffer) =
GST_ROUND_UP_4 (GST_BUFFER_SIZE (jpegenc->output_buffer) -
jpegenc->jdest.free_in_buffer);
GST_BUFFER_SIZE (jpegenc->output_buffer) - jpegenc->jdest.free_in_buffer;
g_signal_emit (G_OBJECT (jpegenc), gst_jpegenc_signals[FRAME_ENCODED], 0);

View file

@ -41,11 +41,11 @@ plugin_init (GstPlugin * plugin)
bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
#endif
if (!gst_element_register (plugin, "pulsesink", GST_RANK_PRIMARY,
if (!gst_element_register (plugin, "pulsesink", GST_RANK_PRIMARY + 10,
GST_TYPE_PULSESINK))
return FALSE;
if (!gst_element_register (plugin, "pulsesrc", GST_RANK_PRIMARY,
if (!gst_element_register (plugin, "pulsesrc", GST_RANK_PRIMARY + 10,
GST_TYPE_PULSESRC))
return FALSE;

View file

@ -63,11 +63,6 @@
GST_DEBUG_CATEGORY_EXTERN (pulse_debug);
#define GST_CAT_DEFAULT pulse_debug
/* according to
* http://www.pulseaudio.org/ticket/314
* we need pulse-0.9.12 to use sink volume properties
*/
#define DEFAULT_SERVER NULL
#define DEFAULT_DEVICE NULL
#define DEFAULT_DEVICE_NAME NULL
@ -145,13 +140,11 @@ struct _GstPulseRingBuffer
pa_sample_spec sample_spec;
#ifdef HAVE_PULSE_0_9_16
void *m_data;
size_t m_towrite;
size_t m_writable;
gint64 m_offset;
gint64 m_lastoffset;
#endif
gboolean corked:1;
gboolean in_commit:1;
@ -229,21 +222,13 @@ gst_pulseringbuffer_init (GstPulseRingBuffer * pbuf)
pbuf->context = NULL;
pbuf->stream = NULL;
#ifdef HAVE_PULSE_0_9_13
pa_sample_spec_init (&pbuf->sample_spec);
#else
pbuf->sample_spec.format = PA_SAMPLE_INVALID;
pbuf->sample_spec.rate = 0;
pbuf->sample_spec.channels = 0;
#endif
#ifdef HAVE_PULSE_0_9_16
pbuf->m_data = NULL;
pbuf->m_towrite = 0;
pbuf->m_writable = 0;
pbuf->m_offset = 0;
pbuf->m_lastoffset = 0;
#endif
pbuf->corked = TRUE;
pbuf->in_commit = FALSE;
@ -255,7 +240,6 @@ gst_pulsering_destroy_stream (GstPulseRingBuffer * pbuf)
{
if (pbuf->stream) {
#ifdef HAVE_PULSE_0_9_16
if (pbuf->m_data) {
/* drop shm memory buffer */
pa_stream_cancel_write (pbuf->stream);
@ -267,7 +251,6 @@ gst_pulsering_destroy_stream (GstPulseRingBuffer * pbuf)
pbuf->m_offset = 0;
pbuf->m_lastoffset = 0;
}
#endif
pa_stream_disconnect (pbuf->stream);
@ -318,9 +301,7 @@ gst_pulsering_destroy_context (GstPulseRingBuffer * pbuf)
/* Make sure we don't get any further callbacks */
pa_context_set_state_callback (pctx->context, NULL, NULL);
#ifdef HAVE_PULSE_0_9_12
pa_context_set_subscribe_callback (pctx->context, NULL, NULL);
#endif
g_hash_table_remove (gst_pulse_shared_contexts, pbuf->context_name);
@ -397,7 +378,6 @@ gst_pulsering_context_state_cb (pa_context * c, void *userdata)
}
}
#ifdef HAVE_PULSE_0_9_12
static void
gst_pulsering_context_subscribe_cb (pa_context * c,
pa_subscription_event_type_t t, uint32_t idx, void *userdata)
@ -431,7 +411,6 @@ gst_pulsering_context_subscribe_cb (pa_context * c,
g_atomic_int_compare_and_exchange (&psink->notify, 0, 1);
}
}
#endif
/* will be called when the device should be opened. In this case we will connect
* to the server. We should not try to open any streams in this state. */
@ -478,10 +457,8 @@ gst_pulseringbuffer_open_device (GstRingBuffer * buf)
/* register some essential callbacks */
pa_context_set_state_callback (pctx->context,
gst_pulsering_context_state_cb, mainloop);
#ifdef HAVE_PULSE_0_9_12
pa_context_set_subscribe_callback (pctx->context,
gst_pulsering_context_subscribe_cb, pctx);
#endif
/* try to connect to the server and wait for completion, we don't want to
* autospawn a deamon */
@ -659,11 +636,7 @@ gst_pulsering_stream_latency_cb (pa_stream * s, void *userdata)
GST_LOG_OBJECT (psink, "latency update (information unknown)");
return;
}
#ifdef HAVE_PULSE_0_9_11
sink_usec = info->configured_sink_usec;
#else
sink_usec = 0;
#endif
GST_LOG_OBJECT (psink,
"latency_update, %" G_GUINT64_FORMAT ", %d:%" G_GINT64_FORMAT ", %d:%"
@ -688,7 +661,6 @@ gst_pulsering_stream_suspended_cb (pa_stream * p, void *userdata)
GST_DEBUG_OBJECT (psink, "stream resumed");
}
#ifdef HAVE_PULSE_0_9_11
static void
gst_pulsering_stream_started_cb (pa_stream * p, void *userdata)
{
@ -700,9 +672,7 @@ gst_pulsering_stream_started_cb (pa_stream * p, void *userdata)
GST_DEBUG_OBJECT (psink, "stream started");
}
#endif
#ifdef HAVE_PULSE_0_9_15
static void
gst_pulsering_stream_event_cb (pa_stream * p, const char *name,
pa_proplist * pl, void *userdata)
@ -729,7 +699,6 @@ gst_pulsering_stream_event_cb (pa_stream * p, const char *name,
GST_DEBUG_OBJECT (psink, "got unknown event %s", name);
}
}
#endif
/* This method should create a new stream of the given @spec. No playback should
* start yet so we start in the corked state. */
@ -800,14 +769,10 @@ gst_pulseringbuffer_acquire (GstRingBuffer * buf, GstRingBufferSpec * spec)
gst_pulsering_stream_latency_cb, pbuf);
pa_stream_set_suspended_callback (pbuf->stream,
gst_pulsering_stream_suspended_cb, pbuf);
#ifdef HAVE_PULSE_0_9_11
pa_stream_set_started_callback (pbuf->stream,
gst_pulsering_stream_started_cb, pbuf);
#endif
#ifdef HAVE_PULSE_0_9_15
pa_stream_set_event_callback (pbuf->stream,
gst_pulsering_stream_event_cb, pbuf);
#endif
/* buffering requirements. When setting prebuf to 0, the stream will not pause
* when we cause an underrun, which causes time to continue. */
@ -836,15 +801,10 @@ gst_pulseringbuffer_acquire (GstRingBuffer * buf, GstRingBufferSpec * spec)
/* construct the flags */
flags = PA_STREAM_INTERPOLATE_TIMING | PA_STREAM_AUTO_TIMING_UPDATE |
#ifdef HAVE_PULSE_0_9_11
PA_STREAM_ADJUST_LATENCY |
#endif
PA_STREAM_START_CORKED;
PA_STREAM_ADJUST_LATENCY | PA_STREAM_START_CORKED;
#ifdef HAVE_PULSE_0_9_12
if (psink->mute_set && psink->mute)
flags |= PA_STREAM_START_MUTED;
#endif
/* we always start corked (see flags above) */
pbuf->corked = TRUE;
@ -1148,18 +1108,16 @@ gst_pulseringbuffer_stop (GstRingBuffer * buf)
pa_threaded_mainloop_signal (mainloop, 0);
}
if (strcmp (psink->pa_version, "0.9.12")) {
/* then try to flush, it's not fatal when this fails */
GST_DEBUG_OBJECT (psink, "flushing");
if ((o = pa_stream_flush (pbuf->stream, gst_pulsering_success_cb, pbuf))) {
while (pa_operation_get_state (o) == PA_OPERATION_RUNNING) {
GST_DEBUG_OBJECT (psink, "wait for completion");
pa_threaded_mainloop_wait (mainloop);
if (gst_pulsering_is_dead (psink, pbuf, TRUE))
goto server_dead;
}
GST_DEBUG_OBJECT (psink, "flush completed");
/* then try to flush, it's not fatal when this fails */
GST_DEBUG_OBJECT (psink, "flushing");
if ((o = pa_stream_flush (pbuf->stream, gst_pulsering_success_cb, pbuf))) {
while (pa_operation_get_state (o) == PA_OPERATION_RUNNING) {
GST_DEBUG_OBJECT (psink, "wait for completion");
pa_threaded_mainloop_wait (mainloop);
if (gst_pulsering_is_dead (psink, pbuf, TRUE))
goto server_dead;
}
GST_DEBUG_OBJECT (psink, "flush completed");
}
res = TRUE;
@ -1335,7 +1293,6 @@ gst_pulseringbuffer_commit (GstRingBuffer * buf, guint64 * sample,
"need to write %d samples at offset %" G_GINT64_FORMAT, *toprocess,
offset);
#ifdef HAVE_PULSE_0_9_16
if (offset != pbuf->m_lastoffset)
GST_LOG_OBJECT (psink, "discontinuity, offset is %" G_GINT64_FORMAT ", "
"last offset was %" G_GINT64_FORMAT, offset, pbuf->m_lastoffset);
@ -1483,94 +1440,10 @@ gst_pulseringbuffer_commit (GstRingBuffer * buf, guint64 * sample,
pbuf->m_towrite = 0;
pbuf->m_offset = offset + towrite; /* keep track of current offset */
}
#else
for (;;) {
/* FIXME, this is not quite right */
if ((avail = pa_stream_writable_size (pbuf->stream)) == (size_t) - 1)
goto writable_size_failed;
/* We always try to satisfy a request for data */
GST_LOG_OBJECT (psink, "writable bytes %" G_GSIZE_FORMAT, avail);
/* convert to samples, we can only deal with multiples of the
* sample size */
avail /= bps;
if (avail > 0)
break;
/* see if we need to uncork because we have no free space */
if (pbuf->corked) {
if (!gst_pulsering_set_corked (pbuf, FALSE, FALSE))
goto uncork_failed;
}
/* we can't write a single byte, wait a bit */
GST_LOG_OBJECT (psink, "waiting for free space");
pa_threaded_mainloop_wait (mainloop);
if (pbuf->paused)
goto was_paused;
}
if (avail > out_samples)
avail = out_samples;
towrite = avail * bps;
GST_LOG_OBJECT (psink, "writing %u samples at offset %" G_GUINT64_FORMAT,
(guint) avail, offset);
if (G_LIKELY (inr == outr && !reverse)) {
/* no rate conversion, simply write out the samples */
if (pa_stream_write (pbuf->stream, data, towrite, NULL, offset,
PA_SEEK_ABSOLUTE) < 0)
goto write_failed;
data += towrite;
in_samples -= avail;
out_samples -= avail;
} else {
guint8 *dest, *d, *d_end;
/* we need to allocate a temporary buffer to resample the data into,
* FIXME, we should have a pulseaudio API to allocate this buffer for us
* from the shared memory. */
dest = d = g_malloc (towrite);
d_end = d + towrite;
if (!reverse) {
if (inr >= outr)
/* forward speed up */
FWD_UP_SAMPLES (data, data_end, d, d_end);
else
/* forward slow down */
FWD_DOWN_SAMPLES (data, data_end, d, d_end);
} else {
if (inr >= outr)
/* reverse speed up */
REV_UP_SAMPLES (data, data_end, d, d_end);
else
/* reverse slow down */
REV_DOWN_SAMPLES (data, data_end, d, d_end);
}
/* see what we have left to write */
towrite = (d - dest);
if (pa_stream_write (pbuf->stream, dest, towrite,
g_free, offset, PA_SEEK_ABSOLUTE) < 0)
goto write_failed;
avail = towrite / bps;
}
#endif /* HAVE_PULSE_0_9_16 */
*sample += avail;
offset += avail * bps;
#ifdef HAVE_PULSE_0_9_16
pbuf->m_lastoffset = offset;
#endif
/* check if we need to uncork after writing the samples */
if (pbuf->corked) {
@ -1656,7 +1529,6 @@ write_failed:
static void
gst_pulsering_flush (GstPulseRingBuffer * pbuf)
{
#ifdef HAVE_PULSE_0_9_16
GstPulseSink *psink;
psink = GST_PULSESINK_CAST (GST_OBJECT_PARENT (pbuf));
@ -1693,7 +1565,6 @@ write_failed:
pa_strerror (pa_context_errno (pbuf->context))), (NULL));
goto done;
}
#endif
}
static void gst_pulsesink_set_property (GObject * object, guint prop_id,
@ -1795,9 +1666,7 @@ G_DEFINE_TYPE_WITH_CODE (GstPulseSink, gst_pulsesink, GST_TYPE_BASE_AUDIO_SINK,
gst_pulsesink_implements_interface_init);
G_IMPLEMENT_INTERFACE (GST_TYPE_PROPERTY_PROBE,
gst_pulsesink_property_probe_interface_init);
#ifdef HAVE_PULSE_0_9_12
G_IMPLEMENT_INTERFACE (GST_TYPE_STREAM_VOLUME, NULL)
#endif
);
static GstRingBuffer *
@ -1855,7 +1724,6 @@ gst_pulsesink_class_init (GstPulseSinkClass * klass)
"Human-readable name of the sound device", DEFAULT_DEVICE_NAME,
G_PARAM_READABLE | G_PARAM_STATIC_STRINGS));
#ifdef HAVE_PULSE_0_9_12
g_object_class_install_property (gobject_class,
PROP_VOLUME,
g_param_spec_double ("volume", "Volume",
@ -1866,7 +1734,6 @@ gst_pulsesink_class_init (GstPulseSinkClass * klass)
g_param_spec_boolean ("mute", "Mute",
"Mute state of this stream", DEFAULT_MUTE,
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
#endif
/**
* GstPulseSink:client
@ -1970,15 +1837,9 @@ gst_pulsesink_init (GstPulseSink * pulsesink)
pulsesink->notify = 0;
/* needed for conditional execution */
pulsesink->pa_version = pa_get_library_version ();
pulsesink->properties = NULL;
pulsesink->proplist = NULL;
GST_DEBUG_OBJECT (pulsesink, "using pulseaudio version %s",
pulsesink->pa_version);
/* override with a custom clock */
if (GST_BASE_AUDIO_SINK (pulsesink)->provided_clock)
gst_object_unref (GST_BASE_AUDIO_SINK (pulsesink)->provided_clock);
@ -2016,7 +1877,6 @@ gst_pulsesink_finalize (GObject * object)
G_OBJECT_CLASS (parent_class)->finalize (object);
}
#ifdef HAVE_PULSE_0_9_12
static void
gst_pulsesink_set_volume (GstPulseSink * psink, gdouble volume)
{
@ -2315,7 +2175,6 @@ info_failed:
goto unlock;
}
}
#endif
static void
gst_pulsesink_sink_info_cb (pa_context * c, const pa_sink_info * i, int eol,
@ -2408,14 +2267,12 @@ gst_pulsesink_set_property (GObject * object,
g_free (pulsesink->device);
pulsesink->device = g_value_dup_string (value);
break;
#ifdef HAVE_PULSE_0_9_12
case PROP_VOLUME:
gst_pulsesink_set_volume (pulsesink, g_value_get_double (value));
break;
case PROP_MUTE:
gst_pulsesink_set_mute (pulsesink, g_value_get_boolean (value));
break;
#endif
case PROP_CLIENT:
g_free (pulsesink->client_name);
if (!g_value_get_string (value)) {
@ -2457,14 +2314,12 @@ gst_pulsesink_get_property (GObject * object,
case PROP_DEVICE_NAME:
g_value_take_string (value, gst_pulsesink_device_description (pulsesink));
break;
#ifdef HAVE_PULSE_0_9_12
case PROP_VOLUME:
g_value_set_double (value, gst_pulsesink_get_volume (pulsesink));
break;
case PROP_MUTE:
g_value_set_boolean (value, gst_pulsesink_get_mute (pulsesink));
break;
#endif
case PROP_CLIENT:
g_value_set_string (value, pulsesink->client_name);
break;
@ -2520,7 +2375,6 @@ name_failed:
}
}
#ifdef HAVE_PULSE_0_9_11
static void
gst_pulsesink_change_props (GstPulseSink * psink, GstTagList * l)
{
@ -2598,7 +2452,6 @@ update_failed:
goto unlock;
}
}
#endif
static void
gst_pulsesink_flush_ringbuffer (GstPulseSink * psink)
@ -2674,9 +2527,7 @@ gst_pulsesink_event (GstBaseSink * sink, GstEvent * event)
g_free (description);
g_free (buf);
#ifdef HAVE_PULSE_0_9_11
gst_pulsesink_change_props (pulsesink, l);
#endif
break;
}

View file

@ -271,13 +271,7 @@ gst_pulsesrc_init (GstPulseSrc * pulsesrc)
pulsesrc->read_buffer = NULL;
pulsesrc->read_buffer_length = 0;
#ifdef HAVE_PULSE_0_9_13
pa_sample_spec_init (&pulsesrc->sample_spec);
#else
pulsesrc->sample_spec.format = PA_SAMPLE_INVALID;
pulsesrc->sample_spec.rate = 0;
pulsesrc->sample_spec.channels = 0;
#endif
pulsesrc->operation_success = FALSE;
pulsesrc->paused = FALSE;
@ -570,11 +564,7 @@ gst_pulsesrc_stream_latency_update_cb (pa_stream * s, void *userdata)
"latency update (information unknown)");
return;
}
#ifdef HAVE_PULSE_0_9_11
source_usec = info->configured_source_usec;
#else
source_usec = 0;
#endif
GST_LOG_OBJECT (GST_PULSESRC_CAST (userdata),
"latency_update, %" G_GUINT64_FORMAT ", %d:%" G_GINT64_FORMAT ", %d:%"
@ -1014,11 +1004,8 @@ gst_pulsesrc_prepare (GstAudioSrc * asrc, GstRingBufferSpec * spec)
GST_INFO_OBJECT (pulsesrc, "fragsize: %d", wanted.fragsize);
if (pa_stream_connect_record (pulsesrc->stream, pulsesrc->device, &wanted,
PA_STREAM_INTERPOLATE_TIMING |
PA_STREAM_AUTO_TIMING_UPDATE | PA_STREAM_NOT_MONOTONOUS |
#ifdef HAVE_PULSE_0_9_11
PA_STREAM_ADJUST_LATENCY |
#endif
PA_STREAM_INTERPOLATE_TIMING | PA_STREAM_AUTO_TIMING_UPDATE |
PA_STREAM_NOT_MONOTONIC | PA_STREAM_ADJUST_LATENCY |
PA_STREAM_START_CORKED) < 0) {
GST_ELEMENT_ERROR (pulsesrc, RESOURCE, FAILED,
("Failed to connect stream: %s",

View file

@ -98,7 +98,6 @@ gst_pulse_fill_sample_spec (GstRingBufferSpec * spec, pa_sample_spec * ss)
ss->format = PA_SAMPLE_S32LE;
else if (spec->format == GST_S32_BE && spec->width == 32)
ss->format = PA_SAMPLE_S32BE;
#ifdef HAVE_PULSE_0_9_15
else if (spec->format == GST_S24_3LE && spec->width == 24)
ss->format = PA_SAMPLE_S24LE;
else if (spec->format == GST_S24_3BE && spec->width == 24)
@ -107,7 +106,6 @@ gst_pulse_fill_sample_spec (GstRingBufferSpec * spec, pa_sample_spec * ss)
ss->format = PA_SAMPLE_S24_32LE;
else if (spec->format == GST_S24_BE && spec->width == 32)
ss->format = PA_SAMPLE_S24_32BE;
#endif
else
return FALSE;

View file

@ -41,22 +41,4 @@ void gst_pulse_cvolume_from_linear (pa_cvolume *v, unsigned channels, gdouble vo
pa_proplist *gst_pulse_make_proplist (const GstStructure *properties);
#if !HAVE_PULSE_0_9_11
static inline int PA_CONTEXT_IS_GOOD(pa_context_state_t x) {
return
x == PA_CONTEXT_CONNECTING ||
x == PA_CONTEXT_AUTHORIZING ||
x == PA_CONTEXT_SETTING_NAME ||
x == PA_CONTEXT_READY;
}
/** Return non-zero if the passed state is one of the connected states */
static inline int PA_STREAM_IS_GOOD(pa_stream_state_t x) {
return
x == PA_STREAM_CREATING ||
x == PA_STREAM_READY;
}
#endif
#endif

View file

@ -113,6 +113,7 @@ gst_1394_clock_get_internal_time (GstClock * clock)
_1394clock = GST_1394_CLOCK_CAST (clock);
if (_1394clock->handle != NULL) {
GST_OBJECT_LOCK (clock);
raw1394_read_cycle_timer (_1394clock->handle, &cycle_timer, &local_time);
if (cycle_timer < _1394clock->cycle_timer_lo) {
@ -130,6 +131,7 @@ gst_1394_clock_get_internal_time (GstClock * clock)
result += (((cycle_timer >> 12) & 0x1fff) * 125) * GST_USECOND;
GST_LOG_OBJECT (clock, "result %" GST_TIME_FORMAT, GST_TIME_ARGS (result));
GST_OBJECT_UNLOCK (clock);
} else {
result = GST_CLOCK_TIME_NONE;
}

View file

@ -605,7 +605,8 @@ gst_aac_parse_check_valid_frame (GstBaseParse * parse,
} else {
GST_DEBUG ("buffer didn't contain valid frame");
gst_base_parse_set_min_frame_size (GST_BASE_PARSE (aacparse), 1024);
gst_base_parse_set_min_frame_size (GST_BASE_PARSE (aacparse),
ADTS_MAX_SIZE);
}
gst_buffer_unmap (buffer, data, size);
@ -700,7 +701,7 @@ gst_aac_parse_start (GstBaseParse * parse)
aacparse = GST_AAC_PARSE (parse);
GST_DEBUG ("start");
gst_base_parse_set_min_frame_size (GST_BASE_PARSE (aacparse), 1024);
gst_base_parse_set_min_frame_size (GST_BASE_PARSE (aacparse), ADTS_MAX_SIZE);
return TRUE;
}

View file

@ -675,7 +675,8 @@ gst_flv_demux_audio_negotiate (GstFlvDemux * demux, guint32 codec_tag,
}
}
caps = gst_caps_new_simple ("audio/mpeg",
"mpegversion", G_TYPE_INT, 4, "framed", G_TYPE_BOOLEAN, TRUE, NULL);
"mpegversion", G_TYPE_INT, 4, "framed", G_TYPE_BOOLEAN, TRUE,
"stream-format", G_TYPE_STRING, "raw", NULL);
break;
}
case 7:

View file

@ -274,11 +274,6 @@ gst_flv_mux_handle_sink_event (GstPad * pad, GstEvent * event)
mux->new_tags = TRUE;
break;
}
case GST_EVENT_NEWSEGMENT:
/* We don't support NEWSEGMENT events */
ret = FALSE;
gst_event_unref (event);
break;
default:
break;
}

View file

@ -617,6 +617,8 @@ gst_qt_mux_add_mp4_date (GstQTMux * qtmux, const GstTagList * list,
month = g_date_get_month (date);
day = g_date_get_day (date);
g_date_free (date);
if (year == G_DATE_BAD_YEAR && month == G_DATE_BAD_MONTH &&
day == G_DATE_BAD_DAY) {
GST_WARNING_OBJECT (qtmux, "invalid date in tag");

View file

@ -131,7 +131,6 @@ gst_ebml_peek_id_length (guint32 * _id, guint64 * _length, guint * _needed,
*_length = G_MAXUINT64;
else
*_length = total;
*_length = total;
*_needed = needed;

View file

@ -1608,6 +1608,10 @@ gst_matroska_demux_search_cluster (GstMatroskaDemux * demux, gint64 * pos)
GstByteReader reader;
gint cluster_pos;
if (buf != NULL) {
gst_buffer_unref (buf);
buf = NULL;
}
ret = gst_pad_pull_range (demux->common.sinkpad, newpos, chunk, &buf);
if (ret != GST_FLOW_OK)
break;
@ -1636,13 +1640,15 @@ gst_matroska_demux_search_cluster (GstMatroskaDemux * demux, gint64 * pos)
demux->common.offset = newpos;
ret = gst_matroska_read_common_peek_id_length_pull (&demux->common,
GST_ELEMENT_CAST (demux), &id, &length, &needed);
if (ret != GST_FLOW_OK)
goto resume;
if (ret != GST_FLOW_OK) {
GST_DEBUG_OBJECT (demux, "need more data -> continue");
continue;
}
g_assert (id == GST_MATROSKA_ID_CLUSTER);
GST_DEBUG_OBJECT (demux, "cluster size %" G_GUINT64_FORMAT ", prefix %d",
length, needed);
/* ok if undefined length or first cluster */
if (length == G_MAXUINT64) {
if (length == GST_EBML_SIZE_UNKNOWN || length == G_MAXUINT64) {
GST_DEBUG_OBJECT (demux, "cluster has undefined length -> OK");
break;
}
@ -1661,8 +1667,6 @@ gst_matroska_demux_search_cluster (GstMatroskaDemux * demux, gint64 * pos)
} else {
/* partial cluster id may have been in tail of buffer */
newpos += MAX (gst_byte_reader_get_remaining (&reader), 4) - 3;
gst_buffer_unref (buf);
buf = NULL;
}
}
@ -1716,6 +1720,10 @@ gst_matroska_demux_search_pos (GstMatroskaDemux * demux, GstClockTime time)
otime = demux->common.segment.last_stop;
GST_OBJECT_UNLOCK (demux);
/* avoid division by zero in first estimation below */
if (otime == 0)
otime = time;
retry:
GST_LOG_OBJECT (demux,
"opos: %" G_GUINT64_FORMAT ", otime: %" GST_TIME_FORMAT, opos,

View file

@ -2527,8 +2527,10 @@ gst_matroska_parse_output (GstMatroskaParse * parse, GstBuffer * buffer,
s = gst_caps_get_structure (caps, 0);
g_value_init (&streamheader, GST_TYPE_ARRAY);
g_value_init (&bufval, GST_TYPE_BUFFER);
GST_BUFFER_FLAG_SET (parse->streamheader, GST_BUFFER_FLAG_IN_CAPS);
gst_value_set_buffer (&bufval, parse->streamheader);
buf = gst_buffer_copy (parse->streamheader);
GST_BUFFER_FLAG_SET (buf, GST_BUFFER_FLAG_IN_CAPS);
gst_value_set_buffer (&bufval, buf);
gst_buffer_unref (buf);
gst_value_array_append_value (&streamheader, &bufval);
g_value_unset (&bufval);
gst_structure_set_value (s, "streamheader", &streamheader);
@ -2536,7 +2538,7 @@ gst_matroska_parse_output (GstMatroskaParse * parse, GstBuffer * buffer,
//gst_caps_replace (parse->caps, caps);
gst_pad_set_caps (parse->srcpad, caps);
buf = gst_buffer_make_metadata_writable (parse->streamheader);
buf = gst_buffer_copy (parse->streamheader);
gst_buffer_set_caps (buf, caps);
gst_caps_unref (caps);

View file

@ -427,6 +427,7 @@ gst_multipart_mux_collected (GstCollectPads * pads, GstMultipartMux * mux)
gchar *header = NULL;
size_t headerlen;
GstBuffer *headerbuf = NULL;
GstBuffer *footerbuf = NULL;
GstBuffer *databuf = NULL;
GstStructure *structure = NULL;
const gchar *mime;
@ -484,7 +485,7 @@ gst_multipart_mux_collected (GstCollectPads * pads, GstMultipartMux * mux)
/* get the mime type for the structure */
mime = gst_multipart_mux_get_mime (mux, structure);
header = g_strdup_printf ("\r\n--%s\r\nContent-Type: %s\r\n"
header = g_strdup_printf ("--%s\r\nContent-Type: %s\r\n"
"Content-Length: %u\r\n\r\n",
mux->boundary, mime, GST_BUFFER_SIZE (best->buffer));
headerlen = strlen (header);
@ -529,6 +530,29 @@ gst_multipart_mux_collected (GstCollectPads * pads, GstMultipartMux * mux)
GST_DEBUG_OBJECT (mux, "pushing %u bytes data buffer",
GST_BUFFER_SIZE (databuf));
ret = gst_pad_push (mux->srcpad, databuf);
if (ret != GST_FLOW_OK)
/* push always takes ownership of the buffer, even after an error, so we
* don't need to unref headerbuf here. */
goto beach;
ret = gst_pad_alloc_buffer_and_set_caps (mux->srcpad, GST_BUFFER_OFFSET_NONE,
2, GST_PAD_CAPS (mux->srcpad), &footerbuf);
if (ret != GST_FLOW_OK)
goto alloc_failed;
memcpy (GST_BUFFER_DATA (footerbuf), "\r\n", 2);
/* the footer has the same timestamp as the data buffer and has a
* duration of 0 */
GST_BUFFER_TIMESTAMP (footerbuf) = best->timestamp;
GST_BUFFER_DURATION (footerbuf) = 0;
GST_BUFFER_OFFSET (footerbuf) = mux->offset;
mux->offset += 2;
GST_BUFFER_OFFSET_END (footerbuf) = mux->offset;
GST_BUFFER_FLAG_SET (footerbuf, GST_BUFFER_FLAG_DELTA_UNIT);
GST_DEBUG_OBJECT (mux, "pushing %" G_GSIZE_FORMAT " bytes footer buffer", 2);
ret = gst_pad_push (mux->srcpad, footerbuf);
beach:
if (best && best->buffer) {

View file

@ -699,7 +699,7 @@ rtp_jitter_buffer_pop (RTPJitterBuffer * jbuf, gint * percent)
{
GstBuffer *buf;
g_return_val_if_fail (jbuf != NULL, FALSE);
g_return_val_if_fail (jbuf != NULL, NULL);
buf = g_queue_pop_tail (jbuf->packets);
@ -727,7 +727,7 @@ rtp_jitter_buffer_peek (RTPJitterBuffer * jbuf)
{
GstBuffer *buf;
g_return_val_if_fail (jbuf != NULL, FALSE);
g_return_val_if_fail (jbuf != NULL, NULL);
buf = g_queue_peek_tail (jbuf->packets);