From: Jihae Yi Date: Tue, 31 May 2016 11:12:13 +0000 (+0900) Subject: Add error return logic if invalid player_display_mode_e is given X-Git-Tag: accepted/tizen/common/20160627.191922^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F22%2F72322%2F1;p=platform%2Fcore%2Fapi%2Fplayer.git Add error return logic if invalid player_display_mode_e is given Change-Id: I30a60f006e851e3a61a3f4e44e5631f87f5f853e --- diff --git a/include/common/player.h b/include/common/player.h old mode 100644 new mode 100755 index faafab7..ec7b596 --- a/include/common/player.h +++ b/include/common/player.h @@ -196,6 +196,7 @@ typedef enum { PLAYER_DISPLAY_MODE_CROPPED_FULL, /**< Cropped full-screen */ PLAYER_DISPLAY_MODE_ORIGIN_OR_LETTER, /**< Origin size (if surface size is larger than video size(width/height)) or Letter box (if video size(width/height) is larger than surface size) */ PLAYER_DISPLAY_MODE_DST_ROI, /**< Dst ROI mode (Deprecated since [3.0]).*/ + PLAYER_DISPLAY_MODE_NUM } player_display_mode_e; /** diff --git a/include/wearable/player.h b/include/wearable/player.h old mode 100644 new mode 100755 index c648c6a..4ad3248 --- a/include/wearable/player.h +++ b/include/wearable/player.h @@ -195,6 +195,7 @@ typedef enum { PLAYER_DISPLAY_MODE_CROPPED_FULL, /**< Cropped full-screen */ PLAYER_DISPLAY_MODE_ORIGIN_OR_LETTER, /**< Origin size (if surface size is larger than video size(width/height)) or Letter box (if video size(width/height) is larger than surface size) */ PLAYER_DISPLAY_MODE_DST_ROI, /**< Dst ROI mode (Deprecated since [3.0]).*/ + PLAYER_DISPLAY_MODE_NUM } player_display_mode_e; /** diff --git a/src/player.c b/src/player.c old mode 100644 new mode 100755 index bc0c45c..0e806ba --- a/src/player.c +++ b/src/player.c @@ -1973,6 +1973,7 @@ int player_set_display(player_h player, player_display_type_e type, player_displ int player_set_display_mode(player_h player, player_display_mode_e mode) { PLAYER_INSTANCE_CHECK(player); + PLAYER_CHECK_CONDITION(PLAYER_DISPLAY_MODE_LETTER_BOX <= mode && mode < PLAYER_DISPLAY_MODE_NUM, PLAYER_ERROR_INVALID_PARAMETER, "PLAYER_ERROR_INVALID_PARAMETER"); int ret = PLAYER_ERROR_NONE; muse_player_api_e api = MUSE_PLAYER_API_SET_DISPLAY_MODE; player_cli_s *pc = (player_cli_s *) player;