From d1a78aa3f9e737023b31ec84fef11e13002a12ea Mon Sep 17 00:00:00 2001 From: David Schleef Date: Thu, 30 Dec 2010 18:25:04 -0800 Subject: [PATCH] schroenc: Output element message with frame stats --- ext/schroedinger/gstschroenc.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/ext/schroedinger/gstschroenc.c b/ext/schroedinger/gstschroenc.c index 7af28eac2a..3ad76ab81b 100644 --- a/ext/schroedinger/gstschroenc.c +++ b/ext/schroedinger/gstschroenc.c @@ -782,7 +782,7 @@ gst_schro_enc_process (GstSchroEnc * schro_enc) buf = gst_buffer_new_and_alloc (sizeof (double) * 21); schro_encoder_get_frame_stats (schro_enc->encoder, (double *) GST_BUFFER_DATA (buf), 21); - structure = gst_structure_new ("schroenc", + structure = gst_structure_new ("GstSchroEnc", "frame-stats", GST_TYPE_BUFFER, buf, NULL); gst_buffer_unref (buf); message = gst_message_new_element (GST_OBJECT (schro_enc), structure); @@ -790,6 +790,21 @@ gst_schro_enc_process (GstSchroEnc * schro_enc) } #endif + { + GstMessage *message; + GstStructure *structure; + GstBuffer *buf; + + buf = gst_buffer_new_and_alloc (sizeof (double) * 21); + schro_encoder_get_frame_stats (schro_enc->encoder, + (double *) GST_BUFFER_DATA (buf), 21); + structure = gst_structure_new ("schroenc", + "frame-stats", GST_TYPE_BUFFER, buf, NULL); + message = gst_message_new_element (GST_OBJECT (schro_enc), structure); + gst_element_post_message (GST_ELEMENT (schro_enc), message); + } + + if (voidptr == NULL) { GST_DEBUG ("got eos"); //frame = schro_enc->eos_frame;