remove unnecessary struct in av
This commit is contained in:
parent
b20a950b7b
commit
970e23747a
53
av.go
53
av.go
@ -112,46 +112,6 @@ const (
|
||||
PCM_MULAW
|
||||
)
|
||||
|
||||
type BasicAudioCodecData struct {
|
||||
CodecType int
|
||||
CodecSampleRate int
|
||||
CodecChannelLayout ChannelLayout
|
||||
CodecSampleFormat SampleFormat
|
||||
}
|
||||
|
||||
func (self BasicAudioCodecData) Type() int {
|
||||
return self.CodecType
|
||||
}
|
||||
|
||||
func (self BasicAudioCodecData) IsAudio() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
func (self BasicAudioCodecData) IsVideo() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
func (self BasicAudioCodecData) SampleRate() int {
|
||||
return self.CodecSampleRate
|
||||
}
|
||||
|
||||
func (self BasicAudioCodecData) ChannelLayout() ChannelLayout {
|
||||
return self.CodecChannelLayout
|
||||
}
|
||||
|
||||
func (self BasicAudioCodecData) SampleFormat() SampleFormat {
|
||||
return self.CodecSampleFormat
|
||||
}
|
||||
|
||||
func NewPCMMulawCodecData() AudioCodecData {
|
||||
return BasicAudioCodecData{
|
||||
CodecType: PCM_MULAW,
|
||||
CodecSampleFormat: S16,
|
||||
CodecChannelLayout: CH_MONO,
|
||||
CodecSampleRate: 8000,
|
||||
}
|
||||
}
|
||||
|
||||
type CodecData interface {
|
||||
IsVideo() bool
|
||||
IsAudio() bool
|
||||
@ -171,19 +131,6 @@ type AudioCodecData interface {
|
||||
ChannelLayout() ChannelLayout
|
||||
}
|
||||
|
||||
type H264CodecData interface {
|
||||
VideoCodecData
|
||||
AVCDecoderConfRecordBytes() []byte
|
||||
SPS() []byte
|
||||
PPS() []byte
|
||||
}
|
||||
|
||||
type AACCodecData interface {
|
||||
AudioCodecData
|
||||
MPEG4AudioConfigBytes() []byte
|
||||
MakeADTSHeader(samples int, payloadLength int) []byte
|
||||
}
|
||||
|
||||
type Muxer interface {
|
||||
WriteHeader([]CodecData) error
|
||||
WritePacket(int, Packet) error
|
||||
|
Loading…
x
Reference in New Issue
Block a user