| 2923 | } |
| 2924 | |
| 2925 | bool RtmpChunkStream::OnPlay2(const RtmpMessageHeader& mh, |
| 2926 | AMFInputStream* istream, |
| 2927 | Socket* socket) { |
| 2928 | if (!connection_context()->is_server_side()) { |
| 2929 | RTMP_ERROR(socket, mh) << "Client should not receive `play2'"; |
| 2930 | return false; |
| 2931 | } |
| 2932 | uint32_t transaction_id = 0; |
| 2933 | if (!ReadAMFUint32(&transaction_id, istream)) { |
| 2934 | RTMP_ERROR(socket, mh) << "Fail to read play2.TransactionId"; |
| 2935 | return false; |
| 2936 | } |
| 2937 | if (!ReadAMFNull(istream)) { |
| 2938 | RTMP_ERROR(socket, mh) << "Fail to read play2.CommandObject"; |
| 2939 | return false; |
| 2940 | } |
| 2941 | RtmpPlay2Options play2_options; |
| 2942 | if (!ReadAMFObject(&play2_options, istream)) { |
| 2943 | RTMP_ERROR(socket, mh) << "Fail to read play2.Parameters"; |
| 2944 | return false; |
| 2945 | } |
| 2946 | butil::intrusive_ptr<RtmpStreamBase> stream; |
| 2947 | if (!connection_context()->FindMessageStream(mh.stream_id, &stream)) { |
| 2948 | RTMP_WARNING(socket, mh) << "Fail to find stream_id=" << mh.stream_id; |
| 2949 | return false; |
| 2950 | } |
| 2951 | static_cast<RtmpServerStream*>(stream.get())->OnPlay2(play2_options); |
| 2952 | return true; |
| 2953 | } |
| 2954 | |
| 2955 | bool RtmpChunkStream::OnDeleteStream(const RtmpMessageHeader& mh, |
| 2956 | AMFInputStream* istream, |
nothing calls this directly
no test coverage detected