fix old import path

master
Baik S. Hyun 3 years ago
parent 3894723f67
commit 3d915d3a69

@ -8,10 +8,10 @@ JOY4 is powerful library written in golang, well-designed interface makes a few
Well-designed and easy-to-use interfaces: Well-designed and easy-to-use interfaces:
- Muxer / Demuxer ([doc](https://pkg.go.dev/github.com/Danile71/joy4/av#Demuxer) [example](https://github.com/Danile71/joy4/blob/master/examples/open_probe_file/main.go)) - Muxer / Demuxer ([doc](https://pkg.go.dev/gitlab.com/ics_cinnamon/joy4/av#Demuxer) [example](https://gitlab.com/ics_cinnamon/joy4/blob/master/examples/open_probe_file/main.go))
- Audio Decoder ([doc](https://pkg.go.dev/github.com/Danile71/joy4/av#AudioDecoder) [example](https://github.com/Danile71/joy4/blob/master/examples/audio_decode/main.go)) - Audio Decoder ([doc](https://pkg.go.dev/gitlab.com/ics_cinnamon/joy4/av#AudioDecoder) [example](https://gitlab.com/ics_cinnamon/joy4/blob/master/examples/audio_decode/main.go))
- Transcoding ([doc](https://pkg.go.dev/github.com/Danile71/joy4/av/transcode) [example](https://github.com/Danile71/joy4/blob/master/examples/transcode/main.go)) - Transcoding ([doc](https://pkg.go.dev/gitlab.com/ics_cinnamon/joy4/av/transcode) [example](https://gitlab.com/ics_cinnamon/joy4/blob/master/examples/transcode/main.go))
- Streaming server ([example](https://github.com/Danile71/joy4/blob/master/examples/http_flv_and_rtmp_server/main.go)) - Streaming server ([example](https://gitlab.com/ics_cinnamon/joy4/blob/master/examples/http_flv_and_rtmp_server/main.go))
Support container formats: Support container formats:
@ -34,31 +34,31 @@ RTMP / HTTP-FLV Server
- High performance - High performance
Publisher-subscriber packet buffer queue ([doc](https://pkg.go.dev/github.com/Danile71/joy4/av/pubsub)) Publisher-subscriber packet buffer queue ([doc](https://pkg.go.dev/gitlab.com/ics_cinnamon/joy4/av/pubsub))
- Customize publisher buffer time and subscriber read position - Customize publisher buffer time and subscriber read position
- Multiple channels live streaming ([example](https://github.com/Danile71/joy4/blob/master/examples/rtmp_server_channels/main.go)) - Multiple channels live streaming ([example](https://gitlab.com/ics_cinnamon/joy4/blob/master/examples/rtmp_server_channels/main.go))
Packet filters ([doc](https://pkg.go.dev/github.com/Danile71/joy4/av/pktque)) Packet filters ([doc](https://pkg.go.dev/gitlab.com/ics_cinnamon/joy4/av/pktque))
- Wait first keyframe - Wait first keyframe
- Fix timestamp - Fix timestamp
- Make A/V sync - Make A/V sync
- Customize ([example](https://github.com/Danile71/joy4/blob/master/examples/rtmp_server_channels/main.go#L19)) - Customize ([example](https://gitlab.com/ics_cinnamon/joy4/blob/master/examples/rtmp_server_channels/main.go#L19))
FFMPEG Golang-style binding ([doc](https://pkg.go.dev/github.com/Danile71/joy4/cgo/ffmpeg)) FFMPEG Golang-style binding ([doc](https://pkg.go.dev/gitlab.com/ics_cinnamon/joy4/cgo/ffmpeg))
- Audio Encoder / Decoder - Audio Encoder / Decoder
- Video Decoder - Video Decoder
- Audio Resampler - Audio Resampler
Support codec and container parsers: Support codec and container parsers:
- H264 SPS/PPS/AVCDecoderConfigure parser ([doc](https://pkg.go.dev/github.com/Danile71/joy4/codec/h264parser)) - H264 SPS/PPS/AVCDecoderConfigure parser ([doc](https://pkg.go.dev/gitlab.com/ics_cinnamon/joy4/codec/h264parser))
- AAC ADTSHeader/MPEG4AudioConfig parser ([doc](https://pkg.go.dev/github.com/Danile71/joy4/codec/aacparser)) - AAC ADTSHeader/MPEG4AudioConfig parser ([doc](https://pkg.go.dev/gitlab.com/ics_cinnamon/joy4/codec/aacparser))
- MP4 Atoms parser ([doc](https://pkg.go.dev/github.com/Danile71/joy4/format/mp4/mp4io)) - MP4 Atoms parser ([doc](https://pkg.go.dev/gitlab.com/ics_cinnamon/joy4/format/mp4/mp4io))
- FLV AMF0 object parser ([doc](https://pkg.go.dev/github.com/Danile71/joy4/format/flv/flvio)) - FLV AMF0 object parser ([doc](https://pkg.go.dev/gitlab.com/ics_cinnamon/joy4/format/flv/flvio))
# Requirements # Requirements

@ -121,6 +121,7 @@ var (
PCM_ALAW = MakeAudioCodecType(avCodecTypeMagic + 3) PCM_ALAW = MakeAudioCodecType(avCodecTypeMagic + 3)
SPEEX = MakeAudioCodecType(avCodecTypeMagic + 4) SPEEX = MakeAudioCodecType(avCodecTypeMagic + 4)
NELLYMOSER = MakeAudioCodecType(avCodecTypeMagic + 5) NELLYMOSER = MakeAudioCodecType(avCodecTypeMagic + 5)
G729= MakeAudioCodecType(avCodecTypeMagic + 6)
) )
const codecTypeAudioBit = 0x1 const codecTypeAudioBit = 0x1
@ -136,6 +137,8 @@ func (self CodecType) String() string {
return "PCM_MULAW" return "PCM_MULAW"
case PCM_ALAW: case PCM_ALAW:
return "PCM_ALAW" return "PCM_ALAW"
case G729:
return "G729"
case SPEEX: case SPEEX:
return "SPEEX" return "SPEEX"
case NELLYMOSER: case NELLYMOSER:

@ -4,17 +4,18 @@ import (
"fmt" "fmt"
"io" "io"
"time" "time"
"github.com/Danile71/joy4/av/avutil"
"github.com/Danile71/joy4/av" "gitlab.com/ics_cinnamon/joy4/av"
"github.com/Danile71/joy4/av/pktque" "gitlab.com/ics_cinnamon/joy4/av/avutil"
"github.com/Danile71/joy4/av/transcode" "gitlab.com/ics_cinnamon/joy4/av/pktque"
"gitlab.com/ics_cinnamon/joy4/av/transcode"
) )
var Debug bool var Debug bool
type Option struct { type Option struct {
Transcode bool Transcode bool
Args []string Args []string
} }
type Options struct { type Options struct {
@ -23,7 +24,7 @@ type Options struct {
type Demuxer struct { type Demuxer struct {
transdemux *transcode.Demuxer transdemux *transcode.Demuxer
streams []av.CodecData streams []av.CodecData
Options Options
Demuxer av.Demuxer Demuxer av.Demuxer
} }
@ -56,10 +57,10 @@ func (self *Demuxer) prepare() (err error) {
} }
/* /*
var streams []av.CodecData var streams []av.CodecData
if streams, err = self.Demuxer.Streams(); err != nil { if streams, err = self.Demuxer.Streams(); err != nil {
return return
} }
*/ */
supports := self.Options.OutputCodecTypes supports := self.Options.OutputCodecTypes
@ -83,7 +84,7 @@ func (self *Demuxer) prepare() (err error) {
ok = true ok = true
var enctype av.CodecType var enctype av.CodecType
for _, typ:= range supports { for _, typ := range supports {
if typ.IsAudio() { if typ.IsAudio() {
if enc, _ = avutil.DefaultHandlers.NewAudioEncoder(typ); enc != nil { if enc, _ = avutil.DefaultHandlers.NewAudioEncoder(typ); enc != nil {
enctype = typ enctype = typ
@ -152,7 +153,7 @@ func ConvertCmdline(args []string) (err error) {
flagt = false flagt = false
var f float64 var f float64
fmt.Sscanf(arg, "%f", &f) fmt.Sscanf(arg, "%f", &f)
duration = time.Duration(f*float64(time.Second)) duration = time.Duration(f * float64(time.Second))
default: default:
output = arg output = arg
@ -223,7 +224,7 @@ func ConvertCmdline(args []string) (err error) {
} }
filterdemux := &pktque.FilterDemuxer{ filterdemux := &pktque.FilterDemuxer{
Demuxer: convdemux, Demuxer: convdemux,
Filter: filters, Filter: filters,
} }
for { for {
@ -252,4 +253,3 @@ func ConvertCmdline(args []string) (err error) {
return return
} }

@ -9,7 +9,7 @@ import (
"path" "path"
"strings" "strings"
"github.com/Danile71/joy4/av" "gitlab.com/ics_cinnamon/joy4/av"
) )
type HandlerDemuxer struct { type HandlerDemuxer struct {

@ -1,7 +1,7 @@
package pktque package pktque
import ( import (
"github.com/Danile71/joy4/av" "gitlab.com/ics_cinnamon/joy4/av"
) )
type Buf struct { type Buf struct {

@ -1,10 +1,10 @@
// Package pktque provides packet Filter interface and structures used by other components. // Package pktque provides packet Filter interface and structures used by other components.
package pktque package pktque
import ( import (
"time" "time"
"github.com/Danile71/joy4/av"
"gitlab.com/ics_cinnamon/joy4/av"
) )
type Filter interface { type Filter interface {
@ -30,8 +30,8 @@ func (self Filters) ModifyPacket(pkt *av.Packet, streams []av.CodecData, videoid
// Wrap origin Demuxer and Filter into a new Demuxer, when read this Demuxer filters will be called. // Wrap origin Demuxer and Filter into a new Demuxer, when read this Demuxer filters will be called.
type FilterDemuxer struct { type FilterDemuxer struct {
av.Demuxer av.Demuxer
Filter Filter Filter Filter
streams []av.CodecData streams []av.CodecData
videoidx int videoidx int
audioidx int audioidx int
} }
@ -81,9 +81,9 @@ func (self *WaitKeyFrame) ModifyPacket(pkt *av.Packet, streams []av.CodecData, v
// Fix incorrect packet timestamps. // Fix incorrect packet timestamps.
type FixTime struct { type FixTime struct {
zerobase time.Duration zerobase time.Duration
incrbase time.Duration incrbase time.Duration
lasttime time.Duration lasttime time.Duration
StartFromZero bool // make timestamp start from zero StartFromZero bool // make timestamp start from zero
MakeIncrement bool // force timestamp increment MakeIncrement bool // force timestamp increment
} }
@ -114,14 +114,14 @@ func (self *FixTime) ModifyPacket(pkt *av.Packet, streams []av.CodecData, videoi
// Drop incorrect packets to make A/V sync. // Drop incorrect packets to make A/V sync.
type AVSync struct { type AVSync struct {
MaxTimeDiff time.Duration MaxTimeDiff time.Duration
time []time.Duration time []time.Duration
} }
func (self *AVSync) ModifyPacket(pkt *av.Packet, streams []av.CodecData, videoidx int, audioidx int) (drop bool, err error) { func (self *AVSync) ModifyPacket(pkt *av.Packet, streams []av.CodecData, videoidx int, audioidx int) (drop bool, err error) {
if self.time == nil { if self.time == nil {
self.time = make([]time.Duration, len(streams)) self.time = make([]time.Duration, len(streams))
if self.MaxTimeDiff == 0 { if self.MaxTimeDiff == 0 {
self.MaxTimeDiff = time.Millisecond*500 self.MaxTimeDiff = time.Millisecond * 500
} }
} }
@ -188,4 +188,3 @@ func (self *Walltime) ModifyPacket(pkt *av.Packet, streams []av.CodecData, video
} }
return return
} }

@ -2,11 +2,12 @@
package pubsub package pubsub
import ( import (
"github.com/Danile71/joy4/av"
"github.com/Danile71/joy4/av/pktque"
"io" "io"
"sync" "sync"
"time" "time"
"gitlab.com/ics_cinnamon/joy4/av"
"gitlab.com/ics_cinnamon/joy4/av/pktque"
) )
// time // time

@ -1,22 +1,22 @@
// Package transcoder implements Transcoder based on Muxer/Demuxer and AudioEncoder/AudioDecoder interface. // Package transcoder implements Transcoder based on Muxer/Demuxer and AudioEncoder/AudioDecoder interface.
package transcode package transcode
import ( import (
"fmt" "fmt"
"time" "time"
"github.com/Danile71/joy4/av"
"github.com/Danile71/joy4/av/pktque" "gitlab.com/ics_cinnamon/joy4/av"
"gitlab.com/ics_cinnamon/joy4/av/pktque"
) )
var Debug bool var Debug bool
type tStream struct { type tStream struct {
codec av.CodecData codec av.CodecData
timeline *pktque.Timeline timeline *pktque.Timeline
aencodec, adecodec av.AudioCodecData aencodec, adecodec av.AudioCodecData
aenc av.AudioEncoder aenc av.AudioEncoder
adec av.AudioDecoder adec av.AudioDecoder
} }
type Options struct { type Options struct {
@ -27,7 +27,7 @@ type Options struct {
} }
type Transcoder struct { type Transcoder struct {
streams []*tStream streams []*tStream
} }
func NewTranscoder(streams []av.CodecData, options Options) (_self *Transcoder, err error) { func NewTranscoder(streams []av.CodecData, options Options) (_self *Transcoder, err error) {
@ -108,7 +108,7 @@ func (self *tStream) audioDecodeAndEncode(inpkt av.Packet) (outpkts []av.Packet,
} }
// Do the transcode. // Do the transcode.
// //
// In audio transcoding one Packet may transcode into many Packets // In audio transcoding one Packet may transcode into many Packets
// packet time will be adjusted automatically. // packet time will be adjusted automatically.
func (self *Transcoder) Do(pkt av.Packet) (out []av.Packet, err error) { func (self *Transcoder) Do(pkt av.Packet) (out []av.Packet, err error) {
@ -150,8 +150,8 @@ func (self *Transcoder) Close() (err error) {
// Wrap transcoder and origin Muxer into new Muxer. // Wrap transcoder and origin Muxer into new Muxer.
// Write to new Muxer will do transcoding automatically. // Write to new Muxer will do transcoding automatically.
type Muxer struct { type Muxer struct {
av.Muxer // origin Muxer av.Muxer // origin Muxer
Options // transcode options Options // transcode options
transcoder *Transcoder transcoder *Transcoder
} }
@ -195,7 +195,7 @@ type Demuxer struct {
av.Demuxer av.Demuxer
Options Options
transcoder *Transcoder transcoder *Transcoder
outpkts []av.Packet outpkts []av.Packet
} }
func (self *Demuxer) prepare() (err error) { func (self *Demuxer) prepare() (err error) {

@ -12,9 +12,9 @@ import (
"time" "time"
"unsafe" "unsafe"
"github.com/Danile71/joy4/av" "gitlab.com/ics_cinnamon/joy4/av"
"github.com/Danile71/joy4/av/avutil" "gitlab.com/ics_cinnamon/joy4/av/avutil"
"github.com/Danile71/joy4/codec/aacparser" "gitlab.com/ics_cinnamon/joy4/codec/aacparser"
) )
const debug = false const debug = false
@ -673,6 +673,8 @@ func NewAudioDecoder(codec av.AudioCodecData) (dec *AudioDecoder, err error) {
case av.PCM_ALAW: case av.PCM_ALAW:
id = C.AV_CODEC_ID_PCM_ALAW id = C.AV_CODEC_ID_PCM_ALAW
case av.G729:
id = C.AV_CODEC_ID_G729
default: default:
if ffcodec, ok := codec.(audioCodecData); ok { if ffcodec, ok := codec.(audioCodecData); ok {

@ -10,8 +10,8 @@ import (
"runtime" "runtime"
"unsafe" "unsafe"
"github.com/Danile71/joy4/av" "gitlab.com/ics_cinnamon/joy4/av"
"github.com/Danile71/joy4/codec/h264parser" "gitlab.com/ics_cinnamon/joy4/codec/h264parser"
) )
type VideoDecoder struct { type VideoDecoder struct {

@ -6,8 +6,8 @@ import (
"io" "io"
"time" "time"
"github.com/Danile71/joy4/av" "gitlab.com/ics_cinnamon/joy4/av"
"github.com/Danile71/joy4/utils/bits" "gitlab.com/ics_cinnamon/joy4/utils/bits"
) )
// copied from libavcodec/mpeg4audio.h // copied from libavcodec/mpeg4audio.h

@ -3,8 +3,8 @@ package codec
import ( import (
"time" "time"
"github.com/Danile71/joy4/av" "gitlab.com/ics_cinnamon/joy4/av"
"github.com/Danile71/joy4/codec/fake" "gitlab.com/ics_cinnamon/joy4/codec/fake"
) )
type PCMUCodecData struct { type PCMUCodecData struct {
@ -43,6 +43,12 @@ func NewPCMAlawCodecData() av.AudioCodecData {
} }
} }
func NewG729CodecData() av.AudioCodecData {
return PCMUCodecData{
typ: av.G729,
}
}
type SpeexCodecData struct { type SpeexCodecData struct {
fake.CodecData fake.CodecData
} }

@ -1,7 +1,7 @@
package fake package fake
import ( import (
"github.com/Danile71/joy4/av" "gitlab.com/ics_cinnamon/joy4/av"
) )
type CodecData struct { type CodecData struct {

@ -4,9 +4,9 @@ import (
"bytes" "bytes"
"fmt" "fmt"
"github.com/Danile71/joy4/av" "gitlab.com/ics_cinnamon/joy4/av"
"github.com/Danile71/joy4/utils/bits" "gitlab.com/ics_cinnamon/joy4/utils/bits"
"github.com/Danile71/joy4/utils/bits/pio" "gitlab.com/ics_cinnamon/joy4/utils/bits/pio"
) )
const ( const (

@ -1,11 +1,10 @@
package main package main
import ( import (
"github.com/Danile71/joy4/av" "gitlab.com/ics_cinnamon/joy4/av"
"github.com/Danile71/joy4/format" "gitlab.com/ics_cinnamon/joy4/av/avutil"
"github.com/Danile71/joy4/av/avutil" "gitlab.com/ics_cinnamon/joy4/cgo/ffmpeg"
"github.com/Danile71/joy4/cgo/ffmpeg" "gitlab.com/ics_cinnamon/joy4/format"
) )
// need ffmpeg installed // need ffmpeg installed
@ -37,4 +36,3 @@ func main() {
file.Close() file.Close()
} }

@ -1,14 +1,15 @@
package main package main
import ( import (
"sync"
"io" "io"
"net/http" "net/http"
"github.com/Danile71/joy4/format" "sync"
"github.com/Danile71/joy4/av/avutil"
"github.com/Danile71/joy4/av/pubsub" "gitlab.com/ics_cinnamon/joy4/av/avutil"
"github.com/Danile71/joy4/format/rtmp" "gitlab.com/ics_cinnamon/joy4/av/pubsub"
"github.com/Danile71/joy4/format/flv" "gitlab.com/ics_cinnamon/joy4/format"
"gitlab.com/ics_cinnamon/joy4/format/flv"
"gitlab.com/ics_cinnamon/joy4/format/rtmp"
) )
func init() { func init() {
@ -78,7 +79,7 @@ func main() {
if ch != nil { if ch != nil {
w.Header().Set("Content-Type", "video/x-flv") w.Header().Set("Content-Type", "video/x-flv")
w.Header().Set("Transfer-Encoding", "chunked") w.Header().Set("Transfer-Encoding", "chunked")
w.Header().Set("Access-Control-Allow-Origin", "*") w.Header().Set("Access-Control-Allow-Origin", "*")
w.WriteHeader(200) w.WriteHeader(200)
flusher := w.(http.Flusher) flusher := w.(http.Flusher)

@ -2,9 +2,10 @@ package main
import ( import (
"fmt" "fmt"
"github.com/Danile71/joy4/av"
"github.com/Danile71/joy4/av/avutil" "gitlab.com/ics_cinnamon/joy4/av"
"github.com/Danile71/joy4/format" "gitlab.com/ics_cinnamon/joy4/av/avutil"
"gitlab.com/ics_cinnamon/joy4/format"
) )
func init() { func init() {
@ -36,4 +37,3 @@ func main() {
file.Close() file.Close()
} }

@ -1,10 +1,10 @@
package main package main
import ( import (
"github.com/Danile71/joy4/av/pktque" "gitlab.com/ics_cinnamon/joy4/av/avutil"
"github.com/Danile71/joy4/format" "gitlab.com/ics_cinnamon/joy4/av/pktque"
"github.com/Danile71/joy4/av/avutil" "gitlab.com/ics_cinnamon/joy4/format"
"github.com/Danile71/joy4/format/rtmp" "gitlab.com/ics_cinnamon/joy4/format/rtmp"
) )
func init() { func init() {
@ -24,4 +24,3 @@ func main() {
file.Close() file.Close()
conn.Close() conn.Close()
} }

@ -2,14 +2,15 @@ package main
import ( import (
"fmt" "fmt"
"github.com/Danile71/joy4/av"
"github.com/Danile71/joy4/av/avutil"
"github.com/Danile71/joy4/av/pktque"
"github.com/Danile71/joy4/av/pubsub"
"github.com/Danile71/joy4/format"
"github.com/Danile71/joy4/format/rtmp"
"sync" "sync"
"time" "time"
"gitlab.com/ics_cinnamon/joy4/av"
"gitlab.com/ics_cinnamon/joy4/av/avutil"
"gitlab.com/ics_cinnamon/joy4/av/pktque"
"gitlab.com/ics_cinnamon/joy4/av/pubsub"
"gitlab.com/ics_cinnamon/joy4/format"
"gitlab.com/ics_cinnamon/joy4/format/rtmp"
) )
func init() { func init() {

@ -3,9 +3,10 @@ package main
import ( import (
"fmt" "fmt"
"strings" "strings"
"github.com/Danile71/joy4/format"
"github.com/Danile71/joy4/av/avutil" "gitlab.com/ics_cinnamon/joy4/av/avutil"
"github.com/Danile71/joy4/format/rtmp" "gitlab.com/ics_cinnamon/joy4/format"
"gitlab.com/ics_cinnamon/joy4/format/rtmp"
) )
func init() { func init() {

@ -1,16 +1,16 @@
package main package main
import ( import (
"github.com/Danile71/joy4/av" "gitlab.com/ics_cinnamon/joy4/av"
"github.com/Danile71/joy4/av/transcode" "gitlab.com/ics_cinnamon/joy4/av/avutil"
"github.com/Danile71/joy4/format" "gitlab.com/ics_cinnamon/joy4/av/transcode"
"github.com/Danile71/joy4/av/avutil" "gitlab.com/ics_cinnamon/joy4/cgo/ffmpeg"
"github.com/Danile71/joy4/format/rtmp" "gitlab.com/ics_cinnamon/joy4/format"
"github.com/Danile71/joy4/cgo/ffmpeg" "gitlab.com/ics_cinnamon/joy4/format/rtmp"
) )
// need ffmpeg with libspeex and libfdkaac installed // need ffmpeg with libspeex and libfdkaac installed
// //
// open http://www.wowza.com/resources/4.4.1/examples/WebcamRecording/FlashRTMPPlayer11/player.html // open http://www.wowza.com/resources/4.4.1/examples/WebcamRecording/FlashRTMPPlayer11/player.html
// click connect and recored // click connect and recored
// input camera H264/SPEEX will converted H264/AAC and saved in out.ts // input camera H264/SPEEX will converted H264/AAC and saved in out.ts

@ -1,11 +1,11 @@
package main package main
import ( import (
"github.com/Danile71/joy4/av" "gitlab.com/ics_cinnamon/joy4/av"
"github.com/Danile71/joy4/av/transcode" "gitlab.com/ics_cinnamon/joy4/av/avutil"
"github.com/Danile71/joy4/format" "gitlab.com/ics_cinnamon/joy4/av/transcode"
"github.com/Danile71/joy4/av/avutil" "gitlab.com/ics_cinnamon/joy4/cgo/ffmpeg"
"github.com/Danile71/joy4/cgo/ffmpeg" "gitlab.com/ics_cinnamon/joy4/format"
) )
// need ffmpeg with libfdkaac installed // need ffmpeg with libfdkaac installed
@ -42,4 +42,3 @@ func main() {
infile.Close() infile.Close()
trans.Close() trans.Close()
} }

@ -6,9 +6,9 @@ import (
"io" "io"
"time" "time"
"github.com/Danile71/joy4/av" "gitlab.com/ics_cinnamon/joy4/av"
"github.com/Danile71/joy4/av/avutil" "gitlab.com/ics_cinnamon/joy4/av/avutil"
"github.com/Danile71/joy4/codec/aacparser" "gitlab.com/ics_cinnamon/joy4/codec/aacparser"
) )
type Muxer struct { type Muxer struct {

@ -5,14 +5,14 @@ import (
"fmt" "fmt"
"io" "io"
"github.com/Danile71/joy4/av" "gitlab.com/ics_cinnamon/joy4/av"
"github.com/Danile71/joy4/av/avutil" "gitlab.com/ics_cinnamon/joy4/av/avutil"
"github.com/Danile71/joy4/codec" "gitlab.com/ics_cinnamon/joy4/codec"
"github.com/Danile71/joy4/codec/aacparser" "gitlab.com/ics_cinnamon/joy4/codec/aacparser"
"github.com/Danile71/joy4/codec/fake" "gitlab.com/ics_cinnamon/joy4/codec/fake"
"github.com/Danile71/joy4/codec/h264parser" "gitlab.com/ics_cinnamon/joy4/codec/h264parser"
"github.com/Danile71/joy4/format/flv/flvio" "gitlab.com/ics_cinnamon/joy4/format/flv/flvio"
"github.com/Danile71/joy4/utils/bits/pio" "gitlab.com/ics_cinnamon/joy4/utils/bits/pio"
) )
var MaxProbePacketCount = 20 var MaxProbePacketCount = 20

@ -6,7 +6,7 @@ import (
"strings" "strings"
"time" "time"
"github.com/Danile71/joy4/utils/bits/pio" "gitlab.com/ics_cinnamon/joy4/utils/bits/pio"
) )
type AMF0ParseError struct { type AMF0ParseError struct {

@ -5,8 +5,8 @@ import (
"io" "io"
"time" "time"
"github.com/Danile71/joy4/av" "gitlab.com/ics_cinnamon/joy4/av"
"github.com/Danile71/joy4/utils/bits/pio" "gitlab.com/ics_cinnamon/joy4/utils/bits/pio"
) )
func TsToTime(ts int32) time.Duration { func TsToTime(ts int32) time.Duration {

@ -1,13 +1,13 @@
package format package format
import ( import (
"github.com/Danile71/joy4/av/avutil" "gitlab.com/ics_cinnamon/joy4/av/avutil"
"github.com/Danile71/joy4/format/aac" "gitlab.com/ics_cinnamon/joy4/format/aac"
"github.com/Danile71/joy4/format/flv" "gitlab.com/ics_cinnamon/joy4/format/flv"
"github.com/Danile71/joy4/format/mp4" "gitlab.com/ics_cinnamon/joy4/format/mp4"
"github.com/Danile71/joy4/format/rtmp" "gitlab.com/ics_cinnamon/joy4/format/rtmp"
"github.com/Danile71/joy4/format/rtsp" "gitlab.com/ics_cinnamon/joy4/format/rtsp"
"github.com/Danile71/joy4/format/ts" "gitlab.com/ics_cinnamon/joy4/format/ts"
) )
func RegisterAll() { func RegisterAll() {

@ -16,13 +16,13 @@ import (
"strings" "strings"
"time" "time"
"github.com/Danile71/joy4/av" "gitlab.com/ics_cinnamon/joy4/av"
"github.com/Danile71/joy4/av/avutil" "gitlab.com/ics_cinnamon/joy4/av/avutil"
"github.com/Danile71/joy4/codec" "gitlab.com/ics_cinnamon/joy4/codec"
"github.com/Danile71/joy4/codec/aacparser" "gitlab.com/ics_cinnamon/joy4/codec/aacparser"
"github.com/Danile71/joy4/codec/h264parser" "gitlab.com/ics_cinnamon/joy4/codec/h264parser"
"github.com/Danile71/joy4/format/rtsp/sdp" "gitlab.com/ics_cinnamon/joy4/format/rtsp/sdp"
"github.com/Danile71/joy4/utils/bits/pio" "gitlab.com/ics_cinnamon/joy4/utils/bits/pio"
) )
var ErrCodecDataChange = fmt.Errorf("rtsp: codec data change, please call HandleCodecDataChange()") var ErrCodecDataChange = fmt.Errorf("rtsp: codec data change, please call HandleCodecDataChange()")

@ -6,10 +6,10 @@ import (
"io" "io"
"time" "time"
"github.com/Danile71/joy4/av" "gitlab.com/ics_cinnamon/joy4/av"
"github.com/Danile71/joy4/codec/aacparser" "gitlab.com/ics_cinnamon/joy4/codec/aacparser"
"github.com/Danile71/joy4/codec/h264parser" "gitlab.com/ics_cinnamon/joy4/codec/h264parser"
"github.com/Danile71/joy4/format/mp4/mp4io" "gitlab.com/ics_cinnamon/joy4/format/mp4/mp4io"
) )
type Demuxer struct { type Demuxer struct {

@ -3,8 +3,8 @@ package mp4
import ( import (
"io" "io"
"github.com/Danile71/joy4/av" "gitlab.com/ics_cinnamon/joy4/av"
"github.com/Danile71/joy4/av/avutil" "gitlab.com/ics_cinnamon/joy4/av/avutil"
) )
var CodecTypes = []av.CodecType{av.H264, av.AAC} var CodecTypes = []av.CodecType{av.H264, av.AAC}

@ -1,7 +1,10 @@
package mp4io package mp4io
import "github.com/Danile71/joy4/utils/bits/pio" import (
import "time" "time"
"gitlab.com/ics_cinnamon/joy4/utils/bits/pio"
)
const MOOF = Tag(0x6d6f6f66) const MOOF = Tag(0x6d6f6f66)

@ -1,14 +1,13 @@
package main package main
import ( import (
"strings"
"fmt" "fmt"
"os"
"go/ast" "go/ast"
"go/parser" "go/parser"
"go/token"
"go/printer" "go/printer"
"go/token"
"os"
"strings"
) )
func getexprs(e ast.Expr) string { func getexprs(e ast.Expr) string {
@ -37,7 +36,7 @@ func genatomdecl(origfn *ast.FuncDecl, origname, origtag string) (decls []ast.De
if typ == "_unknowns" { if typ == "_unknowns" {
fieldslist.List = append(fieldslist.List, &ast.Field{ fieldslist.List = append(fieldslist.List, &ast.Field{
Names: []*ast.Ident{ast.NewIdent("Unknowns")}, Names: []*ast.Ident{ast.NewIdent("Unknowns")},
Type: ast.NewIdent("[]Atom"), Type: ast.NewIdent("[]Atom"),
}) })
} }
continue continue
@ -67,24 +66,24 @@ func genatomdecl(origfn *ast.FuncDecl, origname, origtag string) (decls []ast.De
case "bytesleft": case "bytesleft":
typ = "[]byte" typ = "[]byte"
case "bytes": case "bytes":
typ = "["+name2+"]byte" typ = "[" + name2 + "]byte"
case "uint24": case "uint24":
typ = "uint32" typ = "uint32"
case "time64", "time32": case "time64", "time32":
typ = "time.Time" typ = "time.Time"
case "atom": case "atom":
typ = "*"+name2 typ = "*" + name2
case "atoms": case "atoms":
typ = "[]*"+name2 typ = "[]*" + name2
case "slice": case "slice":
typ = "[]"+name2 typ = "[]" + name2
case "array": case "array":
typ = "["+len3+"]"+name2 typ = "[" + len3 + "]" + name2
} }
fieldslist.List = append(fieldslist.List, &ast.Field{ fieldslist.List = append(fieldslist.List, &ast.Field{
Names: []*ast.Ident{ast.NewIdent(name)}, Names: []*ast.Ident{ast.NewIdent(name)},
Type: ast.NewIdent(typ), Type: ast.NewIdent(typ),
}) })
} }
@ -135,7 +134,7 @@ func typegetlen(typ string) (n int) {
func typegetlens(typ string) string { func typegetlens(typ string) string {
n := typegetlen(typ) n := typegetlen(typ)
if n == 0 { if n == 0 {
return "Len"+typ return "Len" + typ
} else { } else {
return fmt.Sprint(n) return fmt.Sprint(n)
} }
@ -187,7 +186,7 @@ func typegetputfn(typ string) (fn string) {
case "fixed16": case "fixed16":
fn = "PutFixed16" fn = "PutFixed16"
default: default:
fn = "Put"+typ fn = "Put" + typ
} }
return return
} }
@ -218,7 +217,7 @@ func typegetgetfn(typ string) (fn string) {
case "fixed16": case "fixed16":
fn = "GetFixed16" fn = "GetFixed16"
default: default:
fn = "Get"+typ fn = "Get" + typ
} }
return return
} }
@ -237,14 +236,14 @@ func addn(n int) (stmts []ast.Stmt) {
return addns(fmt.Sprint(n)) return addns(fmt.Sprint(n))
} }
func simplecall(fun string, args... string) *ast.ExprStmt { func simplecall(fun string, args ...string) *ast.ExprStmt {
_args := []ast.Expr{} _args := []ast.Expr{}
for _, s := range args { for _, s := range args {
_args = append(_args, ast.NewIdent(s)) _args = append(_args, ast.NewIdent(s))
} }
return &ast.ExprStmt{ return &ast.ExprStmt{
X: &ast.CallExpr{ X: &ast.CallExpr{
Fun: ast.NewIdent(fun), Fun: ast.NewIdent(fun),
Args: _args, Args: _args,
}, },
} }
@ -283,7 +282,7 @@ func newdecl(origname, name string, params, res []*ast.Field, stmts []ast.Stmt)
List: []*ast.Field{ List: []*ast.Field{
&ast.Field{ &ast.Field{
Names: []*ast.Ident{ast.NewIdent("self")}, Names: []*ast.Ident{ast.NewIdent("self")},
Type: ast.NewIdent(origname), Type: ast.NewIdent(origname),
}, },
}, },
}, },
@ -319,7 +318,7 @@ func getstructputgetlenfn(origfn *ast.FuncDecl, origname string) (decls []ast.De
getstmts = append(getstmts, &ast.ReturnStmt{}) getstmts = append(getstmts, &ast.ReturnStmt{})
decls = append(decls, &ast.FuncDecl{ decls = append(decls, &ast.FuncDecl{
Name: ast.NewIdent("Get"+origname), Name: ast.NewIdent("Get" + origname),
Type: &ast.FuncType{ Type: &ast.FuncType{
Params: &ast.FieldList{ Params: &ast.FieldList{
List: []*ast.Field{ List: []*ast.Field{
@ -336,7 +335,7 @@ func getstructputgetlenfn(origfn *ast.FuncDecl, origname string) (decls []ast.De
}) })
decls = append(decls, &ast.FuncDecl{ decls = append(decls, &ast.FuncDecl{
Name: ast.NewIdent("Put"+origname), Name: ast.NewIdent("Put" + origname),
Type: &ast.FuncType{ Type: &ast.FuncType{
Params: &ast.FieldList{ Params: &ast.FieldList{
List: []*ast.Field{ List: []*ast.Field{
@ -352,7 +351,7 @@ func getstructputgetlenfn(origfn *ast.FuncDecl, origname string) (decls []ast.De
Tok: token.CONST, Tok: token.CONST,
Specs: []ast.Spec{ Specs: []ast.Spec{
&ast.ValueSpec{ &ast.ValueSpec{
Names: []*ast.Ident{ast.NewIdent("Len"+origname)}, Names: []*ast.Ident{ast.NewIdent("Len" + origname)},
Values: []ast.Expr{ast.NewIdent(fmt.Sprint(totlen))}, Values: []ast.Expr{ast.NewIdent(fmt.Sprint(totlen))},
}, },
}, },
@ -371,7 +370,7 @@ func cc4decls(name string) (decls []ast.Decl) {
}, },
Values: []ast.Expr{ Values: []ast.Expr{
&ast.CallExpr{ &ast.CallExpr{
Fun: ast.NewIdent("Tag"), Fun: ast.NewIdent("Tag"),
Args: []ast.Expr{&ast.BasicLit{Kind: token.INT, Value: fmt.Sprintf("0x%x", []byte(name))}}, Args: []ast.Expr{&ast.BasicLit{Kind: token.INT, Value: fmt.Sprintf("0x%x", []byte(name))}},
}, },
}, },
@ -431,7 +430,7 @@ func getatommarshalfn(origfn *ast.FuncDecl,
callmarshal := func(name string) (stmts []ast.Stmt) { callmarshal := func(name string) (stmts []ast.Stmt) {
callexpr := &ast.CallExpr{ callexpr := &ast.CallExpr{
Fun: ast.NewIdent(name+".Marshal"), Fun: ast.NewIdent(name + ".Marshal"),
Args: []ast.Expr{ast.NewIdent("b[n:]")}, Args: []ast.Expr{ast.NewIdent("b[n:]")},
} }
assign := &ast.AssignStmt{ assign := &ast.AssignStmt{
@ -446,7 +445,7 @@ func getatommarshalfn(origfn *ast.FuncDecl,
callputstruct := func(typ, name string) (stmts []ast.Stmt) { callputstruct := func(typ, name string) (stmts []ast.Stmt) {
stmts = append(stmts, &ast.ExprStmt{ stmts = append(stmts, &ast.ExprStmt{
X: &ast.CallExpr{ X: &ast.CallExpr{
Fun: ast.NewIdent(typegetputfn(typ)), Fun: ast.NewIdent(typegetputfn(typ)),
Args: []ast.Expr{ast.NewIdent("b[n:]"), ast.NewIdent(name)}, Args: []ast.Expr{ast.NewIdent("b[n:]"), ast.NewIdent(name)},
}, },
}) })
@ -459,7 +458,7 @@ func getatommarshalfn(origfn *ast.FuncDecl,
} }
calllenstruct := func(typ, name string) (stmts []ast.Stmt) { calllenstruct := func(typ, name string) (stmts []ast.Stmt) {
inc := typegetlens(typ)+"*len("+name+")" inc := typegetlens(typ) + "*len(" + name + ")"
stmts = append(stmts, &ast.AssignStmt{ stmts = append(stmts, &ast.AssignStmt{
Tok: token.ADD_ASSIGN, Tok: token.ADD_ASSIGN,
Lhs: []ast.Expr{ast.NewIdent("n")}, Lhs: []ast.Expr{ast.NewIdent("n")},
@ -470,7 +469,7 @@ func getatommarshalfn(origfn *ast.FuncDecl,
calllen := func(name string) (stmts []ast.Stmt) { calllen := func(name string) (stmts []ast.Stmt) {
callexpr := &ast.CallExpr{ callexpr := &ast.CallExpr{
Fun: ast.NewIdent(name+".Len"), Fun: ast.NewIdent(name + ".Len"),
Args: []ast.Expr{}, Args: []ast.Expr{},
} }
assign := &ast.AssignStmt{ assign := &ast.AssignStmt{
@ -484,13 +483,13 @@ func getatommarshalfn(origfn *ast.FuncDecl,
foreach := func(name, field string, block []ast.Stmt) (stmts []ast.Stmt) { foreach := func(name, field string, block []ast.Stmt) (stmts []ast.Stmt) {
rangestmt := &ast.RangeStmt{ rangestmt := &ast.RangeStmt{
Key: ast.NewIdent("_"), Key: ast.NewIdent("_"),
Value: ast.NewIdent(name), Value: ast.NewIdent(name),
Body: &ast.BlockStmt{ Body: &ast.BlockStmt{
List: block, List: block,
}, },
Tok: token.DEFINE, Tok: token.DEFINE,
X: ast.NewIdent(field), X: ast.NewIdent(field),
} }
stmts = append(stmts, rangestmt) stmts = append(stmts, rangestmt)
return return
@ -511,7 +510,7 @@ func getatommarshalfn(origfn *ast.FuncDecl,
List: block, List: block,
}, },
Tok: token.DEFINE, Tok: token.DEFINE,
X: ast.NewIdent(field), X: ast.NewIdent(field),
} }
stmts = append(stmts, rangestmt) stmts = append(stmts, rangestmt)
return return
@ -574,7 +573,7 @@ func getatommarshalfn(origfn *ast.FuncDecl,
unmarshalatom := func(typ, init string) (stmts []ast.Stmt) { unmarshalatom := func(typ, init string) (stmts []ast.Stmt) {
return []ast.Stmt{ return []ast.Stmt{
&ast.AssignStmt{Tok: token.DEFINE, &ast.AssignStmt{Tok: token.DEFINE,
Lhs: []ast.Expr{ast.NewIdent("atom")}, Rhs: []ast.Expr{ast.NewIdent("&"+typ+"{"+init+"}")}, Lhs: []ast.Expr{ast.NewIdent("atom")}, Rhs: []ast.Expr{ast.NewIdent("&" + typ + "{" + init + "}")},
}, },
&ast.IfStmt{ &ast.IfStmt{
Init: &ast.AssignStmt{ Init: &ast.AssignStmt{
@ -591,10 +590,10 @@ func getatommarshalfn(origfn *ast.FuncDecl,
unmrashalatoms := func() (stmts []ast.Stmt) { unmrashalatoms := func() (stmts []ast.Stmt) {
blocks := []ast.Stmt{} blocks := []ast.Stmt{}
blocks = append(blocks, &ast.AssignStmt{ Tok: token.DEFINE, Lhs: []ast.Expr{ast.NewIdent("tag")}, blocks = append(blocks, &ast.AssignStmt{Tok: token.DEFINE, Lhs: []ast.Expr{ast.NewIdent("tag")},
Rhs: []ast.Expr{ast.NewIdent("Tag(pio.U32BE(b[n+4:]))")}, Rhs: []ast.Expr{ast.NewIdent("Tag(pio.U32BE(b[n+4:]))")},
}) })
blocks = append(blocks, &ast.AssignStmt{ Tok: token.DEFINE, Lhs: []ast.Expr{ast.NewIdent("size")}, blocks = append(blocks, &ast.AssignStmt{Tok: token.DEFINE, Lhs: []ast.Expr{ast.NewIdent("size")},
Rhs: []ast.Expr{ast.NewIdent("int(pio.U32BE(b[n:]))")}, Rhs: []ast.Expr{ast.NewIdent("int(pio.U32BE(b[n:]))")},
}) })
blocks = append(blocks, &ast.IfStmt{ blocks = append(blocks, &ast.IfStmt{
@ -614,7 +613,7 @@ func getatommarshalfn(origfn *ast.FuncDecl,
} }
for i, atom := range atomarrnames { for i, atom := range atomarrnames {
selfatom := "self."+atom selfatom := "self." + atom
cases = append(cases, &ast.CaseClause{ cases = append(cases, &ast.CaseClause{
List: []ast.Expr{ast.NewIdent(strings.ToUpper(struct2tag(atomarrtypes[i])))}, List: []ast.Expr{ast.NewIdent(strings.ToUpper(struct2tag(atomarrtypes[i])))},
Body: []ast.Stmt{&ast.BlockStmt{ Body: []ast.Stmt{&ast.BlockStmt{
@ -635,7 +634,7 @@ func getatommarshalfn(origfn *ast.FuncDecl,
} }
blocks = append(blocks, &ast.SwitchStmt{ blocks = append(blocks, &ast.SwitchStmt{
Tag: ast.NewIdent("tag"), Tag: ast.NewIdent("tag"),
Body: &ast.BlockStmt{List: cases}, Body: &ast.BlockStmt{List: cases},
}) })
@ -659,9 +658,9 @@ func getatommarshalfn(origfn *ast.FuncDecl,
ifnotnil := func(name string, block []ast.Stmt) (stmts []ast.Stmt) { ifnotnil := func(name string, block []ast.Stmt) (stmts []ast.Stmt) {
stmts = append(stmts, &ast.IfStmt{ stmts = append(stmts, &ast.IfStmt{
Cond: &ast.BinaryExpr{ Cond: &ast.BinaryExpr{
X: ast.NewIdent(name), X: ast.NewIdent(name),
Op: token.NEQ, Op: token.NEQ,
Y: ast.NewIdent("nil"), Y: ast.NewIdent("nil"),
}, },
Body: &ast.BlockStmt{List: block}, Body: &ast.BlockStmt{List: block},
}) })
@ -693,9 +692,9 @@ func getatommarshalfn(origfn *ast.FuncDecl,
checkcurlen := func(inc, debug string) (stmts []ast.Stmt) { checkcurlen := func(inc, debug string) (stmts []ast.Stmt) {
stmts = append(stmts, &ast.IfStmt{ stmts = append(stmts, &ast.IfStmt{
Cond: &ast.BinaryExpr{ Cond: &ast.BinaryExpr{
X: ast.NewIdent("len(b)"), X: ast.NewIdent("len(b)"),
Op: token.LSS, Op: token.LSS,
Y: ast.NewIdent("n+"+inc), Y: ast.NewIdent("n+" + inc),
}, },
Body: &ast.BlockStmt{List: parseerrreturn(debug)}, Body: &ast.BlockStmt{List: parseerrreturn(debug)},
}) })
@ -710,20 +709,20 @@ func getatommarshalfn(origfn *ast.FuncDecl,
} }
checkstructlendo := func(typ, name, debug string, checkstructlendo := func(typ, name, debug string,
foreach func(string,[]ast.Stmt)[]ast.Stmt, foreach func(string, []ast.Stmt) []ast.Stmt,
) (stmts []ast.Stmt) { ) (stmts []ast.Stmt) {
inc := typegetlens(typ)+"*len("+name+")" inc := typegetlens(typ) + "*len(" + name + ")"
stmts = append(stmts, checkcurlen(inc, debug)...) stmts = append(stmts, checkcurlen(inc, debug)...)
stmts = append(stmts, foreach(name, append( stmts = append(stmts, foreach(name, append(
[]ast.Stmt{ []ast.Stmt{
&ast.AssignStmt{ &ast.AssignStmt{
Tok: token.ASSIGN, Tok: token.ASSIGN,
Lhs: []ast.Expr{ Lhs: []ast.Expr{
ast.NewIdent(name+"[i]"), ast.NewIdent(name + "[i]"),
}, },
Rhs: []ast.Expr{ Rhs: []ast.Expr{
&ast.CallExpr{ &ast.CallExpr{
Fun: ast.NewIdent(typegetgetfn(typ)), Fun: ast.NewIdent(typegetgetfn(typ)),
Args: []ast.Expr{ast.NewIdent("b[n:]")}, Args: []ast.Expr{ast.NewIdent("b[n:]")},
}, },
}, },
@ -967,7 +966,7 @@ func genatoms(filename, outfilename string) {
&ast.GenDecl{ &ast.GenDecl{
Tok: token.IMPORT, Tok: token.IMPORT,
Specs: []ast.Spec{ Specs: []ast.Spec{
&ast.ImportSpec{Path: &ast.BasicLit{Kind: token.STRING, Value: `"github.com/Danile71/joy4/utils/bits/pio"`}}, &ast.ImportSpec{Path: &ast.BasicLit{Kind: token.STRING, Value: `"gitlab.com/ics_cinnamon/joy4/utils/bits/pio"`}},
}, },
}, },
&ast.GenDecl{ &ast.GenDecl{
@ -1054,4 +1053,3 @@ func main() {
genatoms(os.Args[2], os.Args[3]) genatoms(os.Args[2], os.Args[3])
} }
} }

@ -8,7 +8,7 @@ import (
"strings" "strings"
"time" "time"
"github.com/Danile71/joy4/utils/bits/pio" "gitlab.com/ics_cinnamon/joy4/utils/bits/pio"
) )
type ParseError struct { type ParseError struct {

@ -6,11 +6,11 @@ import (
"io" "io"
"time" "time"
"github.com/Danile71/joy4/av" "gitlab.com/ics_cinnamon/joy4/av"
"github.com/Danile71/joy4/codec/aacparser" "gitlab.com/ics_cinnamon/joy4/codec/aacparser"
"github.com/Danile71/joy4/codec/h264parser" "gitlab.com/ics_cinnamon/joy4/codec/h264parser"
"github.com/Danile71/joy4/format/mp4/mp4io" "gitlab.com/ics_cinnamon/joy4/format/mp4/mp4io"
"github.com/Danile71/joy4/utils/bits/pio" "gitlab.com/ics_cinnamon/joy4/utils/bits/pio"
) )
type Muxer struct { type Muxer struct {

@ -3,8 +3,8 @@ package mp4
import ( import (
"time" "time"
"github.com/Danile71/joy4/av" "gitlab.com/ics_cinnamon/joy4/av"
"github.com/Danile71/joy4/format/mp4/mp4io" "gitlab.com/ics_cinnamon/joy4/format/mp4/mp4io"
) )
type Stream struct { type Stream struct {

@ -1,6 +1,6 @@
package mp4f package mp4f
import "github.com/Danile71/joy4/format/mp4/mp4io" import "gitlab.com/ics_cinnamon/joy4/format/mp4/mp4io"
type FDummy struct { type FDummy struct {
Data []byte Data []byte

@ -1,8 +1,8 @@
package mp4fio package mp4fio
import ( import (
"github.com/Danile71/joy4/format/mp4/mp4io" "gitlab.com/ics_cinnamon/joy4/format/mp4/mp4io"
"github.com/Danile71/joy4/utils/bits/pio" "gitlab.com/ics_cinnamon/joy4/utils/bits/pio"
) )
func (self MovieFrag) Tag() mp4io.Tag { func (self MovieFrag) Tag() mp4io.Tag {

@ -1,8 +1,8 @@
package mp4fio package mp4fio
import ( import (
"github.com/Danile71/joy4/format/mp4/mp4io" "gitlab.com/ics_cinnamon/joy4/format/mp4/mp4io"
"github.com/Danile71/joy4/utils/bits/pio" "gitlab.com/ics_cinnamon/joy4/utils/bits/pio"
) )
type ElemStreamDesc struct { type ElemStreamDesc struct {

@ -6,12 +6,12 @@ import (
"os" "os"
"time" "time"
"github.com/Danile71/joy4/av" "gitlab.com/ics_cinnamon/joy4/av"
"github.com/Danile71/joy4/codec/aacparser" "gitlab.com/ics_cinnamon/joy4/codec/aacparser"
"github.com/Danile71/joy4/codec/h264parser" "gitlab.com/ics_cinnamon/joy4/codec/h264parser"
"github.com/Danile71/joy4/format/mp4/mp4io" "gitlab.com/ics_cinnamon/joy4/format/mp4/mp4io"
"github.com/Danile71/joy4/format/mp4f/mp4fio" "gitlab.com/ics_cinnamon/joy4/format/mp4f/mp4fio"
"github.com/Danile71/joy4/utils/bits/pio" "gitlab.com/ics_cinnamon/joy4/utils/bits/pio"
) )
type Muxer struct { type Muxer struct {

@ -3,10 +3,10 @@ package mp4f
import ( import (
"time" "time"
"github.com/Danile71/joy4/av" "gitlab.com/ics_cinnamon/joy4/av"
"github.com/Danile71/joy4/format/mp4" "gitlab.com/ics_cinnamon/joy4/format/mp4"
"github.com/Danile71/joy4/format/mp4/mp4io" "gitlab.com/ics_cinnamon/joy4/format/mp4/mp4io"
"github.com/Danile71/joy4/format/mp4f/mp4fio" "gitlab.com/ics_cinnamon/joy4/format/mp4f/mp4fio"
) )
type Stream struct { type Stream struct {

@ -5,9 +5,9 @@ import (
"io" "io"
"time" "time"
"github.com/Danile71/joy4/av" "gitlab.com/ics_cinnamon/joy4/av"
"github.com/Danile71/joy4/codec/h264parser" "gitlab.com/ics_cinnamon/joy4/codec/h264parser"
"github.com/Danile71/joy4/utils/bits/pio" "gitlab.com/ics_cinnamon/joy4/utils/bits/pio"
) )
type Demuxer struct { type Demuxer struct {

@ -3,8 +3,8 @@ package raw
import ( import (
"io" "io"
"github.com/Danile71/joy4/av" "gitlab.com/ics_cinnamon/joy4/av"
"github.com/Danile71/joy4/av/avutil" "gitlab.com/ics_cinnamon/joy4/av/avutil"
) )
var CodecTypes = []av.CodecType{av.H264, av.AAC} var CodecTypes = []av.CodecType{av.H264, av.AAC}

@ -5,9 +5,9 @@ import (
"fmt" "fmt"
"io" "io"
"github.com/Danile71/joy4/av" "gitlab.com/ics_cinnamon/joy4/av"
"github.com/Danile71/joy4/codec/h264parser" "gitlab.com/ics_cinnamon/joy4/codec/h264parser"
"github.com/Danile71/joy4/utils/bits/pio" "gitlab.com/ics_cinnamon/joy4/utils/bits/pio"
) )
type Muxer struct { type Muxer struct {

@ -4,7 +4,7 @@ import (
"fmt" "fmt"
"time" "time"
"github.com/Danile71/joy4/av" "gitlab.com/ics_cinnamon/joy4/av"
) )
type Stream struct { type Stream struct {

@ -14,11 +14,11 @@ import (
"strings" "strings"
"time" "time"
"github.com/Danile71/joy4/av" "gitlab.com/ics_cinnamon/joy4/av"
"github.com/Danile71/joy4/av/avutil" "gitlab.com/ics_cinnamon/joy4/av/avutil"
"github.com/Danile71/joy4/format/flv" "gitlab.com/ics_cinnamon/joy4/format/flv"
"github.com/Danile71/joy4/format/flv/flvio" "gitlab.com/ics_cinnamon/joy4/format/flv/flvio"
"github.com/Danile71/joy4/utils/bits/pio" "gitlab.com/ics_cinnamon/joy4/utils/bits/pio"
) )
var Debug bool var Debug bool

@ -18,13 +18,13 @@ import (
"strings" "strings"
"time" "time"
"github.com/Danile71/joy4/av" "gitlab.com/ics_cinnamon/joy4/av"
"github.com/Danile71/joy4/av/avutil" "gitlab.com/ics_cinnamon/joy4/av/avutil"
"github.com/Danile71/joy4/codec" "gitlab.com/ics_cinnamon/joy4/codec"
"github.com/Danile71/joy4/codec/aacparser" "gitlab.com/ics_cinnamon/joy4/codec/aacparser"
"github.com/Danile71/joy4/codec/h264parser" "gitlab.com/ics_cinnamon/joy4/codec/h264parser"
"github.com/Danile71/joy4/format/rtsp/sdp" "gitlab.com/ics_cinnamon/joy4/format/rtsp/sdp"
"github.com/Danile71/joy4/utils/bits/pio" "gitlab.com/ics_cinnamon/joy4/utils/bits/pio"
) )
var ErrCodecDataChange = fmt.Errorf("rtsp: codec data change, please call HandleCodecDataChange()") var ErrCodecDataChange = fmt.Errorf("rtsp: codec data change, please call HandleCodecDataChange()")

@ -7,7 +7,7 @@ import (
"strconv" "strconv"
"strings" "strings"
"github.com/Danile71/joy4/av" "gitlab.com/ics_cinnamon/joy4/av"
) )
type Session struct { type Session struct {

@ -3,8 +3,8 @@ package rtsp
import ( import (
"time" "time"
"github.com/Danile71/joy4/av" "gitlab.com/ics_cinnamon/joy4/av"
"github.com/Danile71/joy4/format/rtsp/sdp" "gitlab.com/ics_cinnamon/joy4/format/rtsp/sdp"
) )
type Stream struct { type Stream struct {

@ -6,11 +6,11 @@ import (
"io" "io"
"time" "time"
"github.com/Danile71/joy4/av" "gitlab.com/ics_cinnamon/joy4/av"
"github.com/Danile71/joy4/codec/aacparser" "gitlab.com/ics_cinnamon/joy4/codec/aacparser"
"github.com/Danile71/joy4/codec/h264parser" "gitlab.com/ics_cinnamon/joy4/codec/h264parser"
"github.com/Danile71/joy4/format/ts/tsio" "gitlab.com/ics_cinnamon/joy4/format/ts/tsio"
"github.com/Danile71/joy4/utils/bits/pio" "gitlab.com/ics_cinnamon/joy4/utils/bits/pio"
) )
type Demuxer struct { type Demuxer struct {

@ -3,8 +3,8 @@ package ts
import ( import (
"io" "io"
"github.com/Danile71/joy4/av" "gitlab.com/ics_cinnamon/joy4/av"
"github.com/Danile71/joy4/av/avutil" "gitlab.com/ics_cinnamon/joy4/av/avutil"
) )
func Handler(h *avutil.RegisterHandler) { func Handler(h *avutil.RegisterHandler) {

@ -5,10 +5,10 @@ import (
"io" "io"
"time" "time"
"github.com/Danile71/joy4/av" "gitlab.com/ics_cinnamon/joy4/av"
"github.com/Danile71/joy4/codec/aacparser" "gitlab.com/ics_cinnamon/joy4/codec/aacparser"
"github.com/Danile71/joy4/codec/h264parser" "gitlab.com/ics_cinnamon/joy4/codec/h264parser"
"github.com/Danile71/joy4/format/ts/tsio" "gitlab.com/ics_cinnamon/joy4/format/ts/tsio"
) )
var CodecTypes = []av.CodecType{av.H264, av.AAC} var CodecTypes = []av.CodecType{av.H264, av.AAC}

@ -3,8 +3,8 @@ package ts
import ( import (
"time" "time"
"github.com/Danile71/joy4/av" "gitlab.com/ics_cinnamon/joy4/av"
"github.com/Danile71/joy4/format/ts/tsio" "gitlab.com/ics_cinnamon/joy4/format/ts/tsio"
) )
type Stream struct { type Stream struct {

@ -5,7 +5,7 @@ import (
"io" "io"
"time" "time"
"github.com/Danile71/joy4/utils/bits/pio" "gitlab.com/ics_cinnamon/joy4/utils/bits/pio"
) )
const ( const (

@ -0,0 +1,5 @@
module gitlab.com/ics_cinnamon/joy4
go 1.16
require gocv.io/x/gocv v0.27.0

@ -0,0 +1,3 @@
github.com/pascaldekloe/goe v0.1.0/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc=
gocv.io/x/gocv v0.27.0 h1:3X8I74ULsWHd4m7DQRv2Nqx5VkKscfUFnKgLNodiboI=
gocv.io/x/gocv v0.27.0/go.mod h1:n4LnYjykU6y9gn48yZf4eLCdtuSb77XxSkW6g0wGf/A=
Loading…
Cancel
Save