summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Pointner <equinox@helsinki.at>2016-01-14 03:30:24 (GMT)
committerChristian Pointner <equinox@helsinki.at>2016-01-14 03:30:24 (GMT)
commit70a58b91745495e7dacbead3453708f6c43b21bb (patch)
tree12b3b8c10bade7f443fe6c5f37a85790dab65362
parentb0f92856bebfcd83f78cea366d0937f66de9a367 (diff)
first attempt to parse level meter - not fully working yet
-rw-r--r--player/player.go17
1 files changed, 10 insertions, 7 deletions
diff --git a/player/player.go b/player/player.go
index 60a19fa..131ef58 100644
--- a/player/player.go
+++ b/player/player.go
@@ -100,27 +100,30 @@ func (p *Player) onMessage(bus *gst.Bus, msg *gst.Message) {
case gst.MESSAGE_EOS:
p.pipe.SetState(gst.STATE_NULL)
p.state = IDLE
- p.stdlog.Printf("GStreamer Pipeline: EOS reached!\n")
+ p.stdlog.Printf("GStreamer Pipeline: EOS reached!")
case gst.MESSAGE_WARNING:
warn, _ := msg.ParseWarning()
- p.stdlog.Printf("GStreamer Pipeline Warning: %s\n", warn)
+ p.stdlog.Printf("GStreamer Pipeline Warning: %s", warn)
case gst.MESSAGE_ERROR:
p.pipe.SetState(gst.STATE_NULL)
p.state = IDLE
err, _ := msg.ParseError()
- p.stdlog.Printf("GStreamer Pipeline Error: %s\n", err)
+ p.stdlog.Printf("GStreamer Pipeline Error: %s", err)
case gst.MESSAGE_ASYNC_DONE:
len, ok := p.pipe.QueryDuration(gst.FORMAT_TIME)
if ok {
- p.stdlog.Printf("GStreamer Pipeline: loaded file has length: %d.%d s\n", len/1000000000, len%1000000000)
+ p.stdlog.Printf("GStreamer Pipeline: loaded file has length: %d.%d s", len/1000000000, len%1000000000)
} else {
- p.stdlog.Printf("GStreamer Pipeline Error: unable to query duration of file\n")
+ p.stdlog.Printf("GStreamer Pipeline Error: unable to query duration of file")
}
case gst.MESSAGE_ELEMENT:
- p.stdlog.Printf("GStreamer Message: from element '%s'\n", msg.GetSourceName())
+ src := msg.GetSourceName()
+ p.stdlog.Printf("GStreamer Message: from element '%s'", src)
+ s := msg.GetStructure()
+ p.stdlog.Printf(">>> %s(%s): peak: %v, decay: %v", src, s.Name, s.Data["peak"], s.Data["decay"])
case gst.MESSAGE_STATE_CHANGED:
default:
- p.stdlog.Printf("GStreamer Message: unknown type '%s'\n", msg.GetTypeName())
+ p.stdlog.Printf("GStreamer Message: unknown type '%s'", msg.GetTypeName())
}
}