{
const uint8_t* pdata = (const uint8_t*)in_data;
uint8_t nal_type;
if(!in_data || !in_size || !out_data || !out_size){
TSK_DEBUG_ERROR("Invalid parameter");
return -1;
}
*out_data = tsk_null;
*out_size = 0;
/* 5.3. NAL Unit Octet Usage
+---------------+
|0|1|2|3|4|5|6|7|
+-+-+-+-+-+-+-+-+
|F|NRI| Type |
+---------------+
*/
switch((nal_type = (pdata[0] & 0x1F))){
case undefined_0:
case undefined_30:
case undefined_31:
//modified by shchoi 파이어폭스 NAL TYPE은 STAP-A(24)
//case stap_a:
case stap_b:
case mtap16:
case mtap24:
case fu_b:
break;
//inserted by shchoi
case stap_a:
*append_scp = tsk_true;//(nal_type != 7 && nal_type != 8); // SPS or PPS
return tdav_codec_h264_get_stapa_pay(pdata, in_size, out_data, out_size, append_scp);
case fu_a:
return tdav_codec_h264_get_fua_pay(pdata, in_size, out_data, out_size, append_scp);
default: /* NAL unit (1-23) */
*append_scp = tsk_true;//(nal_type != 7 && nal_type != 8); // SPS or PPS
return tdav_codec_h264_get_nalunit_pay(pdata, in_size, out_data, out_size);
}
TSK_DEBUG_WARN("%d not supported as valid NAL Unit type", (*pdata & 0x1F));
return -1;
}
//inserted by shchoi
int tdav_codec_h264_get_stapa_pay(const uint8_t* in_data, tsk_size_t in_size, const void** out_data, tsk_size_t *out_size, tsk_bool_t* append_scp)
{
/*
if (in_size <= H264_FUA_HEADER_SIZE){
TSK_DEBUG_ERROR("Too short");
return -1;
}
*/
/* RFC 3984 - 5.7.1 Single-Time Aggregation Packet (STAP-A)
0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| RTP Header |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|STAP-A NAL HDR | NALU 1 Size | NALU 1 HDR |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| NALU 1 Data |
: :
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| | NALU 2 Size | NALU 2 HDR |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| NALU 2 Data |
: :
| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| :...OPTIONAL RTP padding |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
*/
int nal_size = 0;
uint8_t nal_type;
nal_size = (in_data[1] << 8) | in_data[2];
nal_type = (in_data[3] & 0x1F);
*out_data = (in_data + 1 + 2);
*out_size = nal_size - 2;
return 0;
}
When telepresence is connected with firefox nightly(version 42.0a1) , the following error happned.
............................
[h264 @ 0x8c9b620] non-existing PPS 12 referenced
[h264 @ 0x8c9b620] decode_slice_header error
[h264 @ 0x8c9b620] no frame!
[h264 @ 0x8c9b620] non-existing PPS 12 referenced
[h264 @ 0x8c9b620] decode_slice_header error
[h264 @ 0x8c9b620] no frame!
.............................
the H.264 codec of the doubango telepresence is ffmpeg.
Please, someone helps me.
Thanks.
From seunghan.