[vlc-commits] codec: avcodec: copy the source max light levels into the output picture

Steve Lhomme git at videolan.org
Fri Apr 7 15:59:54 CEST 2017


vlc | branch: master | Steve Lhomme <robUx4 at videolabs.io> | Thu Apr  6 17:49:57 2017 +0200| [f2be26e78cacde64921ba7e283e7ecebdabb36c1] | committer: Jean-Baptiste Kempf

codec: avcodec: copy the source max light levels into the output picture

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=f2be26e78cacde64921ba7e283e7ecebdabb36c1
---

 modules/codec/avcodec/video.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/modules/codec/avcodec/video.c b/modules/codec/avcodec/video.c
index 6d2cb5d..dcc5a8f 100644
--- a/modules/codec/avcodec/video.c
+++ b/modules/codec/avcodec/video.c
@@ -1067,6 +1067,18 @@ static picture_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block, bool *error
             }
         }
 #endif
+#if (LIBAVUTIL_VERSION_MICRO >= 100 && LIBAVUTIL_VERSION_INT >= AV_VERSION_INT( 55, 60, 100 ) )
+        const AVFrameSideData *metadata_lt =
+                av_frame_get_side_data( frame,
+                                        AV_FRAME_DATA_CONTENT_LIGHT_LEVEL );
+        if ( metadata_lt )
+        {
+            const AVContentLightMetadata *light_meta =
+                    (const AVContentLightMetadata *) metadata_lt->data;
+            p_pic->format.ligthing.MaxCLL = light_meta->MaxCLL;
+            p_pic->format.ligthing.MaxFALL = light_meta->MaxFALL;
+        }
+#endif
         av_frame_free(&frame);
 
         /* Send decoded frame to vout */



More information about the vlc-commits mailing list