| 2542 | } |
| 2543 | |
| 2544 | bool 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 | |
| 2576 | bool RtmpChunkStream::OnCreateStream(const RtmpMessageHeader& mh, |
| 2577 | AMFInputStream* istream, |
nothing calls this directly
no test coverage detected