fix linting and add GstContext

This commit is contained in:
tinyzimmer
2020-09-30 21:36:59 +03:00
parent 8a9b7ca418
commit db4a8fc1b8
9 changed files with 139 additions and 25 deletions

View File

@@ -6,7 +6,7 @@ import (
"github.com/tinyzimmer/go-gst/gst"
)
func main() {
func capsWeirdness() {
gst.Init(nil)
caps := gst.NewCapsFromString("audio/x-raw")

View File

@@ -7,7 +7,7 @@ import (
"github.com/tinyzimmer/go-gst/gst"
)
func main() {
func wait() {
gst.Init(nil)
clock := gst.ObtainSystemClock()

View File

@@ -7,7 +7,7 @@ import (
"time"
)
func main() {
func sleep() {
go func() {
C.sleep(1000000000)
fmt.Println("I slept")

View File

@@ -1,21 +0,0 @@
#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;
}