From: Seungha Yang Date: Fri, 15 Oct 2021 14:18:41 +0000 (+0900) Subject: mediafoundation: Fix various string constness handling X-Git-Tag: 1.19.3~209 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ba79339d56299094d2aab12873e360d55c119b41;p=platform%2Fupstream%2Fgstreamer.git mediafoundation: Fix various string constness handling ... with fixing typo (g_strup -> g_strdup) Constness needs to be explicit in C++ world otherwise compiler would complain about that. Part-of: --- diff --git a/subprojects/gst-plugins-bad/sys/mediafoundation/gstmftransform.cpp b/subprojects/gst-plugins-bad/sys/mediafoundation/gstmftransform.cpp index eee5e1c..4c3de114 100644 --- a/subprojects/gst-plugins-bad/sys/mediafoundation/gstmftransform.cpp +++ b/subprojects/gst-plugins-bad/sys/mediafoundation/gstmftransform.cpp @@ -1059,7 +1059,7 @@ gst_mf_transform_close (GstMFTransform * object) return TRUE; } -static gchar * +static const gchar * gst_mf_transform_event_type_to_string (MediaEventType event) { switch (event) { diff --git a/subprojects/gst-plugins-bad/sys/mediafoundation/gstmfutils.cpp b/subprojects/gst-plugins-bad/sys/mediafoundation/gstmfutils.cpp index bbb69d4..21bfeb2 100644 --- a/subprojects/gst-plugins-bad/sys/mediafoundation/gstmfutils.cpp +++ b/subprojects/gst-plugins-bad/sys/mediafoundation/gstmfutils.cpp @@ -726,7 +726,7 @@ gst_mf_attribute_value_to_string (const GUID & guid, const PROPVARIANT & var) IsEqualGUID (guid, MF_MT_MINIMUM_DISPLAY_APERTURE) || IsEqualGUID (guid, MF_MT_PAN_SCAN_APERTURE)) { /* FIXME: Not our usecase for now */ - return g_strup ("Not parsed"); + return g_strdup ("Not parsed"); } switch (var.vt) { diff --git a/subprojects/gst-plugins-bad/sys/mediafoundation/gstmfvideoenc.cpp b/subprojects/gst-plugins-bad/sys/mediafoundation/gstmfvideoenc.cpp index 66c48e1..72dd177 100644 --- a/subprojects/gst-plugins-bad/sys/mediafoundation/gstmfvideoenc.cpp +++ b/subprojects/gst-plugins-bad/sys/mediafoundation/gstmfvideoenc.cpp @@ -1492,12 +1492,12 @@ gst_mf_video_enc_enum_internal (GstMFTransform * transform, GUID & subtype, {0, NULL}, }; GstMFVideoEncProfileMap *profile_to_check = NULL; - static gchar *h264_caps_str = + static const gchar *h264_caps_str = "video/x-h264, stream-format=(string) byte-stream, alignment=(string) au"; - static gchar *hevc_caps_str = + static const gchar *hevc_caps_str = "video/x-h265, stream-format=(string) byte-stream, alignment=(string) au"; - static gchar *vp9_caps_str = "video/x-vp9"; - static gchar *codec_caps_str = NULL; + static const gchar *vp9_caps_str = "video/x-vp9"; + const gchar *codec_caps_str = NULL; /* NOTE: depending on environment, * some enumerated h/w MFT might not be usable (e.g., multiple GPU case) */ @@ -1850,8 +1850,8 @@ gst_mf_video_enc_register_internal (GstPlugin * plugin, guint rank, GstMFVideoEncClassData *cdata; gboolean is_default = TRUE; gchar *device_name = NULL; - static gchar *type_name_prefix = NULL; - static gchar *feature_name_prefix = NULL; + const gchar *type_name_prefix = NULL; + const gchar *feature_name_prefix = NULL; if (IsEqualGUID (MFVideoFormat_H264, *subtype)) { type_name_prefix = "H264";