mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-20 08:41:07 +00:00
eqMerge remote-tracking branch 'origin/master' into 0.11
Conflicts: ext/jack/gstjackaudiosink.c ext/jack/gstjackaudiosrc.c gst/matroska/matroska-mux.c gst/matroska/matroska-read-common.c gst/rtpmanager/gstrtpssrcdemux.c
This commit is contained in:
commit
8580dd86c9
13 changed files with 255 additions and 58 deletions
|
@ -92,7 +92,7 @@ CONFIGURE_TARGETS += gst-plugins-good-configure
|
|||
-include $(GST_PLUGINS_GOOD_TOP)/gst/law/Android.mk
|
||||
-include $(GST_PLUGINS_GOOD_TOP)/gst/level/Android.mk
|
||||
-include $(GST_PLUGINS_GOOD_TOP)/gst/matroska/Android.mk
|
||||
-include $(GST_PLUGINS_GOOD_TOP)/gst/multifile/Android.mk
|
||||
#-include $(GST_PLUGINS_GOOD_TOP)/gst/multifile/Android.mk
|
||||
-include $(GST_PLUGINS_GOOD_TOP)/gst/multipart/Android.mk
|
||||
-include $(GST_PLUGINS_GOOD_TOP)/gst/isomp4/Android.mk
|
||||
-include $(GST_PLUGINS_GOOD_TOP)/gst/replaygain/Android.mk
|
||||
|
|
|
@ -1047,7 +1047,9 @@ gst_flac_enc_write_callback (const FLAC__StreamEncoder * encoder,
|
|||
ret = gst_flac_enc_process_stream_headers (flacenc);
|
||||
flacenc->got_headers = TRUE;
|
||||
}
|
||||
} else if (flacenc->got_headers && samples == 0) {
|
||||
}
|
||||
|
||||
if (flacenc->got_headers && samples == 0) {
|
||||
/* header fixup, push downstream directly */
|
||||
GST_DEBUG_OBJECT (flacenc, "Fixing up headers at pos=%" G_GUINT64_FORMAT
|
||||
", size=%u", flacenc->offset, (guint) bytes);
|
||||
|
|
|
@ -46,6 +46,27 @@ gst_jack_connect_get_type (void)
|
|||
return (GType) jack_connect_type;
|
||||
}
|
||||
|
||||
GType
|
||||
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"},
|
||||
{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);
|
||||
g_once_init_leave (&type, tmp);
|
||||
}
|
||||
return (GType) type;
|
||||
}
|
||||
|
||||
|
||||
static gpointer
|
||||
gst_jack_client_copy (gpointer jclient)
|
||||
|
|
|
@ -37,16 +37,31 @@
|
|||
*
|
||||
* Specify how the output ports will be connected.
|
||||
*/
|
||||
|
||||
typedef enum {
|
||||
GST_JACK_CONNECT_NONE,
|
||||
GST_JACK_CONNECT_AUTO,
|
||||
GST_JACK_CONNECT_AUTO_FORCED
|
||||
} GstJackConnect;
|
||||
|
||||
/**
|
||||
* GstJackTransport:
|
||||
* @GST_JACK_TRANSPORT_AUTONOMOUS: no transport support
|
||||
* @GST_JACK_TRANSPORT_MASTER: start and stop transport with state-changes
|
||||
* @GST_JACK_TRANSPORT_SLAVE: follow transport state changes
|
||||
*
|
||||
* The jack transport state allow to sync multiple clients. This enum defines a
|
||||
* client behaviour regarding to the transport mechanism.
|
||||
*/
|
||||
typedef enum {
|
||||
GST_JACK_TRANSPORT_AUTONOMOUS,
|
||||
GST_JACK_TRANSPORT_MASTER,
|
||||
GST_JACK_TRANSPORT_SLAVE
|
||||
} GstJackTransport;
|
||||
|
||||
typedef jack_default_audio_sample_t sample_t;
|
||||
|
||||
#define GST_TYPE_JACK_CONNECT (gst_jack_connect_get_type ())
|
||||
#define GST_TYPE_JACK_TRANSPORT (gst_jack_transport_get_type ())
|
||||
#define GST_TYPE_JACK_CLIENT (gst_jack_client_get_type ())
|
||||
|
||||
#if G_BYTE_ORDER == G_LITTLE_ENDIAN
|
||||
|
@ -57,5 +72,6 @@ typedef jack_default_audio_sample_t sample_t;
|
|||
|
||||
GType gst_jack_client_get_type(void);
|
||||
GType gst_jack_connect_get_type(void);
|
||||
GType gst_jack_transport_get_type(void);
|
||||
|
||||
#endif // _GST_JACK_H_
|
||||
|
|
|
@ -55,6 +55,10 @@ typedef struct
|
|||
gint n_clients;
|
||||
GList *src_clients;
|
||||
GList *sink_clients;
|
||||
|
||||
/* transport state handling */
|
||||
gint cur_ts;
|
||||
GstState transport_state;
|
||||
} GstJackAudioConnection;
|
||||
|
||||
/* an object sharing a jack_client_t connection. */
|
||||
|
@ -66,7 +70,7 @@ struct _GstJackAudioClient
|
|||
gboolean active;
|
||||
gboolean deactivate;
|
||||
|
||||
void (*shutdown) (void *arg);
|
||||
JackShutdownCallback shutdown;
|
||||
JackProcessCallback process;
|
||||
JackBufferSizeCallback buffer_size;
|
||||
JackSampleRateCallback sample_rate;
|
||||
|
@ -87,6 +91,27 @@ jack_process_cb (jack_nframes_t nframes, void *arg)
|
|||
GstJackAudioConnection *conn = (GstJackAudioConnection *) arg;
|
||||
GList *walk;
|
||||
int res = 0;
|
||||
jack_transport_state_t ts = jack_transport_query (conn->client, NULL);
|
||||
|
||||
if (ts != conn->cur_ts) {
|
||||
conn->cur_ts = ts;
|
||||
switch (ts) {
|
||||
case JackTransportStopped:
|
||||
GST_DEBUG ("transport state is 'stopped'");
|
||||
conn->transport_state = GST_STATE_PAUSED;
|
||||
break;
|
||||
case JackTransportStarting:
|
||||
GST_DEBUG ("transport state is 'starting'");
|
||||
conn->transport_state = GST_STATE_READY;
|
||||
break;
|
||||
case JackTransportRolling:
|
||||
GST_DEBUG ("transport state is 'rolling'");
|
||||
conn->transport_state = GST_STATE_PLAYING;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
g_mutex_lock (conn->lock);
|
||||
/* call sources first, then sinks. Sources will either push data into the
|
||||
|
@ -117,7 +142,6 @@ jack_process_cb (jack_nframes_t nframes, void *arg)
|
|||
}
|
||||
}
|
||||
g_mutex_unlock (conn->lock);
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
|
@ -224,6 +248,8 @@ gst_jack_audio_make_connection (const gchar * id, const gchar * server,
|
|||
conn->n_clients = 0;
|
||||
conn->src_clients = NULL;
|
||||
conn->sink_clients = NULL;
|
||||
conn->cur_ts = -1;
|
||||
conn->transport_state = GST_STATE_VOID_PENDING;
|
||||
|
||||
/* set our callbacks */
|
||||
jack_set_process_callback (jclient, jack_process_cb, conn);
|
||||
|
@ -525,3 +551,22 @@ gst_jack_audio_client_set_active (GstJackAudioClient * client, gboolean active)
|
|||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* gst_jack_audio_client_get_transport_state:
|
||||
* @client: a #GstJackAudioClient
|
||||
*
|
||||
* Check the current transport state. The client can use this to request a state
|
||||
* change from the application.
|
||||
*
|
||||
* Returns: the state, %GST_STATE_VOID_PENDING for no change in the transport
|
||||
* state
|
||||
*/
|
||||
GstState
|
||||
gst_jack_audio_client_get_transport_state (GstJackAudioClient * client)
|
||||
{
|
||||
GstState state = client->conn->transport_state;
|
||||
|
||||
client->conn->transport_state = GST_STATE_VOID_PENDING;
|
||||
return state;
|
||||
}
|
||||
|
|
|
@ -54,6 +54,8 @@ jack_client_t * gst_jack_audio_client_get_client (GstJackAudioClient *
|
|||
|
||||
gboolean gst_jack_audio_client_set_active (GstJackAudioClient *client, gboolean active);
|
||||
|
||||
GstState gst_jack_audio_client_get_transport_state (GstJackAudioClient *client);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __GST_JACK_AUDIO_CLIENT_H__ */
|
||||
|
|
|
@ -197,6 +197,18 @@ jack_process_cb (jack_nframes_t nframes, void *arg)
|
|||
|
||||
channels = GST_AUDIO_INFO_CHANNELS (&buf->spec.info);
|
||||
|
||||
/* handle transport state requisitions */
|
||||
if (sink->transport == GST_JACK_TRANSPORT_SLAVE) {
|
||||
GstState state = gst_jack_audio_client_get_transport_state (sink->client);
|
||||
|
||||
if ((state != GST_STATE_VOID_PENDING) && (GST_STATE (sink) != state)) {
|
||||
GST_DEBUG_OBJECT (sink, "requesting state change: %s",
|
||||
gst_element_state_get_name (state));
|
||||
gst_element_post_message (GST_ELEMENT (sink),
|
||||
gst_message_new_request_state (GST_OBJECT (sink), state));
|
||||
}
|
||||
}
|
||||
|
||||
/* get target buffers */
|
||||
for (i = 0; i < channels; i++) {
|
||||
sink->buffers[i] =
|
||||
|
@ -564,6 +576,13 @@ gst_jack_ring_buffer_start (GstAudioRingBuffer * buf)
|
|||
|
||||
GST_DEBUG_OBJECT (sink, "start");
|
||||
|
||||
if (sink->transport == GST_JACK_TRANSPORT_MASTER) {
|
||||
jack_client_t *client;
|
||||
|
||||
client = gst_jack_audio_client_get_client (sink->client);
|
||||
jack_transport_start (client);
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
@ -576,6 +595,13 @@ gst_jack_ring_buffer_pause (GstAudioRingBuffer * buf)
|
|||
|
||||
GST_DEBUG_OBJECT (sink, "pause");
|
||||
|
||||
if (sink->transport == GST_JACK_TRANSPORT_MASTER) {
|
||||
jack_client_t *client;
|
||||
|
||||
client = gst_jack_audio_client_get_client (sink->client);
|
||||
jack_transport_stop (client);
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
@ -588,6 +614,13 @@ gst_jack_ring_buffer_stop (GstAudioRingBuffer * buf)
|
|||
|
||||
GST_DEBUG_OBJECT (sink, "stop");
|
||||
|
||||
if (sink->transport == GST_JACK_TRANSPORT_MASTER) {
|
||||
jack_client_t *client;
|
||||
|
||||
client = gst_jack_audio_client_get_client (sink->client);
|
||||
jack_transport_stop (client);
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
@ -655,6 +688,7 @@ enum
|
|||
#define DEFAULT_PROP_CONNECT GST_JACK_CONNECT_AUTO
|
||||
#define DEFAULT_PROP_SERVER NULL
|
||||
#define DEFAULT_PROP_CLIENT_NAME NULL
|
||||
#define DEFAULT_PROP_TRANSPORT GST_JACK_TRANSPORT_AUTONOMOUS
|
||||
|
||||
enum
|
||||
{
|
||||
|
@ -663,6 +697,7 @@ enum
|
|||
PROP_SERVER,
|
||||
PROP_CLIENT,
|
||||
PROP_CLIENT_NAME,
|
||||
PROP_TRANSPORT,
|
||||
PROP_LAST
|
||||
};
|
||||
|
||||
|
@ -730,6 +765,19 @@ gst_jack_audio_sink_class_init (GstJackAudioSinkClass * klass)
|
|||
GST_PARAM_MUTABLE_READY | G_PARAM_READWRITE |
|
||||
G_PARAM_STATIC_STRINGS));
|
||||
|
||||
/**
|
||||
* GstJackAudioSink:transport
|
||||
*
|
||||
* The jack transport behaviour for the client.
|
||||
*
|
||||
* Since: 0.10.31
|
||||
*/
|
||||
g_object_class_install_property (gobject_class, PROP_TRANSPORT,
|
||||
g_param_spec_enum ("transport", "Transport mode",
|
||||
"Jack transport behaviour of the client",
|
||||
GST_TYPE_JACK_TRANSPORT, DEFAULT_PROP_TRANSPORT,
|
||||
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
|
||||
|
||||
gst_element_class_set_details_simple (gstelement_class, "Audio Sink (Jack)",
|
||||
"Sink/Audio", "Output audio to a JACK server",
|
||||
"Wim Taymans <wim.taymans@gmail.com>");
|
||||
|
@ -757,8 +805,9 @@ gst_jack_audio_sink_init (GstJackAudioSink * sink)
|
|||
sink->jclient = NULL;
|
||||
sink->ports = NULL;
|
||||
sink->port_count = 0;
|
||||
sink->client_name = g_strdup (DEFAULT_PROP_CLIENT_NAME);
|
||||
sink->buffers = NULL;
|
||||
sink->client_name = g_strdup (DEFAULT_PROP_CLIENT_NAME);
|
||||
sink->transport = DEFAULT_PROP_TRANSPORT;
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -802,6 +851,9 @@ gst_jack_audio_sink_set_property (GObject * object, guint prop_id,
|
|||
sink->jclient = g_value_get_boxed (value);
|
||||
}
|
||||
break;
|
||||
case PROP_TRANSPORT:
|
||||
sink->transport = g_value_get_enum (value);
|
||||
break;
|
||||
default:
|
||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
||||
break;
|
||||
|
@ -829,6 +881,9 @@ gst_jack_audio_sink_get_property (GObject * object, guint prop_id,
|
|||
case PROP_CLIENT:
|
||||
g_value_set_boxed (value, sink->jclient);
|
||||
break;
|
||||
case PROP_TRANSPORT:
|
||||
g_value_set_enum (value, sink->transport);
|
||||
break;
|
||||
default:
|
||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
||||
break;
|
||||
|
|
|
@ -59,6 +59,7 @@ struct _GstJackAudioSink {
|
|||
gchar *server;
|
||||
jack_client_t *jclient;
|
||||
gchar *client_name;
|
||||
GstJackTransport transport;
|
||||
|
||||
/* our client */
|
||||
GstJackAudioClient *client;
|
||||
|
|
|
@ -217,6 +217,18 @@ jack_process_cb (jack_nframes_t nframes, void *arg)
|
|||
|
||||
channels = GST_AUDIO_INFO_CHANNELS (&buf->spec.info);
|
||||
|
||||
/* handle transport state requisitions */
|
||||
if (src->transport == GST_JACK_TRANSPORT_SLAVE) {
|
||||
GstState state = gst_jack_audio_client_get_transport_state (src->client);
|
||||
|
||||
if ((state != GST_STATE_VOID_PENDING) && (GST_STATE (src) != state)) {
|
||||
GST_DEBUG_OBJECT (src, "requesting state change: %s",
|
||||
gst_element_state_get_name (state));
|
||||
gst_element_post_message (GST_ELEMENT (src),
|
||||
gst_message_new_request_state (GST_OBJECT (src), state));
|
||||
}
|
||||
}
|
||||
|
||||
/* get input buffers */
|
||||
for (i = 0; i < channels; i++)
|
||||
src->buffers[i] =
|
||||
|
@ -576,6 +588,13 @@ gst_jack_ring_buffer_start (GstAudioRingBuffer * buf)
|
|||
|
||||
GST_DEBUG_OBJECT (src, "start");
|
||||
|
||||
if (src->transport == GST_JACK_TRANSPORT_MASTER) {
|
||||
jack_client_t *client;
|
||||
|
||||
client = gst_jack_audio_client_get_client (src->client);
|
||||
jack_transport_start (client);
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
@ -588,6 +607,13 @@ gst_jack_ring_buffer_pause (GstAudioRingBuffer * buf)
|
|||
|
||||
GST_DEBUG_OBJECT (src, "pause");
|
||||
|
||||
if (src->transport == GST_JACK_TRANSPORT_MASTER) {
|
||||
jack_client_t *client;
|
||||
|
||||
client = gst_jack_audio_client_get_client (src->client);
|
||||
jack_transport_stop (client);
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
@ -600,6 +626,13 @@ gst_jack_ring_buffer_stop (GstAudioRingBuffer * buf)
|
|||
|
||||
GST_DEBUG_OBJECT (src, "stop");
|
||||
|
||||
if (src->transport == GST_JACK_TRANSPORT_MASTER) {
|
||||
jack_client_t *client;
|
||||
|
||||
client = gst_jack_audio_client_get_client (src->client);
|
||||
jack_transport_stop (client);
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
@ -658,6 +691,7 @@ enum
|
|||
#define DEFAULT_PROP_CONNECT GST_JACK_CONNECT_AUTO
|
||||
#define DEFAULT_PROP_SERVER NULL
|
||||
#define DEFAULT_PROP_CLIENT_NAME NULL
|
||||
#define DEFAULT_PROP_TRANSPORT GST_JACK_TRANSPORT_AUTONOMOUS
|
||||
|
||||
enum
|
||||
{
|
||||
|
@ -666,6 +700,7 @@ enum
|
|||
PROP_SERVER,
|
||||
PROP_CLIENT,
|
||||
PROP_CLIENT_NAME,
|
||||
PROP_TRANSPORT,
|
||||
PROP_LAST
|
||||
};
|
||||
|
||||
|
@ -751,6 +786,19 @@ gst_jack_audio_src_class_init (GstJackAudioSrcClass * klass)
|
|||
GST_PARAM_MUTABLE_READY | G_PARAM_READWRITE |
|
||||
G_PARAM_STATIC_STRINGS));
|
||||
|
||||
/**
|
||||
* GstJackAudioSink:transport
|
||||
*
|
||||
* The jack transport behaviour for the client.
|
||||
*
|
||||
* Since: 0.10.31
|
||||
*/
|
||||
g_object_class_install_property (gobject_class, PROP_TRANSPORT,
|
||||
g_param_spec_enum ("transport", "Transport mode",
|
||||
"Jack transport behaviour of the client",
|
||||
GST_TYPE_JACK_TRANSPORT, DEFAULT_PROP_TRANSPORT,
|
||||
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
|
||||
|
||||
gst_element_class_add_pad_template (gstelement_class,
|
||||
gst_static_pad_template_get (&src_factory));
|
||||
|
||||
|
@ -769,11 +817,6 @@ gst_jack_audio_src_class_init (GstJackAudioSrcClass * klass)
|
|||
gst_jack_audio_client_init ();
|
||||
}
|
||||
|
||||
/* initialize the new element
|
||||
* instantiate pads and add them to element
|
||||
* set pad calback functions
|
||||
* initialize instance structure
|
||||
*/
|
||||
static void
|
||||
gst_jack_audio_src_init (GstJackAudioSrc * src)
|
||||
{
|
||||
|
@ -785,6 +828,7 @@ gst_jack_audio_src_init (GstJackAudioSrc * src)
|
|||
src->port_count = 0;
|
||||
src->buffers = NULL;
|
||||
src->client_name = g_strdup (DEFAULT_PROP_CLIENT_NAME);
|
||||
src->transport = DEFAULT_PROP_TRANSPORT;
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -826,6 +870,9 @@ gst_jack_audio_src_set_property (GObject * object, guint prop_id,
|
|||
src->jclient = g_value_get_boxed (value);
|
||||
}
|
||||
break;
|
||||
case PROP_TRANSPORT:
|
||||
src->transport = g_value_get_enum (value);
|
||||
break;
|
||||
default:
|
||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
||||
break;
|
||||
|
@ -851,6 +898,9 @@ gst_jack_audio_src_get_property (GObject * object, guint prop_id,
|
|||
case PROP_CLIENT:
|
||||
g_value_set_boxed (value, src->jclient);
|
||||
break;
|
||||
case PROP_TRANSPORT:
|
||||
g_value_set_enum (value, src->transport);
|
||||
break;
|
||||
default:
|
||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
||||
break;
|
||||
|
|
|
@ -76,6 +76,7 @@ struct _GstJackAudioSrc
|
|||
gchar *server;
|
||||
jack_client_t *jclient;
|
||||
gchar *client_name;
|
||||
GstJackTransport transport;
|
||||
|
||||
/* our client */
|
||||
GstJackAudioClient *client;
|
||||
|
|
|
@ -668,6 +668,17 @@ gst_matroska_mux_handle_src_event (GstPad * pad, GstObject * parent,
|
|||
return gst_pad_event_default (pad, parent, event);
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
gst_matroska_mux_free_codec_priv (GstMatroskaTrackContext * context)
|
||||
{
|
||||
if (context->codec_priv != NULL) {
|
||||
g_free (context->codec_priv);
|
||||
context->codec_priv = NULL;
|
||||
context->codec_priv_size = 0;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
gst_matroska_mux_build_vobsub_private (GstMatroskaTrackContext * context,
|
||||
const guint * clut)
|
||||
|
@ -695,7 +706,7 @@ gst_matroska_mux_build_vobsub_private (GstMatroskaTrackContext * context,
|
|||
sclut = g_strjoinv (",", clutv);
|
||||
|
||||
/* build codec private; only palette for now */
|
||||
g_free (context->codec_priv);
|
||||
gst_matroska_mux_free_codec_priv (context);
|
||||
context->codec_priv = (guint8 *) g_strdup_printf ("palette: %s", sclut);
|
||||
/* include terminating 0 */
|
||||
context->codec_priv_size = strlen ((gchar *) context->codec_priv) + 1;
|
||||
|
@ -1046,18 +1057,13 @@ skip_details:
|
|||
|
||||
gst_matroska_mux_set_codec_id (context,
|
||||
GST_MATROSKA_CODEC_ID_VIDEO_VFW_FOURCC);
|
||||
gst_matroska_mux_free_codec_priv (context);
|
||||
context->codec_priv = (gpointer) bih;
|
||||
context->codec_priv_size = size;
|
||||
} else if (!strcmp (mimetype, "video/x-h264")) {
|
||||
gst_matroska_mux_set_codec_id (context,
|
||||
GST_MATROSKA_CODEC_ID_VIDEO_MPEG4_AVC);
|
||||
|
||||
if (context->codec_priv != NULL) {
|
||||
g_free (context->codec_priv);
|
||||
context->codec_priv = NULL;
|
||||
context->codec_priv_size = 0;
|
||||
}
|
||||
|
||||
gst_matroska_mux_free_codec_priv (context);
|
||||
/* Create avcC header */
|
||||
if (codec_buf != NULL) {
|
||||
context->codec_priv_size = gst_buffer_get_size (codec_buf);
|
||||
|
@ -1069,11 +1075,7 @@ skip_details:
|
|||
|
||||
gst_matroska_mux_set_codec_id (context, GST_MATROSKA_CODEC_ID_VIDEO_THEORA);
|
||||
|
||||
if (context->codec_priv != NULL) {
|
||||
g_free (context->codec_priv);
|
||||
context->codec_priv = NULL;
|
||||
context->codec_priv_size = 0;
|
||||
}
|
||||
gst_matroska_mux_free_codec_priv (context);
|
||||
|
||||
streamheader = gst_structure_get_value (structure, "streamheader");
|
||||
if (!theora_streamheader_to_codecdata (streamheader, context)) {
|
||||
|
@ -1108,6 +1110,7 @@ skip_details:
|
|||
|
||||
/* global headers may be in codec data */
|
||||
if (codec_buf != NULL) {
|
||||
gst_matroska_mux_free_codec_priv (context);
|
||||
context->codec_priv_size = gst_buffer_get_size (codec_buf);
|
||||
context->codec_priv = g_malloc0 (context->codec_priv_size);
|
||||
gst_buffer_extract (codec_buf, 0, context->codec_priv, -1);
|
||||
|
@ -1154,6 +1157,7 @@ skip_details:
|
|||
|
||||
gst_buffer_extract (codec_data_buf, 0, priv_data, -1);
|
||||
|
||||
gst_matroska_mux_free_codec_priv (context);
|
||||
context->codec_priv = priv_data;
|
||||
context->codec_priv_size = priv_data_size;
|
||||
}
|
||||
|
@ -1237,6 +1241,7 @@ xiphN_streamheader_to_codecdata (const GValue * streamheader,
|
|||
offset += gst_buffer_get_size (buf[i]);
|
||||
}
|
||||
|
||||
gst_matroska_mux_free_codec_priv (context);
|
||||
context->codec_priv = priv_data;
|
||||
context->codec_priv_size = priv_data_size;
|
||||
|
||||
|
@ -1421,6 +1426,7 @@ flac_streamheader_to_codecdata (const GValue * streamheader,
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
gst_matroska_mux_free_codec_priv (context);
|
||||
context->codec_priv_size = gst_buffer_get_size (buffer) - 9;
|
||||
context->codec_priv = g_malloc (context->codec_priv_size);
|
||||
gst_buffer_extract (buffer, 9, context->codec_priv, -1);
|
||||
|
@ -1430,9 +1436,7 @@ flac_streamheader_to_codecdata (const GValue * streamheader,
|
|||
bufval = &g_array_index (bufarr, GValue, i);
|
||||
|
||||
if (G_VALUE_TYPE (bufval) != GST_TYPE_BUFFER) {
|
||||
g_free (context->codec_priv);
|
||||
context->codec_priv = NULL;
|
||||
context->codec_priv_size = 0;
|
||||
gst_matroska_mux_free_codec_priv (context);
|
||||
GST_WARNING ("streamheaders array does not contain GstBuffers");
|
||||
return FALSE;
|
||||
}
|
||||
|
@ -1487,6 +1491,7 @@ speex_streamheader_to_codecdata (const GValue * streamheader,
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
gst_matroska_mux_free_codec_priv (context);
|
||||
context->codec_priv_size = gst_buffer_get_size (buffer);
|
||||
context->codec_priv = g_malloc (context->codec_priv_size);
|
||||
gst_buffer_extract (buffer, 0, context->codec_priv, -1);
|
||||
|
@ -1494,9 +1499,7 @@ speex_streamheader_to_codecdata (const GValue * streamheader,
|
|||
bufval = &g_array_index (bufarr, GValue, 1);
|
||||
|
||||
if (G_VALUE_TYPE (bufval) != GST_TYPE_BUFFER) {
|
||||
g_free (context->codec_priv);
|
||||
context->codec_priv = NULL;
|
||||
context->codec_priv_size = 0;
|
||||
gst_matroska_mux_free_codec_priv (context);
|
||||
GST_WARNING ("streamheaders array does not contain GstBuffers");
|
||||
return FALSE;
|
||||
}
|
||||
|
@ -1729,11 +1732,7 @@ gst_matroska_mux_audio_pad_setcaps (GstPad * pad, GstCaps * caps)
|
|||
|
||||
gst_matroska_mux_set_codec_id (context, GST_MATROSKA_CODEC_ID_AUDIO_VORBIS);
|
||||
|
||||
if (context->codec_priv != NULL) {
|
||||
g_free (context->codec_priv);
|
||||
context->codec_priv = NULL;
|
||||
context->codec_priv_size = 0;
|
||||
}
|
||||
gst_matroska_mux_free_codec_priv (context);
|
||||
|
||||
streamheader = gst_structure_get_value (structure, "streamheader");
|
||||
if (!vorbis_streamheader_to_codecdata (streamheader, context)) {
|
||||
|
@ -1745,11 +1744,8 @@ gst_matroska_mux_audio_pad_setcaps (GstPad * pad, GstCaps * caps)
|
|||
const GValue *streamheader;
|
||||
|
||||
gst_matroska_mux_set_codec_id (context, GST_MATROSKA_CODEC_ID_AUDIO_FLAC);
|
||||
if (context->codec_priv != NULL) {
|
||||
g_free (context->codec_priv);
|
||||
context->codec_priv = NULL;
|
||||
context->codec_priv_size = 0;
|
||||
}
|
||||
|
||||
gst_matroska_mux_free_codec_priv (context);
|
||||
|
||||
streamheader = gst_structure_get_value (structure, "streamheader");
|
||||
if (!flac_streamheader_to_codecdata (streamheader, context)) {
|
||||
|
@ -1761,11 +1757,7 @@ gst_matroska_mux_audio_pad_setcaps (GstPad * pad, GstCaps * caps)
|
|||
const GValue *streamheader;
|
||||
|
||||
gst_matroska_mux_set_codec_id (context, GST_MATROSKA_CODEC_ID_AUDIO_SPEEX);
|
||||
if (context->codec_priv != NULL) {
|
||||
g_free (context->codec_priv);
|
||||
context->codec_priv = NULL;
|
||||
context->codec_priv_size = 0;
|
||||
}
|
||||
gst_matroska_mux_free_codec_priv (context);
|
||||
|
||||
streamheader = gst_structure_get_value (structure, "streamheader");
|
||||
if (!speex_streamheader_to_codecdata (streamheader, context)) {
|
||||
|
@ -1823,6 +1815,8 @@ gst_matroska_mux_audio_pad_setcaps (GstPad * pad, GstCaps * caps)
|
|||
|
||||
gst_buffer_extract (codec_data_buf, 0, priv_data, -1);
|
||||
|
||||
gst_matroska_mux_free_codec_priv (context);
|
||||
|
||||
context->codec_priv = priv_data;
|
||||
context->codec_priv_size = priv_data_size;
|
||||
}
|
||||
|
@ -1907,6 +1901,7 @@ gst_matroska_mux_audio_pad_setcaps (GstPad * pad, GstCaps * caps)
|
|||
}
|
||||
|
||||
gst_matroska_mux_set_codec_id (context, GST_MATROSKA_CODEC_ID_AUDIO_ACM);
|
||||
gst_matroska_mux_free_codec_priv (context);
|
||||
context->codec_priv = (gpointer) codec_priv;
|
||||
context->codec_priv_size = codec_priv_size;
|
||||
}
|
||||
|
@ -1981,11 +1976,7 @@ gst_matroska_mux_subtitle_pad_setcaps (GstPad * pad, GstCaps * caps)
|
|||
gst_matroska_mux_set_codec_id (context,
|
||||
GST_MATROSKA_CODEC_ID_SUBTITLE_KATE);
|
||||
|
||||
if (context->codec_priv != NULL) {
|
||||
g_free (context->codec_priv);
|
||||
context->codec_priv = NULL;
|
||||
context->codec_priv_size = 0;
|
||||
}
|
||||
gst_matroska_mux_free_codec_priv (context);
|
||||
|
||||
streamheader = gst_structure_get_value (structure, "streamheader");
|
||||
if (!kate_streamheader_to_codecdata (streamheader, context)) {
|
||||
|
@ -2030,8 +2021,7 @@ gst_matroska_mux_subtitle_pad_setcaps (GstPad * pad, GstCaps * caps)
|
|||
return TRUE;
|
||||
}
|
||||
|
||||
if (context->codec_priv != NULL)
|
||||
g_free (context->codec_priv);
|
||||
gst_matroska_mux_free_codec_priv (context);
|
||||
|
||||
priv_data = g_malloc0 (priv_data_size);
|
||||
memcpy (priv_data, priv_buffer_data, priv_data_size);
|
||||
|
|
|
@ -650,6 +650,9 @@ gst_matroska_read_common_parse_attached_file (GstMatroskaReadCommon * common,
|
|||
else
|
||||
gst_tag_list_add (taglist, GST_TAG_MERGE_APPEND, GST_TAG_ATTACHMENT,
|
||||
tagsample, NULL);
|
||||
|
||||
/* the list adds it own ref */
|
||||
gst_buffer_unref (tagsample);
|
||||
}
|
||||
|
||||
g_free (filename);
|
||||
|
|
|
@ -54,7 +54,7 @@ bus_handler (GstBus * bus, GstMessage * message, gpointer data)
|
|||
|
||||
/*
|
||||
* gst-launch \
|
||||
* audiotestsrc freq=440 num-buffers=100 ! interleave name=i ! wavenc ! filesink location=/tmp/mc.wav \
|
||||
* audiotestsrc freq=440 num-buffers=100 ! interleave name=i ! audioconvert ! wavenc ! filesink location=/tmp/mc.wav \
|
||||
* audiotestsrc freq=880 num-buffers=100 ! i.
|
||||
* ...
|
||||
*
|
||||
|
@ -65,7 +65,7 @@ static void
|
|||
make_n_channel_wav (const gint channels, const GValueArray * arr)
|
||||
{
|
||||
GstElement *pipeline;
|
||||
GstElement **audiotestsrc, *interleave, *wavenc, *fakesink;
|
||||
GstElement **audiotestsrc, *interleave, *wavenc, *conv, *fakesink;
|
||||
GstBus *bus;
|
||||
GMainLoop *loop;
|
||||
guint i;
|
||||
|
@ -81,10 +81,21 @@ make_n_channel_wav (const gint channels, const GValueArray * arr)
|
|||
g_object_set (interleave, "channel-positions", arr, NULL);
|
||||
gst_bin_add (GST_BIN (pipeline), interleave);
|
||||
|
||||
if (G_BYTE_ORDER == G_BIG_ENDIAN) {
|
||||
/* we're not here to test orc; audioconvert misbehaves on ppc32 */
|
||||
g_setenv ("ORC_CODE", "backup", 1);
|
||||
conv = gst_element_factory_make ("audioconvert", NULL);
|
||||
} else {
|
||||
conv = gst_element_factory_make ("identity", NULL);
|
||||
}
|
||||
fail_unless (conv != NULL);
|
||||
gst_bin_add (GST_BIN (pipeline), conv);
|
||||
fail_unless (gst_element_link (interleave, conv));
|
||||
|
||||
wavenc = gst_element_factory_make ("wavenc", NULL);
|
||||
fail_unless (wavenc != NULL);
|
||||
gst_bin_add (GST_BIN (pipeline), wavenc);
|
||||
fail_unless (gst_element_link (interleave, wavenc));
|
||||
fail_unless (gst_element_link (conv, wavenc));
|
||||
|
||||
fakesink = gst_element_factory_make ("fakesink", NULL);
|
||||
fail_unless (fakesink != NULL);
|
||||
|
|
Loading…
Reference in a new issue