diff options
author | Richard Boulton <richard@tartarus.org> | 2002-03-08 16:43:08 +0000 |
---|---|---|
committer | Richard Boulton <richard@tartarus.org> | 2002-03-08 16:43:08 +0000 |
commit | 31b3a71dc8ce8f38b4e7a51ccb6cb1dbfc3a75b6 (patch) | |
tree | bd3a0b0dcc65bb49e8cdd35bf32c4b1a70510491 /gst/monoscope/gstmonoscope.c | |
parent | fef1a9307ee15214fe0882df6b4f6ce65adbeb55 (diff) |
Remove static structures: you can now have multiple monoscopes, and they'll actually display different things. :)
Original commit message from CVS:
Remove static structures: you can now have multiple monoscopes, and they'll
actually display different things. :)
Diffstat (limited to 'gst/monoscope/gstmonoscope.c')
-rw-r--r-- | gst/monoscope/gstmonoscope.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/gst/monoscope/gstmonoscope.c b/gst/monoscope/gstmonoscope.c index da370a18..04209a0f 100644 --- a/gst/monoscope/gstmonoscope.c +++ b/gst/monoscope/gstmonoscope.c @@ -40,13 +40,16 @@ struct _GstMonoscope { // the timestamp of the next frame guint64 next_time; - gint16 datain[2][512]; + gint16 datain[512]; // video state gint fps; gint width; gint height; gboolean first_buffer; + + // visualisation state + struct monoscope_state * visstate; }; struct _GstMonoscopeClass { @@ -244,16 +247,16 @@ gst_monoscope_chain (GstPad *pad, GstBuffer *bufin) } data = (gint16 *) GST_BUFFER_DATA (bufin); + // FIXME: get rid of this: waste of effort. for (i=0; i < 512; i++) { - monoscope->datain[0][i] = *data++; - monoscope->datain[1][i] = *data++; + monoscope->datain[i] = *data++; } if (monoscope->first_buffer) { GstCaps *caps; - monoscope_init (monoscope->width, monoscope->height); - + monoscope->visstate = monoscope_init (monoscope->width, monoscope->height); + g_assert(monoscope->visstate != 0); GST_DEBUG (0, "making new pad\n"); caps = GST_CAPS_NEW ( @@ -279,7 +282,7 @@ gst_monoscope_chain (GstPad *pad, GstBuffer *bufin) bufout = gst_buffer_new (); GST_BUFFER_SIZE (bufout) = monoscope->width * monoscope->height * 4; - GST_BUFFER_DATA (bufout) = (guchar *) monoscope_update (monoscope->datain); + GST_BUFFER_DATA (bufout) = (guchar *) monoscope_update (monoscope->visstate, monoscope->datain); GST_BUFFER_TIMESTAMP (bufout) = monoscope->next_time; GST_BUFFER_FLAG_SET (bufout, GST_BUFFER_DONTFREE); |