| 2268 | } |
| 2269 | |
| 2270 | bool RtmpChunkStream::OnCommandMessageAMF0( |
| 2271 | const RtmpMessageHeader& mh, butil::IOBuf* msg_body, Socket* socket) { |
| 2272 | butil::IOBufAsZeroCopyInputStream zc_stream(*msg_body); |
| 2273 | AMFInputStream istream(&zc_stream); |
| 2274 | std::string command_name; |
| 2275 | if (!ReadAMFString(&command_name, &istream)) { |
| 2276 | RTMP_ERROR(socket, mh) << "Fail to read commandName"; |
| 2277 | return false; |
| 2278 | } |
| 2279 | RPC_VLOG << socket->remote_side() << "[" << mh.stream_id |
| 2280 | << "] Command{timestamp=" << mh.timestamp |
| 2281 | << " name=" << command_name << '}'; |
| 2282 | pthread_once(&s_cmd_handlers_init_once, InitCommandHandlers); |
| 2283 | RtmpChunkStream::CommandHandler* phandler = |
| 2284 | s_cmd_handlers->seek(command_name); |
| 2285 | if (phandler == NULL) { |
| 2286 | RTMP_ERROR(socket, mh) << "Unknown command_name=" << command_name; |
| 2287 | return false; |
| 2288 | } |
| 2289 | return (this->**phandler)(mh, &istream, socket); |
| 2290 | } |
| 2291 | |
| 2292 | bool RtmpChunkStream::OnDataMessageAMF3( |
| 2293 | const RtmpMessageHeader& mh, butil::IOBuf* msg_body, Socket* socket) { |
nothing calls this directly
no test coverage detected