@@ -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 ();
@@ -111,6 +111,7 @@ void H264RtpDepacketizer::incoming(message_vector &messages, const message_callb
111
111
messages.end ());
112
112
113
113
while (mRtpBuffer .size () != 0 ) {
114
+ uint8_t payload_type = 0 ;
114
115
uint32_t current_timestamp = 0 ;
115
116
size_t packets_in_timestamp = 0 ;
116
117
@@ -119,6 +120,7 @@ void H264RtpDepacketizer::incoming(message_vector &messages, const message_callb
119
120
120
121
if (current_timestamp == 0 ) {
121
122
current_timestamp = p->timestamp ();
123
+ payload_type = p->payloadType (); // should all be the same for data of the same codec
122
124
} else if (current_timestamp != p->timestamp ()) {
123
125
break ;
124
126
}
@@ -133,7 +135,7 @@ void H264RtpDepacketizer::incoming(message_vector &messages, const message_callb
133
135
auto begin = mRtpBuffer .begin ();
134
136
auto end = mRtpBuffer .begin () + (packets_in_timestamp - 1 );
135
137
136
- auto frames = buildFrames (begin, end + 1 , current_timestamp);
138
+ auto frames = buildFrames (begin, end + 1 , payload_type, current_timestamp);
137
139
messages.insert (messages.end (), frames.begin (), frames.end ());
138
140
mRtpBuffer .erase (mRtpBuffer .begin (), mRtpBuffer .begin () + packets_in_timestamp);
139
141
}
0 commit comments