mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2026-06-16 13:05:59 +08:00
for h264/h265 judge a frame start more safe(h264 is first_mb_in_slice h265 is first_slice_segment_in_pic_flag) and for h265 only idr is key frame
This commit is contained in:
@@ -64,10 +64,11 @@ bool H265Frame::configFrame() const {
|
||||
}
|
||||
|
||||
bool H265Frame::isKeyFrame(int type, const char *ptr) {
|
||||
if (!ptr || type != NAL_IDR_W_RADL) {
|
||||
return type >= NAL_BLA_W_LP && type <= NAL_RSV_IRAP_VCL23;
|
||||
if(ptr){
|
||||
return (((*((uint8_t *) ptr + 2)) >> 7) & 0x01) == 1 && (type == NAL_IDR_N_LP || type == NAL_IDR_W_RADL);
|
||||
}
|
||||
return (((*((uint8_t *) ptr + 2)) >> 7) & 0x01) == 1;
|
||||
return false;
|
||||
|
||||
}
|
||||
|
||||
H265Frame::H265Frame(){
|
||||
|
||||
Reference in New Issue
Block a user