Report caps update only once per video resolution change.

This commit is contained in:
Gwenole Beauchesne 2011-07-22 15:34:48 +02:00
parent ab6efa04ca
commit 2f91c9e8c1

View file

@ -440,24 +440,24 @@ gst_vaapi_decoder_set_picture_size(
) )
{ {
GstVaapiDecoderPrivate * const priv = decoder->priv; GstVaapiDecoderPrivate * const priv = decoder->priv;
gboolean size_changed = FALSE;
g_object_freeze_notify(G_OBJECT(decoder));
if (priv->width != width) { if (priv->width != width) {
GST_DEBUG("picture width changed to %d", width); GST_DEBUG("picture width changed to %d", width);
priv->width = width; priv->width = width;
gst_caps_set_simple(priv->caps, "width", G_TYPE_INT, width, NULL); gst_caps_set_simple(priv->caps, "width", G_TYPE_INT, width, NULL);
g_object_notify(G_OBJECT(decoder), "caps"); size_changed = TRUE;
} }
if (priv->height != height) { if (priv->height != height) {
GST_DEBUG("picture height changed to %d", height); GST_DEBUG("picture height changed to %d", height);
priv->height = height; priv->height = height;
gst_caps_set_simple(priv->caps, "height", G_TYPE_INT, height, NULL); gst_caps_set_simple(priv->caps, "height", G_TYPE_INT, height, NULL);
g_object_notify(G_OBJECT(decoder), "caps"); size_changed = TRUE;
} }
g_object_thaw_notify(G_OBJECT(decoder)); if (size_changed)
g_object_notify(G_OBJECT(decoder), "caps");
} }
void void