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

Method Publish

src/brpc/rtmp.cpp:2017–2031  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2015}
2016
2017int RtmpClientStream::Publish(const butil::StringPiece& name,
2018 RtmpPublishType type) {
2019 butil::IOBuf req_buf;
2020 {
2021 butil::IOBufAsZeroCopyOutputStream zc_stream(&req_buf);
2022 AMFOutputStream ostream(&zc_stream);
2023 WriteAMFString(RTMP_AMF0_COMMAND_PUBLISH, &ostream);
2024 WriteAMFUint32(0, &ostream);
2025 WriteAMFNull(&ostream);
2026 WriteAMFString(name, &ostream);
2027 WriteAMFString(RtmpPublishType2Str(type), &ostream);
2028 CHECK(ostream.good());
2029 }
2030 return SendMessage(0, policy::RTMP_MESSAGE_COMMAND_AMF0, req_buf);
2031}
2032
2033int RtmpClientStream::Seek(double offset_ms) {
2034 butil::IOBuf req_buf;

Callers 1

RunMethod · 0.80

Calls 5

WriteAMFStringFunction · 0.85
WriteAMFUint32Function · 0.85
WriteAMFNullFunction · 0.85
RtmpPublishType2StrFunction · 0.85
goodMethod · 0.45

Tested by

no test coverage detected