+---------------+---------------+---------------+
|0|1|2|3|4|5|6|7|0|1|2|3|4|5|6|7|0|1|2|3|4|5|6|7|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|R|I| PRID |N| DID | QID | TID |U|D|O| RR|
+---------------+---------------+---------------+```
it seems that 'tid' represent the temporal layer of current NAL, to verify this, I use windows to compile and run webrtc; In H264EncoderImpl::InitEncode( ), I chagne the code for support enable svc temporal layer
.....
.....
Since there a object named 'info' which includes the infomation of temporal layer after frame encode, so I can compare the value of info.temporal_layer with value of 'tid' to validate;so I add a judgement and breakpoint as below (code with highlight)
for (int layer = 0; layer < info->iLayerNum; ++layer) {
const SLayerBSInfo& layerInfo = info->sLayerInfo[layer];
// Iterate NAL units making up this layer, noting fragments.
size_t layer_len = 0;
for (int nal = 0; nal < layerInfo.iNalCount; ++nal, ++frag) {
// Because the sum of all layer lengths, |required_capacity|, fits in a
// |size_t|, we know that any indices in-between will not overflow.
RTC_DCHECK_GE(layerInfo.pNalLengthInByte[nal], 4);
RTC_DCHECK_EQ(layerInfo.pBsBuf[layer_len + 0], start_code[0]);
RTC_DCHECK_EQ(layerInfo.pBsBuf[layer_len + 1], start_code[1]);
RTC_DCHECK_EQ(layerInfo.pBsBuf[layer_len + 2], start_code[2]);
RTC_DCHECK_EQ(layerInfo.pBsBuf[layer_len + 3], start_code[3]);
frag_header->fragmentationOffset[frag] =
encoded_image->size() + layer_len + sizeof(start_code);
frag_header->fragmentationLength[frag] =
layerInfo.pNalLengthInByte[nal] - sizeof(start_code);
layer_len += layerInfo.pNalLengthInByte[nal];
}
// Copy the entire layer's data (including start codes).
memcpy(encoded_image->data() + encoded_image->size(), layerInfo.pBsBuf,
layer_len);
encoded_image->set_size(encoded_image->size() + layer_len);
// add a judgement and breakpoint
// after frmae encode, try to compare info.temporal_layer with tid
RTC_LOG(INFO) << "xxxxxxxxxxxxxxxxxxxxxxxxxxxx temporal layer is " << layerInfo.uiTemporalId;
if (layerInfo.uiTemporalId != 0) {
int a;
=> a = 1; // add breakpoint here
}