summaryrefslogtreecommitdiffstats
path: root/video/decode/vd_lavc.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2017-10-30 21:07:38 +0100
committerwm4 <wm4@nowhere>2017-10-30 21:07:48 +0100
commita18a7cd4f568aa934be30b2cdf813a0879b8db19 (patch)
tree1f859ec4ba2f2fa8dcabcd443591b29134053d74 /video/decode/vd_lavc.c
parenta7f4ecb01299835a1afe5cc051be1e9bb5d4f15d (diff)
downloadmpv-a18a7cd4f568aa934be30b2cdf813a0879b8db19.tar.bz2
mpv-a18a7cd4f568aa934be30b2cdf813a0879b8db19.tar.xz
vd_lavc: move display mastering data stuff to mp_image
This is where it should be. It only wasn't because of an old libavcodec bug, that returned the side data only on every IDR. This required some sort of caching, which is now dropped. (mp_image wouldn't have been able to do this kind of caching, because this code is stateless.) We don't support these old libavcodec versions anymore, which is why this is not needed anymore. Also move initialization of rotation/stereo stuff to dec_video.c.
Diffstat (limited to 'video/decode/vd_lavc.c')
-rw-r--r--video/decode/vd_lavc.c39
1 files changed, 0 insertions, 39 deletions
diff --git a/video/decode/vd_lavc.c b/video/decode/vd_lavc.c
index 01c404106e..d146270062 100644
--- a/video/decode/vd_lavc.c
+++ b/video/decode/vd_lavc.c
@@ -49,10 +49,6 @@
#include "video/sws_utils.h"
#include "video/out/vo.h"
-#if LIBAVCODEC_VERSION_MICRO >= 100
-#include <libavutil/mastering_display_metadata.h>
-#endif
-
#include "lavc.h"
#if AVPALETTE_SIZE != MP_PALETTE_SIZE
@@ -728,39 +724,6 @@ static void uninit_avctx(struct dec_video *vd)
ctx->hw_probing = false;
}
-static void update_image_params(struct dec_video *vd, AVFrame *frame,
- struct mp_image_params *params)
-{
- vd_ffmpeg_ctx *ctx = vd->priv;
- AVFrameSideData *sd;
-
-#if LIBAVCODEC_VERSION_MICRO >= 100
- // Get the content light metadata if available
- sd = av_frame_get_side_data(frame, AV_FRAME_DATA_CONTENT_LIGHT_LEVEL);
- if (sd) {
- AVContentLightMetadata *clm = (AVContentLightMetadata *)sd->data;
- params->color.sig_peak = clm->MaxCLL / MP_REF_WHITE;
- }
-
- // Otherwise, try getting the mastering metadata if available
- sd = av_frame_get_side_data(frame, AV_FRAME_DATA_MASTERING_DISPLAY_METADATA);
- if (!params->color.sig_peak && sd) {
- AVMasteringDisplayMetadata *mdm = (AVMasteringDisplayMetadata *)sd->data;
- if (mdm->has_luminance)
- params->color.sig_peak = av_q2d(mdm->max_luminance) / MP_REF_WHITE;
- }
-#endif
-
- if (params->color.sig_peak) {
- ctx->cached_sig_peak = params->color.sig_peak;
- } else {
- params->color.sig_peak = ctx->cached_sig_peak;
- }
-
- params->rotate = vd->codec->rotate;
- params->stereo_in = vd->codec->stereo_mode;
-}
-
static int init_generic_hwaccel(struct dec_video *vd, enum AVPixelFormat hw_fmt)
{
struct lavc_ctx *ctx = vd->priv;
@@ -1174,8 +1137,6 @@ static bool decode_frame(struct dec_video *vd)
mp_pts_from_av(ctx->pic->pkt_duration, &ctx->codec_timebase);
#endif
- update_image_params(vd, ctx->pic, &mpi->params);
-
av_frame_unref(ctx->pic);
MP_TARRAY_APPEND(ctx, ctx->delay_queue, ctx->num_delay_queue, mpi);