Skip to content

Commit 01ea229

Browse files
committed
Upgrade plusplayer capi
1.Add plusplayer_is_live_streaming api 2.Add plusplayer_get_dvr_seekable_range api
1 parent 12cbee6 commit 01ea229

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+217
-130
lines changed

packages/video_player_avplay/tizen/inc/plusplayer_capi/attribute.h

Lines changed: 64 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -39,45 +39,46 @@ extern "C" {
3939
* @brief Enumeration for supported subtitle attributes
4040
*/
4141
typedef enum {
42-
PLUSPLAYER_SUBTITLE_ATTR_REGION_XPOS, /**< float type */
43-
PLUSPLAYER_SUBTITLE_ATTR_REGION_YPOS, /**< float type */
44-
PLUSPLAYER_SUBTITLE_ATTR_REGION_WIDTH, /**< float type */
45-
PLUSPLAYER_SUBTITLE_ATTR_REGION_HEIGHT, /**< float type */
46-
PLUSPLAYER_SUBTITLE_ATTR_WINDOW_XPADDING, /**< float type */
47-
PLUSPLAYER_SUBTITLE_ATTR_WINDOW_YPADDING, /**< float type */
48-
PLUSPLAYER_SUBTITLE_ATTR_WINDOW_LEFT_MARGIN, /**< int type */
49-
PLUSPLAYER_SUBTITLE_ATTR_WINDOW_RIGHT_MARGIN, /**< int type */
50-
PLUSPLAYER_SUBTITLE_ATTR_WINDOW_TOP_MARGIN, /**< int type */
51-
PLUSPLAYER_SUBTITLE_ATTR_WINDOW_BOTTOM_MARGIN, /**< int type */
52-
PLUSPLAYER_SUBTITLE_ATTR_WINDOW_BG_COLOR, /**< int type */
53-
PLUSPLAYER_SUBTITLE_ATTR_WINDOW_OPACITY, /**< float type */
54-
PLUSPLAYER_SUBTITLE_ATTR_WINDOW_SHOW_BG, /**< how to show window background,
55-
uint type */
56-
PLUSPLAYER_SUBTITLE_ATTR_FONT_FAMILY, /**< char* type */
57-
PLUSPLAYER_SUBTITLE_ATTR_FONT_SIZE, /**< float type */
58-
PLUSPLAYER_SUBTITLE_ATTR_FONT_WEIGHT, /**< int type */
59-
PLUSPLAYER_SUBTITLE_ATTR_FONT_STYLE, /**< int type */
60-
PLUSPLAYER_SUBTITLE_ATTR_FONT_COLOR, /**< int type */
61-
PLUSPLAYER_SUBTITLE_ATTR_FONT_BG_COLOR, /**< int type */
62-
PLUSPLAYER_SUBTITLE_ATTR_FONT_OPACITY, /**< float type */
63-
PLUSPLAYER_SUBTITLE_ATTR_FONT_BG_OPACITY, /**< float type */
64-
PLUSPLAYER_SUBTITLE_ATTR_FONT_TEXT_OUTLINE_COLOR, /**< int type */
65-
PLUSPLAYER_SUBTITLE_ATTR_FONT_TEXT_OUTLINE_THICKNESS, /**< int type */
66-
PLUSPLAYER_SUBTITLE_ATTR_FONT_TEXT_OUTLINE_BLUR_RADIUS, /**< int type */
67-
PLUSPLAYER_SUBTITLE_ATTR_FONT_VERTICAL_ALIGN, /**< int type */
68-
PLUSPLAYER_SUBTITLE_ATTR_FONT_HORIZONTAL_ALIGN, /**< int type */
69-
PLUSPLAYER_SUBTITLE_ATTR_RAW_SUBTITLE, /**< char* type */
70-
PLUSPLAYER_SUBTITLE_ATTR_WEBVTT_CUE_LINE, /**< float type */
71-
PLUSPLAYER_SUBTITLE_ATTR_WEBVTT_CUE_LINE_NUM, /**< int type */
72-
PLUSPLAYER_SUBTITLE_ATTR_WEBVTT_CUE_LINE_ALIGN, /**< int type */
73-
PLUSPLAYER_SUBTITLE_ATTR_WEBVTT_CUE_ALIGN, /**< int type */
74-
PLUSPLAYER_SUBTITLE_ATTR_WEBVTT_CUE_SIZE, /**< float type */
75-
PLUSPLAYER_SUBTITLE_ATTR_WEBVTT_CUE_POSITION, /**< float type */
76-
PLUSPLAYER_SUBTITLE_ATTR_WEBVTT_CUE_POSITION_ALIGN, /**< int type */
77-
PLUSPLAYER_SUBTITLE_ATTR_WEBVTT_CUE_VERTICAL, /**< int type */
78-
PLUSPLAYER_SUBTITLE_ATTR_TIMESTAMP,
79-
PLUSPLAYER_SUBTITLE_ATTR_EXTSUB_INDEX /**< File index of external subtitle */
80-
} plusplayer_subtitle_attr_e;
42+
PLUSPLAYER_SUBTITLE_ATTR_TYPE_REGION_XPOS, /**< float type */
43+
PLUSPLAYER_SUBTITLE_ATTR_TYPE_REGION_YPOS, /**< float type */
44+
PLUSPLAYER_SUBTITLE_ATTR_TYPE_REGION_WIDTH, /**< float type */
45+
PLUSPLAYER_SUBTITLE_ATTR_TYPE_REGION_HEIGHT, /**< float type */
46+
PLUSPLAYER_SUBTITLE_ATTR_TYPE_WINDOW_XPADDING, /**< float type */
47+
PLUSPLAYER_SUBTITLE_ATTR_TYPE_WINDOW_YPADDING, /**< float type */
48+
PLUSPLAYER_SUBTITLE_ATTR_TYPE_WINDOW_LEFT_MARGIN, /**< int type */
49+
PLUSPLAYER_SUBTITLE_ATTR_TYPE_WINDOW_RIGHT_MARGIN, /**< int type */
50+
PLUSPLAYER_SUBTITLE_ATTR_TYPE_WINDOW_TOP_MARGIN, /**< int type */
51+
PLUSPLAYER_SUBTITLE_ATTR_TYPE_WINDOW_BOTTOM_MARGIN, /**< int type */
52+
PLUSPLAYER_SUBTITLE_ATTR_TYPE_WINDOW_BG_COLOR, /**< int type */
53+
PLUSPLAYER_SUBTITLE_ATTR_TYPE_WINDOW_OPACITY, /**< float type */
54+
PLUSPLAYER_SUBTITLE_ATTR_TYPE_WINDOW_SHOW_BG, /**< how to show window
55+
background, uint type */
56+
PLUSPLAYER_SUBTITLE_ATTR_TYPE_FONT_FAMILY, /**< char* type */
57+
PLUSPLAYER_SUBTITLE_ATTR_TYPE_FONT_SIZE, /**< float type */
58+
PLUSPLAYER_SUBTITLE_ATTR_TYPE_FONT_WEIGHT, /**< int type */
59+
PLUSPLAYER_SUBTITLE_ATTR_TYPE_FONT_STYLE, /**< int type */
60+
PLUSPLAYER_SUBTITLE_ATTR_TYPE_FONT_COLOR, /**< int type */
61+
PLUSPLAYER_SUBTITLE_ATTR_TYPE_FONT_BG_COLOR, /**< int type */
62+
PLUSPLAYER_SUBTITLE_ATTR_TYPE_FONT_OPACITY, /**< float type */
63+
PLUSPLAYER_SUBTITLE_ATTR_TYPE_FONT_BG_OPACITY, /**< float type */
64+
PLUSPLAYER_SUBTITLE_ATTR_TYPE_FONT_TEXT_OUTLINE_COLOR, /**< int type */
65+
PLUSPLAYER_SUBTITLE_ATTR_TYPE_FONT_TEXT_OUTLINE_THICKNESS, /**< int type */
66+
PLUSPLAYER_SUBTITLE_ATTR_TYPE_FONT_TEXT_OUTLINE_BLUR_RADIUS, /**< int type */
67+
PLUSPLAYER_SUBTITLE_ATTR_TYPE_FONT_VERTICAL_ALIGN, /**< int type */
68+
PLUSPLAYER_SUBTITLE_ATTR_TYPE_FONT_HORIZONTAL_ALIGN, /**< int type */
69+
PLUSPLAYER_SUBTITLE_ATTR_TYPE_RAW_SUBTITLE, /**< char* type */
70+
PLUSPLAYER_SUBTITLE_ATTR_TYPE_WEBVTT_CUE_LINE, /**< float type */
71+
PLUSPLAYER_SUBTITLE_ATTR_TYPE_WEBVTT_CUE_LINE_NUM, /**< int type */
72+
PLUSPLAYER_SUBTITLE_ATTR_TYPE_WEBVTT_CUE_LINE_ALIGN, /**< int type */
73+
PLUSPLAYER_SUBTITLE_ATTR_TYPE_WEBVTT_CUE_ALIGN, /**< int type */
74+
PLUSPLAYER_SUBTITLE_ATTR_TYPE_WEBVTT_CUE_SIZE, /**< float type */
75+
PLUSPLAYER_SUBTITLE_ATTR_TYPE_WEBVTT_CUE_POSITION, /**< float type */
76+
PLUSPLAYER_SUBTITLE_ATTR_TYPE_WEBVTT_CUE_POSITION_ALIGN, /**< int type */
77+
PLUSPLAYER_SUBTITLE_ATTR_TYPE_WEBVTT_CUE_VERTICAL, /**< int type */
78+
PLUSPLAYER_SUBTITLE_ATTR_TYPE_TIMESTAMP,
79+
PLUSPLAYER_SUBTITLE_ATTR_TYPE_EXTSUB_INDEX /**< File index of external
80+
subtitle */
81+
} plusplayer_subtitle_attr_type_e;
8182

8283
/**
8384
* @brief Enumeration for player supported subtitle types
@@ -92,20 +93,28 @@ typedef enum {
9293
* @brief Enumeration for player supported subtitle attribute data types
9394
*/
9495
typedef enum {
95-
PLUSPLAYER_SUBTITLE_ATTR_TYPE_BOOL, /**< subtitle attribute data type bool */
96-
PLUSPLAYER_SUBTITLE_ATTR_TYPE_FLOAT, /**< subtitle attribute data type float
97-
*/
98-
PLUSPLAYER_SUBTITLE_ATTR_TYPE_DOUBLE, /**< subtitle attribute data type double
99-
*/
100-
PLUSPLAYER_SUBTITLE_ATTR_TYPE_STRING, /**< subtitle attribute data type string
101-
*/
102-
PLUSPLAYER_SUBTITLE_ATTR_TYPE_INT, /**< subtitle attribute data type int */
103-
PLUSPLAYER_SUBTITLE_ATTR_TYPE_UINT, /**< subtitle attribute data type uint */
104-
PLUSPLAYER_SUBTITLE_ATTR_TYPE_INT64, /**< subtitle attribute data type int64
105-
*/
106-
PLUSPLAYER_SUBTITLE_ATTR_TYPE_UINT64 /**< subtitle attribute data type uint64
107-
*/
108-
} plusplayer_subtitle_attr_type_e;
96+
PLUSPLAYER_SUBTITLE_ATTR_DATA_TYPE_BOOL, /**< subtitle attribute data type
97+
bool */
98+
PLUSPLAYER_SUBTITLE_ATTR_DATA_TYPE_FLOAT, /**< subtitle attribute data type
99+
* float
100+
*/
101+
PLUSPLAYER_SUBTITLE_ATTR_DATA_TYPE_DOUBLE, /**< subtitle attribute data type
102+
* double
103+
*/
104+
PLUSPLAYER_SUBTITLE_ATTR_DATA_TYPE_STRING, /**< subtitle attribute data type
105+
* string
106+
*/
107+
PLUSPLAYER_SUBTITLE_ATTR_DATA_TYPE_INT, /**< subtitle attribute data type int
108+
*/
109+
PLUSPLAYER_SUBTITLE_ATTR_DATA_TYPE_UINT, /**< subtitle attribute data type
110+
uint */
111+
PLUSPLAYER_SUBTITLE_ATTR_DATA_TYPE_INT64, /**< subtitle attribute data type
112+
* int64
113+
*/
114+
PLUSPLAYER_SUBTITLE_ATTR_DATA_TYPE_UINT64 /**< subtitle attribute data type
115+
* uint64
116+
*/
117+
} plusplayer_subtitle_attr_data_type_e;
109118

110119
/**
111120
* @brief structure definition of subtitle attribute
@@ -114,12 +123,12 @@ typedef struct {
114123
/**
115124
* @brief Subtitle attribute.
116125
*/
117-
plusplayer_subtitle_attr_e attr;
126+
plusplayer_subtitle_attr_type_e attr;
118127

119128
/**
120129
* @brief Subtitle attribute data type.
121130
*/
122-
plusplayer_subtitle_attr_type_e dtype;
131+
plusplayer_subtitle_attr_data_type_e dtype;
123132

124133
/**
125134
* @brief Start time.

packages/video_player_avplay/tizen/inc/plusplayer_capi/plusplayer_capi.h

Lines changed: 100 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1234,9 +1234,10 @@ int plusplayer_activate_audio(plusplayer_h handle);
12341234
* PLUSPLAYER_PROPERTY_CONFIG_LOW_LATENCY,
12351235
* PLUSPLAYER_PROPERTY_ATSC3_L1_SERVER_TIME,
12361236
* PLUSPLAYER_PROPERTY_AUDIO_DESCRIPTION, PLUSPLAYER_PROPERTY_PRESELECTION_TAG,
1237-
* PLUSPLAYER_PROPERTY_USE_MAIN_OUT_SHARE, PLUSPLAYER_PROPERTY_TOKEN,
1237+
* PLUSPLAYER_PROPERTY_USE_MAIN_OUT_SHARE, PLUSPLAYER_PROPERTY_URL_AUTH_TOKEN,
12381238
* PLUSPLAYER_PROPERTY_USER_LOW_LATENCY, PLUSPLAYER_PROPERTY_OPEN_HTTP_HEADER,
1239-
* PLUSPLAYER_PROPERTY_MAX_BANDWIDTH, PLUSPLAYER_PROPERTY_MPEGH_METADATA]
1239+
* PLUSPLAYER_PROPERTY_MAX_BANDWIDTH, PLUSPLAYER_PROPERTY_MPEGH_METADATA,
1240+
* PLUSPLAYER_PROPERTY_OPEN_MANIFEST]
12401241
* @exception None
12411242
*/
12421243
int plusplayer_set_property(plusplayer_h handle, plusplayer_property_e property,
@@ -1271,10 +1272,9 @@ int plusplayer_set_property(plusplayer_h handle, plusplayer_property_e property,
12711272
* @post None
12721273
* @remark It is caller's responsibility to free @c value memory resources
12731274
* ONLY on api return success.
1274-
* @remark Valid Properties to Get are [PLUSPLAYER_PROPERTY_IS_LIVE,
1275-
* PLUSPLAYER_PROPERTY_AVAILABLE_BITRATE, PLUSPLAYER_PROPERTY_LIVE_DURATION,
1276-
* PLUSPLAYER_PROPERTY_CURRENT_BANDWIDTH, PLUSPLAYER_PROPERTY_PRESELECTION_TAG,
1277-
* PLUSPLAYER_PROPERTY_CUR_LATENCY, PLUSPLAYER_PROPERTY_IS_DVB_DASH,
1275+
* @remark Valid Properties to Get are
1276+
* [PLUSPLAYER_PROPERTY_AVAILABLE_BITRATE, PLUSPLAYER_PROPERTY_PRESELECTION_TAG,
1277+
* PLUSPLAYER_PROPERTY_CURRENT_LATENCY, PLUSPLAYER_PROPERTY_IS_DVB_DASH,
12781278
* PLUSPLAYER_PROPERTY_LIVE_PLAYER_START, PLUSPLAYER_PROPERTY_HTTP_HEADER,
12791279
* PLUSPLAYER_PROPERTY_START_DATE,
12801280
* PLUSPLAYER_PROPERTY_MPEGH_METADATA, PLUSPLAYER_PROPERTY_DASH_STREAM_INFO]
@@ -1731,12 +1731,104 @@ int plusplayer_set_user_agent(plusplayer_h handle, const char* user_agent);
17311731
* @endcode
17321732
* @pre The player state must be at least #PLUSPLAYER_STATE_IDLE
17331733
* @post The player state will be same as @pre
1734-
* @remark For general (.mp4) content, this api will return error @c
1735-
* PLUSPLAYER_ERROR_TYPE_INVALID_OPERATION
1734+
* @remark For general non-adaptive streaming content, this api will return
1735+
* error @c PLUSPLAYER_ERROR_TYPE_INVALID_OPERATION
17361736
* @exception None
17371737
*/
17381738
int plusplayer_set_resume_time(plusplayer_h handle, uint64_t resume_time_ms);
17391739

1740+
/**
1741+
* @brief To check whether stream is live.
1742+
* @param [in] handle : plusplayer handle.
1743+
* @param [out] is_live : live streaming or not @c true = live streaming
1744+
* @c false = VOD
1745+
* @return @c PLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of
1746+
* plusplayer_error_type_e values will be returned.
1747+
* @retval #PLUSPLAYER_ERROR_TYPE_NONE Successful
1748+
* @retval #PLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
1749+
* @retval #PLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation failed
1750+
* @retval #PLUSPLAYER_ERROR_TYPE_INVALID_STATE Invalid state
1751+
* @code
1752+
* plusplayer_h player = plusplayer_create();
1753+
* plusplayer_open(player,uri);
1754+
* plusplayer_prepare(player);
1755+
* // ... your codes ...
1756+
* plusplayer_is_live_streaming(player, &is_live);
1757+
* // ... your codes ...
1758+
* @endcode
1759+
* @pre The player state must be #PLUSPLAYER_STATE_READY or
1760+
* #PLUSPLAYER_STATE_PLAYING or #PLUSPLAYER_STATE_PAUSED
1761+
* @post The player state will be same as @pre
1762+
* @remark For general non-adaptive streaming content, this api will return
1763+
* error @c PLUSPLAYER_ERROR_TYPE_INVALID_OPERATION
1764+
* @exception None
1765+
*/
1766+
int plusplayer_is_live_streaming(plusplayer_h handle, bool* is_live);
1767+
1768+
/**
1769+
* @brief Get live stream duration of current DVR window.
1770+
* @param [in] handle : plusplayer handle.
1771+
* @param [out] start_time_ms : start time in milliseconds.
1772+
* @param [out] end_time_ms : end time in milliseconds.
1773+
* @return @c PLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of
1774+
* plusplayer_error_type_e values will be returned.
1775+
* @retval #PLUSPLAYER_ERROR_TYPE_NONE Successful
1776+
* @retval #PLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
1777+
* @retval #PLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation failed
1778+
* @retval #PLUSPLAYER_ERROR_TYPE_INVALID_STATE Invalid state
1779+
* @code
1780+
* plusplayer_h player = plusplayer_create();
1781+
* plusplayer_open(player,uri);
1782+
* plusplayer_prepare(player);
1783+
* // ... your codes ...
1784+
* plusplayer_get_dvr_seekable_range(player, &start_time_ms,
1785+
* &end_time_ms);
1786+
* // ... your codes ...
1787+
* @endcode
1788+
* @pre The player state must be #PLUSPLAYER_STATE_READY or
1789+
* #PLUSPLAYER_STATE_PLAYING or #PLUSPLAYER_STATE_PAUSED
1790+
* @post The player state will be same as @pre
1791+
* @remark Live streams do not have fixed duration. But server generally
1792+
* maintains a finite buffer (called DVR) of live encoded data, whose right edge
1793+
* @c end_time_ms indicates live point and @c start_time_ms indicates oldest
1794+
* segment buffered by the server. DVR is sliding rightward with time to keep
1795+
* with live point.
1796+
* @remark For general non-adaptive streaming content, this api will return
1797+
* error @c PLUSPLAYER_ERROR_TYPE_INVALID_OPERATION
1798+
* @exception None
1799+
*/
1800+
int plusplayer_get_dvr_seekable_range(plusplayer_h handle,
1801+
uint64_t* start_time_ms,
1802+
uint64_t* end_time_ms);
1803+
1804+
/**
1805+
* @brief Get the current streaming bandwidth.
1806+
* @param [in] handle : plusplayer handle.
1807+
* @param [out] curr_bandwidth_bps : value of current bandwidth in bits/s
1808+
* @return @c PLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of
1809+
* plusplayer_error_type_e values will be returned.
1810+
* @retval #PLUSPLAYER_ERROR_TYPE_NONE Successful
1811+
* @retval #PLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
1812+
* @retval #PLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation failed
1813+
* @retval #PLUSPLAYER_ERROR_TYPE_INVALID_STATE Invalid state
1814+
* @code
1815+
* plusplayer_h player = plusplayer_create();
1816+
* plusplayer_open(player,uri);
1817+
* plusplayer_prepare(player);
1818+
* // ... your codes ...
1819+
* plusplayer_get_current_bandwidth(player, &curr_bandwidth_bps);
1820+
* // ... your codes ...
1821+
* @endcode
1822+
* @pre The player state must be #PLUSPLAYER_STATE_READY or
1823+
* #PLUSPLAYER_STATE_PLAYING or #PLUSPLAYER_STATE_PAUSED
1824+
* @post The player state will be same as @pre
1825+
* @remark For general non-adaptive streaming content, this api will return
1826+
* error @c PLUSPLAYER_ERROR_TYPE_INVALID_OPERATION
1827+
* @exception None
1828+
*/
1829+
int plusplayer_get_current_bandwidth(plusplayer_h handle,
1830+
uint32_t* curr_bandwidth_bps);
1831+
17401832
#ifdef __cplusplus
17411833
}
17421834
#endif

0 commit comments

Comments
 (0)