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: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1164>
This commit is contained in:
Seungha Yang 2021-10-15 23:18:41 +09:00
parent 1fdcbae677
commit ba79339d56
3 changed files with 8 additions and 8 deletions

View file

@ -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) {

View file

@ -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) {

View file

@ -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";