[0.6.180] apply tizen naming coding rule
[platform/core/multimedia/libmm-player.git] / src / include / mm_player.h
1 /*
2  * libmm-player
3  *
4  * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
5  *
6  * Contact: JongHyuk Choi <jhchoi.choi@samsung.com>, YeJin Cho <cho.yejin@samsung.com>,
7  * Seungbae Shin <seungbae.shin@samsung.com>, YoungHwan An <younghwan_.an@samsung.com>
8  *
9  * Licensed under the Apache License, Version 2.0 (the "License");
10  * you may not use this file except in compliance with the License.
11  * You may obtain a copy of the License at
12  *
13  * http://www.apache.org/licenses/LICENSE-2.0
14  *
15  * Unless required by applicable law or agreed to in writing, software
16  * distributed under the License is distributed on an "AS IS" BASIS,
17  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18  * See the License for the specific language governing permissions and
19  * limitations under the License.
20  *
21  */
22
23 #ifndef __MM_PLAYER_H__
24 #define __MM_PLAYER_H__
25
26
27 /*===========================================================================================
28 |                                                                                           |
29 |  INCLUDE FILES                                        |
30 |                                                                                           |
31 ========================================================================================== */
32
33 #include <glib.h>
34
35 #include <mm_types.h>
36 #include <mm_message.h>
37 #include <media_packet.h>
38
39 #ifdef __cplusplus
40         extern "C" {
41 #endif
42
43 /*===========================================================================================
44 |                                                                                           |
45 |  GLOBAL DEFINITIONS AND DECLARATIONS                                        |
46 |                                                                                           |
47 ========================================================================================== */
48
49 /**
50  * MM_PLAYER_URI:
51  *
52  * uri to play (string)
53  *
54  */
55 #define MM_PLAYER_CONTENT_URI               "profile_uri"
56 /**
57  * MM_PLAYER_VIDEO_ROTATION
58  *
59  * can change video angle (int)
60  * @see MMDisplayRotationType
61  */
62 #define MM_PLAYER_VIDEO_ROTATION            "display_rotation"
63 /**
64  * MM_PLAYER_VIDEO_WIDTH:
65  *
66  * get the video width (int), It's guaranteed after calling mm_player_start() or
67  * receiving MM_MESSAGE_BEGIN_OF_STREAM.
68  *
69  */
70 #define MM_PLAYER_VIDEO_WIDTH               "content_video_width"
71 /**
72  * MM_PLAYER_VIDEO_HEIGHT:
73  *
74  * get the video height (int), It's guaranteed after calling mm_player_start() or
75  * receiving MM_MESSAGE_BEGIN_OF_STREAM.
76  *
77  */
78 #define MM_PLAYER_VIDEO_HEIGHT              "content_video_height"
79 /**
80  * MM_PLAYER_VIDEO_EVAS_SURFACE_SINK:
81  *
82  * get the video evas surface sink plugin name (string), It's guaranteed after calling mm_player_create()
83  *
84  */
85 #define MM_PLAYER_VIDEO_EVAS_SURFACE_SINK          "display_evas_surface_sink"
86 /**
87  * MM_PLAYER_MEM_SRC:
88  *
89  * set memory pointer to play (data)
90  *
91  */
92 #define MM_PLAYER_MEMORY_SRC                "profile_user_param"
93 /**
94  * MM_PLAYER_PLAYBACK_COUNT
95  *
96  * can set playback count (int), Default value is 1 and -1 is for infinity playing until releasing it.
97  *
98  */
99 #define MM_PLAYER_PLAYBACK_COUNT            "profile_play_count"
100 /**
101  * MM_PLAYER_SUBTITLE_URI
102  *
103  * set the subtitle path (string)
104  */
105 #define MM_PLAYER_SUBTITLE_URI              "subtitle_uri"
106 /**
107  * MM_PLAYER_STREAMING_USER_AGENT
108  *
109  * set the streaming user agent (string)
110  */
111 #define MM_PLAYER_STREAMING_USER_AGENT      "streaming_user_agent"
112 /**
113  * MM_PLAYER_STREAMING_COOKIE
114  *
115  * set the streaming cookie (int)
116  */
117 #define MM_PLAYER_STREAMING_COOKIE          "streaming_cookie"
118 /**
119  * MM_PLAYER_VIDEO_CODEC
120  *
121  * codec the video data is stored in (string)
122  */
123 #define MM_PLAYER_VIDEO_CODEC               "content_video_codec"
124 /**
125  * MM_PLAYER_AUDIO_CODEC
126  *
127  * codec the audio data is stored in (string)
128  */
129 #define MM_PLAYER_AUDIO_CODEC               "content_audio_codec"
130 /**
131  * MM_PLAYER_AUDIO_BITRATE
132  *
133  * set the streaming proxy port (int)
134  */
135 #define MM_PLAYER_AUDIO_BITRATE             "content_audio_bitrate"
136 /**
137  * MM_PLAYER_AUDIO_CHANNEL
138  *
139  * the number of audio channel (int)
140  */
141 #define MM_PLAYER_AUDIO_CHANNEL             "content_audio_channels"
142 /**
143  * MM_PLAYER_AUDIO_SAMPLERATE
144  *
145  * audio samplerate  (int)
146  */
147 #define MM_PLAYER_AUDIO_SAMPLERATE          "content_audio_samplerate"
148 /**
149  * MM_PLAYER_TEXT_TRACK_NUM
150  *
151  * track number inside a collection (int)
152  */
153 #define MM_PLAYER_TEXT_TRACK_NUM            "content_text_track_num"
154 /**
155  * MM_PLAYER_TAG_ARTIST
156  *
157  * person(s) responsible for the recording (string)
158  */
159 #define MM_PLAYER_TAG_ARTIST                "tag_artist"
160 /**
161  * MM_PLAYER_TAG_TITLE
162  *
163  * title (string)
164  */
165 #define MM_PLAYER_TAG_TITLE                 "tag_title"
166 /**
167  * MM_PLAYER_TAG_ALBUM
168  *
169  * album containing this data (string)
170  */
171 #define MM_PLAYER_TAG_ALBUM                 "tag_album"
172 /**
173  * MM_PLAYER_TAG_GENRE
174  *
175  * genre this data belongs to (string)
176  */
177 #define MM_PLAYER_TAG_GENRE                 "tag_genre"
178 /**
179  * MM_PLAYER_TAG_AUTHOUR
180  *
181  * author (string)
182  */
183 #define MM_PLAYER_TAG_AUTHOUR               "tag_author"
184 /**
185  * MM_PLAYER_TAG_COPYRIGHT
186  *
187  * copyright notice of the data (string)
188  */
189 #define MM_PLAYER_TAG_COPYRIGHT             "tag_copyright"
190 /**
191  * MM_PLAYER_TAG_DATE
192  *
193  * date the data was created (string)
194  */
195 #define MM_PLAYER_TAG_DATE                  "tag_date"
196 /**
197  * MM_PLAYER_TAG_DESCRIPRION
198  *
199  * short text describing the content of the data (string)
200  */
201 #define MM_PLAYER_TAG_DESCRIPRION           "tag_description"
202 /**
203  * MM_PLAYER_TAG_TRACK_NUM
204  *
205  * track number inside a collection (int)
206  */
207 #define MM_PLAYER_TAG_TRACK_NUM             "tag_track_num"
208
209 /**
210  * MM_PLAYER_DRC_MODE
211  *
212  * dynamic resolution change mode (int)
213  */
214 #define MM_PLAYER_DRC_MODE                  "drc_mode"
215
216 /**
217  * MM_PLAYER_GAPLESS_MODE
218  *
219  * gapless playback mode (int)
220  */
221 #define MM_PLAYER_GAPLESS_MODE              "gapless_mode"
222
223 /**
224  * MM_PLAYER_ENABLE_VIDEO_DECODED_CB
225  *
226  * enable video decoded callback (int)
227  */
228 #define MM_PLAYER_ENABLE_VIDEO_DECODED_CB   "enable_video_decoded_cb"
229
230 /**
231  * MM_PLAYER_VIDEO_CODEC_TYPE
232  *
233  * video codec type (int)
234  */
235 #define MM_PLAYER_VIDEO_CODEC_TYPE          "video_codec_type"
236
237 /**
238  * MM_PLAYER_AUDIO_CODEC_TYPE
239  *
240  * audio codec type (int)
241  */
242 #define MM_PLAYER_AUDIO_CODEC_TYPE          "audio_codec_type"
243
244 /**
245  * MM_PLAYER_PREBUFFER_MS
246  *
247  * prebuffer ms (int)
248  */
249 #define MM_PLAYER_PREBUFFER_MS              "prebuffer_ms"
250
251 /**
252  * MM_PLAYER_REBUFFER_MS
253  *
254  * rebuffer ms (int)
255  */
256 #define MM_PLAYER_REBUFFER_MS               "rebuffer_ms"
257 /**
258  * MM_PLAYER_AUDIO_OFFLOAD (int)
259  */
260 #define MM_PLAYER_AUDIO_OFFLOAD             "audio_offload"
261
262 /**
263  * MM_PLAYER_PITCH_CONTROL (int)
264  */
265 #define MM_PLAYER_PITCH_CONTROL             "pitch_control"
266
267 /**
268  * MM_PLAYER_PITCH_VALUE (double)
269  */
270 #define MM_PLAYER_PITCH_VALUE               "pitch_value"
271
272
273 #define BUFFER_MAX_PLANE_NUM (4)
274
275 typedef struct {
276         MMPixelFormatType format;              /**< image format */
277         int width;                             /**< width of video buffer */
278         int height;                            /**< height of video buffer */
279         unsigned int timestamp;                /**< timestamp of stream buffer (msec)*/
280         unsigned int length_total;             /**< total length of stream buffer (in byte)*/
281         void *data[BUFFER_MAX_PLANE_NUM];
282         void *bo[BUFFER_MAX_PLANE_NUM];        /**< TBM buffer object */
283         void *internal_buffer;                 /**< Internal buffer pointer */
284         int stride[BUFFER_MAX_PLANE_NUM];      /**< stride of plane */
285         int elevation[BUFFER_MAX_PLANE_NUM];   /**< elevation of plane */
286         int orientation;                       /**< orientation */
287         int bo_size;                           /**< TBM buffer object size */
288 } mmplayer_video_decoded_data_info_t;
289
290 /**
291  * Enumerations of player state.
292  */
293 typedef enum {
294         MM_PLAYER_STATE_NULL,                           /**< Player is created, but not realized yet */
295         MM_PLAYER_STATE_READY,                          /**< Player is ready to play media */
296         MM_PLAYER_STATE_PLAYING,                        /**< Player is now playing media */
297         MM_PLAYER_STATE_PAUSED,                         /**< Player is paused while playing media */
298         MM_PLAYER_STATE_NONE,                           /**< Player is not created yet */
299         MM_PLAYER_STATE_NUM,                            /**< Number of player states */
300 } mmplayer_state_e;
301
302 /**
303  * Enumeration for attribute values types.
304  */
305 typedef enum {
306         MM_PLAYER_ATTRS_TYPE_INVALID = -1,        /**< Type is invalid */
307         MM_PLAYER_ATTRS_TYPE_INT,                 /**< Integer type */
308         MM_PLAYER_ATTRS_TYPE_DOUBLE,              /**< Double type */
309         MM_PLAYER_ATTRS_TYPE_STRING,              /**< UTF-8 String type */
310         MM_PLAYER_ATTRS_TYPE_DATA,                /**< Pointer type */
311         MM_PLAYER_ATTRS_TYPE_ARRAY,               /**< Array type */
312         MM_PLAYER_ATTRS_TYPE_RANGE,               /**< Range type */
313         MM_PLAYER_ATTRS_TYPE_NUM,                 /**< Number of attribute type */
314 } mmplayer_attrs_type_e;
315
316 /**
317  * Enumeration for attribute validation type.
318  */
319 typedef enum {
320         MM_PLAYER_ATTRS_VALID_TYPE_INVALID = -1,                /**< Invalid validation type */
321         MM_PLAYER_ATTRS_VALID_TYPE_NONE,                                /**< Do not check validity */
322         MM_PLAYER_ATTRS_VALID_TYPE_INT_ARRAY,          /**< validity checking type of integer array */
323         MM_PLAYER_ATTRS_VALID_TYPE_INT_RANGE,          /**< validity checking type of integer range */
324         MM_PLAYER_ATTRS_VALID_TYPE_DOUBLE_ARRAY,                /**< validity checking type of double array */
325         MM_PLAYER_ATTRS_VALID_TYPE_DOUBLE_RANGE,       /**< validity checking type of double range */
326 } mmplayer_attrs_valid_type_e;
327
328 /**
329  * Enumeration for attribute access flag.
330  */
331 typedef enum {
332         MM_PLAYER_ATTRS_FLAG_NONE = 0,                                  /**< None flag is set */
333         MM_PLAYER_ATTRS_FLAG_READABLE = 1 << 0,                 /**< Readable */
334         MM_PLAYER_ATTRS_FLAG_WRITABLE = 1 << 1,                 /**< Writable */
335         MM_PLAYER_ATTRS_FLAG_MODIFIED = 1 << 2,                 /**< Modified */
336
337         MM_PLAYER_ATTRS_FLAG_RW = MM_PLAYER_ATTRS_FLAG_READABLE | MM_PLAYER_ATTRS_FLAG_WRITABLE, /**< Readable and Writable */
338 } mmplayer_attrs_flag_e;
339
340 /**
341  * Enumeration of track types
342  */
343 typedef enum {
344         MM_PLAYER_TRACK_TYPE_AUDIO = 0,
345         MM_PLAYER_TRACK_TYPE_VIDEO,
346         MM_PLAYER_TRACK_TYPE_TEXT,
347         MM_PLAYER_TRACK_TYPE_MAX
348 } mmplayer_track_type_e;
349
350 /**
351  * Enumeration of runtime buffering mode
352  */
353 typedef enum {
354         MM_PLAYER_BUFFERING_MODE_ADAPTIVE = 0,  /**< default, If buffering is occurred, player will consider the bandwidth to adjust buffer setting. */
355         MM_PLAYER_BUFFERING_MODE_FIXED,                 /**< player will set buffer size with this fixed size value. */
356         MM_PLAYER_BUFFERING_MODE_MAX,
357 } mmplayer_buffering_mode_e;
358
359 /**
360  * Enumeration of media stream buffer status
361  */
362 typedef enum {
363         MM_PLAYER_MEDIA_STREAM_BUFFER_UNDERRUN,
364         MM_PLAYER_MEDIA_STREAM_BUFFER_OVERFLOW,
365 } mmplayer_media_stream_buffer_status_e;
366
367 /**
368  * Enumeration for stream type.
369  */
370 typedef enum {
371         MM_PLAYER_STREAM_TYPE_DEFAULT,  /**< Container type */
372         MM_PLAYER_STREAM_TYPE_AUDIO,    /**< Audio element stream type */
373         MM_PLAYER_STREAM_TYPE_VIDEO,    /**< Video element stream type */
374         MM_PLAYER_STREAM_TYPE_TEXT,     /**< Text type */
375         MM_PLAYER_STREAM_TYPE_MAX,
376 } mmplayer_stream_type_e;
377
378 typedef enum {
379         MM_PLAYER_CODEC_TYPE_DEFAULT = 0, /**< codec is selected by the priority */
380         MM_PLAYER_CODEC_TYPE_HW,          /**< HW codec can only be selected */
381         MM_PLAYER_CODEC_TYPE_SW,          /**< SW codec can only be selected */
382 } mmplayer_video_codec_type_e;
383
384 /**
385  * Attribute validity structure
386  */
387 typedef struct {
388          mmplayer_attrs_type_e type;
389          mmplayer_attrs_valid_type_e validity_type;
390          mmplayer_attrs_flag_e flag;
391         /**
392           * a union that describes validity of the attribute.
393           * Only when type is 'MM_ATTRS_TYPE_INT' or 'MM_ATTRS_TYPE_DOUBLE',
394           * the attribute can have validity.
395          */
396          union {
397                 /**
398                    * Validity structure for integer array.
399                  */
400                 struct {
401                         int *array;  /**< a pointer of array */
402                         int count;   /**< size of array */
403                         int d_val;
404                 } int_array;
405                 /**
406                    * Validity structure for integer range.
407                  */
408                 struct {
409                         int min;   /**< minimum range */
410                         int max;   /**< maximum range */
411                         int d_val;
412                 } int_range;
413                 /**
414                 * Validity structure for double array.
415                 */
416                 struct {
417                         double *array;  /**< a pointer of array */
418                         int count;   /**< size of array */
419                         double d_val;
420                 } double_array;
421                 /**
422                 * Validity structure for double range.
423                 */
424                 struct {
425                         double min;   /**< minimum range */
426                         double max;   /**< maximum range */
427                         double d_val;
428                 } double_range;
429         };
430 } mmplayer_attrs_info_t;
431
432 /**
433  * Volume type.
434  *
435  * @see         mm_player_set_volume, mm_player_get_volume
436  */
437 typedef struct {
438         float level[MM_VOLUME_CHANNEL_NUM];     /**< Relative volume factor for each channels */
439 } mmplayer_volume_type_t;
440
441 /**
442  * Video stream info in external demux case
443  *
444 **/
445 typedef struct {
446         const char *mime;
447         unsigned int framerate_num;
448         unsigned int framerate_den;
449         unsigned int width;
450         unsigned int height;
451         unsigned char *codec_extradata;
452         unsigned int extradata_size;
453         unsigned int version;
454 } mmplayer_video_stream_info_t;
455
456 /**
457  * Audio stream info in external demux case
458  *
459 **/
460 typedef struct {
461         const char *mime;
462         unsigned int channels;
463         unsigned int sample_rate;
464         unsigned char *codec_extradata;
465         unsigned int extradata_size;
466         unsigned int version;
467         unsigned int user_info;
468
469         /* for pcm */
470 //      unsigned int width;
471 //      unsigned int depth;
472 //      unsigned int endianness;
473 //      bool signedness;
474 } mmplayer_audio_stream_info_t;
475
476 /**
477  * Subtitle stream info in external demux case
478  *
479 **/
480 typedef struct _SubtitleStreamInfo {
481         const char *mime;
482         unsigned int codec_tag;
483         void *context;  //for smpte text
484 } mmplayer_subtitle_stream_info_t;
485
486 /**
487  * selected subtitle track number callback function type.
488  *
489  * @param       track_num       [in]    Track number of subtitle
490  * @param       user_param      [in]    User defined parameter
491  *
492  *
493  * @return      This callback function have to return MM_ERROR_NONE.
494  */
495 typedef bool (*mm_player_track_selected_subtitle_language_callback)(int track_num, void *user_param);
496
497 /**
498  * Buffer underrun / overflow data callback function type.
499  *
500  * @param       status     [in] buffer status
501  * @param       user_param [in] User defined parameter which is passed when set
502  *                          to enough data callback or need data callback
503  *
504  * @return      This callback function have to return MM_ERROR_NONE.
505  */
506 typedef bool (*mm_player_media_stream_buffer_status_callback)(mmplayer_stream_type_e type, mmplayer_media_stream_buffer_status_e status, unsigned long long bytes, void *user_param);
507
508 /**
509  * Buffer seek data callback function type.
510  *
511  * @param       offset     [in] offset for the buffer playback
512  * @param       user_param [in] User defined parameter which is passed when set
513  *                          to seek data callback
514  *
515  * @return      This callback function have to return MM_ERROR_NONE.
516  */
517 typedef bool (*mm_player_media_stream_seek_data_callback)(mmplayer_stream_type_e type, unsigned long long offset, void *user_param);
518
519 /**
520  * Called to notify the stream changed.
521  *
522  * @param user_data [in] The user data passed from the callback registration function
523  *
524  * @return      This callback function have to return MM_ERROR_NONE.
525  */
526 typedef bool (*mm_player_stream_changed_callback)(void *user_param);
527
528
529 /*===========================================================================================
530 |                                                                                           |
531 |  GLOBAL FUNCTION PROTOTYPES                                        |
532 |                                                                                           |
533 ========================================================================================== */
534
535 /**
536  * This function creates a player object for playing multimedia contents. \n
537  * The attributes of player are created to get/set some values with application. \n
538  * And, mutex, gstreamer and other resources are initialized at this time. \n
539  * If player is created, the state will become MM_PLAYER_STATE_NULL.
540  *
541  * @param   player [out] Handle of player
542  *
543  * @return  This function returns zero on success, or negative value with error code. \n
544  *          Please refer 'mm_error.h' to know it in detail.
545  * @pre     None
546  * @post    MM_PLAYER_STATE_NULL
547  * @see     mm_player_destroy
548  * @remark  You can create multiple handles on a context at the same time. \n
549  *          However, player cannot guarantee proper operation because of limitation of resources, \n
550  *          such as audio device or display device.
551  *
552  * @par Example
553  * @code
554 char *g_err_attr_name = NULL;
555
556 if (mm_player_create(&g_player) != MM_ERROR_NONE) {
557         LOGE("failed to create player\n");
558 }
559
560 if (mm_player_set_attribute(g_player,
561                                                 &g_err_attr_name,
562                                                 "profile_uri", filename, strlen(filename),
563                                                 "display_overlay", (void *)&g_win.xid, sizeof(g_win.xid),
564                                                 NULL) != MM_ERROR_NONE) {
565         LOGE("failed to set %s attribute\n", g_err_attr_name);
566         free(g_err_attr_name);
567 }
568
569 mm_player_set_message_callback(g_player, msg_callback, (void *)g_player);
570  * @endcode
571  */
572 int mm_player_create(MMHandleType *player);
573
574 /**
575  * This function releases player object and all resources which were created by mm_player_create(). \n
576  * And, player handle will also be destroyed.
577  *
578  * @param   player [in] Handle of player
579  *
580  * @return  This function returns zero on success, or negative value with error code.
581  * @pre     Player state may be MM_PLAYER_STATE_NULL. \n
582  *          But, it can be called in any state.
583  * @post    Because handle is released, there is no any state.
584  * @see     mm_player_create
585  * @remark  This method can be called with a valid player handle from any state to \n
586  *          completely shutdown the player operation.
587  *
588  * @par Example
589  * @code
590 if (mm_player_destroy(g_player) != MM_ERROR_NONE) {
591         LOGE("failed to destroy player\n");
592 }
593  * @endcode
594  */
595 int mm_player_destroy(MMHandleType player);
596
597 /**
598  * This function parses uri and makes gstreamer pipeline by uri scheme. \n
599  * So, uri should be set before realizing with mm_player_set_attribute(). \n
600  *
601  * @param   player [in] Handle of player
602  *
603  * @return  This function returns zero on success, or negative value with error code.
604  *
605  * @pre     Player state should be MM_PLAYER_STATE_NULL.
606  * @post    player state will be MM_PLAYER_STATE_READY.
607  * @see     mm_player_unrealize
608  * @remark  None
609  * @par Example
610  * @code
611 if (mm_player_realize(g_player) != MM_ERROR_NONE) {
612         LOGE("failed to realize player\n");
613 }
614  * @endcode
615  */
616 int mm_player_realize(MMHandleType player);
617
618 /**
619  * This function uninitializes player object. So, resources and allocated memory \n
620  * will be freed. And, gstreamer pipeline is also destroyed. So, if you want to play \n
621  * other contents, player should be created again after destruction or realized with new uri.
622  *
623  * @param   player [in] Handle of player
624  *
625  * @return  This function returns zero on success, or negative value with error code.
626  * @pre     Player state may be MM_PLAYER_STATE_READY to unrealize. \n
627  *          But, it can be called in any state.
628  * @post    Player state will be MM_PLAYER_STATE_NULL.
629  * @see     mm_player_realize
630  * @remark  This method can be called with a valid player handle from any state.
631  *
632  * @par Example
633  * @code
634 if (mm_player_unrealize(g_player) != MM_ERROR_NONE) {
635         LOGE("failed to unrealize player\n");
636 }
637  * @endcode
638  */
639 int mm_player_unrealize(MMHandleType player);
640
641 /**
642  * This function is to abort pause state transition
643  * for unrealize or destroy.
644  */
645 int mm_player_abort_pause(MMHandleType player);
646
647 /**
648  * This function is to get current state of player. \n
649  * Application have to check current state before doing some action.
650  *
651  * @param player [in]  Handle of player
652  * @param state  [out] current state of player on success
653  *
654  * @return   This function returns zero on success, or negative value with error code.
655  *
656  * @see      mmplayer_state_e
657  * @remark   None
658  * @par Example
659  * @code
660 if (mm_player_get_state(g_player, &state) != MM_ERROR_NONE) {
661         LOGE("failed to get state\n");
662 }
663  * @endcode
664  */
665 int mm_player_get_state(MMHandleType player, mmplayer_state_e *state);
666
667 /**
668  * This function is to set relative volume of player. \n
669  * So, It controls logical volume value. \n
670  * But, if developer want to change system volume, mm sound api should be used.
671  *
672  * @param       player          [in]    Handle of player
673  * @param       volume          [in]    Volume factor of each channel
674  *
675  * @return      This function returns zero on success, or negative value with error code.
676  * @see         mmplayer_volume_type_t, mm_player_get_volume
677  * @remark      The range of factor range is from 0 to 1.0. (1.0 = 100%) And, default value is 1.0.
678  * @par Example
679  * @code
680 mmplayer_volume_type_t volume;
681 int i = 0;
682
683 for (i = 0; i < MM_VOLUME_CHANNEL_NUM; i++)
684         volume.level[i] = MM_VOLUME_LEVEL_MAX;
685
686 if (mm_player_set_volume(g_player, &volume) != MM_ERROR_NONE)
687 {
688     LOGE("failed to set volume\n");
689 }
690  * @endcode
691  */
692 int mm_player_set_volume(MMHandleType player, mmplayer_volume_type_t *volume);
693
694 /**
695  * This function is to get current volume factor of player.
696  *
697  * @param       player          [in]    Handle of player.
698  * @param       volume          [out]   Volume factor of each channel.
699  *
700  * @return      This function returns zero on success, or negative value with error code.
701  *
702  * @see         mmplayer_volume_type_t, mm_player_set_volume
703  * @remark  None
704  * @par Example
705  * @code
706 mmplayer_volume_type_t volume;
707 int i;
708
709 if (mm_player_get_volume(g_player, &volume) != MM_ERROR_NONE)
710 {
711         LOGW("failed to get volume\n");
712 }
713
714 for (i = 0; i < MM_VOLUME_CHANNEL_NUM; i++)
715         LOGD("channel[%d] = %d \n", i, volume.level[i]);
716  * @endcode
717  */
718 int mm_player_get_volume(MMHandleType player, mmplayer_volume_type_t *volume);
719
720 /**
721  * This function is to start playing media contents. Demux(parser), codec and related plugins are decided \n
722  * at this time. And, MM_MESSAGE_BEGIN_OF_STREAM will be posted through callback function registered \n
723  * by mm_player_set_message_callback().
724  *
725  * @param       player          [in]    Handle of player
726  *
727  * @return      This function returns zero on success, or negative value with error code.
728  * @remark
729  *
730  * @pre         Player state may be MM_PLAYER_STATE_READY.
731  * @post                Player state will be MM_PLAYER_STATE_PLAYING.
732  * @see         mm_player_stop
733  * @remark  None
734  * @par Example
735  * @code
736 if (mm_player_start(g_player) != MM_ERROR_NONE)
737 {
738         LOGE("failed to start player\n");
739 }
740  * @endcode
741  */
742 int mm_player_start(MMHandleType player);
743
744 /**
745  * This function is to stop playing media contents and it's different with pause. \n
746  * If mm_player_start() is called after this, content will be started again from the beginning. \n
747  * So, it can be used to close current playback.
748  *
749  * @param       player          [in]    Handle of player
750  *
751  * @return      This function returns zero on success, or negative value with error code.
752  *
753  * @pre         Player state may be MM_PLAYER_STATE_PLAYING.
754  * @post                Player state will be MM_PLAYER_STATE_READY.
755  * @see         mm_player_start
756  * @remark  None
757  * @par Example
758  * @code
759 if (mm_player_stop(g_player) != MM_ERROR_NONE)
760 {
761         LOGE("failed to stop player\n");
762 }
763  * @endcode
764  */
765 int mm_player_stop(MMHandleType player);
766
767 /**
768  * This function is to pause playing media contents.
769  *
770  * @param       player          [in]    Handle of player.
771  *
772  * @return      This function returns zero on success, or negative value with error code.
773  *
774  * @pre         Player state may be MM_PLAYER_STATE_PLAYING.
775  * @post                Player state will be MM_PLAYER_STATE_PAUSED.
776  * @see         mm_player_resume
777  * @remark  None
778  * @par Example
779  * @code
780 if (mm_player_pause(g_player) != MM_ERROR_NONE)
781 {
782         LOGE("failed to pause player\n");
783 }
784  * @endcode
785  */
786 int mm_player_pause(MMHandleType player);
787
788 /**
789  * This function is to resume paused media contents.
790  *
791  * @param       player          [in]    Handle of player.
792  *
793  * @return      This function returns zero on success, or negative value with error code.
794  *
795  * @pre         Player state may be MM_PLAYER_STATE_PAUSED.
796  * @post                Player state will be MM_PLAYER_STATE_PLAYING.
797  * @see         mm_player_pause
798  * @remark  None
799  * @par Example
800  * @code
801 if (mm_player_resume(g_player) != MM_ERROR_NONE)
802 {
803         LOGE("failed to resume player\n");
804 }
805  * @endcode
806  */
807 int mm_player_resume(MMHandleType player);
808
809 /**
810  * This function is to set the position for playback. \n
811  * So, it can be seeked to requested position. \n
812  *
813  * @param       player          [in]    Handle of player
814  * @param       pos                     [in]    Position for playback
815  *
816  * @return      This function returns zero on success, or negative value with error code.
817  * @see         mm_player_get_position
818  * @remark  the unit of time-based format is millisecond and other case is percent.
819  */
820 int mm_player_set_position(MMHandleType player, int64_t pos);
821
822 /**
823  * This function is to get current position of playback content.
824  *
825  * @param       player          [in]    Handle of player.
826  * @param       format          [in]    Format of position.
827  * @param    pos        [out] contains current position on success or zero in case of failure.
828  *
829  * @return      This function returns zero on success, or negative value with errors
830  * @see         mm_player_set_position
831  * @remark  the unit of time-based format is millisecond and other case is percent.
832  */
833 int mm_player_get_position(MMHandleType player, int64_t *pos);
834
835 /**
836  * This function is to get the content time duration.
837  */
838 int mm_player_get_duration(MMHandleType player, int64_t *dur);
839
840 /**
841  * This function is to get current buffer position of playback content.
842  *
843  * @param   player      [in]    Handle of player.
844  * @param   format      [in]    Format of position.
845  * @param   start_pos   [out] contains buffer start  position on success or zero in case of failure.
846  * @param   stop_pos    [out] contains buffer current  position on success or zero in case of failure.
847  *
848  * @return      This function returns zero on success, or negative value with errors
849  * @see         mm_player_set_position
850  * @remark  the unit of time-based format is millisecond and other case is percent.
851  * @par Example
852  * @code
853 int start_pos = 0, stop_pos = 0;
854
855 mm_player_get_buffer_position(g_player, &start_pos, &end_pos );
856
857 LOGD("buffer position: [%d] ~ [%d] \%\n", start_pos, end_pos );
858  * @endcode
859  */
860 int mm_player_get_buffer_position(MMHandleType player, int *start_pos, int *end_pos);
861
862 /**
863  * This function sets callback function for receiving messages from player.
864  * So, player can notify warning, error and normal cases to application.
865  *
866  * @param       player          [in]    Handle of player.
867  * @param       callback        [in]    Message callback function.
868  * @param       user_param      [in]    User parameter which is passed to callback function.
869  *
870  * @return      This function returns zero on success, or negative value with error code.
871  * @see         MMMessageCallback
872  * @remark  None
873  * @par Example
874  * @code
875 int msg_callback(int message, MMMessageParamType *param, void *user_param)
876 {
877         switch (message)
878         {
879                 case MM_MESSAGE_ERROR:
880                         //do something
881                         break;
882
883                 case MM_MESSAGE_END_OF_STREAM:
884                         //do something
885                         break;
886
887                 case MM_MESSAGE_STATE_CHANGED:
888                         //do something
889                         break;
890
891                 case MM_MESSAGE_BEGIN_OF_STREAM:
892                         //do something
893                         break;
894
895                 default:
896                         break;
897         }
898         return TRUE;
899 }
900
901 mm_player_set_message_callback(g_player, msg_callback, (void *)g_player);
902  * @endcode
903  */
904 int mm_player_set_message_callback(MMHandleType player, MMMessageCallback callback, void *user_param);
905
906 /**
907  * This function is to mute volume of player
908  *
909  * @param       player  [in]    Handle of player
910  * @param       mute    [in]    Mute(1) or not mute(0)
911  *
912  * @return      This function returns zero on success, or negative value with error code
913  * @see         mm_player_get_mute
914  * @remark  None
915  * @par Example
916  * @code
917 if (mm_player_set_mute(g_player, TRUE) != MM_ERROR_NONE)
918 {
919         LOGW("failed to set mute\n");
920 }
921  * @endcode
922  */
923 int mm_player_set_mute(MMHandleType player, int mute);
924
925 /**
926  * This function is to get mute value of player
927  *
928  * @param       player  [in]    Handle of player
929  * @param       mute    [out]   Sound is muted
930  *
931  * @return      This function returns zero on success, or negative value with error code
932  * @see         mm_player_set_mute
933  * @remark  None
934  * @par Example
935  * @code
936 int mute;
937
938 if (mm_player_get_mute(g_player, &mute) != MM_ERROR_NONE)
939 {
940         LOGW("failed to get mute\n");
941 }
942
943 LOGD("mute status:%d\n", mute);
944  * @endcode
945  */
946 int mm_player_get_mute(MMHandleType player, int *mute);
947
948 /**
949  * This function is to adjust subtitle postion. So, subtitle can show at the adjusted position. \n
950  * If pos is negative, subtitle will be displayed previous time, the other hand forward time. \n
951  *
952  * @param       player  [in]    Handle of player
953  * @param       pos             [in]    postion to be adjusted
954  *
955  * @return      This function returns zero on success, or negative value with error
956  *                      code
957  * @see         mm_player_adjust_subtitle_position
958  * @remark  None
959  * @par Example
960  * @code
961 int pos;
962
963 pos = 5000;
964 if (mm_player_adjust_subtitle_position(g_player, pos) != MM_ERROR_NONE)
965 {
966         LOGW("failed to adjust subtitle postion.\n");
967 }
968  * @endcode
969  */
970
971 int mm_player_adjust_subtitle_position(MMHandleType player, int pos);
972
973 /**
974  * This function is to set subtitle silent status. So, subtitle can show or hide during playback \n
975  * by this value. But, one subtitle file should be set with "subtitle_uri" attribute before calling mm_player_realize(); \n
976  * Player FW parses subtitle file and send text data including timestamp to application \n
977  * through message callback with MM_MESSAGE_UPDATE_SUBTITLE will be. \n
978  * So, application have to render it. And, subtitle can be supported only in a seprate file. \n
979  * So, it's not supported for embedded case.
980  *
981  * @param       player  [in]    Handle of player
982  * @param       silent  [in]    silent(integer value except 0) or not silent(0)
983  *
984  * @return      This function returns zero on success, or negative value with error
985  *                      code
986  * @see         mm_player_get_subtitle_silent, MM_MESSAGE_UPDATE_SUBTITLE
987  * @remark  None
988  * @par Example
989  * @code
990 mm_player_set_attribute(g_player,
991                                         &g_err_name,
992                                         "subtitle_uri", g_subtitle_uri, strlen(g_subtitle_uri),
993                                         NULL
994                                         );
995
996 if (mm_player_set_subtitle_silent(g_player, TRUE) != MM_ERROR_NONE)
997 {
998         LOGW("failed to set subtitle silent\n");
999 }
1000  * @endcode
1001  */
1002 int mm_player_set_subtitle_silent(MMHandleType player, int silent);
1003
1004 /**
1005  * This function is to get silent status of subtitle.
1006  *
1007  * @param       player  [in]    Handle of player
1008  * @param       silent  [out]   subtitle silent property
1009  *
1010  * @return      This function returns zero on success, or negative value with error
1011  *                      code
1012  * @see         mm_player_set_subtitle_silent, MM_MESSAGE_UPDATE_SUBTITLE
1013  * @remark  None
1014  * @par Example
1015  * @code
1016 int silent = FALSE;
1017
1018 if (mm_player_get_subtitle_silent(g_player, &silent) != MM_ERROR_NONE)
1019 {
1020         LOGW("failed to set subtitle silent\n");
1021 }
1022  * @endcode
1023  */
1024 int mm_player_get_subtitle_silent(MMHandleType player, int *silent);
1025
1026 /**
1027  * This function is to set attributes into player. Multiple attributes can be set simultaneously. \n
1028  * If one of attribute fails, this function will stop at the point and let you know the name which is failed. \n
1029  *
1030  * @param   player                 [in]   Handle of player.
1031  * @param   err_attr_name          [out]  Name of attribute which is failed to set
1032  * @param   first_attribute_name   [in]   Name of the first attribute to set
1033  * @param   ...                    [in]   Value for the first attribute, followed optionally by more name/value pairs, terminated by NULL.
1034  *                                        But, in the case of data or string type, it should be name/value/size.
1035  *
1036  * @return  This function returns zero on success, or negative value with error code.
1037  *
1038  * @see     mm_player_get_attribute
1039  * @remark  This function must be terminated by NULL argument.
1040  *          And, if this function is failed, err_attr_name param must be free.
1041  * @par Example
1042  * @code
1043 char *g_err_attr_name = NULL;
1044
1045 if (mm_player_set_attribute(g_player,
1046                                                 &g_err_attr_name,
1047                                                 "profile_uri", filename, strlen(filename),
1048                                                 "profile_play_count", count,
1049                                                 NULL) != MM_ERROR_NONE) {
1050         LOGW("failed to set %s attribute\n", g_err_attr_name);
1051         free(g_err_attr_name);
1052 }
1053
1054  * @endcode
1055  */
1056 int mm_player_set_attribute(MMHandleType player,  char **err_attr_name, const char *first_attribute_name, ...)G_GNUC_NULL_TERMINATED;
1057
1058 /**
1059  * This function is to get attributes from player. Multiple attributes can be got simultaneously.
1060  *
1061  * @param   player                [in]  Handle of player.
1062  * @param   err_attr_name         [out] Name of attribute which is failed to get
1063  * @param   first_attribute_name  [in]  Name of the first attribute to get
1064  * @param   ...                   [out] Value for the first attribute, followed optionally by more name/value pairs, terminated by NULL.
1065  *                                      But, in the case of data or string type, it should be name/value/size.
1066  *
1067  * @return  This function returns zero on success, or negative value with error
1068  *          code.
1069  * @see     mm_player_set_attribute
1070  * @remark  This function must be terminated by NULL argument.
1071  *          And, if this function is failed, err_attr_name param must be free.
1072  */
1073 int mm_player_get_attribute(MMHandleType player,  char **err_attr_name, const char *first_attribute_name, ...)G_GNUC_NULL_TERMINATED;
1074
1075 /**
1076  * This function is to get detail information of attribute.
1077  *
1078  * @param   player          [in]  Handle of player.
1079  * @param   attribute_name  [in]  Name of the attribute to get
1080  * @param   info            [out] Attribute infomation
1081  *
1082  * @return  This function returns zero on success, or negative value with error
1083  *          code.
1084  *
1085  * @see     mm_player_set_attribute, mm_player_get_attribute
1086  * @remark  None
1087  * @par Example
1088  * @code
1089 if (mm_player_get_attribute_info(g_player, "display_method", &method_info) != MM_ERROR_NONE) {
1090         LOGW("failed to get info\n");
1091 }
1092
1093 LOGD("type:%d \n", method_info.type); //int, double..
1094 LOGD("flag:%d \n", method_info.flag); //readable, writable..
1095 LOGD("validity type:%d \n", method_info.validity_type); //range, array..
1096
1097 if (method_info. validity_type == MM_PLAYER_ATTRS_VALID_TYPE_INT_RANGE) {
1098         LOGD("range min:%d\n", method_info.int_range.min);
1099         LOGD("range max:%d\n", method_info.int_range.max);
1100 }
1101  * @endcode
1102  */
1103 int mm_player_get_attribute_info(MMHandleType player,  const char *attribute_name, mmplayer_attrs_info_t *info);
1104
1105 /**
1106  * This function is to get the track count
1107  *
1108  * @param   player [in]  handle of player.
1109  * @param   track  [in]  type of the track type
1110  * @param   info   [out] the count of the track
1111  *
1112  * @return  This function returns zero on success, or negative value with error
1113  *          code.
1114  *
1115  * @par Example
1116  * @code
1117 gint audio_count = 0;
1118
1119 if (mm_player_get_track_count(g_player, MM_PLAYER_TRACK_TYPE_AUDIO, &audio_count) != MM_ERROR_NONE) {
1120         LOGW("failed to get audio track count\n");
1121 }
1122
1123 LOGD("audio track count : %d \n", audio_count);
1124  * @endcode
1125  */
1126 int mm_player_get_track_count(MMHandleType player,  mmplayer_track_type_e type, int *count);
1127
1128 /**
1129  * This function is to select the track
1130  *
1131  * @param   player [in] handle of player.
1132  * @param   type   [in] type of the track type
1133  * @param   index  [in] the index of the track
1134  *
1135  * @return  This function returns zero on success, or negative value with error
1136  *          code.
1137  */
1138 int mm_player_select_track(MMHandleType player, mmplayer_track_type_e type, int index);
1139
1140 /**
1141  * This function is to get the track language
1142  *
1143  * @param   player [in]  handle of player.
1144  * @param   type   [in]  type of the track type
1145  * @param   index  [in]  the index of the track
1146  * @param   code   [out] language code in ISO 639-1(string)
1147  *
1148  * @return  This function returns zero on success, or negative value with error
1149  *          code.
1150  */
1151 int mm_player_get_track_language_code(MMHandleType player,  mmplayer_track_type_e type, int index, char **code);
1152
1153 /**
1154  * This function is to get the current running track
1155  *
1156  * @param       player          [in]    handle of player.
1157  * @param       type                    [in]    type of the track type
1158  * @param       index           [out]    the index of the track
1159  *
1160  * @return      This function returns zero on success, or negative value with error
1161  *                      code.
1162  */
1163
1164 int mm_player_get_current_track(MMHandleType hplayer, mmplayer_track_type_e type, int *index);
1165
1166 /**
1167  * This function is to set the subtitle path
1168  *
1169  * @param       player  [in]    handle of player
1170  * @param       path    [in]    subtitle path
1171  *
1172  * @return      This function returns zero on success, or negative value with error code.
1173  */
1174 int mm_player_set_external_subtitle_path(MMHandleType player, const char *path);
1175
1176 /**
1177  * This function is to set uri.
1178  *
1179  * @param   player [in] handle of player
1180  * @param   uri    [in] uri
1181  * @return  This function returns zero on success, or negative value with error code.
1182  */
1183 int mm_player_set_uri(MMHandleType player, const char *uri);
1184
1185 /**
1186  * This function is to set next uri.
1187  *
1188  * @param   player [in] handle of player
1189  * @param   uri    [in] uri
1190  * @return  This function returns zero on success, or negative value with error code.
1191  */
1192 int mm_player_set_next_uri(MMHandleType player, const char *uri);
1193
1194 /**
1195  * This function is to get next uri.
1196  *
1197  * @param   player   [in]  handle of player
1198  * @param   uri      [out] uri
1199  * @return  This function returns zero on success, or negative value with error code.
1200  */
1201 int mm_player_get_next_uri(MMHandleType player, char **uri);
1202
1203 /**
1204  * This function is to decrease reference count of internal buffer.
1205  *
1206  * @param    buffer [in] video callback internal buffer
1207  * @return   None;
1208  */
1209 void mm_player_video_stream_internal_buffer_unref(void *buffer);
1210
1211 /**mm_player_submit_packet
1212  * This function is to submit buffer to appsrc.  \n
1213  * @param   player                      [in]    Handle of player.
1214  * @param   buf             [in]    buffer to be submit in appsrc in external feeder case.
1215  * @param   len                         [in]    length of buffer.
1216  * @param   pts                         [in]    timestamp of buffer.
1217  * @param   streamtype          [in]    stream type of buffer.
1218  * @return  This function returns zero on success, or negative value with error code.
1219  */
1220 int mm_player_submit_packet(MMHandleType player, media_packet_h packet);
1221
1222 /**mm_player_set_video_info
1223  * This function is to set caps of src pad of video appsrc in external feeder case.  \n
1224  * @param   player         [in] Handle of player.
1225  * @param   media_format_h [in] Video stream info.
1226  * @return  This function returns zero on success, or negative value with error code.
1227  */
1228 int mm_player_set_video_info(MMHandleType player, media_format_h format);
1229
1230 /**mm_player_set_audio_info
1231  * This function is to set caps of src pad of Audio appsrc in external feeder case.  \n
1232  * @param       player                       [in]    Handle of player.
1233  * @param       media_format_h               [in]    Audio stream info.
1234  * @return      This function returns zero on success, or negative value with error code.
1235  */
1236 int mm_player_set_audio_info(MMHandleType player, media_format_h format);
1237
1238 /**mm_player_set_subtitle_info
1239  * This function is to set caps of src pad of subtitle appsrc in external feeder case.  \n
1240  * @param       player                          [in]    Handle of player.
1241  * @param       subtitle_stream_info               [in]    Subtitle stream info.
1242  * @return      This function returns zero on success, or negative value with error code.
1243  */
1244 int mm_player_set_subtitle_info(MMHandleType player, mmplayer_subtitle_stream_info_t *info);
1245
1246 /**
1247  * This function set callback function for receiving need or enough data message from player.
1248  *
1249  * @param   player     [in] Handle of player.
1250  * @param   type       [in] stream type
1251  * @param   callback   [in] data callback function for stream type.
1252  * @param   user_param [in] User parameter.
1253  *
1254  * @return  This function returns zero on success, or negative value with error
1255  *          code.
1256  */
1257 int mm_player_set_media_stream_buffer_status_callback(MMHandleType player, mmplayer_stream_type_e type, mm_player_media_stream_buffer_status_callback callback, void *user_param);
1258
1259 /**
1260  * This function set callback function for receiving seek data message from player.
1261  *
1262  * @param       player          [in]    Handle of player.
1263  * @param       type            [in]    stream type
1264  * @param       callback        [in]    Seek data callback function for stream type.
1265  * @param       user_param      [in]    User parameter.
1266  *
1267  * @return      This function returns zero on success, or negative value with error
1268  *                      code.
1269  */
1270 int mm_player_set_media_stream_seek_data_callback(MMHandleType player, mmplayer_stream_type_e type, mm_player_media_stream_seek_data_callback callback, void *user_param);
1271
1272 /**
1273  * This function is to set max size of buffer(appsrc).
1274  *
1275  * @param       player          [in]    Handle of player.
1276  * @param       type            [in]    stream type
1277  * @param       max_size        [in]    max bytes of buffer.
1278  *
1279  * @return      This function returns zero on success, or negative value with error
1280  *                      code.
1281  */
1282 int mm_player_set_media_stream_buffer_max_size(MMHandleType player, mmplayer_stream_type_e type, unsigned long long max_size);
1283
1284 /**
1285  * This function is to get max size of buffer(appsrc).
1286  *
1287  * @param       player          [in]    Handle of player.
1288  * @param       type            [in]    stream type
1289  * @param       max_size        [out]   max bytes of buffer.
1290  *
1291  * @return      This function returns zero on success, or negative value with error
1292  *                      code.
1293  */
1294 int mm_player_get_media_stream_buffer_max_size(MMHandleType player, mmplayer_stream_type_e type, unsigned long long *max_size);
1295
1296 /**
1297  * This function is to set min percent of buffer(appsrc).
1298  *
1299  * @param       player          [in]    Handle of player.
1300  * @param       type            [in]    stream type
1301  * @param       min_percent     [in]    min percent of buffer.
1302  *
1303  * @return      This function returns zero on success, or negative value with error
1304  *                      code.
1305  */
1306 int mm_player_set_media_stream_buffer_min_percent(MMHandleType player, mmplayer_stream_type_e type, unsigned min_percent);
1307
1308 /**
1309  * This function is to get min percent of buffer(appsrc).
1310  *
1311  * @param       player          [in]    Handle of player.
1312  * @param       type            [in]    stream type
1313  * @param       min_percent     [out]   min percent of buffer.
1314  *
1315  * @return      This function returns zero on success, or negative value with error
1316  *                      code.
1317  */
1318 int mm_player_get_media_stream_buffer_min_percent(MMHandleType player, mmplayer_stream_type_e type, unsigned int *min_percent);
1319
1320 /**
1321  * This function set callback function for changing audio stream from player. \n
1322  * It's only supported when audio stream is included in file. \n
1323  *
1324  * @param       player   [in] Handle of player.
1325  * @param       callback [in] Audio stream changed callback function.
1326  * @param       user_param [in] User parameter.
1327  *
1328  * @return      This function returns zero on success, or negative value with error
1329  *                      code.
1330  * @see         mm_player_stream_changed_callback
1331  * @since
1332  */
1333 int mm_player_set_audio_stream_changed_callback(MMHandleType player, mm_player_stream_changed_callback callback, void *user_param);
1334
1335 /**
1336  * This function set callback function for changing video stream from player. \n
1337  * It's only supported when video stream is included in file. \n
1338  *
1339  * @param       player   [in] Handle of player.
1340  * @param       callback [in] Video stream changed callback function.
1341  * @param       user_param [in] User parameter.
1342  *
1343  * @return      This function returns zero on success, or negative value with error
1344  *                      code.
1345  * @see         mm_player_stream_changed_callback
1346  */
1347 int mm_player_set_video_stream_changed_callback(MMHandleType player, mm_player_stream_changed_callback callback, void *user_param);
1348
1349 /**
1350  * This function is to get timeout value according to the content type for muse. \n
1351  * It's only supported when video stream is included in file. \n
1352  *
1353  * @param       player  [in] Handle of player.
1354  * @param       timeout [out] timeout value (sec).
1355  *
1356  * @return      This function returns zero on success, or negative value with error
1357  *                      code.
1358  * @since 3.0
1359  */
1360 int mm_player_get_timeout(MMHandleType player, int *timeout);
1361
1362 /**
1363  * This function is to get the number of video output buffers. \n
1364  * It's only supported when video stream is included in file. \n
1365  *
1366  * @param       player  [in] Handle of player.
1367  * @param       num     [out] num of buffers.
1368  * @param       extra_num [out] extra num of buffers.
1369  *
1370  * @return      This function returns zero on success, or negative value with error
1371  *                      code.
1372  * @since 3.0
1373  */
1374 int mm_player_get_num_of_video_out_buffers(MMHandleType player, int *num, int *extra_num);
1375
1376 /**
1377  * This function is to set the dynamic resolution information. \n
1378  * It's only supported when video stream is included in file. \n
1379  *
1380  * @param       player  [in] Handle of player.
1381  * @param       drc     [in] dynamic resolution info of media stream data
1382  *
1383  * @return      This function returns zero on success, or negative value with error
1384  *                      code.
1385  * @since 3.0
1386  */
1387 int mm_player_set_media_stream_dynamic_resolution(MMHandleType player, bool drc);
1388
1389 /**
1390  * This function is to release the video stream bo to reuse. \n
1391  * It's only supported when sw codec is used to decode video stream. \n
1392  *
1393  * @param       player  [in] Handle of player.
1394  * @param       bo     [in] bo address to be released
1395  *
1396  * @return      This function returns zero on success, or negative value with error
1397  *                      code.
1398  * @since 3.0
1399  */
1400 int mm_player_release_video_stream_bo(MMHandleType player, void *bo);
1401
1402 /**
1403  * This function is to set sound stream info
1404  */
1405 int mm_player_set_sound_stream_info(MMHandleType player, char *stream_type, int stream_index);
1406
1407 /**
1408  * This function is to manage the playback according to the external storage state
1409  */
1410 int mm_player_manage_external_storage_state(MMHandleType player, int id, int state);
1411
1412 /**
1413  * These functions are to set/get the max variant of HAS
1414  */
1415 int mm_player_get_adaptive_variant_info(MMHandleType player, int *num, char **var_info);
1416 int mm_player_set_max_adaptive_variant_limit(MMHandleType player, int bandwidth, int width, int height);
1417 int mm_player_get_max_adaptive_variant_limit(MMHandleType player, int *bandwidth, int *width, int *height);
1418
1419 /**
1420  * These functions are to set/get the audio only mode
1421  */
1422 int mm_player_set_audio_only(MMHandleType player, bool audio_only);
1423 int mm_player_get_audio_only(MMHandleType player, bool *audio_only);
1424
1425 /**
1426  * These functions are to get the streaming bufferint time
1427  */
1428 int mm_player_get_streaming_buffering_time(MMHandleType player, int *prebuffer_ms, int *rebuffer_ms);
1429
1430 /**
1431  * These functions are to display the 360 video content
1432  */
1433 int mm_player_360_is_content_spherical(MMHandleType player, bool *is_spherical);
1434 int mm_player_360_set_enabled(MMHandleType player, bool enabled);
1435 int mm_player_360_is_enabled(MMHandleType player, bool *enabled);
1436
1437 int mm_player_360_set_direction_of_view(MMHandleType player, float yaw, float pitch);
1438 int mm_player_360_get_direction_of_view(MMHandleType player, float *yaw, float *pitch);
1439
1440 int mm_player_360_set_zoom(MMHandleType player, float level);
1441 int mm_player_360_get_zoom(MMHandleType player, float *level);
1442
1443 int mm_player_360_set_field_of_view(MMHandleType player, int horizontal_degrees, int vertical_degrees);
1444 int mm_player_360_get_field_of_view(MMHandleType player, int *horizontal_degrees, int *vertical_degrees);
1445
1446 /**
1447  * This function is to set codec type
1448  */
1449 int mm_player_set_codec_type(MMHandleType player, mmplayer_stream_type_e stream_type, mmplayer_video_codec_type_e codec_type);
1450
1451 /**
1452  * These functions are to apply the replaygain
1453  */
1454 int mm_player_set_replaygain_enabled(MMHandleType player, bool enabled);
1455 int mm_player_is_replaygain_enabled(MMHandleType player, bool *enabled);
1456
1457 /**
1458  * This function is to set/get video content ROI area
1459  */
1460 int mm_player_set_video_roi_area(MMHandleType player, double scale_x, double scale_y, double scale_width, double scale_height);
1461 int mm_player_get_video_roi_area(MMHandleType player, double *scale_x, double *scale_y, double *scale_width, double *scale_height);
1462
1463 /**
1464         @}
1465  */
1466
1467 #ifdef __cplusplus
1468         }
1469 #endif
1470
1471 #endif  /* __MM_PLAYER_H__ */