Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add dnssd name as property #8

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

AleSoHe
Copy link

@AleSoHe AleSoHe commented Mar 3, 2024

This lets the user set the DNS-SD name via a GStreamer property such as:

gst-launch-1.0 airplaysrc dnssd-name=DeviceX ! ...

This way, the iPad or iPhone will display DeviceX when listing the AirPlay devices.

@knuesel
Copy link
Owner

knuesel commented Mar 11, 2024

This is great, thanks! (and sorry for the delay)

I'm getting a segfault at gstairplaysrc.c:180 when the dnssd-name property is not specified on the gst-launch command line, due to the uninitialized name I guess. Can you have a look? Looking forward to merge this.

case PROP_DNSSD_NAME:
g_mutex_lock(&self->data->property_lock);
g_free (self->data->dnssd_name);
self->data->dnssd_name = g_strdup (g_value_get_string (value));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

g_value_dup_string()

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this a style or correctness fix?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style, I guess. g_value_dup_string() replaces g_strdup() and g_value_get_string() into one.

@@ -389,7 +407,11 @@ gst_airplay_src_class_init (GstAirPlaySrcClass * klass)
prop_connected = g_param_spec_boolean ("connected", "Connected",
"Whether a client is connected to the airplay server",
FALSE, G_PARAM_READABLE);
prop_dnssd_name = g_param_spec_string ("dnssd-name", "DNS-SD name",
"Name to use for the DNS Service Discovery", DEFAULT_DNSSD_NAME,
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You need to add G_PARAM_CONSTRUCT so that the property is set when the object is created.

@knuesel
Copy link
Owner

knuesel commented Oct 30, 2024

@hadess thanks for the review! With the suggested changes there's no segfault anymore. I won't have access to my iPad in the next few days so I can't test it, but if you confirm it's working I'll merge.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants