return ret;
}
+/* FIXME : this code is workaround code and needed to be revised soon */
+static void _enable_focus_status_if_radio(void *stream, stream_type_t type, bool is_new_data)
+{
+ const char *prop_media_role = NULL;
+ pa_proplist* p = NULL;
+
+ p = (is_new_data ? GET_STREAM_NEW_PROPLIST(stream, type) : GET_STREAM_PROPLIST(stream, type));
+ if (!p)
+ return;
+
+ prop_media_role = pa_proplist_gets(p, PA_PROP_MEDIA_ROLE);
+ if (prop_media_role) {
+ if (pa_safe_streq(prop_media_role, STREAM_ROLE_RADIO)) {
+ pa_log_info("This stream is radio, update focus status to 1");
+ pa_proplist_setf(p, PA_PROP_MEDIA_FOCUS_STATUS, "%u", 1);
+ }
+ }
+}
+
static bool update_focus_status_of_stream(pa_stream_manager *m, void *stream, stream_type_t type, bool is_new_data) {
const char *p_idx;
uint32_t parent_idx = 0;
pa_proplist_setf(GET_STREAM_NEW_PROPLIST(stream, type), PA_PROP_MEDIA_FOCUS_STATUS, "%u", sp->focus_status);
else
pa_proplist_setf(GET_STREAM_PROPLIST(stream, type), PA_PROP_MEDIA_FOCUS_STATUS, "%u", sp->focus_status);
+
+ /* FIXME : If stream is radio, then fix focus_status to 1 */
+ _enable_focus_status_if_radio(stream, type, is_new_data);
+
pa_log_debug("p_idx(%s), idx(%u), focus_status(0x%x, 0x1:playback 0x2:capture 0x3:both)", p_idx, parent_idx, sp->focus_status);
} else {
pa_log_error("could not find matching client for this parent_id(%u)", parent_idx);