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

Method SendMessage

src/brpc/rtmp.cpp:1262–1282  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1260}
1261
1262int RtmpStreamBase::SendMessage(uint32_t timestamp,
1263 uint8_t message_type,
1264 const butil::IOBuf& body) {
1265 if (_rtmpsock == NULL) {
1266 errno = EPERM;
1267 return -1;
1268 }
1269 if (_chunk_stream_id == 0) {
1270 LOG(ERROR) << "SendXXXMessage can't be called before play() is received";
1271 errno = EPERM;
1272 return -1;
1273 }
1274 SocketMessagePtr<policy::RtmpUnsentMessage> msg(new policy::RtmpUnsentMessage);
1275 msg->header.timestamp = timestamp;
1276 msg->header.message_length = body.size();
1277 msg->header.message_type = message_type;
1278 msg->header.stream_id = _message_stream_id;
1279 msg->chunk_stream_id = _chunk_stream_id;
1280 msg->body = body;
1281 return _rtmpsock->Write(msg);
1282}
1283
1284int RtmpStreamBase::SendControlMessage(
1285 uint8_t message_type, const void* body, size_t size) {

Callers

nothing calls this directly

Calls 2

sizeMethod · 0.45
WriteMethod · 0.45

Tested by

no test coverage detected