mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2024-11-22 10:40:05 +08:00
http-flv拉流客户端支持压测模式
This commit is contained in:
parent
585f7c3a3a
commit
d542eca4d7
@ -54,8 +54,11 @@ void FlvPlayer::onResponseCompleted(const SockException &ex) {
|
||||
}
|
||||
|
||||
void FlvPlayer::onResponseBody(const char *buf, size_t size) {
|
||||
if (!_benchmark_mode) {
|
||||
// 性能测试模式不做数据解析,节省cpu
|
||||
FlvSplitter::input(buf, size);
|
||||
}
|
||||
}
|
||||
|
||||
bool FlvPlayer::onRecvMetadata(const AMFValue &metadata) {
|
||||
return onMetadata(metadata);
|
||||
@ -64,6 +67,7 @@ bool FlvPlayer::onRecvMetadata(const AMFValue &metadata) {
|
||||
void FlvPlayer::onRecvRtmpPacket(RtmpPacket::Ptr packet) {
|
||||
if (!_play_result && !packet->isConfigFrame()) {
|
||||
_play_result = true;
|
||||
_benchmark_mode = (*this)[Client::kBenchmarkMode].as<int>();
|
||||
onPlayResult(SockException(Err_success, "play http-flv success"));
|
||||
}
|
||||
onRtmpPacket(std::move(packet));
|
||||
|
@ -40,6 +40,7 @@ private:
|
||||
|
||||
private:
|
||||
bool _play_result = false;
|
||||
bool _benchmark_mode = false;
|
||||
};
|
||||
|
||||
using FlvPlayerImp = FlvPlayerBase<FlvPlayer>;
|
||||
|
Loading…
Reference in New Issue
Block a user