mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-18 07:47:17 +00:00
Merge branch 'master' into 0.11
Conflicts: ext/wavpack/gstwavpackparse.c sys/v4l2/gstv4l2bufferpool.c sys/v4l2/gstv4l2bufferpool.h sys/v4l2/gstv4l2videooverlay.c
This commit is contained in:
commit
26dd999b68
13 changed files with 40 additions and 70 deletions
|
@ -52,16 +52,14 @@ gst_jack_transport_get_type (void)
|
|||
static volatile gsize type = 0;
|
||||
|
||||
if (g_once_init_enter (&type)) {
|
||||
static const GEnumValue enum_values[] = {
|
||||
{GST_JACK_TRANSPORT_AUTONOMOUS,
|
||||
"No transport support", "autonomous"},
|
||||
static const GFlagsValue flag_values[] = {
|
||||
{GST_JACK_TRANSPORT_MASTER,
|
||||
"Start and stop transport with state changes", "master"},
|
||||
{GST_JACK_TRANSPORT_SLAVE,
|
||||
"Follow transport state changes", "slave"},
|
||||
{0, NULL, NULL},
|
||||
};
|
||||
GType tmp = g_enum_register_static ("GstJackTransport", enum_values);
|
||||
GType tmp = g_flags_register_static ("GstJackTransport", flag_values);
|
||||
g_once_init_leave (&type, tmp);
|
||||
}
|
||||
return (GType) type;
|
||||
|
|
|
@ -53,9 +53,9 @@ typedef enum {
|
|||
* client behaviour regarding to the transport mechanism.
|
||||
*/
|
||||
typedef enum {
|
||||
GST_JACK_TRANSPORT_AUTONOMOUS,
|
||||
GST_JACK_TRANSPORT_MASTER,
|
||||
GST_JACK_TRANSPORT_SLAVE
|
||||
GST_JACK_TRANSPORT_AUTONOMOUS = 0,
|
||||
GST_JACK_TRANSPORT_MASTER = (1 << 0),
|
||||
GST_JACK_TRANSPORT_SLAVE = (1 << 1),
|
||||
} GstJackTransport;
|
||||
|
||||
typedef jack_default_audio_sample_t sample_t;
|
||||
|
|
|
@ -88,10 +88,10 @@ static gboolean
|
|||
jack_handle_transport_change (GstJackAudioClient * client, GstState state)
|
||||
{
|
||||
GstObject *obj = GST_OBJECT_PARENT (client->user_data);
|
||||
GstJackTransport mode;
|
||||
guint mode;
|
||||
|
||||
g_object_get (obj, "transport", &mode, NULL);
|
||||
if ((mode == GST_JACK_TRANSPORT_SLAVE) && (GST_STATE (obj) != state)) {
|
||||
if ((mode & GST_JACK_TRANSPORT_SLAVE) && (GST_STATE (obj) != state)) {
|
||||
GST_INFO_OBJECT (obj, "requesting state change: %s",
|
||||
gst_element_state_get_name (state));
|
||||
gst_element_post_message (GST_ELEMENT (obj),
|
||||
|
|
|
@ -564,7 +564,7 @@ gst_jack_ring_buffer_start (GstAudioRingBuffer * buf)
|
|||
|
||||
GST_DEBUG_OBJECT (sink, "start");
|
||||
|
||||
if (sink->transport == GST_JACK_TRANSPORT_MASTER) {
|
||||
if (sink->transport & GST_JACK_TRANSPORT_MASTER) {
|
||||
jack_client_t *client;
|
||||
|
||||
client = gst_jack_audio_client_get_client (sink->client);
|
||||
|
@ -583,7 +583,7 @@ gst_jack_ring_buffer_pause (GstAudioRingBuffer * buf)
|
|||
|
||||
GST_DEBUG_OBJECT (sink, "pause");
|
||||
|
||||
if (sink->transport == GST_JACK_TRANSPORT_MASTER) {
|
||||
if (sink->transport & GST_JACK_TRANSPORT_MASTER) {
|
||||
jack_client_t *client;
|
||||
|
||||
client = gst_jack_audio_client_get_client (sink->client);
|
||||
|
@ -602,7 +602,7 @@ gst_jack_ring_buffer_stop (GstAudioRingBuffer * buf)
|
|||
|
||||
GST_DEBUG_OBJECT (sink, "stop");
|
||||
|
||||
if (sink->transport == GST_JACK_TRANSPORT_MASTER) {
|
||||
if (sink->transport & GST_JACK_TRANSPORT_MASTER) {
|
||||
jack_client_t *client;
|
||||
|
||||
client = gst_jack_audio_client_get_client (sink->client);
|
||||
|
@ -761,7 +761,7 @@ gst_jack_audio_sink_class_init (GstJackAudioSinkClass * klass)
|
|||
* Since: 0.10.31
|
||||
*/
|
||||
g_object_class_install_property (gobject_class, PROP_TRANSPORT,
|
||||
g_param_spec_enum ("transport", "Transport mode",
|
||||
g_param_spec_flags ("transport", "Transport mode",
|
||||
"Jack transport behaviour of the client",
|
||||
GST_TYPE_JACK_TRANSPORT, DEFAULT_PROP_TRANSPORT,
|
||||
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
|
||||
|
@ -840,7 +840,7 @@ gst_jack_audio_sink_set_property (GObject * object, guint prop_id,
|
|||
}
|
||||
break;
|
||||
case PROP_TRANSPORT:
|
||||
sink->transport = g_value_get_enum (value);
|
||||
sink->transport = g_value_get_flags (value);
|
||||
break;
|
||||
default:
|
||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
||||
|
@ -870,7 +870,7 @@ gst_jack_audio_sink_get_property (GObject * object, guint prop_id,
|
|||
g_value_set_boxed (value, sink->jclient);
|
||||
break;
|
||||
case PROP_TRANSPORT:
|
||||
g_value_set_enum (value, sink->transport);
|
||||
g_value_set_flags (value, sink->transport);
|
||||
break;
|
||||
default:
|
||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
||||
|
|
|
@ -59,7 +59,7 @@ struct _GstJackAudioSink {
|
|||
gchar *server;
|
||||
jack_client_t *jclient;
|
||||
gchar *client_name;
|
||||
GstJackTransport transport;
|
||||
guint transport;
|
||||
|
||||
/* our client */
|
||||
GstJackAudioClient *client;
|
||||
|
|
|
@ -576,7 +576,7 @@ gst_jack_ring_buffer_start (GstAudioRingBuffer * buf)
|
|||
|
||||
GST_DEBUG_OBJECT (src, "start");
|
||||
|
||||
if (src->transport == GST_JACK_TRANSPORT_MASTER) {
|
||||
if (src->transport & GST_JACK_TRANSPORT_MASTER) {
|
||||
jack_client_t *client;
|
||||
|
||||
client = gst_jack_audio_client_get_client (src->client);
|
||||
|
@ -595,7 +595,7 @@ gst_jack_ring_buffer_pause (GstAudioRingBuffer * buf)
|
|||
|
||||
GST_DEBUG_OBJECT (src, "pause");
|
||||
|
||||
if (src->transport == GST_JACK_TRANSPORT_MASTER) {
|
||||
if (src->transport & GST_JACK_TRANSPORT_MASTER) {
|
||||
jack_client_t *client;
|
||||
|
||||
client = gst_jack_audio_client_get_client (src->client);
|
||||
|
@ -614,7 +614,7 @@ gst_jack_ring_buffer_stop (GstAudioRingBuffer * buf)
|
|||
|
||||
GST_DEBUG_OBJECT (src, "stop");
|
||||
|
||||
if (src->transport == GST_JACK_TRANSPORT_MASTER) {
|
||||
if (src->transport & GST_JACK_TRANSPORT_MASTER) {
|
||||
jack_client_t *client;
|
||||
|
||||
client = gst_jack_audio_client_get_client (src->client);
|
||||
|
@ -782,7 +782,7 @@ gst_jack_audio_src_class_init (GstJackAudioSrcClass * klass)
|
|||
* Since: 0.10.31
|
||||
*/
|
||||
g_object_class_install_property (gobject_class, PROP_TRANSPORT,
|
||||
g_param_spec_enum ("transport", "Transport mode",
|
||||
g_param_spec_flags ("transport", "Transport mode",
|
||||
"Jack transport behaviour of the client",
|
||||
GST_TYPE_JACK_TRANSPORT, DEFAULT_PROP_TRANSPORT,
|
||||
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
|
||||
|
@ -859,7 +859,7 @@ gst_jack_audio_src_set_property (GObject * object, guint prop_id,
|
|||
}
|
||||
break;
|
||||
case PROP_TRANSPORT:
|
||||
src->transport = g_value_get_enum (value);
|
||||
src->transport = g_value_get_flags (value);
|
||||
break;
|
||||
default:
|
||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
||||
|
@ -887,7 +887,7 @@ gst_jack_audio_src_get_property (GObject * object, guint prop_id,
|
|||
g_value_set_boxed (value, src->jclient);
|
||||
break;
|
||||
case PROP_TRANSPORT:
|
||||
g_value_set_enum (value, src->transport);
|
||||
g_value_set_flags (value, src->transport);
|
||||
break;
|
||||
default:
|
||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
||||
|
|
|
@ -72,11 +72,11 @@ struct _GstJackAudioSrc
|
|||
GstCaps *caps;
|
||||
|
||||
/* properties */
|
||||
GstJackConnect connect;
|
||||
GstJackConnect connect;
|
||||
gchar *server;
|
||||
jack_client_t *jclient;
|
||||
gchar *client_name;
|
||||
GstJackTransport transport;
|
||||
guint transport;
|
||||
|
||||
/* our client */
|
||||
GstJackAudioClient *client;
|
||||
|
|
|
@ -171,6 +171,8 @@ gst_wavpack_dec_start (GstAudioDecoder * dec)
|
|||
gst_audio_decoder_set_max_errors (dec, 16);
|
||||
/* don't bother us with flushing */
|
||||
gst_audio_decoder_set_drainable (dec, FALSE);
|
||||
/* aim for some perfect timestamping */
|
||||
gst_audio_decoder_set_tolerance (dec, 10 * GST_MSECOND);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
@ -396,14 +398,14 @@ gst_wavpack_dec_handle_frame (GstAudioDecoder * bdec, GstBuffer * buf)
|
|||
if (width == 8) {
|
||||
gint8 *outbuffer = (gint8 *) out_data;
|
||||
|
||||
for (i = 0; i < max; i--) {
|
||||
for (i = 0; i < max; i++) {
|
||||
*outbuffer++ = (gint8) (dec_data[i]);
|
||||
}
|
||||
} else if (width == 16) {
|
||||
gint16 *outbuffer = (gint16 *) out_data;
|
||||
|
||||
for (i = 0; i < max; i++) {
|
||||
*outbuffer++ = (gint8) (dec_data[i]);
|
||||
*outbuffer++ = (gint16) (dec_data[i]);
|
||||
}
|
||||
} else if (dec->width == 32) {
|
||||
gint32 *outbuffer = (gint32 *) out_data;
|
||||
|
|
|
@ -619,6 +619,13 @@ gst_wavpack_enc_push_block (void *id, void *data, int32_t count)
|
|||
}
|
||||
}
|
||||
samples = wph.block_samples;
|
||||
|
||||
/* decorate buffer */
|
||||
/* NOTE: this will get overwritten by baseclass, but stay for those
|
||||
* that are pushed directly
|
||||
* FIXME: add setting to baseclass to avoid overwriting it ?? */
|
||||
GST_BUFFER_OFFSET (buffer) = wph.block_index;
|
||||
GST_BUFFER_OFFSET_END (buffer) = wph.block_index + wph.block_samples;
|
||||
} else {
|
||||
/* if it's something else set no timestamp and duration on the buffer */
|
||||
GST_DEBUG_OBJECT (enc, "got %d bytes of unknown data", count);
|
||||
|
|
|
@ -142,7 +142,6 @@ static void
|
|||
gst_wavpack_parse_class_init (GstWavpackParseClass * klass)
|
||||
{
|
||||
GObjectClass *gobject_class;
|
||||
|
||||
GstElementClass *gstelement_class;
|
||||
|
||||
gobject_class = (GObjectClass *) klass;
|
||||
|
@ -166,7 +165,6 @@ gst_wavpack_parse_index_get_entry_from_sample (GstWavpackParse * wvparse,
|
|||
gint64 sample_offset)
|
||||
{
|
||||
gint i;
|
||||
|
||||
GSList *node;
|
||||
|
||||
if (wvparse->entries == NULL)
|
||||
|
@ -287,9 +285,7 @@ static gboolean
|
|||
gst_wavpack_parse_src_query (GstPad * pad, GstQuery * query)
|
||||
{
|
||||
GstWavpackParse *parse = GST_WAVPACK_PARSE (gst_pad_get_parent (pad));
|
||||
|
||||
GstFormat format;
|
||||
|
||||
gboolean ret = FALSE;
|
||||
|
||||
switch (GST_QUERY_TYPE (query)) {
|
||||
|
@ -409,9 +405,7 @@ gst_wavpack_parse_scan_to_find_sample (GstWavpackParse * parse,
|
|||
gint64 sample, gint64 * byte_offset, gint64 * start_sample)
|
||||
{
|
||||
GstWavpackParseIndexEntry *entry;
|
||||
|
||||
GstFlowReturn ret;
|
||||
|
||||
gint64 off = 0;
|
||||
|
||||
/* first, check if we have to scan at all */
|
||||
|
@ -439,7 +433,6 @@ gst_wavpack_parse_scan_to_find_sample (GstWavpackParse * parse,
|
|||
/* now scan forward until we find the chunk we're looking for or hit EOS */
|
||||
do {
|
||||
WavpackHeader header;
|
||||
|
||||
GstBuffer *buf;
|
||||
|
||||
buf = gst_wavpack_parse_pull_buffer (parse, off, sizeof (WavpackHeader),
|
||||
|
@ -479,13 +472,9 @@ gst_wavpack_parse_send_newsegment (GstWavpackParse * wvparse, gboolean update)
|
|||
GstSegment *s = &wvparse->segment;
|
||||
|
||||
gboolean ret;
|
||||
|
||||
gint64 stop_time = -1;
|
||||
|
||||
gint64 start_time = 0;
|
||||
|
||||
gint64 cur_pos_time;
|
||||
|
||||
gint64 diff;
|
||||
|
||||
/* segment is in DEFAULT format, but we want to send a TIME newsegment */
|
||||
|
@ -522,31 +511,18 @@ gst_wavpack_parse_handle_seek_event (GstWavpackParse * wvparse,
|
|||
GstEvent * event)
|
||||
{
|
||||
GstSeekFlags seek_flags;
|
||||
|
||||
GstSeekType start_type;
|
||||
|
||||
GstSeekType stop_type;
|
||||
|
||||
GstSegment segment;
|
||||
|
||||
GstFormat format;
|
||||
|
||||
gboolean only_update;
|
||||
|
||||
gboolean flush, ret;
|
||||
|
||||
gdouble speed;
|
||||
|
||||
gint64 stop;
|
||||
|
||||
gint64 start; /* sample we want to seek to */
|
||||
|
||||
gint64 byte_offset; /* byte offset the chunk we seek to starts at */
|
||||
|
||||
gint64 chunk_start; /* first sample in chunk we seek to */
|
||||
|
||||
guint rate;
|
||||
|
||||
gint64 last_stop;
|
||||
|
||||
if (wvparse->adapter) {
|
||||
|
@ -672,7 +648,6 @@ static gboolean
|
|||
gst_wavpack_parse_sink_event (GstPad * pad, GstEvent * event)
|
||||
{
|
||||
GstWavpackParse *parse;
|
||||
|
||||
gboolean ret = TRUE;
|
||||
|
||||
parse = GST_WAVPACK_PARSE (gst_pad_get_parent (pad));
|
||||
|
@ -731,7 +706,6 @@ static gboolean
|
|||
gst_wavpack_parse_src_event (GstPad * pad, GstEvent * event)
|
||||
{
|
||||
GstWavpackParse *parse;
|
||||
|
||||
gboolean ret;
|
||||
|
||||
parse = GST_WAVPACK_PARSE (gst_pad_get_parent (pad));
|
||||
|
@ -753,7 +727,6 @@ static void
|
|||
gst_wavpack_parse_init (GstWavpackParse * parse, GstWavpackParseClass * gclass)
|
||||
{
|
||||
GstElementClass *klass = GST_ELEMENT_GET_CLASS (parse);
|
||||
|
||||
GstPadTemplate *tmpl;
|
||||
|
||||
tmpl = gst_element_class_get_pad_template (klass, "sink");
|
||||
|
@ -778,7 +751,6 @@ static gint64
|
|||
gst_wavpack_parse_get_upstream_length (GstWavpackParse * parse)
|
||||
{
|
||||
gint64 length = -1;
|
||||
|
||||
GstFormat format = GST_FORMAT_BYTES;
|
||||
|
||||
if (!gst_pad_query_peer_duration (parse->sinkpad, &format, &length)) {
|
||||
|
@ -794,7 +766,6 @@ gst_wavpack_parse_pull_buffer (GstWavpackParse * wvparse, gint64 offset,
|
|||
guint size, GstFlowReturn * flow)
|
||||
{
|
||||
GstFlowReturn flow_ret;
|
||||
|
||||
GstBuffer *buf = NULL;
|
||||
|
||||
if (offset + size > wvparse->upstream_length) {
|
||||
|
@ -835,9 +806,7 @@ gst_wavpack_parse_create_src_pad (GstWavpackParse * wvparse, GstBuffer * buf,
|
|||
WavpackHeader * header)
|
||||
{
|
||||
GstWavpackMetadata meta;
|
||||
|
||||
GstCaps *caps = NULL;
|
||||
|
||||
guchar *bufptr;
|
||||
|
||||
g_assert (wvparse->srcpad == NULL);
|
||||
|
@ -952,8 +921,8 @@ gst_wavpack_parse_push_buffer (GstWavpackParse * wvparse, GstBuffer * buf,
|
|||
WavpackHeader * header)
|
||||
{
|
||||
GstFlowReturn ret;
|
||||
wvparse->current_offset += header->ckSize + 8;
|
||||
|
||||
wvparse->current_offset += header->ckSize + 8;
|
||||
wvparse->segment.last_stop = header->block_index;
|
||||
|
||||
if (wvparse->need_newsegment) {
|
||||
|
@ -1019,8 +988,7 @@ gst_wavpack_parse_push_buffer (GstWavpackParse * wvparse, GstBuffer * buf,
|
|||
static guint8 *
|
||||
gst_wavpack_parse_find_marker (guint8 * buf, guint size)
|
||||
{
|
||||
int i;
|
||||
|
||||
gint i;
|
||||
guint8 *ret = NULL;
|
||||
|
||||
if (G_UNLIKELY (size < 4))
|
||||
|
@ -1039,7 +1007,6 @@ static GstFlowReturn
|
|||
gst_wavpack_parse_resync_loop (GstWavpackParse * parse, WavpackHeader * header)
|
||||
{
|
||||
GstFlowReturn flow_ret = GST_FLOW_EOS;
|
||||
|
||||
GstBuffer *buf = NULL;
|
||||
|
||||
/* loop until we have a frame header or reach the end of the stream */
|
||||
|
@ -1106,7 +1073,6 @@ static void
|
|||
gst_wavpack_parse_loop (GstElement * element)
|
||||
{
|
||||
GstWavpackParse *parse = GST_WAVPACK_PARSE (element);
|
||||
|
||||
GstFlowReturn flow_ret;
|
||||
WavpackHeader header = { {0,}, 0, };
|
||||
GstBuffer *buf = NULL;
|
||||
|
@ -1180,7 +1146,6 @@ static gboolean
|
|||
gst_wavpack_parse_resync_adapter (GstAdapter * adapter)
|
||||
{
|
||||
const guint8 *buf, *marker;
|
||||
|
||||
guint avail = gst_adapter_available (adapter);
|
||||
|
||||
if (avail < 4)
|
||||
|
@ -1212,11 +1177,8 @@ static GstFlowReturn
|
|||
gst_wavpack_parse_chain (GstPad * pad, GstBuffer * buf)
|
||||
{
|
||||
GstWavpackParse *wvparse = GST_WAVPACK_PARSE (GST_PAD_PARENT (pad));
|
||||
|
||||
GstFlowReturn ret = GST_FLOW_OK;
|
||||
|
||||
WavpackHeader wph;
|
||||
|
||||
const guint8 *tmp_buf;
|
||||
|
||||
if (!wvparse->adapter) {
|
||||
|
@ -1276,7 +1238,6 @@ static GstStateChangeReturn
|
|||
gst_wavpack_parse_change_state (GstElement * element, GstStateChange transition)
|
||||
{
|
||||
GstWavpackParse *wvparse = GST_WAVPACK_PARSE (element);
|
||||
|
||||
GstStateChangeReturn ret = GST_STATE_CHANGE_SUCCESS;
|
||||
|
||||
switch (transition) {
|
||||
|
|
|
@ -399,7 +399,7 @@ gst_wavpack_parse_frame_header (GstWavpackParse * parse, GstBuffer * buf,
|
|||
gint skip, WavpackHeader * _wph)
|
||||
{
|
||||
GstByteReader br = GST_BYTE_READER_INIT_FROM_BUFFER (buf);
|
||||
WavpackHeader wph;
|
||||
WavpackHeader wph = { {0,}, 0, };
|
||||
|
||||
g_return_val_if_fail (GST_BUFFER_SIZE (buf) >= skip + sizeof (WavpackHeader),
|
||||
FALSE);
|
||||
|
|
|
@ -178,7 +178,7 @@ static GstStaticPadTemplate audio_sink_factory =
|
|||
"rate = (int) [ 1000, 96000 ], " "channels = (int) [ 1, 2 ]; "
|
||||
#endif*/
|
||||
"audio/x-ac3, "
|
||||
"rate = (int) [ 1000, 96000 ], " "channels = (int) [ 1, 2 ]; "
|
||||
"rate = (int) [ 1000, 96000 ], " "channels = (int) [ 1, 6 ]; "
|
||||
"audio/x-alaw, "
|
||||
"rate = (int) [ 1000, 48000 ], " "channels = (int) [ 1, 2 ]; "
|
||||
"audio/x-mulaw, "
|
||||
|
|
|
@ -31,6 +31,8 @@
|
|||
#include <X11/extensions/Xv.h>
|
||||
#include <X11/extensions/Xvlib.h>
|
||||
#include <sys/stat.h>
|
||||
/* for XkbKeycodeToKeysym */
|
||||
#include <X11/XKBlib.h>
|
||||
|
||||
#include <gst/interfaces/navigation.h>
|
||||
|
||||
|
@ -323,7 +325,7 @@ event_refresh (gpointer data)
|
|||
case KeyPress:
|
||||
case KeyRelease:
|
||||
g_mutex_lock (&v4l2xv->mutex);
|
||||
keysym = XKeycodeToKeysym (v4l2xv->dpy, e.xkey.keycode, 0);
|
||||
keysym = XkbKeycodeToKeysym (v4l2xv->dpy, e.xkey.keycode, 0, 0);
|
||||
if (keysym != NoSymbol) {
|
||||
key_str = XKeysymToString (keysym);
|
||||
} else {
|
||||
|
|
Loading…
Reference in a new issue