@@ -32,10 +32,10 @@ const uint8_t naluTypeSTAPA = 24;
32
32
const uint8_t naluTypeFUA = 28 ;
33
33
34
34
message_vector H264RtpDepacketizer::buildFrames (message_vector::iterator begin,
35
- message_vector::iterator end, uint32_t timestamp) {
35
+ message_vector::iterator end, uint8_t payloadType, uint32_t timestamp) {
36
36
message_vector out = {};
37
37
auto fua_buffer = std::vector<std::byte>{};
38
- auto frameInfo = std::make_shared<FrameInfo>(timestamp);
38
+ auto frameInfo = std::make_shared<FrameInfo>(payloadType, timestamp);
39
39
40
40
for (auto it = begin; it != end; it++) {
41
41
auto pkt = it->get ();
@@ -122,6 +122,7 @@ void H264RtpDepacketizer::incoming(message_vector &messages, const message_callb
122
122
messages.end ());
123
123
124
124
while (mRtpBuffer .size () != 0 ) {
125
+ uint8_t payload_type = 0 ;
125
126
uint32_t current_timestamp = 0 ;
126
127
size_t packets_in_timestamp = 0 ;
127
128
@@ -130,6 +131,7 @@ void H264RtpDepacketizer::incoming(message_vector &messages, const message_callb
130
131
131
132
if (current_timestamp == 0 ) {
132
133
current_timestamp = p->timestamp ();
134
+ payload_type = p->payloadType (); // should all be the same for data of the same codec
133
135
} else if (current_timestamp != p->timestamp ()) {
134
136
break ;
135
137
}
@@ -144,7 +146,7 @@ void H264RtpDepacketizer::incoming(message_vector &messages, const message_callb
144
146
auto begin = mRtpBuffer .begin ();
145
147
auto end = mRtpBuffer .begin () + (packets_in_timestamp - 1 );
146
148
147
- auto frames = buildFrames (begin, end + 1 , current_timestamp);
149
+ auto frames = buildFrames (begin, end + 1 , payload_type, current_timestamp);
148
150
messages.insert (messages.end (), frames.begin (), frames.end ());
149
151
mRtpBuffer .erase (mRtpBuffer .begin (), mRtpBuffer .begin () + packets_in_timestamp);
150
152
}
0 commit comments