- Timestamp:
- Apr 26, 2012 7:27:06 AM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjmedia/src/pjmedia-codec/ffmpeg_vid_codecs.c
r4083 r4089 53 53 #endif 54 54 55 55 56 /* Various compatibility */ 57 56 58 #if LIBAVCODEC_VER_AT_LEAST(53,20) 57 # define AV_OPT_SET(obj,name,val,opt) av_opt_set(obj,name,val,opt)58 # define AV_OPT_SET_INT(obj,name,val) av_opt_set_int(obj,name,val,0)59 59 # define AVCODEC_OPEN(ctx,c) avcodec_open2(ctx,c,NULL) 60 60 #else 61 # define AV_OPT_SET(obj,name,val,opt) av_set_string3(obj,name,val,opt,NULL)62 # define AV_OPT_SET_INT(obj,name,val) av_set_int(obj,name,val)63 61 # define AVCODEC_OPEN(ctx,c) avcodec_open(ctx,c) 64 62 #endif … … 70 68 */ 71 69 # define AVCODEC_HAS_ENCODE(c) (c->encode || c->encode2) 70 # define AV_OPT_SET(obj,name,val,opt) (av_opt_set(obj,name,val,opt)==0) 71 # define AV_OPT_SET_INT(obj,name,val) (av_opt_set_int(obj,name,val,0)==0) 72 72 #else 73 73 # define AVCODEC_HAS_ENCODE(c) (c->encode) 74 # define AV_OPT_SET(obj,name,val,opt) (av_set_string3(obj,name,val,opt,NULL)==0) 75 # define AV_OPT_SET_INT(obj,name,val) (av_set_int(obj,name,val)!=NULL) 74 76 #endif 75 77 #define AVCODEC_HAS_DECODE(c) (c->decode) … … 400 402 break; 401 403 } 402 if (profile && 403 AV_OPT_SET(ctx->priv_data, "profile", profile, 0)) 404 if (profile && !AV_OPT_SET(ctx->priv_data, "profile", profile, 0)) 404 405 { 405 PJ_LOG(3, (THIS_FILE, "Failed to set H264 profile")); 406 PJ_LOG(3, (THIS_FILE, "Failed to set H264 profile to '%s'", 407 profile)); 406 408 } 407 409 … … 433 435 * Let's just use the x264 predefined preset & tune. 434 436 */ 435 if ( AV_OPT_SET(ctx->priv_data, "preset", "veryfast", 0)) {437 if (!AV_OPT_SET(ctx->priv_data, "preset", "veryfast", 0)) { 436 438 PJ_LOG(3, (THIS_FILE, "Failed to set x264 preset 'veryfast'")); 437 439 } 438 if ( AV_OPT_SET(ctx->priv_data, "tune", "animation+zerolatency", 0)) {440 if (!AV_OPT_SET(ctx->priv_data, "tune", "animation+zerolatency", 0)) { 439 441 PJ_LOG(3, (THIS_FILE, "Failed to set x264 tune 'zerolatency'")); 440 442 }
Note: See TracChangeset
for help on using the changeset viewer.