mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-06-07 16:08:51 +00:00
Merge remote-tracking branch 'origin/master' into 0.11
Conflicts: common docs/libs/gst-plugins-base-libs.types ext/pango/gsttextoverlay.c ext/vorbis/gstvorbisdec.c gst/playback/gstplaysink.c gst/playback/gstplaysinkconvertbin.c sys/ximage/ximagesink.c sys/xvimage/xvimagesink.c
This commit is contained in:
commit
29c266ccff
19 changed files with 149 additions and 82 deletions
|
@ -671,7 +671,7 @@ AG_GST_CHECK_FEATURE(OGG, [Xiph Ogg library], ogg, [
|
||||||
dnl *** pango ***
|
dnl *** pango ***
|
||||||
translit(dnm, m, l) AM_CONDITIONAL(USE_PANGO, true)
|
translit(dnm, m, l) AM_CONDITIONAL(USE_PANGO, true)
|
||||||
AG_GST_CHECK_FEATURE(PANGO, [Pango font rendering], pango, [
|
AG_GST_CHECK_FEATURE(PANGO, [Pango font rendering], pango, [
|
||||||
AG_GST_PKG_CHECK_MODULES(PANGO, pango >= 1.16.0 pangocairo >= 1.16.0)
|
AG_GST_PKG_CHECK_MODULES(PANGO, pango >= 1.22.0 pangocairo >= 1.22.0)
|
||||||
])
|
])
|
||||||
|
|
||||||
dnl *** theora ***
|
dnl *** theora ***
|
||||||
|
|
|
@ -201,7 +201,7 @@ gst_text_render_class_init (GstTextRenderClass * klass)
|
||||||
|
|
||||||
fontmap = pango_cairo_font_map_get_default ();
|
fontmap = pango_cairo_font_map_get_default ();
|
||||||
klass->pango_context =
|
klass->pango_context =
|
||||||
pango_cairo_font_map_create_context (PANGO_CAIRO_FONT_MAP (fontmap));
|
pango_font_map_create_context (PANGO_FONT_MAP (fontmap));
|
||||||
g_object_class_install_property (G_OBJECT_CLASS (klass), PROP_FONT_DESC,
|
g_object_class_install_property (G_OBJECT_CLASS (klass), PROP_FONT_DESC,
|
||||||
g_param_spec_string ("font-desc", "font description",
|
g_param_spec_string ("font-desc", "font description",
|
||||||
"Pango font description of font "
|
"Pango font description of font "
|
||||||
|
|
|
@ -124,14 +124,6 @@ vorbis_dec_finalize (GObject * object)
|
||||||
G_OBJECT_CLASS (parent_class)->finalize (object);
|
G_OBJECT_CLASS (parent_class)->finalize (object);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
|
||||||
gst_vorbis_dec_reset (GstVorbisDec * dec)
|
|
||||||
{
|
|
||||||
if (dec->taglist)
|
|
||||||
gst_tag_list_free (dec->taglist);
|
|
||||||
dec->taglist = NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
vorbis_dec_start (GstAudioDecoder * dec)
|
vorbis_dec_start (GstAudioDecoder * dec)
|
||||||
{
|
{
|
||||||
|
@ -141,7 +133,6 @@ vorbis_dec_start (GstAudioDecoder * dec)
|
||||||
vorbis_info_init (&vd->vi);
|
vorbis_info_init (&vd->vi);
|
||||||
vorbis_comment_init (&vd->vc);
|
vorbis_comment_init (&vd->vc);
|
||||||
vd->initialized = FALSE;
|
vd->initialized = FALSE;
|
||||||
gst_vorbis_dec_reset (vd);
|
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
@ -159,7 +150,6 @@ vorbis_dec_stop (GstAudioDecoder * dec)
|
||||||
vorbis_dsp_clear (&vd->vd);
|
vorbis_dsp_clear (&vd->vd);
|
||||||
vorbis_comment_clear (&vd->vc);
|
vorbis_comment_clear (&vd->vc);
|
||||||
vorbis_info_clear (&vd->vi);
|
vorbis_info_clear (&vd->vi);
|
||||||
gst_vorbis_dec_reset (vd);
|
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
@ -216,7 +206,7 @@ vorbis_handle_comment_packet (GstVorbisDec * vd, ogg_packet * packet)
|
||||||
{
|
{
|
||||||
guint bitrate = 0;
|
guint bitrate = 0;
|
||||||
gchar *encoder = NULL;
|
gchar *encoder = NULL;
|
||||||
GstTagList *list, *old_list;
|
GstTagList *list;
|
||||||
guint8 *data;
|
guint8 *data;
|
||||||
gsize size;
|
gsize size;
|
||||||
|
|
||||||
|
@ -229,57 +219,51 @@ vorbis_handle_comment_packet (GstVorbisDec * vd, ogg_packet * packet)
|
||||||
gst_tag_list_from_vorbiscomment (data, size, (guint8 *) "\003vorbis", 7,
|
gst_tag_list_from_vorbiscomment (data, size, (guint8 *) "\003vorbis", 7,
|
||||||
&encoder);
|
&encoder);
|
||||||
|
|
||||||
old_list = vd->taglist;
|
if (!list) {
|
||||||
vd->taglist = gst_tag_list_merge (vd->taglist, list, GST_TAG_MERGE_REPLACE);
|
|
||||||
|
|
||||||
if (old_list)
|
|
||||||
gst_tag_list_free (old_list);
|
|
||||||
gst_tag_list_free (list);
|
|
||||||
|
|
||||||
if (!vd->taglist) {
|
|
||||||
GST_ERROR_OBJECT (vd, "couldn't decode comments");
|
GST_ERROR_OBJECT (vd, "couldn't decode comments");
|
||||||
vd->taglist = gst_tag_list_new_empty ();
|
list = gst_tag_list_new ();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (encoder) {
|
if (encoder) {
|
||||||
if (encoder[0])
|
if (encoder[0])
|
||||||
gst_tag_list_add (vd->taglist, GST_TAG_MERGE_REPLACE,
|
gst_tag_list_add (list, GST_TAG_MERGE_REPLACE,
|
||||||
GST_TAG_ENCODER, encoder, NULL);
|
GST_TAG_ENCODER, encoder, NULL);
|
||||||
g_free (encoder);
|
g_free (encoder);
|
||||||
}
|
}
|
||||||
gst_tag_list_add (vd->taglist, GST_TAG_MERGE_REPLACE,
|
gst_tag_list_add (list, GST_TAG_MERGE_REPLACE,
|
||||||
GST_TAG_ENCODER_VERSION, vd->vi.version,
|
GST_TAG_ENCODER_VERSION, vd->vi.version,
|
||||||
GST_TAG_AUDIO_CODEC, "Vorbis", NULL);
|
GST_TAG_AUDIO_CODEC, "Vorbis", NULL);
|
||||||
if (vd->vi.bitrate_nominal > 0 && vd->vi.bitrate_nominal <= 0x7FFFFFFF) {
|
if (vd->vi.bitrate_nominal > 0 && vd->vi.bitrate_nominal <= 0x7FFFFFFF) {
|
||||||
gst_tag_list_add (vd->taglist, GST_TAG_MERGE_REPLACE,
|
gst_tag_list_add (list, GST_TAG_MERGE_REPLACE,
|
||||||
GST_TAG_NOMINAL_BITRATE, (guint) vd->vi.bitrate_nominal, NULL);
|
GST_TAG_NOMINAL_BITRATE, (guint) vd->vi.bitrate_nominal, NULL);
|
||||||
bitrate = vd->vi.bitrate_nominal;
|
bitrate = vd->vi.bitrate_nominal;
|
||||||
}
|
}
|
||||||
if (vd->vi.bitrate_upper > 0 && vd->vi.bitrate_upper <= 0x7FFFFFFF) {
|
if (vd->vi.bitrate_upper > 0 && vd->vi.bitrate_upper <= 0x7FFFFFFF) {
|
||||||
gst_tag_list_add (vd->taglist, GST_TAG_MERGE_REPLACE,
|
gst_tag_list_add (list, GST_TAG_MERGE_REPLACE,
|
||||||
GST_TAG_MAXIMUM_BITRATE, (guint) vd->vi.bitrate_upper, NULL);
|
GST_TAG_MAXIMUM_BITRATE, (guint) vd->vi.bitrate_upper, NULL);
|
||||||
if (!bitrate)
|
if (!bitrate)
|
||||||
bitrate = vd->vi.bitrate_upper;
|
bitrate = vd->vi.bitrate_upper;
|
||||||
}
|
}
|
||||||
if (vd->vi.bitrate_lower > 0 && vd->vi.bitrate_lower <= 0x7FFFFFFF) {
|
if (vd->vi.bitrate_lower > 0 && vd->vi.bitrate_lower <= 0x7FFFFFFF) {
|
||||||
gst_tag_list_add (vd->taglist, GST_TAG_MERGE_REPLACE,
|
gst_tag_list_add (list, GST_TAG_MERGE_REPLACE,
|
||||||
GST_TAG_MINIMUM_BITRATE, (guint) vd->vi.bitrate_lower, NULL);
|
GST_TAG_MINIMUM_BITRATE, (guint) vd->vi.bitrate_lower, NULL);
|
||||||
if (!bitrate)
|
if (!bitrate)
|
||||||
bitrate = vd->vi.bitrate_lower;
|
bitrate = vd->vi.bitrate_lower;
|
||||||
}
|
}
|
||||||
if (bitrate) {
|
if (bitrate) {
|
||||||
gst_tag_list_add (vd->taglist, GST_TAG_MERGE_REPLACE,
|
gst_tag_list_add (list, GST_TAG_MERGE_REPLACE,
|
||||||
GST_TAG_BITRATE, (guint) bitrate, NULL);
|
GST_TAG_BITRATE, (guint) bitrate, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
gst_audio_decoder_merge_tags (GST_AUDIO_DECODER_CAST (vd), list,
|
||||||
|
GST_TAG_MERGE_REPLACE);
|
||||||
if (vd->initialized) {
|
if (vd->initialized) {
|
||||||
gst_pad_push_event (GST_AUDIO_DECODER_SRC_PAD (vd),
|
gst_tag_list_free (list);
|
||||||
gst_event_new_tag (vd->taglist));
|
|
||||||
vd->taglist = NULL;
|
|
||||||
} else {
|
} else {
|
||||||
/* Only post them as messages for the time being. *
|
/* Only post them as messages for the time being. *
|
||||||
* They will be pushed on the pad once the decoder is initialized */
|
* They will be pushed on the pad once the decoder is initialized */
|
||||||
gst_element_post_message (GST_ELEMENT_CAST (vd),
|
gst_element_post_message (GST_ELEMENT_CAST (vd),
|
||||||
gst_message_new_tag (GST_OBJECT (vd), gst_tag_list_copy (vd->taglist)));
|
gst_message_new_tag (GST_OBJECT (vd), list));
|
||||||
}
|
}
|
||||||
|
|
||||||
return GST_FLOW_OK;
|
return GST_FLOW_OK;
|
||||||
|
@ -305,12 +289,6 @@ vorbis_handle_type_packet (GstVorbisDec * vd)
|
||||||
|
|
||||||
vd->initialized = TRUE;
|
vd->initialized = TRUE;
|
||||||
|
|
||||||
if (vd->taglist) {
|
|
||||||
/* The tags have already been sent on the bus as messages. */
|
|
||||||
gst_pad_push_event (GST_AUDIO_DECODER_SRC_PAD (vd),
|
|
||||||
gst_event_new_tag (vd->taglist));
|
|
||||||
vd->taglist = NULL;
|
|
||||||
}
|
|
||||||
return GST_FLOW_OK;
|
return GST_FLOW_OK;
|
||||||
|
|
||||||
/* ERRORS */
|
/* ERRORS */
|
||||||
|
@ -650,7 +628,4 @@ vorbis_dec_flush (GstAudioDecoder * dec, gboolean hard)
|
||||||
#ifdef HAVE_VORBIS_SYNTHESIS_RESTART
|
#ifdef HAVE_VORBIS_SYNTHESIS_RESTART
|
||||||
vorbis_synthesis_restart (&vd->vd);
|
vorbis_synthesis_restart (&vd->vd);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (hard)
|
|
||||||
gst_vorbis_dec_reset (vd);
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -64,8 +64,6 @@ struct _GstVorbisDec {
|
||||||
gboolean initialized;
|
gboolean initialized;
|
||||||
GstAudioInfo info;
|
GstAudioInfo info;
|
||||||
|
|
||||||
GstTagList *taglist;
|
|
||||||
|
|
||||||
CopySampleFunc copy_samples;
|
CopySampleFunc copy_samples;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -1041,7 +1041,7 @@ gst_audio_decoder_push_buffers (GstAudioDecoder * dec, gboolean force)
|
||||||
g_assert (offset <= av);
|
g_assert (offset <= av);
|
||||||
if (offset) {
|
if (offset) {
|
||||||
/* jumped a bit */
|
/* jumped a bit */
|
||||||
GST_DEBUG_OBJECT (dec, "setting DISCONT");
|
GST_DEBUG_OBJECT (dec, "skipped %d; setting DISCONT", offset);
|
||||||
gst_adapter_flush (priv->adapter, offset);
|
gst_adapter_flush (priv->adapter, offset);
|
||||||
flush = offset;
|
flush = offset;
|
||||||
/* avoid parsing indefinitely */
|
/* avoid parsing indefinitely */
|
||||||
|
@ -2602,3 +2602,40 @@ gst_audio_decoder_get_needs_format (GstAudioDecoder * dec)
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* gst_audio_decoder_merge_tags:
|
||||||
|
* @dec: a #GstAudioDecoder
|
||||||
|
* @tags: a #GstTagList to merge
|
||||||
|
* @mode: the #GstTagMergeMode to use
|
||||||
|
*
|
||||||
|
* Adds tags to so-called pending tags, which will be processed
|
||||||
|
* before pushing out data downstream.
|
||||||
|
*
|
||||||
|
* Note that this is provided for convenience, and the subclass is
|
||||||
|
* not required to use this and can still do tag handling on its own,
|
||||||
|
* although it should be aware that baseclass already takes care
|
||||||
|
* of the usual CODEC/AUDIO_CODEC tags.
|
||||||
|
*
|
||||||
|
* MT safe.
|
||||||
|
*
|
||||||
|
* Since: 0.10.37
|
||||||
|
*/
|
||||||
|
void
|
||||||
|
gst_audio_decoder_merge_tags (GstAudioDecoder * dec,
|
||||||
|
const GstTagList * tags, GstTagMergeMode mode)
|
||||||
|
{
|
||||||
|
GstTagList *otags;
|
||||||
|
|
||||||
|
g_return_if_fail (GST_IS_AUDIO_DECODER (dec));
|
||||||
|
g_return_if_fail (tags == NULL || GST_IS_TAG_LIST (tags));
|
||||||
|
|
||||||
|
GST_AUDIO_DECODER_STREAM_LOCK (dec);
|
||||||
|
if (tags)
|
||||||
|
GST_DEBUG_OBJECT (dec, "merging tags %" GST_PTR_FORMAT, tags);
|
||||||
|
otags = dec->priv->taglist;
|
||||||
|
dec->priv->taglist = gst_tag_list_merge (dec->priv->taglist, tags, mode);
|
||||||
|
if (otags)
|
||||||
|
gst_tag_list_free (otags);
|
||||||
|
GST_AUDIO_DECODER_STREAM_UNLOCK (dec);
|
||||||
|
}
|
||||||
|
|
|
@ -41,6 +41,8 @@ G_BEGIN_DECLS
|
||||||
(G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_AUDIO_DECODER))
|
(G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_AUDIO_DECODER))
|
||||||
#define GST_IS_AUDIO_DECODER_CLASS(obj) \
|
#define GST_IS_AUDIO_DECODER_CLASS(obj) \
|
||||||
(G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_AUDIO_DECODER))
|
(G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_AUDIO_DECODER))
|
||||||
|
#define GST_AUDIO_DECODER_CAST(obj) \
|
||||||
|
((GstAudioDecoder *)(obj))
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* GST_AUDIO_DECODER_SINK_NAME:
|
* GST_AUDIO_DECODER_SINK_NAME:
|
||||||
|
@ -306,6 +308,9 @@ void gst_audio_decoder_set_needs_format (GstAudioDecoder * dec,
|
||||||
|
|
||||||
gboolean gst_audio_decoder_get_needs_format (GstAudioDecoder * dec);
|
gboolean gst_audio_decoder_get_needs_format (GstAudioDecoder * dec);
|
||||||
|
|
||||||
|
void gst_audio_decoder_merge_tags (GstAudioDecoder * dec,
|
||||||
|
const GstTagList * tags, GstTagMergeMode mode);
|
||||||
|
|
||||||
G_END_DECLS
|
G_END_DECLS
|
||||||
|
|
||||||
#endif /* _GST_AUDIO_DECODER_H_ */
|
#endif /* _GST_AUDIO_DECODER_H_ */
|
||||||
|
|
|
@ -1157,8 +1157,15 @@ handle_message (GstDiscoverer * dc, GstMessage * msg)
|
||||||
/* We need to stop */
|
/* We need to stop */
|
||||||
done = TRUE;
|
done = TRUE;
|
||||||
|
|
||||||
GST_DEBUG ("Setting result to ERROR");
|
/* Don't override missing plugin result code for missing plugin errors */
|
||||||
dc->priv->current_info->result = GST_DISCOVERER_ERROR;
|
if (dc->priv->current_info->result != GST_DISCOVERER_MISSING_PLUGINS ||
|
||||||
|
(!g_error_matches (gerr, GST_CORE_ERROR,
|
||||||
|
GST_CORE_ERROR_MISSING_PLUGIN) &&
|
||||||
|
!g_error_matches (gerr, GST_STREAM_ERROR,
|
||||||
|
GST_STREAM_ERROR_CODEC_NOT_FOUND))) {
|
||||||
|
GST_DEBUG ("Setting result to ERROR");
|
||||||
|
dc->priv->current_info->result = GST_DISCOVERER_ERROR;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
|
@ -560,7 +560,7 @@ gst_install_plugins_return_from_status (gint status)
|
||||||
ret = (GstInstallPluginsReturn) WEXITSTATUS (status);
|
ret = (GstInstallPluginsReturn) WEXITSTATUS (status);
|
||||||
|
|
||||||
/* did the helper return an invalid status code? */
|
/* did the helper return an invalid status code? */
|
||||||
if ((ret < 0 || ret >= GST_INSTALL_PLUGINS_STARTED_OK) &&
|
if (((guint) ret) >= GST_INSTALL_PLUGINS_STARTED_OK &&
|
||||||
ret != GST_INSTALL_PLUGINS_INTERNAL_FAILURE) {
|
ret != GST_INSTALL_PLUGINS_INTERNAL_FAILURE) {
|
||||||
ret = GST_INSTALL_PLUGINS_INVALID;
|
ret = GST_INSTALL_PLUGINS_INVALID;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1338,7 +1338,7 @@ video_blend_scale_linear_RGBA (GstBlendVideoFormatInfo * src,
|
||||||
*/
|
*/
|
||||||
gboolean
|
gboolean
|
||||||
video_blend (GstBlendVideoFormatInfo * dest,
|
video_blend (GstBlendVideoFormatInfo * dest,
|
||||||
GstBlendVideoFormatInfo * src, guint x, guint y)
|
GstBlendVideoFormatInfo * src, gint x, gint y)
|
||||||
{
|
{
|
||||||
guint i, j;
|
guint i, j;
|
||||||
guint8 alpha;
|
guint8 alpha;
|
||||||
|
|
|
@ -71,6 +71,6 @@ void video_blend_scale_linear_RGBA (GstBlendVideoFormatInfo * src,
|
||||||
|
|
||||||
gboolean video_blend (GstBlendVideoFormatInfo * dest,
|
gboolean video_blend (GstBlendVideoFormatInfo * dest,
|
||||||
GstBlendVideoFormatInfo * src,
|
GstBlendVideoFormatInfo * src,
|
||||||
guint x, guint y);
|
gint x, gint y);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -2252,8 +2252,10 @@ setup_audio_chain (GstPlaySink * playsink, gboolean raw)
|
||||||
GstElement *elem;
|
GstElement *elem;
|
||||||
GstPlayAudioChain *chain;
|
GstPlayAudioChain *chain;
|
||||||
GstStateChangeReturn ret;
|
GstStateChangeReturn ret;
|
||||||
|
GstPlaySinkAudioConvert *conv;
|
||||||
|
|
||||||
chain = playsink->audiochain;
|
chain = playsink->audiochain;
|
||||||
|
conv = GST_PLAY_SINK_AUDIO_CONVERT_CAST (chain->conv);
|
||||||
|
|
||||||
chain->chain.raw = raw;
|
chain->chain.raw = raw;
|
||||||
|
|
||||||
|
@ -2302,10 +2304,7 @@ setup_audio_chain (GstPlaySink * playsink, gboolean raw)
|
||||||
}
|
}
|
||||||
|
|
||||||
g_object_set (chain->conv, "use-volume", FALSE, NULL);
|
g_object_set (chain->conv, "use-volume", FALSE, NULL);
|
||||||
} else {
|
} else if (conv) {
|
||||||
GstPlaySinkAudioConvert *conv =
|
|
||||||
GST_PLAY_SINK_AUDIO_CONVERT_CAST (chain->conv);
|
|
||||||
|
|
||||||
/* no volume, we need to add a volume element when we can */
|
/* no volume, we need to add a volume element when we can */
|
||||||
g_object_set (chain->conv, "use-volume",
|
g_object_set (chain->conv, "use-volume",
|
||||||
! !(playsink->flags & GST_PLAY_FLAG_SOFT_VOLUME), NULL);
|
! !(playsink->flags & GST_PLAY_FLAG_SOFT_VOLUME), NULL);
|
||||||
|
@ -3737,6 +3736,9 @@ gst_play_sink_handle_message (GstBin * bin, GstMessage * message)
|
||||||
gst_object_unref (overlay);
|
gst_object_unref (overlay);
|
||||||
gst_message_unref (message);
|
gst_message_unref (message);
|
||||||
gst_video_overlay_prepare_window_handle (GST_VIDEO_OVERLAY (playsink));
|
gst_video_overlay_prepare_window_handle (GST_VIDEO_OVERLAY (playsink));
|
||||||
|
} else {
|
||||||
|
GST_BIN_CLASS (gst_play_sink_parent_class)->handle_message (bin,
|
||||||
|
message);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -189,7 +189,7 @@ gst_play_sink_convert_bin_remove_element (GstElement * element,
|
||||||
GstPlaySinkConvertBin * self)
|
GstPlaySinkConvertBin * self)
|
||||||
{
|
{
|
||||||
gst_element_set_state (element, GST_STATE_NULL);
|
gst_element_set_state (element, GST_STATE_NULL);
|
||||||
gst_object_unref (GST_OBJECT_CAST (element));
|
gst_object_unref (element);
|
||||||
gst_bin_remove (GST_BIN_CAST (self), element);
|
gst_bin_remove (GST_BIN_CAST (self), element);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -117,6 +117,9 @@
|
||||||
|
|
||||||
#include "gst/glib-compat-private.h"
|
#include "gst/glib-compat-private.h"
|
||||||
|
|
||||||
|
/* for XkbKeycodeToKeysym */
|
||||||
|
#include <X11/XKBlib.h>
|
||||||
|
|
||||||
GST_DEBUG_CATEGORY_EXTERN (gst_debug_ximagesink);
|
GST_DEBUG_CATEGORY_EXTERN (gst_debug_ximagesink);
|
||||||
GST_DEBUG_CATEGORY_EXTERN (GST_CAT_PERFORMANCE);
|
GST_DEBUG_CATEGORY_EXTERN (GST_CAT_PERFORMANCE);
|
||||||
#define GST_CAT_DEFAULT gst_debug_ximagesink
|
#define GST_CAT_DEFAULT gst_debug_ximagesink
|
||||||
|
@ -593,6 +596,7 @@ gst_ximagesink_handle_xevents (GstXImageSink * ximagesink)
|
||||||
KeyPressMask | KeyReleaseMask |
|
KeyPressMask | KeyReleaseMask |
|
||||||
ButtonPressMask | ButtonReleaseMask, &e)) {
|
ButtonPressMask | ButtonReleaseMask, &e)) {
|
||||||
KeySym keysym;
|
KeySym keysym;
|
||||||
|
const char *key_str = NULL;
|
||||||
|
|
||||||
/* We lock only for the X function call */
|
/* We lock only for the X function call */
|
||||||
g_mutex_unlock (ximagesink->x_lock);
|
g_mutex_unlock (ximagesink->x_lock);
|
||||||
|
@ -617,24 +621,20 @@ gst_ximagesink_handle_xevents (GstXImageSink * ximagesink)
|
||||||
case KeyRelease:
|
case KeyRelease:
|
||||||
/* Key pressed/released over our window. We send upstream
|
/* Key pressed/released over our window. We send upstream
|
||||||
events for interactivity/navigation */
|
events for interactivity/navigation */
|
||||||
GST_DEBUG ("ximagesink key %d pressed over window at %d,%d",
|
|
||||||
e.xkey.keycode, e.xkey.x, e.xkey.x);
|
|
||||||
g_mutex_lock (ximagesink->x_lock);
|
g_mutex_lock (ximagesink->x_lock);
|
||||||
keysym = XKeycodeToKeysym (ximagesink->xcontext->disp,
|
keysym = XkbKeycodeToKeysym (ximagesink->xcontext->disp,
|
||||||
e.xkey.keycode, 0);
|
e.xkey.keycode, 0, 0);
|
||||||
g_mutex_unlock (ximagesink->x_lock);
|
|
||||||
if (keysym != NoSymbol) {
|
if (keysym != NoSymbol) {
|
||||||
char *key_str = NULL;
|
|
||||||
|
|
||||||
g_mutex_lock (ximagesink->x_lock);
|
|
||||||
key_str = XKeysymToString (keysym);
|
key_str = XKeysymToString (keysym);
|
||||||
g_mutex_unlock (ximagesink->x_lock);
|
|
||||||
gst_navigation_send_key_event (GST_NAVIGATION (ximagesink),
|
|
||||||
e.type == KeyPress ? "key-press" : "key-release", key_str);
|
|
||||||
} else {
|
} else {
|
||||||
gst_navigation_send_key_event (GST_NAVIGATION (ximagesink),
|
key_str = "unknown";
|
||||||
e.type == KeyPress ? "key-press" : "key-release", "unknown");
|
|
||||||
}
|
}
|
||||||
|
g_mutex_unlock (ximagesink->x_lock);
|
||||||
|
GST_DEBUG_OBJECT (ximagesink,
|
||||||
|
"key %d pressed over window at %d,%d (%s)",
|
||||||
|
e.xkey.keycode, e.xkey.x, e.xkey.y, key_str);
|
||||||
|
gst_navigation_send_key_event (GST_NAVIGATION (ximagesink),
|
||||||
|
e.type == KeyPress ? "key-press" : "key-release", key_str);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
GST_DEBUG_OBJECT (ximagesink, "ximagesink unhandled X event (%d)",
|
GST_DEBUG_OBJECT (ximagesink, "ximagesink unhandled X event (%d)",
|
||||||
|
|
|
@ -132,6 +132,9 @@
|
||||||
|
|
||||||
#include "gst/glib-compat-private.h"
|
#include "gst/glib-compat-private.h"
|
||||||
|
|
||||||
|
/* for XkbKeycodeToKeysym */
|
||||||
|
#include <X11/XKBlib.h>
|
||||||
|
|
||||||
GST_DEBUG_CATEGORY_EXTERN (gst_debug_xvimagesink);
|
GST_DEBUG_CATEGORY_EXTERN (gst_debug_xvimagesink);
|
||||||
GST_DEBUG_CATEGORY_EXTERN (GST_CAT_PERFORMANCE);
|
GST_DEBUG_CATEGORY_EXTERN (GST_CAT_PERFORMANCE);
|
||||||
#define GST_CAT_DEFAULT gst_debug_xvimagesink
|
#define GST_CAT_DEFAULT gst_debug_xvimagesink
|
||||||
|
@ -722,6 +725,7 @@ gst_xvimagesink_handle_xevents (GstXvImageSink * xvimagesink)
|
||||||
KeyPressMask | KeyReleaseMask | ButtonPressMask | ButtonReleaseMask,
|
KeyPressMask | KeyReleaseMask | ButtonPressMask | ButtonReleaseMask,
|
||||||
&e)) {
|
&e)) {
|
||||||
KeySym keysym;
|
KeySym keysym;
|
||||||
|
const char *key_str = NULL;
|
||||||
|
|
||||||
/* We lock only for the X function call */
|
/* We lock only for the X function call */
|
||||||
g_mutex_unlock (xvimagesink->x_lock);
|
g_mutex_unlock (xvimagesink->x_lock);
|
||||||
|
@ -748,24 +752,20 @@ gst_xvimagesink_handle_xevents (GstXvImageSink * xvimagesink)
|
||||||
case KeyRelease:
|
case KeyRelease:
|
||||||
/* Key pressed/released over our window. We send upstream
|
/* Key pressed/released over our window. We send upstream
|
||||||
events for interactivity/navigation */
|
events for interactivity/navigation */
|
||||||
GST_DEBUG ("xvimagesink key %d pressed over window at %d,%d",
|
|
||||||
e.xkey.keycode, e.xkey.x, e.xkey.y);
|
|
||||||
g_mutex_lock (xvimagesink->x_lock);
|
g_mutex_lock (xvimagesink->x_lock);
|
||||||
keysym = XKeycodeToKeysym (xvimagesink->xcontext->disp,
|
keysym = XkbKeycodeToKeysym (xvimagesink->xcontext->disp,
|
||||||
e.xkey.keycode, 0);
|
e.xkey.keycode, 0, 0);
|
||||||
g_mutex_unlock (xvimagesink->x_lock);
|
|
||||||
if (keysym != NoSymbol) {
|
if (keysym != NoSymbol) {
|
||||||
char *key_str = NULL;
|
|
||||||
|
|
||||||
g_mutex_lock (xvimagesink->x_lock);
|
|
||||||
key_str = XKeysymToString (keysym);
|
key_str = XKeysymToString (keysym);
|
||||||
g_mutex_unlock (xvimagesink->x_lock);
|
|
||||||
gst_navigation_send_key_event (GST_NAVIGATION (xvimagesink),
|
|
||||||
e.type == KeyPress ? "key-press" : "key-release", key_str);
|
|
||||||
} else {
|
} else {
|
||||||
gst_navigation_send_key_event (GST_NAVIGATION (xvimagesink),
|
key_str = "unknown";
|
||||||
e.type == KeyPress ? "key-press" : "key-release", "unknown");
|
|
||||||
}
|
}
|
||||||
|
g_mutex_unlock (xvimagesink->x_lock);
|
||||||
|
GST_DEBUG_OBJECT (xvimagesink,
|
||||||
|
"key %d pressed over window at %d,%d (%s)",
|
||||||
|
e.xkey.keycode, e.xkey.x, e.xkey.y, key_str);
|
||||||
|
gst_navigation_send_key_event (GST_NAVIGATION (xvimagesink),
|
||||||
|
e.type == KeyPress ? "key-press" : "key-release", key_str);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
GST_DEBUG_OBJECT (xvimagesink, "xvimagesink unhandled X event (%d)",
|
GST_DEBUG_OBJECT (xvimagesink, "xvimagesink unhandled X event (%d)",
|
||||||
|
@ -913,7 +913,7 @@ gst_xvimagesink_get_xv_support (GstXvImageSink * xvimagesink,
|
||||||
xcontext->adaptors[i] = g_strdup (adaptors[i].name);
|
xcontext->adaptors[i] = g_strdup (adaptors[i].name);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (xvimagesink->adaptor_no >= 0 &&
|
if (xvimagesink->adaptor_no != -1 &&
|
||||||
xvimagesink->adaptor_no < xcontext->nb_adaptors) {
|
xvimagesink->adaptor_no < xcontext->nb_adaptors) {
|
||||||
/* Find xv port from user defined adaptor */
|
/* Find xv port from user defined adaptor */
|
||||||
gst_lookup_xv_port_from_adaptor (xcontext, adaptors,
|
gst_lookup_xv_port_from_adaptor (xcontext, adaptors,
|
||||||
|
|
|
@ -921,7 +921,7 @@ videoscale_suite (void)
|
||||||
tcase_add_test (tc_chain, test_downscale_640x480_1x240_method_0);
|
tcase_add_test (tc_chain, test_downscale_640x480_1x240_method_0);
|
||||||
tcase_add_test (tc_chain, test_downscale_640x480_1x240_method_1);
|
tcase_add_test (tc_chain, test_downscale_640x480_1x240_method_1);
|
||||||
tcase_add_test (tc_chain, test_downscale_640x480_1x240_method_2);
|
tcase_add_test (tc_chain, test_downscale_640x480_1x240_method_2);
|
||||||
tcase_add_test (tc_chain, test_downscale_640x480_1x240_method_3);
|
tcase_skip_broken_test (tc_chain, test_downscale_640x480_1x240_method_3);
|
||||||
tcase_add_test (tc_chain, test_upscale_1x240_640x480_method_0);
|
tcase_add_test (tc_chain, test_upscale_1x240_640x480_method_0);
|
||||||
tcase_add_test (tc_chain, test_upscale_1x240_640x480_method_1);
|
tcase_add_test (tc_chain, test_upscale_1x240_640x480_method_1);
|
||||||
tcase_add_test (tc_chain, test_upscale_1x240_640x480_method_2);
|
tcase_add_test (tc_chain, test_upscale_1x240_640x480_method_2);
|
||||||
|
|
|
@ -142,6 +142,46 @@ GST_START_TEST (test_disco_sync_reuse_timeout)
|
||||||
|
|
||||||
GST_END_TEST;
|
GST_END_TEST;
|
||||||
|
|
||||||
|
GST_START_TEST (test_disco_missing_plugins)
|
||||||
|
{
|
||||||
|
const gchar *files[] = { "test.mkv", "test.mp3", "partialframe.mjpeg" };
|
||||||
|
GError *err = NULL;
|
||||||
|
GstDiscoverer *dc;
|
||||||
|
GstDiscovererInfo *info;
|
||||||
|
GstDiscovererResult result;
|
||||||
|
gchar *uri, *path;
|
||||||
|
int i;
|
||||||
|
|
||||||
|
for (i = 0; i < G_N_ELEMENTS (files); ++i) {
|
||||||
|
dc = gst_discoverer_new (5 * GST_SECOND, &err);
|
||||||
|
fail_unless (dc != NULL);
|
||||||
|
fail_unless (err == NULL);
|
||||||
|
|
||||||
|
/* GST_TEST_FILE comes from makefile CFLAGS */
|
||||||
|
path = g_build_filename (GST_TEST_FILES_PATH, files[i], NULL);
|
||||||
|
uri = gst_filename_to_uri (path, &err);
|
||||||
|
g_free (path);
|
||||||
|
fail_unless (err == NULL);
|
||||||
|
|
||||||
|
GST_INFO ("discovering uri '%s'", uri);
|
||||||
|
info = gst_discoverer_discover_uri (dc, uri, &err);
|
||||||
|
fail_unless (info != NULL);
|
||||||
|
fail_unless (err != NULL);
|
||||||
|
result = gst_discoverer_info_get_result (info);
|
||||||
|
GST_INFO ("result: %d, error message: %s", result, err->message);
|
||||||
|
fail_unless_equals_int (result, GST_DISCOVERER_MISSING_PLUGINS);
|
||||||
|
GST_INFO ("misc: %" GST_PTR_FORMAT, gst_discoverer_info_get_misc (info));
|
||||||
|
|
||||||
|
gst_discoverer_info_unref (info);
|
||||||
|
g_error_free (err);
|
||||||
|
err = NULL;
|
||||||
|
g_free (uri);
|
||||||
|
g_object_unref (dc);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
GST_END_TEST;
|
||||||
|
|
||||||
static Suite *
|
static Suite *
|
||||||
discoverer_suite (void)
|
discoverer_suite (void)
|
||||||
{
|
{
|
||||||
|
@ -154,6 +194,7 @@ discoverer_suite (void)
|
||||||
tcase_add_test (tc_chain, test_disco_sync_reuse_ogg);
|
tcase_add_test (tc_chain, test_disco_sync_reuse_ogg);
|
||||||
tcase_add_test (tc_chain, test_disco_sync_reuse_mp3);
|
tcase_add_test (tc_chain, test_disco_sync_reuse_mp3);
|
||||||
tcase_add_test (tc_chain, test_disco_sync_reuse_timeout);
|
tcase_add_test (tc_chain, test_disco_sync_reuse_timeout);
|
||||||
|
tcase_add_test (tc_chain, test_disco_missing_plugins);
|
||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -3,5 +3,6 @@ EXTRA_DIST = \
|
||||||
hls.m3u8 \
|
hls.m3u8 \
|
||||||
license-uris \
|
license-uris \
|
||||||
partialframe.mjpeg \
|
partialframe.mjpeg \
|
||||||
|
test.mkv \
|
||||||
test.mp3 \
|
test.mp3 \
|
||||||
theora-vorbis.ogg
|
theora-vorbis.ogg
|
||||||
|
|
BIN
tests/files/test.mkv
Normal file
BIN
tests/files/test.mkv
Normal file
Binary file not shown.
|
@ -49,6 +49,7 @@ EXPORTS
|
||||||
gst_audio_decoder_get_plc_aware
|
gst_audio_decoder_get_plc_aware
|
||||||
gst_audio_decoder_get_tolerance
|
gst_audio_decoder_get_tolerance
|
||||||
gst_audio_decoder_get_type
|
gst_audio_decoder_get_type
|
||||||
|
gst_audio_decoder_merge_tags
|
||||||
gst_audio_decoder_set_byte_time
|
gst_audio_decoder_set_byte_time
|
||||||
gst_audio_decoder_set_drainable
|
gst_audio_decoder_set_drainable
|
||||||
gst_audio_decoder_set_latency
|
gst_audio_decoder_set_latency
|
||||||
|
|
Loading…
Reference in a new issue