Changeset 5305 for pjproject


Ignore:
Timestamp:
May 18, 2016 7:50:15 AM (9 years ago)
Author:
riza
Message:

Re #1920: Update how keyframe is detected on FFMpeg codec, since
AVCodecContext.coded_frame is deprecated.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjmedia/src/pjmedia-codec/ffmpeg_vid_codecs.c

    r5286 r5305  
    14771477        return PJMEDIA_CODEC_EFAILED; 
    14781478    } else { 
     1479        pj_bool_t has_key_frame = PJ_FALSE; 
    14791480        output->size = err; 
    14801481        output->bit_info = 0; 
    1481         if (ff->enc_ctx->coded_frame->key_frame) 
    1482             output->bit_info |= PJMEDIA_VID_FRM_KEYFRAME; 
     1482 
     1483#if LIBAVCODEC_VER_AT_LEAST(54,15) 
     1484        has_key_frame = (avpacket.flags & AV_PKT_FLAG_KEY); 
     1485#else 
     1486        has_key_frame = ff->enc_ctx->coded_frame->key_frame;         
     1487#endif 
     1488        if (has_key_frame)     
     1489            output->bit_info |= PJMEDIA_VID_FRM_KEYFRAME; 
    14831490    } 
    14841491 
Note: See TracChangeset for help on using the changeset viewer.