return result;
}
+
+int mm_player_set_replaygain_enabled(MMHandleType player, bool enabled)
+{
+ int result = MM_ERROR_NONE;
+
+ MMPLAYER_RETURN_VAL_IF_FAIL(player, MM_ERROR_PLAYER_NOT_INITIALIZED);
+
+ MMPLAYER_CMD_LOCK(player);
+
+ result = _mmplayer_set_replaygain_enabled(player, enabled);
+
+ MMPLAYER_CMD_UNLOCK(player);
+
+ return result;
+}
+
+int mm_player_is_replaygain_enabled(MMHandleType player, bool *enabled)
+{
+ int result = MM_ERROR_NONE;
+
+ MMPLAYER_RETURN_VAL_IF_FAIL(player, MM_ERROR_PLAYER_NOT_INITIALIZED);
+ MMPLAYER_RETURN_VAL_IF_FAIL(enabled, MM_ERROR_INVALID_ARGUMENT);
+
+ MMPLAYER_CMD_LOCK(player);
+
+ result = _mmplayer_is_replaygain_enabled(player, enabled);
+
+ MMPLAYER_CMD_UNLOCK(player);
+
+ return result;
+}
/* converter */
MMPLAYER_CREATE_ELEMENT(audiobin, MMPLAYER_A_CONV, "audioconvert", "audio converter", TRUE, player);
+ /* replaygain volume */
+ MMPLAYER_CREATE_ELEMENT(audiobin, MMPLAYER_A_RGVOL, "rgvolume", "audio rgvolume", TRUE, player);
+ if (player->sound.rg_enable)
+ g_object_set(G_OBJECT(audiobin[MMPLAYER_A_RGVOL].gst), "enable-rgvolume", TRUE, NULL);
+ else
+ g_object_set(G_OBJECT(audiobin[MMPLAYER_A_RGVOL].gst), "enable-rgvolume", FALSE, NULL);
+
/* resampler */
MMPLAYER_CREATE_ELEMENT(audiobin, MMPLAYER_A_RESAMPLER, player->ini.audioresampler_element, "audio resampler", TRUE, player);
/* give default value of audio effect setting */
player->sound.volume = MM_VOLUME_FACTOR_DEFAULT;
+ player->sound.rg_enable = false;
player->playback_rate = DEFAULT_PLAYBACK_RATE;
player->play_subtitle = FALSE;
player->video360_horizontal_fov = 0;
player->video360_vertical_fov = 0;
+ player->sound.rg_enable = false;
+
MMPLAYER_FLEAVE();
}
MMPLAYER_FLEAVE();
return MM_ERROR_NONE;
}
+
+int
+_mmplayer_set_replaygain_enabled(MMHandleType hplayer, bool enabled)
+{
+ mm_player_t* player = (mm_player_t*) hplayer;
+ GstElement* rg_vol_element = NULL;
+
+ MMPLAYER_FENTER();
+
+ MMPLAYER_RETURN_VAL_IF_FAIL(player, MM_ERROR_PLAYER_NOT_INITIALIZED);
+
+ player->sound.rg_enable = enabled;
+
+ /* just hold rgvolume enable value if pipeline is not ready */
+ if (!player->pipeline || !player->pipeline->audiobin) {
+ LOGD("pipeline is not ready. holding rgvolume enable value\n");
+ return MM_ERROR_NONE;
+ }
+
+ rg_vol_element = player->pipeline->audiobin[MMPLAYER_A_RGVOL].gst;
+
+ if (!rg_vol_element) {
+ LOGD("rgvolume element is not created");
+ return MM_ERROR_PLAYER_INTERNAL;
+ }
+
+ if (enabled)
+ g_object_set(rg_vol_element, "enable-rgvolume", TRUE, NULL);
+ else
+ g_object_set(rg_vol_element, "enable-rgvolume", FALSE, NULL);
+
+ MMPLAYER_FLEAVE();
+
+ return MM_ERROR_NONE;
+}
+
+int
+_mmplayer_is_replaygain_enabled(MMHandleType hplayer, bool *enabled)
+{
+ mm_player_t* player = (mm_player_t*) hplayer;
+ GstElement* rg_vol_element = NULL;
+ gboolean enable = FALSE;
+
+ MMPLAYER_FENTER();
+
+ MMPLAYER_RETURN_VAL_IF_FAIL(player, MM_ERROR_PLAYER_NOT_INITIALIZED);
+ MMPLAYER_RETURN_VAL_IF_FAIL(enabled, MM_ERROR_INVALID_ARGUMENT);
+
+ /* just hold enable_rg value if pipeline is not ready */
+ if (!player->pipeline || !player->pipeline->audiobin) {
+ LOGD("pipeline is not ready. holding rgvolume value (%d)\n", player->sound.rg_enable);
+ *enabled = player->sound.rg_enable;
+ return MM_ERROR_NONE;
+ }
+
+ rg_vol_element = player->pipeline->audiobin[MMPLAYER_A_RGVOL].gst;
+
+ if (!rg_vol_element) {
+ LOGD("rgvolume element is not created");
+ return MM_ERROR_PLAYER_INTERNAL;
+ }
+
+ g_object_get(rg_vol_element, "enable-rgvolume", &enable, NULL);
+ *enabled = enable;
+
+ MMPLAYER_FLEAVE();
+
+ return MM_ERROR_NONE;
+}