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

Steve Lhomme robux4 at videolabs.io
Thu Apr 6 17:49:57 CEST 2017


--
replaces https://patches.videolan.org/patch/16242/
and https://patches.videolan.org/patch/16269/
- rebased
---
 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 6d2cb5d8a6..dcc5a8fe54 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 */
-- 
2.11.1



More information about the vlc-devel mailing list