[vlc-commits] codec: hxxx_helper: add hxxx_helper_get_colorimetry

Thomas Guillem git at videolan.org
Wed Sep 13 11:15:11 CEST 2017


vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Wed Sep 13 10:17:53 2017 +0200| [24de07411b65163eff77792e5589bac7369cc11a] | committer: Thomas Guillem

codec: hxxx_helper: add hxxx_helper_get_colorimetry

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

 modules/codec/hxxx_helper.c | 27 ++++++++++++++++++++++++++-
 modules/codec/hxxx_helper.h |  6 ++++++
 2 files changed, 32 insertions(+), 1 deletion(-)

diff --git a/modules/codec/hxxx_helper.c b/modules/codec/hxxx_helper.c
index f8f2872423..76cfded6eb 100644
--- a/modules/codec/hxxx_helper.c
+++ b/modules/codec/hxxx_helper.c
@@ -475,7 +475,6 @@ hxxx_helper_set_extra(struct hxxx_helper *hh, const void *p_extra,
     return VLC_SUCCESS;;
 }
 
-
 block_t *
 h264_helper_get_annexb_config(const struct hxxx_helper *hh)
 {
@@ -600,3 +599,29 @@ h264_helper_get_current_dpb_values(const struct hxxx_helper *hh,
     return h264_get_dpb_values(hsps->h264_sps, p_depth, p_delay) ?
            VLC_SUCCESS : VLC_EGENERIC;
 }
+
+int
+hxxx_helper_get_colorimetry(const struct hxxx_helper *hh,
+                            video_color_primaries_t *p_primaries,
+                            video_transfer_func_t *p_transfer,
+                            video_color_space_t *p_colorspace,
+                            bool *p_full_range)
+{
+    switch (hh->i_codec)
+    {
+        case VLC_CODEC_H264:
+        {
+            const struct hxxx_helper_nal *hsps = h264_helper_get_current_sps(hh);
+            if (hsps == NULL)
+                return VLC_EGENERIC;
+            return h264_get_colorimetry(hsps->h264_sps, p_primaries, p_transfer,
+                                        p_colorspace, p_full_range)
+                == true ? VLC_SUCCESS : VLC_EGENERIC;
+        }
+        case VLC_CODEC_HEVC:
+            /* FIXME */
+            return VLC_EGENERIC;
+        default:
+            vlc_assert_unreachable();
+    }
+}
diff --git a/modules/codec/hxxx_helper.h b/modules/codec/hxxx_helper.h
index 7753048f7a..e9551642dd 100644
--- a/modules/codec/hxxx_helper.h
+++ b/modules/codec/hxxx_helper.h
@@ -86,3 +86,9 @@ int h264_helper_get_current_sar(const struct hxxx_helper *hh, int *p_num, int *p
 
 int h264_helper_get_current_dpb_values(const struct hxxx_helper *hh,
                                        uint8_t *p_depth, unsigned *pi_delay);
+
+int hxxx_helper_get_colorimetry(const struct hxxx_helper *hh,
+                                video_color_primaries_t *p_primaries,
+                                video_transfer_func_t *p_transfer,
+                                video_color_space_t *p_colorspace,
+                                bool *p_full_range);



More information about the vlc-commits mailing list