mirror of
https://github.com/go-gst/go-gst.git
synced 2025-10-06 16:36:51 +08:00
organize hack code
This commit is contained in:
21
hack/test.c
Normal file
21
hack/test.c
Normal file
@@ -0,0 +1,21 @@
|
||||
#include <gst/gst.h>
|
||||
#include <stdio.h>
|
||||
|
||||
gboolean caps_map_func (GstCapsFeatures * features, GstStructure * structure, gpointer user_data)
|
||||
{
|
||||
printf(gst_caps_features_to_string(features));
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
int main () {
|
||||
gst_init(NULL, NULL);
|
||||
|
||||
GstCaps * caps = gst_caps_from_string("audio/x-raw");
|
||||
|
||||
gst_caps_filter_and_map_in_place(caps, caps_map_func, NULL);
|
||||
gst_caps_foreach(caps, caps_map_func, NULL);
|
||||
|
||||
gst_caps_unref(caps);
|
||||
|
||||
return 0;
|
||||
}
|
25
hack/test.go
Normal file
25
hack/test.go
Normal file
@@ -0,0 +1,25 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/tinyzimmer/go-gst/gst"
|
||||
)
|
||||
|
||||
func main() {
|
||||
gst.Init(nil)
|
||||
|
||||
caps := gst.NewCapsFromString("audio/x-raw")
|
||||
|
||||
// caps.ForEach(func(features *gst.CapsFeatures, structure *gst.Structure) bool {
|
||||
// fmt.Println(features)
|
||||
// return true
|
||||
// })
|
||||
|
||||
caps.FilterAndMapInPlace(func(features *gst.CapsFeatures, structure *gst.Structure) bool {
|
||||
fmt.Println(features)
|
||||
return true
|
||||
})
|
||||
|
||||
caps.Unref()
|
||||
}
|
Reference in New Issue
Block a user