[ACR-1448] add api to set audio codec type 47/212947/13
authorEunhye Choi <eunhae1.choi@samsung.com>
Wed, 28 Aug 2019 10:56:22 +0000 (19:56 +0900)
committerEunhye Choi <eunhae1.choi@samsung.com>
Fri, 20 Sep 2019 06:08:52 +0000 (15:08 +0900)
- Add API to set/get default audio codec type
- Add new error code to return about availability
- Some changes are related to the ACR-1420
- Modify the internal api to support video only

Change-Id: I8bf380ae9533793bb246cff15a32ad6b0ed6f938

doc/player_doc.h
include/player.h
include/player_internal.h
src/player.c
src/player_internal.c
test/player_test.c

index 8106547..2a31db1 100644 (file)
  *        <td>player_video_stream_changed_cb()</td>
  *        <td>called when the video stream info is changed </td>
  *     </tr>
-
  *</table></div>
  *
  * @section CAPI_MEDIA_PLAYER_MODULE_FEATURE Related Features
index f0bd5ed..55fd740 100644 (file)
@@ -96,6 +96,7 @@ typedef enum {
        PLAYER_ERROR_NOT_SUPPORTED_VIDEO_CODEC = PLAYER_ERROR_CLASS | 0x0f,             /**< Not supported video codec but audio can be played (Since 4.0) */
        PLAYER_ERROR_NOT_SUPPORTED_SUBTITLE = PLAYER_ERROR_CLASS | 0x10,                /**< Not supported subtitle format (Since 4.0) */
        PLAYER_ERROR_NOT_SUPPORTED_FORMAT = PLAYER_ERROR_CLASS | 0x11,                  /**< Not supported format (Since 5.5) */
+       PLAYER_ERROR_NOT_AVAILABLE        = PLAYER_ERROR_CLASS | 0x12,                  /**< Not available operation (Since 5.5)*/
 } player_error_e;
 
 /**
@@ -161,6 +162,15 @@ typedef enum {
 } player_audio_extract_option_e;
 
 /**
+ * @brief Enumeration for codec type.
+ * @since_tizen 5.5
+ */
+typedef enum {
+       PLAYER_CODEC_TYPE_HW,           /**< This is an optional flag for using the H/W codec */
+       PLAYER_CODEC_TYPE_SW,           /**< This is an optional flag for using the S/W codec */
+} player_codec_type_e;
+
+/**
  * @}
  */
 
@@ -735,7 +745,7 @@ int player_set_sound_stream_info(player_h player, sound_stream_info_h stream_inf
  *          If it's high mode, audio output interval can be increased so, it can keep more audio data to play.
  *          But, state transition like pause or resume can be more slower than default(mid) mode.
  * @remarks If audio offload is enabled by calling player_audio_offload_set_enabled(),
- *          this function will return #PLAYER_ERROR_INVALID_OPERATION and
+ *          this function will return #PLAYER_ERROR_NOT_AVAILABLE and
  *          this will not work at all even if it was called before enabling offload. (Since 5.5)
  * @param[in] player The handle to the media player
  * @param[in] latency_mode The latency mode to be applied to the audio
@@ -744,9 +754,11 @@ int player_set_sound_stream_info(player_h player, sound_stream_info_h stream_inf
  * @retval #PLAYER_ERROR_NONE Successful
  * @retval #PLAYER_ERROR_INVALID_PARAMETER Invalid parameter
  * @retval #PLAYER_ERROR_INVALID_OPERATION Invalid operation
+ * @retval #PLAYER_ERROR_NOT_AVAILABLE Not available (Since 5.5)
  * @see #audio_latency_mode_e
  * @see player_get_audio_latency_mode()
  * @see player_audio_offload_set_enabled()
+ * @see player_audio_offload_is_enabled()
  */
 int player_set_audio_latency_mode(player_h player, audio_latency_mode_e latency_mode);
 
@@ -754,7 +766,7 @@ int player_set_audio_latency_mode(player_h player, audio_latency_mode_e latency_
  * @brief Gets the current audio latency mode.
  * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
  * @remarks If audio offload is enabled by calling player_audio_offload_set_enabled(),
- *          this function will return #PLAYER_ERROR_INVALID_OPERATION. (Since 5.5)
+ *          this function will return #PLAYER_ERROR_NOT_AVAILABLE. (Since 5.5)
  * @param[in] player The handle to the media player
  * @param[out] latency_mode The latency mode to get from the audio
  * @return @c 0 on success,
@@ -762,9 +774,11 @@ int player_set_audio_latency_mode(player_h player, audio_latency_mode_e latency_
  * @retval #PLAYER_ERROR_NONE Successful
  * @retval #PLAYER_ERROR_INVALID_PARAMETER Invalid parameter
  * @retval #PLAYER_ERROR_INVALID_OPERATION Invalid operation
+ * @retval #PLAYER_ERROR_NOT_AVAILABLE Not available (Since 5.5)
  * @see #audio_latency_mode_e
  * @see player_set_audio_latency_mode()
  * @see player_audio_offload_set_enabled()
+ * @see player_audio_offload_is_enabled()
  */
 int player_get_audio_latency_mode(player_h player, audio_latency_mode_e *latency_mode);
 
@@ -1094,8 +1108,10 @@ int player_unset_media_packet_video_frame_decoded_cb(player_h player);
  *          The packet has to be destroyed as quickly as possible after rendering the data\n
  *          and all the packets have to be destroyed before player_unprepare() is called.\n
  * @remarks If audio offload is enabled by calling player_audio_offload_set_enabled(),
- *          this function will return #PLAYER_ERROR_INVALID_OPERATION and
- *          this will not work at all even if it was called before enabling offload. (Since 5.5)
+ *          this function will return #PLAYER_ERROR_NOT_AVAILABLE and
+ *          this will not work at all even if this was called before enabling offload.
+ * @remarks This function could be unavailable depending on the audio codec type and
+ *          this will return #PLAYER_ERROR_NOT_AVAILABLE.
  * @remarks If the content is encrypted or there are copyright issues with it,
  *          this function could be unsupported depending on the DRM policy.
  * @param[in] player     The handle to the media player
@@ -1111,9 +1127,13 @@ int player_unset_media_packet_video_frame_decoded_cb(player_h player);
  * @retval #PLAYER_ERROR_INVALID_PARAMETER Invalid parameter
  * @retval #PLAYER_ERROR_INVALID_STATE Invalid state
  * @retval #PLAYER_ERROR_INVALID_OPERATION Invalid operation
+ * @retval #PLAYER_ERROR_NOT_AVAILABLE Not available
  * @pre The player's state must be #PLAYER_STATE_IDLE.
  * @see player_unset_media_packet_audio_frame_decoded_cb()
  * @see player_audio_offload_set_enabled()
+ * @see player_audio_offload_is_enabled()
+ * @see player_set_audio_codec_type()
+ * @see player_get_audio_codec_type()
  * @par Example
    @code
       #include <player.h>
@@ -1139,14 +1159,21 @@ int player_set_media_packet_audio_frame_decoded_cb(player_h player, media_format
 /**
  * @brief Unsets the media packet audio frame decoded callback function.
  * @since_tizen 5.5
+ * @remarks Depending on the audio codec type or by enabling audio offload,
+ *          this function could be unavailable and this will return #PLAYER_ERROR_NOT_AVAILABLE.
  * @param[in] player The handle to the media player
  * @return @c 0 on success,
  *         otherwise a negative error value
  * @retval #PLAYER_ERROR_NONE Successful
  * @retval #PLAYER_ERROR_INVALID_PARAMETER Invalid parameter
  * @retval #PLAYER_ERROR_INVALID_STATE Invalid state
+ * @retval #PLAYER_ERROR_NOT_AVAILABLE Not available
  * @pre The player's state must be #PLAYER_STATE_READY or #PLAYER_STATE_IDLE
  * @see player_set_media_packet_audio_frame_decoded_cb()
+ * @see player_audio_offload_set_enabled()
+ * @see player_audio_offload_is_enabled()
+ * @see player_set_audio_codec_type()
+ * @see player_get_audio_codec_type()
  */
 int player_unset_media_packet_audio_frame_decoded_cb(player_h player);
 
@@ -1659,28 +1686,28 @@ int player_get_duration_nsec(player_h player, int64_t *nanoseconds);
 /**
  * @brief Gets the number of equalizer bands.
  * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
- * @remarks If audio offload is enabled by calling player_audio_offload_set_enabled(),
- *          this function will return #PLAYER_ERROR_INVALID_OPERATION. (Since 5.5)
+ * @remarks If player_audio_effect_equalizer_is_available() returns @a available parameter as @c false,
+ *          this function will return #PLAYER_ERROR_NOT_AVAILABLE. (Since 5.5)
  * @param[in] player The handle to the media player
  * @param[out] count The number of equalizer bands
  * @return @c 0 on success,
  *         otherwise a negative error value
  * @retval #PLAYER_ERROR_NONE Successful
  * @retval #PLAYER_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #PLAYER_ERROR_INVALID_OPERATION Invalid operation (Since 5.5)
+ * @retval #PLAYER_ERROR_NOT_AVAILABLE Not available (Since 5.5)
  * @see player_audio_effect_equalizer_is_available()
  * @see player_audio_effect_set_equalizer_band_level()
  * @see player_audio_effect_set_equalizer_all_bands()
- * @see player_audio_offload_set_enabled()
  */
 int player_audio_effect_get_equalizer_bands_count(player_h player, int *count);
 
 /**
  * @brief Sets the gain set for the given equalizer band.
  * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
- * @remarks If audio offload is enabled by calling player_audio_offload_set_enabled(),
- *          this function will return #PLAYER_ERROR_INVALID_OPERATION and
- *          this will not work at all even if it was called before enabling offload. (Since 5.5)
+ * @remarks If player_audio_effect_equalizer_is_available() returns @a available parameter as @c false,
+ *          this function will return #PLAYER_ERROR_NOT_AVAILABLE and
+ *          this will not work at all even if it was called before enabling audio offload
+ *          which makes audio effect function group unavailable. (Since 5.5)
  * @param[in] player The handle to the media player
  * @param[in] index The index of the equalizer band to be set
  * @param[in] level The new gain in decibel that is set to the given band [dB]
@@ -1689,6 +1716,7 @@ int player_audio_effect_get_equalizer_bands_count(player_h player, int *count);
  * @retval #PLAYER_ERROR_NONE Successful
  * @retval #PLAYER_ERROR_INVALID_PARAMETER Invalid parameter
  * @retval #PLAYER_ERROR_INVALID_OPERATION Invalid operation
+ * @retval #PLAYER_ERROR_NOT_AVAILABLE Not available (Since 5.5)
  * @see player_audio_effect_equalizer_is_available()
  * @see player_audio_effect_get_equalizer_bands_count()
  * @see player_audio_effect_get_equalizer_level_range()
@@ -1701,8 +1729,8 @@ int player_audio_effect_set_equalizer_band_level(player_h player, int index, int
 /**
  * @brief Gets the gain set for the given equalizer band.
  * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
- * @remarks If audio offload is enabled by calling player_audio_offload_set_enabled(),
- *          this function will return #PLAYER_ERROR_INVALID_OPERATION. (Since 5.5)
+ * @remarks If player_audio_effect_equalizer_is_available() returns @a available parameter as @c false,
+ *          this function will return #PLAYER_ERROR_NOT_AVAILABLE. (Since 5.5)
  * @param[in]   player The handle to the media player
  * @param[in]   index The index of the requested equalizer band
  * @param[out]   level The gain in decibel of the given band [dB]
@@ -1710,19 +1738,19 @@ int player_audio_effect_set_equalizer_band_level(player_h player, int index, int
  *         otherwise a negative error value
  * @retval #PLAYER_ERROR_NONE Successful
  * @retval #PLAYER_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #PLAYER_ERROR_INVALID_OPERATION Invalid operation (Since 5.5)
+ * @retval #PLAYER_ERROR_NOT_AVAILABLE Not available (Since 5.5)
  * @see player_audio_effect_equalizer_is_available()
  * @see player_audio_effect_set_equalizer_band_level()
- * @see player_audio_offload_set_enabled()
  */
 int player_audio_effect_get_equalizer_band_level(player_h player, int index, int *level);
 
 /**
  * @brief Sets all bands of the equalizer.
  * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
- * @remarks If audio offload is enabled by calling player_audio_offload_set_enabled(),
- *          this function will return #PLAYER_ERROR_INVALID_OPERATION and
- *          this will not work at all even if it was called before enabling offload. (Since 5.5)
+ * @remarks If player_audio_effect_equalizer_is_available() returns @a available parameter as @c false,
+ *          this function will return #PLAYER_ERROR_NOT_AVAILABLE and
+ *          this will not work at all even if it was called before enabling audio offload
+ *          which makes audio effect function group unavailable. (Since 5.5)
  * @param[in] player The handle to the media player
  * @param[in] band_levels The list of band levels to be set
  * @param[in] length The length of the band level
@@ -1731,6 +1759,7 @@ int player_audio_effect_get_equalizer_band_level(player_h player, int index, int
  * @retval #PLAYER_ERROR_NONE Successful
  * @retval #PLAYER_ERROR_INVALID_PARAMETER Invalid parameter
  * @retval #PLAYER_ERROR_INVALID_OPERATION Invalid operation
+ * @retval #PLAYER_ERROR_NOT_AVAILABLE Not available (Since 5.5)
  * @see player_audio_effect_equalizer_is_available()
  * @see player_audio_effect_get_equalizer_bands_count()
  * @see player_audio_effect_get_equalizer_level_range()
@@ -1742,8 +1771,8 @@ int player_audio_effect_set_equalizer_all_bands(player_h player, int *band_level
 /**
  * @brief Gets the valid band level range of the equalizer.
  * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
- * @remarks If audio offload is enabled by calling player_audio_offload_set_enabled(),
- *          this function will return #PLAYER_ERROR_INVALID_OPERATION. (Since 5.5)
+ * @remarks If player_audio_effect_equalizer_is_available() returns @a available parameter as @c false,
+ *          this function will return #PLAYER_ERROR_NOT_AVAILABLE. (Since 5.5)
  * @param[in] player The handle to the media player
  * @param[out] min The minimum value to be set [dB]
  * @param[out] max The maximum value to be set [dB]
@@ -1752,18 +1781,18 @@ int player_audio_effect_set_equalizer_all_bands(player_h player, int *band_level
  * @retval #PLAYER_ERROR_NONE Successful
  * @retval #PLAYER_ERROR_INVALID_PARAMETER Invalid parameter
  * @retval #PLAYER_ERROR_INVALID_OPERATION Invalid operation
+ * @retval #PLAYER_ERROR_NOT_AVAILABLE Not available (Since 5.5)
  * @see player_audio_effect_equalizer_is_available()
  * @see player_audio_effect_set_equalizer_band_level()
  * @see player_audio_effect_set_equalizer_all_bands()
- * @see player_audio_offload_set_enabled()
  */
 int player_audio_effect_get_equalizer_level_range(player_h player, int *min, int *max);
 
 /**
  * @brief Gets the band frequency of the equalizer.
  * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
- * @remarks If audio offload is enabled by calling player_audio_offload_set_enabled(),
- *          this function will return #PLAYER_ERROR_INVALID_OPERATION. (Since 5.5)
+ * @remarks If player_audio_effect_equalizer_is_available() returns @a available parameter as @c false,
+ *          this function will return #PLAYER_ERROR_NOT_AVAILABLE. (Since 5.5)
  * @param[in] player The handle to the media player
  * @param[in]  index The index of the requested equalizer band
  * @param[out] frequency The frequency of the given band [dB]
@@ -1771,17 +1800,16 @@ int player_audio_effect_get_equalizer_level_range(player_h player, int *min, int
  *         otherwise a negative error value
  * @retval #PLAYER_ERROR_NONE Successful
  * @retval #PLAYER_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #PLAYER_ERROR_INVALID_OPERATION Invalid operation (Since 5.5)
+ * @retval #PLAYER_ERROR_NOT_AVAILABLE Not available (Since 5.5)
  * @see player_audio_effect_equalizer_is_available()
- * @see player_audio_offload_set_enabled()
  */
 int player_audio_effect_get_equalizer_band_frequency(player_h player, int index, int *frequency);
 
 /**
  * @brief Gets the band frequency range of the equalizer.
  * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
- * @remarks If audio offload is enabled by calling player_audio_offload_set_enabled(),
- *          this function will return #PLAYER_ERROR_INVALID_OPERATION. (Since 5.5)
+ * @remarks If player_audio_effect_equalizer_is_available() returns @a available parameter as @c false,
+ *          this function will return #PLAYER_ERROR_NOT_AVAILABLE. (Since 5.5)
  * @param[in] player The handle to the media player
  * @param[in]  index The index of the requested equalizer band
  * @param[out] range The frequency range of the given band [dB]
@@ -1789,46 +1817,49 @@ int player_audio_effect_get_equalizer_band_frequency(player_h player, int index,
  *         otherwise a negative error value
  * @retval #PLAYER_ERROR_NONE Successful
  * @retval #PLAYER_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #PLAYER_ERROR_INVALID_OPERATION Invalid operation (Since 5.5)
+ * @retval #PLAYER_ERROR_NOT_AVAILABLE Not available (Since 5.5)
  * @see player_audio_effect_equalizer_is_available()
- * @see player_audio_offload_set_enabled()
  */
 int player_audio_effect_get_equalizer_band_frequency_range(player_h player, int index, int *range);
 
 /**
  * @brief Clears the equalizer effect.
  * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
- * @remarks If audio offload is enabled by calling player_audio_offload_set_enabled(),
- *          this function will return #PLAYER_ERROR_INVALID_OPERATION. (Since 5.5)
+ * @remarks If player_audio_effect_equalizer_is_available() returns @a available parameter as @c false,
+ *          this function will return #PLAYER_ERROR_NOT_AVAILABLE. (Since 5.5)
  * @param[in] player The handle to the media player
  * @return @c 0 on success,
  *         otherwise a negative error value
  * @retval #PLAYER_ERROR_NONE Successful
  * @retval #PLAYER_ERROR_INVALID_PARAMETER Invalid parameter
  * @retval #PLAYER_ERROR_INVALID_OPERATION Invalid operation
+ * @retval #PLAYER_ERROR_NOT_AVAILABLE Not available (Since 5.5)
  * @see player_audio_effect_equalizer_is_available()
  * @see player_audio_effect_set_equalizer_band_level()
  * @see player_audio_effect_set_equalizer_all_bands()
- * @see player_audio_offload_set_enabled()
  */
 int player_audio_effect_equalizer_clear(player_h player);
 
 /**
  * @brief Checks whether the custom equalizer effect is available.
+ * @details This function returns the availability of the audio effect function group and
+ *          it could be unavailable depending on the platform capabilities.
  * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
  * @remarks If audio offload is enabled by calling player_audio_offload_set_enabled(),
- *          this function will return #PLAYER_ERROR_INVALID_OPERATION. (Since 5.5)
- * @param[in] player The handle to the media player
+ *          @a available will be @c false.
+ * @param[in]  player    The handle to the media player
  * @param[out] available If @c true the specified audio effect is available,
  *                       otherwise @c false
  * @return @c 0 on success,
  *         otherwise a negative error value
  * @retval #PLAYER_ERROR_NONE Successful
  * @retval #PLAYER_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #PLAYER_ERROR_INVALID_OPERATION Invalid operation (Since 5.5)
  * @see player_audio_effect_set_equalizer_band_level()
  * @see player_audio_effect_set_equalizer_all_bands()
  * @see player_audio_offload_set_enabled()
+ * @see player_audio_offload_is_enabled()
+ * @see player_set_audio_codec_type()
+ * @see player_get_audio_codec_type()
  */
 int player_audio_effect_equalizer_is_available(player_h player, bool *available);
 
@@ -2089,7 +2120,7 @@ int player_unset_buffering_cb(player_h player);
  * @remarks No operation is performed, if @a rate is @c 0.
  * @remarks The sound is muted, when playback rate is under @c 0.0 and over @c 2.0.
  * @remarks If audio offload is enabled by calling player_audio_offload_set_enabled(),
- *          this function will return #PLAYER_ERROR_INVALID_OPERATION. (Since 5.5)
+ *          this function will return #PLAYER_ERROR_NOT_AVAILABLE. (Since 5.5)
  * @param[in] player   The handle to the media player
  * @param[in] rate     The playback rate (-5.0x ~ 5.0x)
  * @return @c 0 on success,
@@ -2098,6 +2129,7 @@ int player_unset_buffering_cb(player_h player);
  * @retval #PLAYER_ERROR_INVALID_PARAMETER Invalid parameter
  * @retval #PLAYER_ERROR_INVALID_OPERATION Invalid operation
  * @retval #PLAYER_ERROR_INVALID_STATE Invalid player state
+ * @retval #PLAYER_ERROR_NOT_AVAILABLE Not available (Since 5.5)
  * @pre The player state must be one of #PLAYER_STATE_READY, #PLAYER_STATE_PLAYING, or #PLAYER_STATE_PAUSED.
  * @see player_audio_offload_set_enabled()
  */
@@ -2241,7 +2273,7 @@ int player_unset_video_stream_changed_cb(player_h player);
  * @details Index starts from 0.
  * @since_tizen @if WEARABLE 3.0 @else 2.4 @endif
  * @remarks If audio offload is enabled by calling player_audio_offload_set_enabled(),
- *          this function will return #PLAYER_ERROR_INVALID_OPERATION. (Since 5.5)
+ *          this function will return #PLAYER_ERROR_NOT_AVAILABLE. (Since 5.5)
  * @param[in]  player   The handle to the media player
  * @param[in]  type     The type of target stream which is #PLAYER_STREAM_TYPE_AUDIO or #PLAYER_STREAM_TYPE_TEXT
  * @param[out] index    The index of track
@@ -2251,6 +2283,7 @@ int player_unset_video_stream_changed_cb(player_h player);
  * @retval #PLAYER_ERROR_INVALID_PARAMETER Invalid parameter
  * @retval #PLAYER_ERROR_INVALID_OPERATION Invalid operation
  * @retval #PLAYER_ERROR_INVALID_STATE Invalid player state
+ * @retval #PLAYER_ERROR_NOT_AVAILABLE Not available (Since 5.5)
  * @pre The player state must be one of #PLAYER_STATE_READY, #PLAYER_STATE_PLAYING, or #PLAYER_STATE_PAUSED
  * @see player_audio_offload_set_enabled()
  */
@@ -2261,7 +2294,7 @@ int player_get_current_track(player_h player, player_stream_type_e type, int *in
  * @since_tizen @if WEARABLE 3.0 @else 2.4 @endif
  * @remarks @a code must be released with @c free() by caller
  * @remarks If audio offload is enabled by calling player_audio_offload_set_enabled(),
- *          this function will return #PLAYER_ERROR_INVALID_OPERATION. (Since 5.5)
+ *          this function will return #PLAYER_ERROR_NOT_AVAILABLE. (Since 5.5)
  * @param[in] player   The handle to the media player
  * @param[in] type     The type of target stream which is #PLAYER_STREAM_TYPE_AUDIO or #PLAYER_STREAM_TYPE_TEXT
  * @param[in] index    The index of track
@@ -2272,6 +2305,7 @@ int player_get_current_track(player_h player, player_stream_type_e type, int *in
  * @retval #PLAYER_ERROR_INVALID_PARAMETER Invalid parameter
  * @retval #PLAYER_ERROR_INVALID_OPERATION Invalid operation
  * @retval #PLAYER_ERROR_INVALID_STATE Invalid player state
+ * @retval #PLAYER_ERROR_NOT_AVAILABLE Not available (Since 5.5)
  * @pre The player state must be one of #PLAYER_STATE_READY, #PLAYER_STATE_PLAYING, or #PLAYER_STATE_PAUSED
  * @see player_audio_offload_set_enabled()
  */
@@ -2281,7 +2315,7 @@ int player_get_track_language_code(player_h player, player_stream_type_e type, i
  * @brief Gets the track count.
  * @since_tizen @if WEARABLE 3.0 @else 2.4 @endif
  * @remarks If audio offload is enabled by calling player_audio_offload_set_enabled(),
- *          this function will return #PLAYER_ERROR_INVALID_OPERATION. (Since 5.5)
+ *          this function will return #PLAYER_ERROR_NOT_AVAILABLE. (Since 5.5)
  * @param[in] player   The handle to the media player
  * @param[in] type     The type of target stream which is #PLAYER_STREAM_TYPE_AUDIO or #PLAYER_STREAM_TYPE_TEXT
  * @param[out] count The number of track
@@ -2291,6 +2325,7 @@ int player_get_track_language_code(player_h player, player_stream_type_e type, i
  * @retval #PLAYER_ERROR_INVALID_PARAMETER Invalid parameter
  * @retval #PLAYER_ERROR_INVALID_OPERATION Invalid operation
  * @retval #PLAYER_ERROR_INVALID_STATE Invalid player state
+ * @retval #PLAYER_ERROR_NOT_AVAILABLE Not available (Since 5.5)
  * @pre The player state must be one of #PLAYER_STATE_READY, #PLAYER_STATE_PLAYING, or #PLAYER_STATE_PAUSED
  * @see player_audio_offload_set_enabled()
  */
@@ -2300,7 +2335,7 @@ int player_get_track_count(player_h player, player_stream_type_e type, int *coun
  * @brief Selects a track to play.
  * @since_tizen @if WEARABLE 3.0 @else 2.4 @endif
  * @remarks If audio offload is enabled by calling player_audio_offload_set_enabled(),
- *          this function will return #PLAYER_ERROR_INVALID_OPERATION. (Since 5.5)
+ *          this function will return #PLAYER_ERROR_NOT_AVAILABLE. (Since 5.5)
  * @param[in] player   The handle to the media player
  * @param[in] type     The type of target stream which is #PLAYER_STREAM_TYPE_AUDIO or #PLAYER_STREAM_TYPE_TEXT
  * @param[in] index    The index of track
@@ -2310,6 +2345,7 @@ int player_get_track_count(player_h player, player_stream_type_e type, int *coun
  * @retval #PLAYER_ERROR_INVALID_PARAMETER Invalid parameter
  * @retval #PLAYER_ERROR_INVALID_OPERATION Invalid operation
  * @retval #PLAYER_ERROR_INVALID_STATE Invalid player state
+ * @retval #PLAYER_ERROR_NOT_AVAILABLE Not available (Since 5.5)
  * @pre The player state must be one of #PLAYER_STATE_READY, #PLAYER_STATE_PLAYING, or #PLAYER_STATE_PAUSED
  * @see player_get_current_track()
  * @see player_audio_offload_set_enabled()
@@ -2428,8 +2464,10 @@ int player_is_audio_only(player_h player, bool *audio_only);
  *          If it is @c false, the replaygain isn't affected by tag and properties.
  * @since_tizen 5.0
  * @remarks If audio offload is enabled by calling player_audio_offload_set_enabled(),
- *          this function will return #PLAYER_ERROR_INVALID_OPERATION and
- *          this will not work at all even if it was called before enabling offload. (Since 5.5)
+ *          this function will return #PLAYER_ERROR_NOT_AVAILABLE and
+ *          this will not work at all even if this was called before enabling offload. (Since 5.5)
+ * @remarks This function could be unavailable depending on the audio codec type and
+ *          this will return #PLAYER_ERROR_NOT_AVAILABLE. (Since 5.5)
  * @param[in]   player The handle to the media player
  * @param[in]   enabled The new replaygain status: (@c true = enable, @c false = disable)
  * @return @c 0 on success,
@@ -2437,16 +2475,20 @@ int player_is_audio_only(player_h player, bool *audio_only);
  * @retval #PLAYER_ERROR_NONE Successful
  * @retval #PLAYER_ERROR_INVALID_PARAMETER Invalid parameter
  * @retval #PLAYER_ERROR_INVALID_OPERATION Invalid operation
+ * @retval #PLAYER_ERROR_NOT_AVAILABLE Not available (Since 5.5)
  * @see player_is_replaygain_enabled()
  * @see player_audio_offload_set_enabled()
+ * @see player_audio_offload_is_enabled()
+ * @see player_set_audio_codec_type()
+ * @see player_get_audio_codec_type()
  */
 int player_set_replaygain_enabled(player_h player, bool enabled);
 
 /**
  * @brief Gets the player's replaygain status.
  * @since_tizen 5.0
- * @remarks If audio offload is enabled by calling player_audio_offload_set_enabled(),
- *          this function will return #PLAYER_ERROR_INVALID_OPERATION. (Since 5.5)
+ * @remarks Depending on audio codec type or by enabling audio offload,
+ *          this function could be unavailable and this will return #PLAYER_ERROR_NOT_AVAILABLE. (Since 5.5)
  * @param[in]   player    The handle to the media player
  * @param[out]  enabled   Pointer to store current replaygain status:
  *                        (@c true = enabled replaygain,
@@ -2456,8 +2498,12 @@ int player_set_replaygain_enabled(player_h player, bool enabled);
  * @retval #PLAYER_ERROR_NONE Successful
  * @retval #PLAYER_ERROR_INVALID_PARAMETER Invalid parameter
  * @retval #PLAYER_ERROR_INVALID_OPERATION Invalid operation
+ * @retval #PLAYER_ERROR_NOT_AVAILABLE Not available (Since 5.5)
  * @see player_set_replaygain_enabled()
  * @see player_audio_offload_set_enabled()
+ * @see player_audio_offload_is_enabled()
+ * @see player_set_audio_codec_type()
+ * @see player_get_audio_codec_type()
  */
 int player_is_replaygain_enabled(player_h player, bool *enabled);
 
@@ -2534,21 +2580,27 @@ int player_get_video_roi_area(player_h player, double *x_scale, double *y_scale,
  * @remarks This function is used for audio content only.
  * @remarks Enabling pitch control could increase the CPU usage on some devices.
  * @remarks If audio offload is enabled by calling player_audio_offload_set_enabled(),
- *          this function will return #PLAYER_ERROR_INVALID_OPERATION and
- *          this will not work at all even if it was called before enabling offload. (Since 5.5)
+ *          this function will return #PLAYER_ERROR_NOT_AVAILABLE and
+ *          this will not work at all even if this was called before enabling offload.
+ * @remarks This function could be unavailable depending on the audio codec type and
+ *          this will return #PLAYER_ERROR_NOT_AVAILABLE.
  * @param[in] player   The handle to the media player
  * @param[in] enabled  The new audio pitch control status (default: false)
  * @return @c 0 on success,
  *         otherwise a negative error value
  * @retval #PLAYER_ERROR_NONE Successful
- * @retval #PLAYER_ERROR_INVALID_STATE Invalid player state
  * @retval #PLAYER_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #PLAYER_ERROR_INVALID_STATE Invalid player state
  * @retval #PLAYER_ERROR_INVALID_OPERATION Invalid operation
+ * @retval #PLAYER_ERROR_NOT_AVAILABLE Not available
  * @pre The player state must be #PLAYER_STATE_IDLE.
  * @see player_audio_pitch_is_enabled()
  * @see player_audio_pitch_set_value()
  * @see player_audio_pitch_get_value()
  * @see player_audio_offload_set_enabled()
+ * @see player_audio_offload_is_enabled()
+ * @see player_set_audio_codec_type()
+ * @see player_get_audio_codec_type()
  */
 int player_audio_pitch_set_enabled(player_h player, bool enabled);
 
@@ -2556,8 +2608,8 @@ int player_audio_pitch_set_enabled(player_h player, bool enabled);
  * @brief Gets the status of controlling the pitch of audio.
  * @since_tizen 5.5
  * @remarks This function is used for audio content only.
- * @remarks If audio offload is enabled by calling player_audio_offload_set_enabled(),
- *          this function will return #PLAYER_ERROR_INVALID_OPERATION. (Since 5.5)
+ * @remarks Depending on audio codec type or by enabling audio offload,
+ *          this function could be unavailable and this will return #PLAYER_ERROR_NOT_AVAILABLE.
  * @param[in]   player   The handle to the media player
  * @param[out]  enabled  The audio pitch control status (default: false)
  * @return @c 0 on success,
@@ -2565,10 +2617,14 @@ int player_audio_pitch_set_enabled(player_h player, bool enabled);
  * @retval #PLAYER_ERROR_NONE Successful
  * @retval #PLAYER_ERROR_INVALID_PARAMETER Invalid parameter
  * @retval #PLAYER_ERROR_INVALID_OPERATION Invalid operation
+ * @retval #PLAYER_ERROR_NOT_AVAILABLE Not available
  * @see player_audio_pitch_set_enabled()
  * @see player_audio_pitch_set_value()
  * @see player_audio_pitch_get_value()
  * @see player_audio_offload_set_enabled()
+ * @see player_audio_offload_is_enabled()
+ * @see player_set_audio_codec_type()
+ * @see player_get_audio_codec_type()
  */
 int player_audio_pitch_is_enabled(player_h player, bool *enabled);
 
@@ -2577,8 +2633,10 @@ int player_audio_pitch_is_enabled(player_h player, bool *enabled);
  * @since_tizen 5.5
  * @remarks This function is used for audio content only.
  * @remarks If audio offload is enabled by calling player_audio_offload_set_enabled(),
- *          this function will return #PLAYER_ERROR_INVALID_OPERATION and
- *          this will not work at all even if it was called before enabling offload. (Since 5.5)
+ *          this function will return #PLAYER_ERROR_NOT_AVAILABLE and
+ *          this will not work at all even if this was called before enabling offload.
+ * @remarks This function could be unavailable depending on the audio codec type and
+ *          this will return #PLAYER_ERROR_NOT_AVAILABLE.
  * @param[in] player The handle to the media player
  * @param[in] value  The audio stream pitch value  \n
  *                   Valid range is 0.5~2. Default value is 1.
@@ -2587,11 +2645,15 @@ int player_audio_pitch_is_enabled(player_h player, bool *enabled);
  * @retval #PLAYER_ERROR_NONE Successful
  * @retval #PLAYER_ERROR_INVALID_PARAMETER Invalid parameter
  * @retval #PLAYER_ERROR_INVALID_OPERATION Invalid operation
+ * @retval #PLAYER_ERROR_NOT_AVAILABLE Not available
  * @pre The pitch control must be enabled by calling player_audio_pitch_set_enabled() function.
  * @see player_audio_pitch_set_enabled()
  * @see player_audio_pitch_is_enabled()
  * @see player_audio_pitch_get_value()
  * @see player_audio_offload_set_enabled()
+ * @see player_audio_offload_is_enabled()
+ * @see player_set_audio_codec_type()
+ * @see player_get_audio_codec_type()
  */
 int player_audio_pitch_set_value(player_h player, float value);
 
@@ -2599,8 +2661,8 @@ int player_audio_pitch_set_value(player_h player, float value);
  * @brief Gets the pitch of audio.
  * @since_tizen 5.5
  * @remarks This function is used for audio content only.
- * @remarks If audio offload is enabled by calling player_audio_offload_set_enabled(),
- *          this function will return #PLAYER_ERROR_INVALID_OPERATION. (Since 5.5)
+ * @remarks Depending on audio codec type or by enabling audio offload,
+ *          this function could be unavailable and this will return #PLAYER_ERROR_NOT_AVAILABLE.
  * @param[in]  player The handle to the media player
  * @param[out] value  The audio stream pitch value \n
  *                    Valid range is 0.5~2. Default value is 1.
@@ -2609,10 +2671,14 @@ int player_audio_pitch_set_value(player_h player, float value);
  * @retval #PLAYER_ERROR_NONE Successful
  * @retval #PLAYER_ERROR_INVALID_PARAMETER Invalid parameter
  * @retval #PLAYER_ERROR_INVALID_OPERATION Invalid operation
+ * @retval #PLAYER_ERROR_NOT_AVAILABLE Not available
  * @see player_audio_pitch_set_enabled()
  * @see player_audio_pitch_is_enabled()
  * @see player_audio_pitch_set_value()
  * @see player_audio_offload_set_enabled()
+ * @see player_audio_offload_is_enabled()
+ * @see player_set_audio_codec_type()
+ * @see player_get_audio_codec_type()
  */
 int player_audio_pitch_get_value(player_h player, float *value);
 
@@ -2646,19 +2712,12 @@ int player_audio_offload_foreach_supported_format(player_h player, player_suppor
  * @since_tizen 5.5
  * @remarks This function is related to the following feature:\n
  *          %http://tizen.org/feature/multimedia.player.audio_offload\n
- *          The sound stream type of the player should be #SOUND_STREAM_TYPE_MEDIA.\n
- *          If audio offload is enabled, the following functions will return #PLAYER_ERROR_INVALID_OPERATION
+ * @remarks The sound stream type of the player should be #SOUND_STREAM_TYPE_MEDIA.\n
+ * @remarks If audio offload is enabled, functions for audio effect are not available.\n
+ * @remarks If audio offload is enabled, the following functions will return #PLAYER_ERROR_NOT_AVAILABLE
  *          and they will not work at all even if they were called before enabling offload. :\n
- *          player_audio_effect_get_equalizer_bands_count()\n
- *          player_audio_effect_set_equalizer_band_level()\n
- *          player_audio_effect_get_equalizer_band_level()\n
- *          player_audio_effect_set_equalizer_all_bands()\n
- *          player_audio_effect_get_equalizer_level_range()\n
- *          player_audio_effect_get_equalizer_band_frequency()\n
- *          player_audio_effect_get_equalizer_band_frequency_range()\n
- *          player_audio_effect_equalizer_clear()\n
- *          player_audio_effect_equalizer_is_available()\n
  *          player_set_media_packet_audio_frame_decoded_cb()\n
+ *          player_unset_media_packet_audio_frame_decoded_cb()\n
  *          player_set_audio_latency_mode()\n
  *          player_get_audio_latency_mode()\n
  *          player_set_playback_rate()\n
@@ -2683,6 +2742,7 @@ int player_audio_offload_foreach_supported_format(player_h player, player_suppor
  * @retval #PLAYER_ERROR_FEATURE_NOT_SUPPORTED_ON_DEVICE Unsupported feature
  * @pre The player state must be #PLAYER_STATE_IDLE.
  * @see player_set_sound_stream_info()
+ * @see player_audio_effect_equalizer_is_available()
  * @see player_set_interrupted_cb()
  * @see player_audio_offload_foreach_supported_format()
  * @see player_audio_offload_is_enabled()
@@ -2733,6 +2793,53 @@ int player_audio_offload_is_enabled(player_h player, bool *enabled);
 int player_audio_offload_is_activated(player_h player, bool *activated);
 
 /**
+ * @brief Sets the default codec type of the audio decoder.
+ * @since_tizen 5.5
+ * @remarks The default codec type could be different depending on the device capability.
+ *          S/W codec type is supported basically.
+ * @remarks If selected H/W audio codec type does not support in some cases,
+ *          S/W audio codec type could be used instead.\n
+ * @remarks If application use the H/W audio codec type by default,
+ *          following functions should be called after setting codec type
+ *          because the availability could be changed depending on the codec capability. :\n
+ *          player_audio_effect_equalizer_is_available()\n
+ *          player_set_media_packet_audio_frame_decoded_cb()\n
+ *          player_unset_media_packet_audio_frame_decoded_cb()\n
+ *          player_set_replaygain_enabled()\n
+ *          player_is_replaygain_enabled()\n
+ *          player_audio_pitch_set_enabled()\n
+ *          player_audio_pitch_is_enabled()\n
+ *          player_audio_pitch_set_value()\n
+ *          player_audio_pitch_get_value()\n
+ * @param[in] player       The handle to the media player
+ * @param[in] codec_type   The default codec type
+ * @return @c 0 on success,
+ *         otherwise a negative error value
+ * @retval #PLAYER_ERROR_NONE Successful
+ * @retval #PLAYER_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #PLAYER_ERROR_INVALID_OPERATION Invalid operation
+ * @retval #PLAYER_ERROR_INVALID_STATE Invalid player state
+ * @retval #PLAYER_ERROR_NOT_SUPPORTED_AUDIO_CODEC Not support audio codec type
+ * @pre The player state must be #PLAYER_STATE_IDLE by player_create() or player_unprepare().
+ * @see player_get_audio_codec_type()
+ */
+int player_set_audio_codec_type(player_h player, player_codec_type_e codec_type);
+
+/**
+ * @brief Gets the default codec type of the audio decoder.
+ * @since_tizen 5.5
+ * @param[in]  player        The handle to the media player
+ * @param[out] codec_type    The default codec type
+ * @return @c 0 on success,
+ *         otherwise a negative error value
+ * @retval #PLAYER_ERROR_NONE Successful
+ * @retval #PLAYER_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #PLAYER_ERROR_INVALID_OPERATION Invalid operation
+ * @see player_set_audio_codec_type()
+ */
+int player_get_audio_codec_type(player_h player, player_codec_type_e *codec_type);
+
+/**
  * @}
  */
 
@@ -2804,7 +2911,7 @@ int player_set_streaming_buffering_time(player_h player, int prebuffer_ms, int r
  * @retval #PLAYER_ERROR_NONE Successful
  * @retval #PLAYER_ERROR_INVALID_PARAMETER Invalid parameter
  * @if WEARABLE @retval #PLAYER_ERROR_FEATURE_NOT_SUPPORTED_ON_DEVICE Unsupported feature @endif
- * @see player_get_streaming_buffering_time()
+ * @see player_set_streaming_buffering_time()
  */
 int player_get_streaming_buffering_time(player_h player, int *prebuffer_ms, int *rebuffer_ms);
 
index 078fcdd..e186c0f 100644 (file)
@@ -40,9 +40,9 @@ typedef enum {
  * @since_tizen 4.0
  */
 typedef enum {
-       PLAYER_VIDEO_CODEC_TYPE_EX_DEFAULT = 0,  /**< This is an optional flag for using codec which has higher priority */
        PLAYER_VIDEO_CODEC_TYPE_EX_HW,           /**< This is an optional flag for using the h/w codec */
        PLAYER_VIDEO_CODEC_TYPE_EX_SW,           /**< This is an optional flag for using the s/w codec */
+       PLAYER_VIDEO_CODEC_TYPE_EX_DEFAULT,      /**< This is an optional flag for using codec which has higher priority */
 } player_video_codec_type_ex_e;
 
 /**
@@ -481,6 +481,7 @@ int player_enable_media_packet_video_frame_decoded_cb(player_h player, bool enab
  * @retval #PLAYER_ERROR_INVALID_PARAMETER Invalid parameter
  * @retval #PLAYER_ERROR_INVALID_OPERATION Invalid operation
  * @retval #PLAYER_ERROR_INVALID_STATE Invalid player state
+ * @retval #PLAYER_ERROR_NOT_SUPPORTED_VIDEO_CODEC Not supported video codec type
  * @pre The player state must be #PLAYER_STATE_IDLE by player_create() or player_unprepare().
  * @see player_get_video_codec_type_ex()
  */
index 7aa9419..3884d95 100644 (file)
@@ -5510,3 +5510,50 @@ int player_audio_offload_is_activated(player_h player, bool *activated)
        g_free(ret_buf);
        return ret;
 }
+
+int player_set_audio_codec_type(player_h player, player_codec_type_e codec_type)
+{
+       PLAYER_INSTANCE_CHECK(player);
+       PLAYER_RANGE_ARG_CHECK(codec_type, PLAYER_CODEC_TYPE_HW, PLAYER_CODEC_TYPE_SW);
+
+       int ret = PLAYER_ERROR_NONE;
+       muse_player_api_e api = MUSE_PLAYER_API_SET_CODEC_TYPE;
+       player_cli_s *pc = (player_cli_s *)player;
+       char *ret_buf = NULL;
+
+       LOGD("ENTER codec: %d", codec_type);
+
+       PLAYER_SEND_MSG(api, pc, ret_buf, ret,
+                       MUSE_TYPE_INT, "stream_type", PLAYER_STREAM_TYPE_AUDIO,
+                       MUSE_TYPE_INT, "codec_type", codec_type);
+
+       g_free(ret_buf);
+       LOGD("LEAVE");
+       return ret;
+
+}
+
+int player_get_audio_codec_type(player_h player, player_codec_type_e *codec_type)
+{
+       PLAYER_INSTANCE_CHECK(player);
+       PLAYER_NULL_ARG_CHECK(codec_type);
+
+       int ret = PLAYER_ERROR_NONE;
+       muse_player_api_e api = MUSE_PLAYER_API_GET_CODEC_TYPE;
+       player_cli_s *pc = (player_cli_s *)player;
+       char *ret_buf = NULL;
+       int type = 0;
+
+       LOGD("ENTER");
+
+       PLAYER_SEND_MSG(api, pc, ret_buf, ret,
+                       MUSE_TYPE_INT, "stream_type", PLAYER_STREAM_TYPE_AUDIO);
+       if (ret == PLAYER_ERROR_NONE) {
+               player_msg_get(type, ret_buf);
+               *codec_type = type;
+       }
+
+       g_free(ret_buf);
+       LOGD("LEAVE codec: %d", *codec_type);
+       return ret;
+}
index 7bf25a2..7364f8e 100644 (file)
@@ -350,7 +350,7 @@ int player_enable_media_packet_video_frame_decoded_cb(player_h player, bool enab
 int player_set_video_codec_type_ex(player_h player, player_video_codec_type_ex_e codec_type)
 {
        PLAYER_INSTANCE_CHECK(player);
-       PLAYER_RANGE_ARG_CHECK(codec_type, PLAYER_VIDEO_CODEC_TYPE_EX_DEFAULT, PLAYER_VIDEO_CODEC_TYPE_EX_SW);
+       PLAYER_RANGE_ARG_CHECK(codec_type, PLAYER_VIDEO_CODEC_TYPE_EX_HW, PLAYER_VIDEO_CODEC_TYPE_EX_DEFAULT);
 
        int ret = PLAYER_ERROR_NONE;
        muse_player_api_e api = MUSE_PLAYER_API_SET_CODEC_TYPE;
@@ -360,34 +360,35 @@ int player_set_video_codec_type_ex(player_h player, player_video_codec_type_ex_e
        LOGD("ENTER codec: %d", codec_type);
 
        PLAYER_SEND_MSG(api, pc, ret_buf, ret,
-                                       MUSE_TYPE_INT, "stream_type", PLAYER_STREAM_TYPE_VIDEO,
-                                       MUSE_TYPE_INT, "codec_type", codec_type);
+                       MUSE_TYPE_INT, "stream_type", PLAYER_STREAM_TYPE_VIDEO,
+                       MUSE_TYPE_INT, "codec_type", codec_type);
 
        g_free(ret_buf);
        LOGD("LEAVE");
        return ret;
 }
 
-int player_get_video_codec_type_ex(player_h player, player_video_codec_type_ex_e *pcodec_type)
+int player_get_video_codec_type_ex(player_h player, player_video_codec_type_ex_e *codec_type)
 {
        PLAYER_INSTANCE_CHECK(player);
-       PLAYER_NULL_ARG_CHECK(pcodec_type);
+       PLAYER_NULL_ARG_CHECK(codec_type);
 
        int ret = PLAYER_ERROR_NONE;
        muse_player_api_e api = MUSE_PLAYER_API_GET_CODEC_TYPE;
        player_cli_s *pc = (player_cli_s *)player;
        char *ret_buf = NULL;
-       int codec_type = 0;
+       int type = 0;
 
        LOGD("ENTER");
 
-       PLAYER_SEND_MSG(api, pc, ret_buf, ret, MUSE_TYPE_INT, "stream_type", PLAYER_STREAM_TYPE_VIDEO);
+       PLAYER_SEND_MSG(api, pc, ret_buf, ret,
+                       MUSE_TYPE_INT, "stream_type", PLAYER_STREAM_TYPE_VIDEO);
        if (ret == PLAYER_ERROR_NONE) {
-               player_msg_get(codec_type, ret_buf);
-               *pcodec_type = codec_type;
+               player_msg_get(type, ret_buf);
+               *codec_type = type;
        }
 
        g_free(ret_buf);
-       LOGD("LEAVE codec: %d", *pcodec_type);
+       LOGD("LEAVE codec: %d", *codec_type);
        return ret;
 }
index 27302c3..f6389c7 100644 (file)
@@ -170,7 +170,9 @@ enum {
        CURRENT_STATUS_VIDEO360_SET_ZOOM_WITH_FOV,
        CURRENT_STATUS_VIDEO360_SET_ZOOM_WITH_FOV1,
        CURRENT_STATUS_VIDEO360_SET_ZOOM_WITH_FOV2,
-       CURRENT_STATUS_VIDEO_CODEC_TYPE,
+       CURRENT_STATUS_SET_VIDEO_CODEC_TYPE,
+       CURRENT_STATUS_SET_AUDIO_CODEC_TYPE,
+       CURRENT_STATUS_GET_CODEC_TYPE,
        CURRENT_STATUS_REPLAYGAIN_ENABLE,
        CURRENT_STATUS_AUDIO_OFFLOAD,
        CURRENT_STATUS_PITCH_CONTROL,
@@ -1495,22 +1497,39 @@ static void get_duration()
        g_print("                                                            ==> [Player_Test] Duration: [%d ] msec\n", duration);
 }
 
-static void set_video_codec_type(int v_codec_type)
+static void set_video_codec_type(int codec_type)
 {
        int ret;
 
-       ret = player_set_video_codec_type_ex(g_player[0], v_codec_type);
-       g_print("                                                            ==> [Player_Test] video codec type (%d) return: %d\n", v_codec_type, ret);
+       ret = player_set_video_codec_type_ex(g_player[0], codec_type);
+       g_print("                                                            ==> [Player_Test] video codec type (%d) return: %d\n", codec_type, ret);
 
 }
 
-static void get_codec_type(void)
+static void set_audio_codec_type(int codec_type)
 {
        int ret;
-       player_video_codec_type_ex_e vtype = 0;
 
-       ret = player_get_video_codec_type_ex(g_player[0], &vtype);
-       g_print("                                                            ==> [Player_Test] Video Codec type: [%d][ret 0x%X]\n", vtype, ret);
+       ret = player_set_audio_codec_type(g_player[0], codec_type);
+       g_print("                                                            ==> [Player_Test] audio codec type (%d) return: %d\n", codec_type, ret);
+
+}
+
+static void get_codec_type(int stream_type)
+{
+       int ret;
+       int type = 0;
+
+       if (stream_type == 1) {
+               player_video_codec_type_ex_e vtype;
+               ret = player_get_video_codec_type_ex(g_player[0], &vtype);
+               type = vtype;
+       } else {
+               player_codec_type_e atype;
+               ret = player_get_audio_codec_type(g_player[0], &atype);
+               type = atype;
+       }
+       g_print("                                                            ==> [Player_Test] Codec type: [%d][ret 0x%X]\n", type, ret);
 }
 
 static void get_stream_info()
@@ -2398,9 +2417,11 @@ void _interpret_main_menu(char *cmd)
                } else if (strncmp(cmd, "bf", 2) == 0) {
                        g_menu_state = CURRENT_STATUS_SET_PRE_BUFFERING_SIZE;
                } else if (strncmp(cmd, "C1", 2) == 0) {
-                       g_menu_state = CURRENT_STATUS_VIDEO_CODEC_TYPE;
+                       g_menu_state = CURRENT_STATUS_SET_VIDEO_CODEC_TYPE;
                } else if (strncmp(cmd, "C2", 2) == 0) {
-                       get_codec_type();
+                       g_menu_state = CURRENT_STATUS_SET_AUDIO_CODEC_TYPE;
+               } else if (strncmp(cmd, "C3", 2) == 0) {
+                       g_menu_state = CURRENT_STATUS_GET_CODEC_TYPE;
                } else if (!strncmp(cmd, "si", 2)) {
                        video360_is_spherical();
                } else if (!strncmp(cmd, "se", 2)) {
@@ -2591,8 +2612,12 @@ static void displaymenu()
                g_print("*** input horizontal field of view angle (1~360 deg.)\n");
        } else if (g_menu_state == CURRENT_STATUS_VIDEO360_SET_ZOOM_WITH_FOV2) {
                g_print("*** input vertical field of view angle (1~180 deg.)\n");
-       } else if (g_menu_state == CURRENT_STATUS_VIDEO_CODEC_TYPE) {
-               g_print("*** set video codec type (1: HW, 2: SW) \n");
+       } else if (g_menu_state == CURRENT_STATUS_SET_VIDEO_CODEC_TYPE) {
+               g_print("*** set video codec type (0: HW, 1: SW) \n");
+       } else if (g_menu_state == CURRENT_STATUS_SET_AUDIO_CODEC_TYPE) {
+               g_print("*** set audio codec type (0: HW, 1: SW) \n");
+       } else if (g_menu_state == CURRENT_STATUS_GET_CODEC_TYPE) {
+               g_print("*** stream type (1: video, 2: audio) \n");
        } else if (g_menu_state == CURRENT_STATUS_REPLAYGAIN_ENABLE) {
                g_print("*** input replaygain value.(0:disable, 1: enable) \n");
        } else if (g_menu_state == CURRENT_STATUS_AUDIO_OFFLOAD) {
@@ -2934,13 +2959,27 @@ static void interpret(char *cmd)
                        reset_menu_state();
                }
                break;
-       case CURRENT_STATUS_VIDEO_CODEC_TYPE:
+       case CURRENT_STATUS_SET_VIDEO_CODEC_TYPE:
                {
                        value1 = atoi(cmd);
                        set_video_codec_type(value1);
                        reset_menu_state();
                }
                break;
+       case CURRENT_STATUS_SET_AUDIO_CODEC_TYPE:
+               {
+                       value1 = atoi(cmd);
+                       set_audio_codec_type(value1);
+                       reset_menu_state();
+               }
+               break;
+       case CURRENT_STATUS_GET_CODEC_TYPE:
+               {
+                       value1 = atoi(cmd);
+                       get_codec_type(value1);
+                       reset_menu_state();
+               }
+               break;
        case CURRENT_STATUS_REPLAYGAIN_ENABLE:
                {
                        value1 = atoi(cmd);