forked from ziutek/gst
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathappsrc.go
42 lines (32 loc) · 787 Bytes
/
appsrc.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
package gst
/*
#include <stdlib.h>
#include <gst/gst.h>
#include <gst/app/gstappsrc.h>
#cgo LDFLAGS: -lgstapp-1.0
*/
import "C"
import (
"unsafe"
)
type AppSrc struct {
BaseSrc
}
func (b *AppSrc) g() *C.GstAppSrc {
return (*C.GstAppSrc)(b.GetPtr())
}
func (b *AppSrc) AsAppSrc() *AppSrc {
return b
}
func NewAppSrc(name string) *AppSrc {
return (*AppSrc)(unsafe.Pointer(ElementFactoryMake("appsrc", name)))
}
func (b *AppSrc) PushBuffer(buffer *Buffer) int {
return (int)(C.gst_app_src_push_buffer((*C.GstAppSrc)(b.g()), (*C.GstBuffer)(buffer.GstBuffer)))
}
func (b *AppSrc) EndOfStream() int {
return (int)(C.gst_app_src_end_of_stream((*C.GstAppSrc)(b.g())))
}
func (b *AppSrc) SetCaps(caps *Caps) {
C.gst_app_src_set_caps((*C.GstAppSrc)(b.g()), (*C.GstCaps)(caps))
}