Changed NewRevidInstance to NewRevid

This commit is contained in:
Saxon Milton 2018-04-16 14:47:50 +09:30
parent 597b0840a4
commit 093df161f1
3 changed files with 5 additions and 5 deletions

View File

@ -18,7 +18,7 @@ func main() {
Bitrate: "500000", Bitrate: "500000",
Packetization: revid.Flv, Packetization: revid.Flv,
} }
revidInst, err := revid.NewRevidInstance(config) revidInst, err := revid.NewRevid(config)
if err != nil { if err != nil {
fmt.Println("Should not have got error!") fmt.Println("Should not have got error!")
return return

View File

@ -115,10 +115,10 @@ type revid struct {
mutex sync.Mutex mutex sync.Mutex
} }
// NewRevidInstance returns a pointer to a new revid with the desired // NewRevid returns a pointer to a new revid with the desired
// configuration, and/or an error if construction of the new instant was not // configuration, and/or an error if construction of the new instant was not
// successful. // successful.
func NewRevidInstance(config Config) (r *revid, err error) { func NewRevid(config Config) (r *revid, err error) {
r = new(revid) r = new(revid)
r.mutex = sync.Mutex{} r.mutex = sync.Mutex{}
r.ringBuffer = ringbuffer.NewRingBuffer(ringBufferSize, ringBufferElementSize) r.ringBuffer = ringbuffer.NewRingBuffer(ringBufferSize, ringBufferElementSize)
@ -211,7 +211,7 @@ noPacketizationSetup:
// ChangeConfig changes the current configuration of the revid instance. // ChangeConfig changes the current configuration of the revid instance.
func (r *revid) ChangeConfig(config Config) (err error) { func (r *revid) ChangeConfig(config Config) (err error) {
r.Stop() r.Stop()
r, err = NewRevidInstance(config) r, err = NewRevid(config)
if err != nil { if err != nil {
return return
} }

View File

@ -182,7 +182,7 @@ func TestRaspividToRtmp(t *testing.T) {
Packetization: Flv, Packetization: Flv,
FrameRate: "25", FrameRate: "25",
} }
revidInst, err := NewRevidInstance(config) revidInst, err := NewRevid(config)
if err != nil { if err != nil {
t.Errorf("Should not have got an error!") t.Errorf("Should not have got an error!")
return return