Skip to content

Commit

Permalink
ios/VideoToolbox: add option videotoolbox-handle-resolution-change
Browse files Browse the repository at this point in the history
  • Loading branch information
bbcallen committed Jul 14, 2016
1 parent 69b4465 commit c275f6c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions ijkmedia/ijkplayer/ff_ffplay_def.h
Original file line number Diff line number Diff line change
Expand Up @@ -615,6 +615,7 @@ typedef struct FFPlayer {
int vtb_max_frame_width;
int vtb_async;
int vtb_wait_async;
int vtb_handle_resolution_change;

int mediacodec_all_videos;
int mediacodec_avc;
Expand Down
2 changes: 2 additions & 0 deletions ijkmedia/ijkplayer/ff_ffplay_options.h
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,8 @@ static const AVOption ffp_context_options[] = {
OPTION_OFFSET(vtb_async), OPTION_INT(0, 0, 1) },
{ "videotoolbox-wait-async", "VideoToolbox: call VTDecompressionSessionWaitForAsynchronousFrames()",
OPTION_OFFSET(vtb_wait_async), OPTION_INT(1, 0, 1) },
{ "videotoolbox-handle-resolution-change", "VideoToolbox: handle resolution change automatically",
OPTION_OFFSET(vtb_handle_resolution_change), OPTION_INT(0, 0, 1) },

// Android only options
{ "mediacodec", "MediaCodec: enable H264 (deprecated by 'mediacodec-avc')",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -752,7 +752,8 @@ static int decode_video(VideoToolBoxContext* context, AVCodecContext *avctx, AVP
return 0;
}

if (context->codecpar->codec_id == AV_CODEC_ID_H264) {
if (context->ffp->vtb_handle_resolution_change &&
context->codecpar->codec_id == AV_CODEC_ID_H264) {
size_data = av_packet_get_side_data(avpkt, AV_PKT_DATA_NEW_EXTRADATA, &size_data_size);
if (size_data && size_data_size > AV_INPUT_BUFFER_PADDING_SIZE) {
int got_picture = 0;
Expand Down

0 comments on commit c275f6c

Please sign in to comment.