[vlc-devel] [PATCH 22/28] codec: avcodec: copy the source max light levels into the output picture

Steve Lhomme robux4 at videolabs.io
Mon Apr 3 10:22:10 CEST 2017


---
 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 5b850001c3..5c3fa5969b 100644
--- a/modules/codec/avcodec/video.c
+++ b/modules/codec/avcodec/video.c
@@ -1063,6 +1063,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, 54, 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 */
-- 
2.11.1



More information about the vlc-devel mailing list