mirror of
https://github.com/encounter/go-rtmp.git
synced 2026-03-30 11:12:49 -07:00
32 lines
639 B
Go
32 lines
639 B
Go
//
|
|
// Copyright (c) 2018- yutopp (yutopp@gmail.com)
|
|
//
|
|
// Distributed under the Boost Software License, Version 1.0. (See accompanying
|
|
// file LICENSE_1_0.txt or copy at https://www.boost.org/LICENSE_1_0.txt)
|
|
//
|
|
|
|
package rtmp
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/encounter/go-rtmp/message"
|
|
)
|
|
|
|
func BenchmarkHandlePublisherVideoMessage(b *testing.B) {
|
|
rwc := &rwcMock{}
|
|
c := newConn(rwc, nil)
|
|
|
|
s := newStream(42, c)
|
|
s.handler.ChangeState(streamStateServerPublish)
|
|
|
|
chunkStreamID := 0
|
|
timestamp := uint32(0)
|
|
msg := &message.VideoMessage{}
|
|
|
|
b.ResetTimer()
|
|
for i := 0; i < b.N; i++ {
|
|
_ = s.handle(chunkStreamID, timestamp, msg)
|
|
}
|
|
}
|