MCPcopy Create free account
hub / github.com/apache/brpc / OnStatus

Method OnStatus

src/brpc/policy/rtmp_protocol.cpp:2544–2574  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2542}
2543
2544bool RtmpChunkStream::OnStatus(const RtmpMessageHeader& mh,
2545 AMFInputStream* istream,
2546 Socket* socket) {
2547 if (!connection_context()->is_client_side()) {
2548 RTMP_ERROR(socket, mh) << "Server-side should not receive `onStatus'";
2549 return false;
2550 }
2551 uint32_t transaction_id = 0;
2552 if (!ReadAMFUint32(&transaction_id, istream)) {
2553 RTMP_ERROR(socket, mh) << "Fail to read onStatus.TransactionId";
2554 return false;
2555 }
2556 if (!ReadAMFNull(istream)) { // command object
2557 RTMP_ERROR(socket, mh) << "Fail to read onStatus.CommandObject";
2558 return false;
2559 }
2560 RtmpInfo info;
2561 if (!ReadAMFObject(&info, istream)) {
2562 RTMP_ERROR(socket, mh) << "Fail to read onStatus.InfoObject";
2563 return false;
2564 }
2565 butil::intrusive_ptr<RtmpStreamBase> stream;
2566 if (!connection_context()->FindMessageStream(mh.stream_id, &stream)) {
2567 RTMP_WARNING(socket, mh) << "Fail to find stream_id=" << mh.stream_id;
2568 return false;
2569 }
2570 RPC_VLOG << socket->remote_side() << "[" << mh.stream_id
2571 << "] onStatus{" << info.ShortDebugString() << '}';
2572 static_cast<RtmpClientStream*>(stream.get())->OnStatus(info);
2573 return true;
2574}
2575
2576bool RtmpChunkStream::OnCreateStream(const RtmpMessageHeader& mh,
2577 AMFInputStream* istream,

Callers

nothing calls this directly

Calls 7

ReadAMFUint32Function · 0.85
ReadAMFNullFunction · 0.85
ReadAMFObjectFunction · 0.85
FindMessageStreamMethod · 0.80
is_client_sideMethod · 0.45
remote_sideMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected