Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
deepch committed Jun 5, 2022
2 parents 898c5e5 + 4db7d61 commit b232090
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 105 deletions.
30 changes: 30 additions & 0 deletions av/avutil/avutil.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ import (
"strings"

"github.com/deepch/vdk/av"
"github.com/deepch/vdk/codec/aacparser"
"github.com/deepch/vdk/codec/h264parser"
)

type HandlerDemuxer struct {
Expand Down Expand Up @@ -310,3 +312,31 @@ func CopyFile(dst av.Muxer, src av.Demuxer) (err error) {
}
return
}

func Equal(c1 []av.CodecData, c2 []av.CodecData) bool {
if len(c1) != len(c2) {
return false
}
for i, codec := range c1 {
if codec.Type() != c2[i].Type() {
return false
}
switch codec.Type() {
case av.H264:
if eq := bytes.Compare(
codec.(h264parser.CodecData).AVCDecoderConfRecordBytes(),
c2[i].(h264parser.CodecData).AVCDecoderConfRecordBytes(),
); eq != 0 {
return false
}
case av.AAC:
if eq := bytes.Compare(
codec.(aacparser.CodecData).MPEG4AudioConfigBytes(),
c2[i].(aacparser.CodecData).MPEG4AudioConfigBytes(),
); eq != 0 {
return false
}
}
}
return true
}
5 changes: 2 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ go 1.15

require (
github.com/google/uuid v1.3.0
github.com/pion/interceptor v0.1.10
github.com/pion/interceptor v0.1.11
github.com/pion/webrtc/v2 v2.2.26
github.com/pion/webrtc/v3 v3.1.31
github.com/quadrifoglio/go-mkv v0.0.0-20180620161916-e7a1fc70199c // indirect
github.com/pion/webrtc/v3 v3.1.41
)
Loading

0 comments on commit b232090

Please sign in to comment.