diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2014-05-11 21:48:32 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2014-05-11 21:48:32 +0200 |
commit | d93cf093f840b9a28481c73d7e421f469f2ca4e7 (patch) | |
tree | 6159a41d2f67277f41953dd72ae349c3e2670155 | |
parent | 5e95551199871e5912c7bd498cbcc502d33113aa (diff) | |
parent | 632ad2248e2e5d8cd4b51e6c87c943a38c3da425 (diff) | |
download | ffmpeg-d93cf093f840b9a28481c73d7e421f469f2ca4e7.tar.gz |
Merge commit '632ad2248e2e5d8cd4b51e6c87c943a38c3da425'
* commit '632ad2248e2e5d8cd4b51e6c87c943a38c3da425':
lavc: Add an internal wrapper around get_format()
Conflicts:
libavcodec/h264_slice.c
libavcodec/mpeg12dec.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r-- | libavcodec/8bps.c | 2 | ||||
-rw-r--r-- | libavcodec/h263dec.c | 2 | ||||
-rw-r--r-- | libavcodec/internal.h | 7 | ||||
-rw-r--r-- | libavcodec/pthread_frame.c | 2 | ||||
-rw-r--r-- | libavcodec/utils.c | 7 | ||||
-rw-r--r-- | libavcodec/vc1dec.c | 2 |
6 files changed, 17 insertions, 5 deletions
diff --git a/libavcodec/8bps.c b/libavcodec/8bps.c index d01ef924c7..e00bdfc808 100644 --- a/libavcodec/8bps.c +++ b/libavcodec/8bps.c @@ -150,7 +150,7 @@ static av_cold int decode_init(AVCodecContext *avctx) c->planemap[0] = 0; // 1st plane is palette indexes break; case 24: - avctx->pix_fmt = avctx->get_format(avctx, pixfmt_rgb24); + avctx->pix_fmt = ff_get_format(avctx, pixfmt_rgb24); c->planes = 3; c->planemap[0] = 2; // 1st plane is red c->planemap[1] = 1; // 2nd plane is green diff --git a/libavcodec/h263dec.c b/libavcodec/h263dec.c index 474714ed77..0eba2f9141 100644 --- a/libavcodec/h263dec.c +++ b/libavcodec/h263dec.c @@ -60,7 +60,7 @@ av_cold int ff_h263_decode_init(AVCodecContext *avctx) if (avctx->codec->id == AV_CODEC_ID_MSS2) avctx->pix_fmt = AV_PIX_FMT_YUV420P; else - avctx->pix_fmt = avctx->get_format(avctx, avctx->codec->pix_fmts); + avctx->pix_fmt = ff_get_format(avctx, avctx->codec->pix_fmts); s->unrestricted_mv = 1; /* select sub codec */ diff --git a/libavcodec/internal.h b/libavcodec/internal.h index f5455448a8..abe9fb93b9 100644 --- a/libavcodec/internal.h +++ b/libavcodec/internal.h @@ -254,6 +254,13 @@ int ff_side_data_update_matrix_encoding(AVFrame *frame, enum AVMatrixEncoding matrix_encoding); /** + * Select the (possibly hardware accelerated) pixel format. + * This is a wrapper around AVCodecContext.get_format() and should be used + * instead of calling get_format() directly. + */ +int ff_get_format(AVCodecContext *avctx, const enum AVPixelFormat *fmt); + +/** * Set various frame properties from the codec context / packet data. */ int ff_decode_frame_props(AVCodecContext *avctx, AVFrame *frame); diff --git a/libavcodec/pthread_frame.c b/libavcodec/pthread_frame.c index 5f452010da..f2ac735145 100644 --- a/libavcodec/pthread_frame.c +++ b/libavcodec/pthread_frame.c @@ -832,7 +832,7 @@ enum AVPixelFormat ff_thread_get_format(AVCodecContext *avctx, const enum AVPixe PerThreadContext *p = avctx->internal->thread_ctx; if (!(avctx->active_thread_type & FF_THREAD_FRAME) || avctx->thread_safe_callbacks || avctx->get_format == avcodec_default_get_format) - return avctx->get_format(avctx, fmt); + return ff_get_format(avctx, fmt); if (p->state != STATE_SETTING_UP) { av_log(avctx, AV_LOG_ERROR, "get_format() cannot be called after ff_thread_finish_setup()\n"); return -1; diff --git a/libavcodec/utils.c b/libavcodec/utils.c index b899392fcc..f8fa3590e4 100644 --- a/libavcodec/utils.c +++ b/libavcodec/utils.c @@ -1117,6 +1117,11 @@ enum AVPixelFormat avcodec_default_get_format(struct AVCodecContext *s, const en return fmt[0]; } +int ff_get_format(AVCodecContext *avctx, const enum AVPixelFormat *fmt) +{ + return avctx->get_format(avctx, fmt); +} + #if FF_API_AVFRAME_LAVC void avcodec_get_frame_defaults(AVFrame *frame) { @@ -3424,7 +3429,7 @@ int ff_thread_ref_frame(ThreadFrame *dst, ThreadFrame *src) enum AVPixelFormat ff_thread_get_format(AVCodecContext *avctx, const enum AVPixelFormat *fmt) { - return avctx->get_format(avctx, fmt); + return ff_get_format(avctx, fmt); } int ff_thread_get_buffer(AVCodecContext *avctx, ThreadFrame *f, int flags) diff --git a/libavcodec/vc1dec.c b/libavcodec/vc1dec.c index 614e774972..be6a3b8a9d 100644 --- a/libavcodec/vc1dec.c +++ b/libavcodec/vc1dec.c @@ -5606,7 +5606,7 @@ static av_cold int vc1_decode_init(AVCodecContext *avctx) if (!avctx->extradata_size || !avctx->extradata) return -1; if (!(avctx->flags & CODEC_FLAG_GRAY)) - avctx->pix_fmt = avctx->get_format(avctx, avctx->codec->pix_fmts); + avctx->pix_fmt = ff_get_format(avctx, avctx->codec->pix_fmts); else avctx->pix_fmt = AV_PIX_FMT_GRAY8; avctx->hwaccel = ff_find_hwaccel(avctx); |