commit 2ec09410fc02c819207c5d400c6c27f1b1aa509b
Author: benjamin gaignard <benjamin.gaignard@stericsson>
Date:   Thu Jan 7 10:32:24 2010 +0100

    add frame drop message

diff --git a/gst/gstmessage.c b/gst/gstmessage.c
index c30f738..3065da5 100644
--- a/gst/gstmessage.c
+++ b/gst/gstmessage.c
@@ -111,6 +111,7 @@ static GstMessageQuarks message_quarks[] = {
   {GST_MESSAGE_ASYNC_DONE, "async-done", 0},
   {GST_MESSAGE_REQUEST_STATE, "request-state", 0},
   {GST_MESSAGE_STEP_START, "step-start", 0},
+  {GST_MESSAGE_FRAME_DROP, "frame-drop", 0},
   {0, NULL, 0}
 };
 
@@ -1793,3 +1794,26 @@ gst_message_parse_step_start (GstMessage * message, gboolean * active,
       GST_QUARK (FLUSH), G_TYPE_BOOLEAN, flush,
       GST_QUARK (INTERMEDIATE), G_TYPE_BOOLEAN, intermediate, NULL);
 }
+
+GstMessage * gst_message_new_frame_drop	(GstObject * src, GstClockTime timestamp)
+{
+  GstMessage *message;
+  GstStructure *structure;
+
+  structure = gst_structure_id_new (GST_QUARK (MESSAGE_FRAME_DROP),
+        GST_QUARK (TIMESTAMP), G_TYPE_UINT64, timestamp, NULL);
+  message = gst_message_new_custom (GST_MESSAGE_FRAME_DROP, src, structure);
+
+  return message;
+
+}
+
+void gst_message_parse_frame_drop (GstMessage * message, GstClockTime *timestamp)
+{
+  g_return_if_fail (GST_IS_MESSAGE (message));
+  g_return_if_fail (GST_MESSAGE_TYPE (message) == GST_MESSAGE_FRAME_DROP);
+  
+  gst_structure_id_get (message->structure,
+      GST_QUARK (TIMESTAMP), G_TYPE_UINT64, timestamp, NULL);
+}
+
diff --git a/gst/gstmessage.h b/gst/gstmessage.h
index 8fb75c0..34d4c68 100644
--- a/gst/gstmessage.h
+++ b/gst/gstmessage.h
@@ -85,6 +85,7 @@ typedef struct _GstMessageClass GstMessageClass;
  * change state. This message is a suggestion to the application which can
  * decide to perform the state change on (part of) the pipeline. Since: 0.10.23.
  * @GST_MESSAGE_STEP_START: A stepping operation was started.
+ * @GST_MESSAGE_FRAME_DROP: Poste by elements when a frame is drop
  * @GST_MESSAGE_ANY: mask for all of the above messages.
  *
  * The different message types that are available.
@@ -119,6 +120,7 @@ typedef enum
   GST_MESSAGE_ASYNC_DONE        = (1 << 21),
   GST_MESSAGE_REQUEST_STATE     = (1 << 22),
   GST_MESSAGE_STEP_START        = (1 << 23),
+  GST_MESSAGE_FRAME_DROP		= (1 << 24),
   GST_MESSAGE_ANY               = ~0
 } GstMessageType;
 
@@ -472,6 +474,9 @@ GstMessage *    gst_message_new_step_start      (GstObject * src, gboolean activ
 void            gst_message_parse_step_start    (GstMessage * message, gboolean *active, GstFormat *format,
                                                  guint64 *amount, gdouble *rate, gboolean *flush,
 						 gboolean *intermediate);
+/* FRAME DROP */
+GstMessage *	gst_message_new_frame_drop		(GstObject * src, GstClockTime timestamp);
+void			gst_message_parse_frame_drop	(GstMessage * message, GstClockTime *timestamp); 
 
 /* custom messages */
 GstMessage *	gst_message_new_custom		(GstMessageType type,
diff --git a/gst/gstquark.c b/gst/gstquark.c
index 957f43c..28376ef 100644
--- a/gst/gstquark.c
+++ b/gst/gstquark.c
@@ -47,7 +47,7 @@ static const gchar *_quark_strings[] = {
   "GstQueryPosition", "GstQueryDuration", "GstQueryLatency", "GstQueryConvert",
   "GstQuerySegment", "GstQuerySeeking", "GstQueryFormats", "GstQueryBuffering",
   "GstQueryURI", "GstEventStep", "GstMessageStepDone", "amount", "flush",
-  "intermediate", "GstMessageStepStart", "active", "eos"
+  "intermediate", "GstMessageStepStart", "active", "eos", "frame-drop"
 };
 
 GQuark _priv_gst_quark_table[GST_QUARK_MAX];
diff --git a/gst/gstquark.h b/gst/gstquark.h
index 234883e..a1ff76d 100644
--- a/gst/gstquark.h
+++ b/gst/gstquark.h
@@ -117,8 +117,8 @@ typedef enum _GstQuarkId
   GST_QUARK_MESSAGE_STEP_START = 88,
   GST_QUARK_ACTIVE = 89,
   GST_QUARK_EOS = 90,
-
-  GST_QUARK_MAX = 91
+  GST_QUARK_MESSAGE_FRAME_DROP = 91,
+  GST_QUARK_MAX = 92
 } GstQuarkId;
 
 extern GQuark _priv_gst_quark_table[GST_QUARK_MAX];
diff --git a/libs/gst/base/gstbasesink.c b/libs/gst/base/gstbasesink.c
index 4d35948..f727ccc 100644
--- a/libs/gst/base/gstbasesink.c
+++ b/libs/gst/base/gstbasesink.c
@@ -2807,6 +2807,9 @@ dropped:
   {
     priv->dropped++;
     GST_DEBUG_OBJECT (basesink, "buffer late, dropping");
+	gst_element_post_message (GST_ELEMENT (basesink),
+		gst_message_new_frame_drop (GST_OBJECT (basesink),
+			GST_BUFFER_TIMESTAMP(GST_BUFFER_CAST (obj))));
     goto done;
   }
 flushing:
diff --git a/libs/gst/base/gstbasetransform.c b/libs/gst/base/gstbasetransform.c
index 2e56962..0b63ecd 100644
--- a/libs/gst/base/gstbasetransform.c
+++ b/libs/gst/base/gstbasetransform.c
@@ -2081,6 +2081,10 @@ gst_base_transform_chain (GstPad * pad, GstBuffer * buffer)
       ret = gst_pad_push (trans->srcpad, outbuf);
     } else
       gst_buffer_unref (outbuf);
+  } else {
+	gst_element_post_message (GST_ELEMENT (trans),
+		gst_message_new_frame_drop (GST_OBJECT (trans),
+			GST_BUFFER_TIMESTAMP(buffer)));
   }
 
   /* convert internal flow to OK and mark discont for the next buffer. */
