Make push_buffer() look similar to the code used in alsamidisrc
[gst-aseq-appsrc.git] / gst-aseq-appsrc.c
index 1b2da94..7c42ab4 100644 (file)
@@ -171,12 +171,11 @@ connect_ports (App * app)
 static void
 push_buffer (App * app, gpointer data, guint size)
 {
-  GstBuffer *buffer;
   GstClockTime time;
-  int ret;
   gpointer local_data;
+  GstBuffer *buffer;
+  int ret;
 
-  /* read the next chunk */
   buffer = gst_buffer_new ();
 
   time = app->tick * DEFAULT_TICK_PERIOD_MS * GST_MSECOND;
@@ -192,6 +191,8 @@ push_buffer (App * app, gpointer data, guint size)
       gst_memory_new_wrapped (0, local_data, size, 0, size, local_data,
           g_free));
 
+  GST_MEMDUMP ("MIDI data:", local_data, size);
+
   GST_DEBUG ("feed buffer %p, tick %" G_GUINT64_FORMAT " size: %u",
       (gpointer) buffer, app->tick, size);
   g_signal_emit_by_name (app->appsrc, "push-buffer", buffer, &ret);
@@ -392,9 +393,12 @@ main (int argc, char *argv[])
   GOptionContext *ctx;
   GError *err = NULL;
   gchar *ports = NULL;
+  gboolean verbose = FALSE;
   GOptionEntry options[] = {
     {"ports", 'p', 0, G_OPTION_ARG_STRING, &ports,
         "Comma separated list of sequencer ports", "client:port,..."},
+    {"verbose", 'v', 0, G_OPTION_ARG_NONE, &verbose,
+         "Output status information and property notifications", NULL},
     {NULL}
   };
 
@@ -433,6 +437,9 @@ main (int argc, char *argv[])
       ("appsrc name=mysource ! fluiddec ! audioconvert ! autoaudiosink", NULL);
   g_assert (app->pipeline);
 
+  if (verbose)
+    g_signal_connect (app->pipeline, "deep-notify", G_CALLBACK (gst_object_default_deep_notify), NULL);
+
   bus = gst_pipeline_get_bus (GST_PIPELINE (app->pipeline));
   g_assert (bus);