message: add timeout to progress message

Add a timeout member to the progress messages to let the application know about
the timeout so that it can do some gui things with it.
This commit is contained in:
Wim Taymans 2011-02-15 18:26:00 +01:00
parent fab02a497a
commit ea21e404a7
3 changed files with 6 additions and 4 deletions

View file

@ -2104,7 +2104,7 @@ gst_message_new_progress (GstObject * src, GstProgressType type,
{
GstMessage *message;
GstStructure *structure;
gint percent = 100;
gint percent = 100, timeout = -1;
g_return_val_if_fail (code != NULL, NULL);
g_return_val_if_fail (text != NULL, NULL);
@ -2116,7 +2116,8 @@ gst_message_new_progress (GstObject * src, GstProgressType type,
GST_QUARK (TYPE), GST_TYPE_PROGRESS_TYPE, type,
GST_QUARK (CODE), G_TYPE_STRING, code,
GST_QUARK (TEXT), G_TYPE_STRING, text,
GST_QUARK (PERCENT), G_TYPE_INT, percent, NULL);
GST_QUARK (PERCENT), G_TYPE_INT, percent,
GST_QUARK (TIMEOUT), G_TYPE_INT, timeout, NULL);
message = gst_message_new_custom (GST_MESSAGE_PROGRESS, src, structure);
return message;

View file

@ -50,7 +50,7 @@ static const gchar *_quark_strings[] = {
"intermediate", "GstMessageStepStart", "active", "eos", "sink-message",
"message", "GstMessageQOS", "running-time", "stream-time", "jitter",
"quality", "processed", "dropped", "buffering-ranges", "GstMessageProgress",
"code", "text", "percent"
"code", "text", "percent", "timeout"
};
GQuark _priv_gst_quark_table[GST_QUARK_MAX];

View file

@ -131,8 +131,9 @@ typedef enum _GstQuarkId
GST_QUARK_CODE = 102,
GST_QUARK_TEXT = 103,
GST_QUARK_PERCENT = 104,
GST_QUARK_TIMEOUT = 105,
GST_QUARK_MAX = 105
GST_QUARK_MAX = 106
} GstQuarkId;
extern GQuark _priv_gst_quark_table[GST_QUARK_MAX];