forked from koropets/goav
-
Notifications
You must be signed in to change notification settings - Fork 2
/
packet_struct.go
executable file
·83 lines (65 loc) · 1.53 KB
/
packet_struct.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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
// Use of this source code is governed by a MIT license that can be found in the LICENSE file.
// Giorgis (habtom@giorgis.io)
package avcodec
//#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
//#cgo CFLAGS: -Wdeprecated-declarations
//#cgo pkg-config: libavcodec
//#include <libavcodec/avcodec.h>
import "C"
import "unsafe"
func (p *Packet) Buf() *AvBufferRef {
return (*AvBufferRef)(p.buf)
}
func (p *Packet) Duration() int {
return int(p.duration)
}
func (p *Packet) Flags() int {
return int(p.flags)
}
func (p *Packet) SetFlags(f int) {
p.flags = C.int(f)
}
func (p *Packet) SideDataElems() int {
return int(p.side_data_elems)
}
func (p *Packet) Size() int {
return int(p.size)
}
func (p *Packet) SetSize(s int) {
p.size = C.int(s)
}
//func (p *Packet) SetPts(s int64) {
// p.pts = C.long(s)
//}
func (p *Packet) StreamIndex() int {
return int(p.stream_index)
}
func (p *Packet) SetStreamIndex(i int) {
p.stream_index = C.int(i)
}
func (p *Packet) ConvergenceDuration() int64 {
return int64(p.convergence_duration)
}
func (p *Packet) Dts() int64 {
return int64(p.dts)
}
func (p *Packet) Pos() int64 {
return int64(p.pos)
}
func (p *Packet) Pts() int64 {
return int64(p.pts)
}
func (p *Packet) Data() *uint8 {
return (*uint8)(p.data)
}
func (p *Packet) SetData(d *uint8) {
p.data = (*C.uint8_t)(d)
}
func (p *Packet) SetDataNULL() {
//p.data = (*C.uint8_t)(unsafe.Pointer(nil))
// a := "1"
// pca := C.CString(*a)
p.data = (*C.uint8_t)(unsafe.Pointer(C.NULL))
//p.data = C.int(0)
//C.free(unsafe.Pointer(pca))
}