__mmplayer_gst_set_pulsesink_property(mmplayer_t *player)
{
#define MAX_PROPS_LEN 128
+ mmplayer_gst_element_t *audiobin = NULL;
gint latency_mode = 0;
gchar *stream_type = NULL;
gchar *latency = NULL;
MMPLAYER_FENTER();
MMPLAYER_RETURN_IF_FAIL(player && player->pipeline && player->pipeline->audiobin);
+ audiobin = player->pipeline->audiobin;
+
+ g_object_set(G_OBJECT(audiobin[MMPLAYER_A_SINK].gst), "volume", player->sound.volume, NULL);
+ if (player->sound.mute) {
+ LOGD("mute enabled");
+ g_object_set(G_OBJECT(audiobin[MMPLAYER_A_SINK].gst), "mute", player->sound.mute, NULL);
+ }
+
mm_attrs_get_int_by_name(player->attrs, "sound_stream_index", &stream_id);
mm_attrs_get_string_by_name(player->attrs, "sound_stream_type", &stream_type);
snprintf(stream_props, sizeof(stream_props) - 1, "props,media.role=%s, media.parent_id=%d",
stream_type, stream_id);
props = gst_structure_from_string(stream_props, NULL);
- g_object_set(player->pipeline->audiobin[MMPLAYER_A_SINK].gst, "stream-properties", props, NULL);
+ g_object_set(audiobin[MMPLAYER_A_SINK].gst, "stream-properties", props, NULL);
LOGI("stream_type[%s], stream_id[%d], result[%s].", stream_type, stream_id, stream_props);
gst_structure_free(props);
}
break;
};
- g_object_set(player->pipeline->audiobin[MMPLAYER_A_SINK].gst,
- "latency", latency,
- NULL);
+ g_object_set(audiobin[MMPLAYER_A_SINK].gst, "latency", latency, NULL);
LOGD("audiosink property - latency=%s", latency);
/* resampler */
MMPLAYER_CREATE_ELEMENT(audiobin, MMPLAYER_A_RESAMPLER, player->ini.audioresampler_element, "audio resampler", *bucket, player);
- /* for logical volume control */
- MMPLAYER_CREATE_ELEMENT(audiobin, MMPLAYER_A_VOL, "volume", "volume", *bucket, player);
- g_object_set(G_OBJECT(audiobin[MMPLAYER_A_VOL].gst), "volume", player->sound.volume, NULL);
+ if (g_strrstr(player->ini.audiosink_element, "openalsink")) {
+ /* currently, only openalsink uses volume element */
+ MMPLAYER_CREATE_ELEMENT(audiobin, MMPLAYER_A_VOL, "volume", "volume", *bucket, player);
+ g_object_set(G_OBJECT(audiobin[MMPLAYER_A_VOL].gst), "volume", player->sound.volume, NULL);
- if (player->sound.mute) {
- LOGD("mute enabled");
- g_object_set(G_OBJECT(audiobin[MMPLAYER_A_VOL].gst), "mute", player->sound.mute, NULL);
+ if (player->sound.mute) {
+ LOGD("mute enabled");
+ g_object_set(G_OBJECT(audiobin[MMPLAYER_A_VOL].gst), "mute", player->sound.mute, NULL);
+ }
}
mm_attrs_get_int_by_name(player->attrs, "content_audio_channels", &channels);
return MM_ERROR_NONE;
}
- if (player->build_audio_offload) {
- LOGD("offload pipeline");
+ if (player->build_audio_offload || g_strrstr(player->ini.audiosink_element, "pulsesink"))
volume_elem_id = MMPLAYER_A_SINK;
- }
vol_element = player->pipeline->audiobin[volume_elem_id].gst;
if (!vol_element) {