MCPcopy Create free account
hub / github.com/BigPig0/RelayLive / Decode

Method Decode

Modules/LiveClient/Recode.cpp:231–288  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

229 }
230
231 int CDecoder::Decode(AV_BUFF buff){
232 char *nalu = NULL;
233 h264_nalu_data(buff.pData, &nalu);
234 NalType t = h264_naltype(nalu);
235 switch (t)
236 {
237 case b_Nal: // �ǹؼ�֡
238 {
239 if(!m_bFirstKey)
240 break;
241 //������ڹؼ�֡û�д�������Ҫ�ȷ��͹ؼ�֡��pps�����ڹؼ�֡������յ���
242 //sps��pps��ʧ������ʹ����һ�εġ�
243 DecodeKeyVideo();
244 //Log::debug("send frame");
245 DecodeVideo(buff);
246 m_timestamp += m_tick_gap;
247 }
248 break;
249 case idr_Nal: // �ؼ�֡
250 {
251 m_pKeyFrame->clear();
252 m_pKeyFrame->append_data(buff.pData, buff.nLen);
253 m_nKeyPts = buff.m_pts;
254 m_nKeyDts = buff.m_dts;
255 //һ��sps��pps���ڹؼ�֡ǰ�棬����ʱ���ڹؼ�֡���档
256 if(m_bGotPPS && m_bGotSPS)
257 DecodeKeyVideo();
258 }
259 break;
260 case sei_Nal:
261 break;
262 case sps_Nal:
263 {
264 //Log::debug("save sps size:%d",nLen);
265 CHECK_POINT_INT(m_pSPS,-1);
266 m_pSPS->clear();
267 m_pSPS->append_data(buff.pData, buff.nLen);
268 m_bGotSPS = true;
269 }
270 break;
271 case pps_Nal:
272 {
273 //Log::debug("save pps size:%d",nLen);
274 CHECK_POINT_INT(m_pPPS,-1);
275 m_pPPS->clear();
276 m_pPPS->append_data(buff.pData, buff.nLen);
277 m_bGotPPS = true;
278 }
279 break;
280 case other:
281 case unknow:
282 default:
283 //Log::warning("h264 nal type: %d", t);
284 break;
285 }
286
287 return 0;
288 }

Callers 2

push_pes_streamMethod · 0.45
ReceiveStreamAsyncMethod · 0.45

Calls 3

h264_nalu_dataFunction · 0.85
h264_naltypeFunction · 0.85
append_dataMethod · 0.80

Tested by

no test coverage detected