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

Method Create

src/brpc/rtmp.cpp:415–434  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

413}
414
415butil::Status RtmpAACMessage::Create(const RtmpAudioMessage& msg) {
416 if (msg.codec != FLV_AUDIO_AAC) {
417 return butil::Status(EINVAL, "codec=%s is not AAC",
418 FlvAudioCodec2Str(msg.codec));
419 }
420 const uint8_t* p = (const uint8_t*)msg.data.fetch1();
421 if (p == NULL) {
422 return butil::Status(EINVAL, "Not enough data in AudioMessage");
423 }
424 if (*p > FLV_AAC_PACKET_RAW) {
425 return butil::Status(EINVAL, "Invalid AAC packet_type=%d", (int)*p);
426 }
427 this->timestamp = msg.timestamp;
428 this->rate = msg.rate;
429 this->bits = msg.bits;
430 this->type = msg.type;
431 this->packet_type = (FlvAACPacketType)*p;
432 msg.data.append_to(&data, msg.data.size() - 1, 1);
433 return butil::Status::OK();
434}
435
436AudioSpecificConfig::AudioSpecificConfig()
437 : aac_object(AAC_OBJECT_UNKNOWN)

Callers 6

TESTFunction · 0.45
TEST_FFunction · 0.45
WriteMethod · 0.45
CreateSocketMethod · 0.45
CreateSocketMethod · 0.45
CreateSocketMethod · 0.45

Calls 10

FlvAudioCodec2StrFunction · 0.85
FlvVideoCodec2StrFunction · 0.85
ReadBigEndian3BytesFunction · 0.85
fetchMethod · 0.80
optionsMethod · 0.80
StatusEnum · 0.70
fetch1Method · 0.45
append_toMethod · 0.45
sizeMethod · 0.45
copy_toMethod · 0.45

Tested by 2

TESTFunction · 0.36
TEST_FFunction · 0.36