Ignore:
Timestamp:
Dec 28, 2016 3:40:07 AM (7 years ago)
Author:
nanang
Message:

Re #1900: More merged from trunk (r5512 mistakenly contains merged changes in third-party dir only).

Location:
pjproject/branches/projects/uwp
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • pjproject/branches/projects/uwp

  • pjproject/branches/projects/uwp/pjmedia/src/pjmedia-codec/ffmpeg_vid_codecs.c

    r5198 r5513  
    14301430    PJ_ASSERT_RETURN(ff->enc_ctx, PJ_EINVALIDOP); 
    14311431 
     1432#ifdef PJMEDIA_USE_OLD_FFMPEG 
     1433    avcodec_get_frame_defaults(&avframe); 
     1434#else 
    14321435    pj_bzero(&avframe, sizeof(avframe)); 
    14331436    av_frame_unref(&avframe); 
     1437#endif 
    14341438 
    14351439    // Let ffmpeg manage the timestamps 
     
    14731477        return PJMEDIA_CODEC_EFAILED; 
    14741478    } else { 
     1479        pj_bool_t has_key_frame = PJ_FALSE; 
    14751480        output->size = err; 
    14761481        output->bit_info = 0; 
    1477         if (ff->enc_ctx->coded_frame->key_frame) 
    1478             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; 
    14791490    } 
    14801491 
     
    16811692     * closed). 
    16821693     */ 
     1694#ifdef PJMEDIA_USE_OLD_FFMPEG 
     1695    avcodec_get_frame_defaults(&avframe); 
     1696#else 
    16831697    pj_bzero(&avframe, sizeof(avframe)); 
    16841698    av_frame_unref(&avframe); 
     1699#endif 
    16851700 
    16861701    /* Init packet, the container of the encoded data */ 
Note: See TracChangeset for help on using the changeset viewer.