File tree Expand file tree Collapse file tree 1 file changed +16
-3
lines changed Expand file tree Collapse file tree 1 file changed +16
-3
lines changed Original file line number Diff line number Diff line change 1
1
package media
2
2
3
3
import (
4
+ "encoding/json"
5
+
4
6
// Packages
5
7
ff "github.com/mutablelogic/go-media/sys/ffmpeg61"
6
8
)
@@ -9,8 +11,7 @@ import (
9
11
// TYPES
10
12
11
13
type packet struct {
12
- X string `json:"type"`
13
- * ff.AVPacket
14
+ ctx * ff.AVPacket
14
15
}
15
16
16
17
var _ Packet = (* packet )(nil )
@@ -19,5 +20,17 @@ var _ Packet = (*packet)(nil)
19
20
// LIFECYCLE
20
21
21
22
func newPacket (ctx * ff.AVPacket ) * packet {
22
- return & packet {"X" , ctx }
23
+ return & packet {ctx }
24
+ }
25
+
26
+ ////////////////////////////////////////////////////////////////////////////////
27
+ // STRINGIFY
28
+
29
+ func (packet * packet ) MarshalJSON () ([]byte , error ) {
30
+ return json .Marshal (packet .ctx )
31
+ }
32
+
33
+ func (packet * packet ) String () string {
34
+ data , _ := json .MarshalIndent (packet , "" , " " )
35
+ return string (data )
23
36
}
You can’t perform that action at this time.
0 commit comments