major rework of reference handling

This commit is contained in:
Avi Zimmerman
2021-01-19 00:18:30 +02:00
parent 63a53be42a
commit 1f7d60b390
79 changed files with 1239 additions and 800 deletions

View File

@@ -55,7 +55,6 @@ func createPipeline() (*gst.Pipeline, error) {
if sample == nil {
return gst.FlowEOS
}
defer sample.Unref()
// Retrieve the buffer from the sample
buffer := sample.GetBuffer()
@@ -89,7 +88,6 @@ func createPipeline() (*gst.Pipeline, error) {
}
func handleMessage(msg *gst.Message) error {
defer msg.Unref() // Messages are a good candidate for trying out runtime finalizers
switch msg.Type() {
case gst.MessageEOS:
@@ -103,8 +101,6 @@ func handleMessage(msg *gst.Message) error {
func mainLoop(pipeline *gst.Pipeline) error {
defer pipeline.Destroy() // Will stop and unref the pipeline when this function returns
// Start the pipeline
pipeline.SetState(gst.StatePlaying)