2e0b8a6db8e17b788aef8691f7800c340ce81b5c
[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 #define BUFFER_MAX_PLANE_NUM (4)
259
260 typedef struct {
261         MMPixelFormatType format;              /**< image format */
262         int width;                             /**< width of video buffer */
263         int height;                            /**< height of video buffer */
264         unsigned int timestamp;                /**< timestamp of stream buffer (msec)*/
265         unsigned int length_total;             /**< total length of stream buffer (in byte)*/
266         void *data[BUFFER_MAX_PLANE_NUM];
267         void *bo[BUFFER_MAX_PLANE_NUM];        /**< TBM buffer object */
268         void *internal_buffer;                 /**< Internal buffer pointer */
269         int stride[BUFFER_MAX_PLANE_NUM];      /**< stride of plane */
270         int elevation[BUFFER_MAX_PLANE_NUM];   /**< elevation of plane */
271         int orientation;                       /**< orientation */
272         int bo_size;                           /**< TBM buffer object size */
273 } MMPlayerVideoStreamDataType;
274
275 /**
276  * Enumerations of player state.
277  */
278 typedef enum {
279         MM_PLAYER_STATE_NULL,                           /**< Player is created, but not realized yet */
280         MM_PLAYER_STATE_READY,                          /**< Player is ready to play media */
281         MM_PLAYER_STATE_PLAYING,                        /**< Player is now playing media */
282         MM_PLAYER_STATE_PAUSED,                         /**< Player is paused while playing media */
283         MM_PLAYER_STATE_NONE,                           /**< Player is not created yet */
284         MM_PLAYER_STATE_NUM,                            /**< Number of player states */
285 } MMPlayerStateType;
286
287 /**
288  * Enumerations of position formats.
289  */
290 typedef enum {
291         MM_PLAYER_POS_FORMAT_TIME,                      /**< Format for time based */
292         MM_PLAYER_POS_FORMAT_PERCENT,                   /**< Format for percentage */
293         MM_PLAYER_POS_FORMAT_NUM,                       /**< Number of position formats */
294 } MMPlayerPosFormatType;
295
296 /**
297  * Enumeration for attribute values types.
298  */
299 typedef enum {
300         MM_PLAYER_ATTRS_TYPE_INVALID = -1,        /**< Type is invalid */
301         MM_PLAYER_ATTRS_TYPE_INT,                 /**< Integer type */
302         MM_PLAYER_ATTRS_TYPE_DOUBLE,              /**< Double type */
303         MM_PLAYER_ATTRS_TYPE_STRING,              /**< UTF-8 String type */
304         MM_PLAYER_ATTRS_TYPE_DATA,                /**< Pointer type */
305         MM_PLAYER_ATTRS_TYPE_ARRAY,               /**< Array type */
306         MM_PLAYER_ATTRS_TYPE_RANGE,               /**< Range type */
307         MM_PLAYER_ATTRS_TYPE_NUM,                 /**< Number of attribute type */
308 } MMPlayerAttrsType;
309
310 /**
311  * Enumeration for attribute validation type.
312  */
313 typedef enum {
314         MM_PLAYER_ATTRS_VALID_TYPE_INVALID = -1,                /**< Invalid validation type */
315         MM_PLAYER_ATTRS_VALID_TYPE_NONE,                                /**< Do not check validity */
316         MM_PLAYER_ATTRS_VALID_TYPE_INT_ARRAY,          /**< validity checking type of integer array */
317         MM_PLAYER_ATTRS_VALID_TYPE_INT_RANGE,          /**< validity checking type of integer range */
318         MM_PLAYER_ATTRS_VALID_TYPE_DOUBLE_ARRAY,                /**< validity checking type of double array */
319         MM_PLAYER_ATTRS_VALID_TYPE_DOUBLE_RANGE,       /**< validity checking type of double range */
320 } MMPlayerAttrsValidType;
321
322 /**
323  * Enumeration for attribute access flag.
324  */
325 typedef enum {
326         MM_PLAYER_ATTRS_FLAG_NONE = 0,                                  /**< None flag is set */
327         MM_PLAYER_ATTRS_FLAG_READABLE = 1 << 0,                 /**< Readable */
328         MM_PLAYER_ATTRS_FLAG_WRITABLE = 1 << 1,                 /**< Writable */
329         MM_PLAYER_ATTRS_FLAG_MODIFIED = 1 << 2,                 /**< Modified */
330
331         MM_PLAYER_ATTRS_FLAG_RW = MM_PLAYER_ATTRS_FLAG_READABLE | MM_PLAYER_ATTRS_FLAG_WRITABLE, /**< Readable and Writable */
332 } MMPlayerAttrsFlag;
333
334 /**
335  * Enumeration of track types
336  */
337 typedef enum {
338         MM_PLAYER_TRACK_TYPE_AUDIO = 0,
339         MM_PLAYER_TRACK_TYPE_VIDEO,
340         MM_PLAYER_TRACK_TYPE_TEXT,
341         MM_PLAYER_TRACK_TYPE_MAX
342 } MMPlayerTrackType;
343
344 /**
345  * Enumeration of runtime buffering mode
346  */
347 typedef enum {
348         MM_PLAYER_BUFFERING_MODE_ADAPTIVE = 0,  /**< default, If buffering is occurred, player will consider the bandwidth to adjust buffer setting. */
349         MM_PLAYER_BUFFERING_MODE_FIXED,                 /**< player will set buffer size with this fixed size value. */
350         MM_PLAYER_BUFFERING_MODE_MAX,
351 } MMPlayerBufferingMode;
352
353 /**
354  * Edge Properties of the text.
355  */
356 typedef enum {
357         MM_PLAYER_EDGE_NO,
358         MM_PLAYER_EDGE_RAISED,
359         MM_PLAYER_EDGE_DEPRESSED,
360         MM_PLAYER_EDGE_UNIFORM,
361         MM_PLAYER_EDGE_DROPSHADOW
362 } MMPlayerSubtitleEdge;
363
364 /**
365  * Enumeration of media stream buffer status
366  */
367 typedef enum {
368         MM_PLAYER_MEDIA_STREAM_BUFFER_UNDERRUN,
369         MM_PLAYER_MEDIA_STREAM_BUFFER_OVERFLOW,
370 } MMPlayerMediaStreamBufferStatus;
371
372 /**
373  * Enumeration for stream type.
374  */
375 typedef enum {
376         MM_PLAYER_STREAM_TYPE_DEFAULT,  /**< Container type */
377         MM_PLAYER_STREAM_TYPE_AUDIO,    /**< Audio element stream type */
378         MM_PLAYER_STREAM_TYPE_VIDEO,    /**< Video element stream type */
379         MM_PLAYER_STREAM_TYPE_TEXT,     /**< Text type */
380         MM_PLAYER_STREAM_TYPE_MAX,
381 } MMPlayerStreamType;
382
383 typedef enum {
384         MM_PLAYER_CODEC_TYPE_DEFAULT = 0, /**< codec is selected by the priority */
385         MM_PLAYER_CODEC_TYPE_HW,          /**< HW codec can only be selected */
386         MM_PLAYER_CODEC_TYPE_SW,          /**< SW codec can only be selected */
387 } MMPlayerVideoCodecType;
388
389 /**
390  * Attribute validity structure
391  */
392 typedef struct {
393          MMPlayerAttrsType type;
394          MMPlayerAttrsValidType validity_type;
395          MMPlayerAttrsFlag flag;
396         /**
397           * a union that describes validity of the attribute.
398           * Only when type is 'MM_ATTRS_TYPE_INT' or 'MM_ATTRS_TYPE_DOUBLE',
399           * the attribute can have validity.
400          */
401          union {
402                 /**
403                    * Validity structure for integer array.
404                  */
405                 struct {
406                         int *array;  /**< a pointer of array */
407                         int count;   /**< size of array */
408                         int d_val;
409                 } int_array;
410                 /**
411                    * Validity structure for integer range.
412                  */
413                 struct {
414                         int min;   /**< minimum range */
415                         int max;   /**< maximum range */
416                         int d_val;
417                 } int_range;
418                 /**
419                 * Validity structure for double array.
420                 */
421                 struct {
422                         double *array;  /**< a pointer of array */
423                         int count;   /**< size of array */
424                         double d_val;
425                 } double_array;
426                 /**
427                 * Validity structure for double range.
428                 */
429                 struct {
430                         double min;   /**< minimum range */
431                         double max;   /**< maximum range */
432                         double d_val;
433                 } double_range;
434         };
435 } MMPlayerAttrsInfo;
436
437 /**
438  * Volume type.
439  *
440  * @see         mm_player_set_volume, mm_player_get_volume
441  */
442 typedef struct {
443         float level[MM_VOLUME_CHANNEL_NUM];     /**< Relative volume factor for each channels */
444 } MMPlayerVolumeType;
445
446 /**
447  * Video stream info in external demux case
448  *
449 **/
450 typedef struct _VideoStreamInfo {
451         const char *mime;
452         unsigned int framerate_num;
453         unsigned int framerate_den;
454         unsigned int width;
455         unsigned int height;
456         unsigned char *codec_extradata;
457         unsigned int extradata_size;
458         unsigned int version;
459 } MMPlayerVideoStreamInfo;
460
461 /**
462  * Audio stream info in external demux case
463  *
464 **/
465 typedef struct _AudioStreamInfo {
466         const char *mime;
467         unsigned int channels;
468         unsigned int sample_rate;
469         unsigned char *codec_extradata;
470         unsigned int extradata_size;
471         unsigned int version;
472         unsigned int user_info;
473
474         /* for pcm */
475 //      unsigned int width;
476 //      unsigned int depth;
477 //      unsigned int endianness;
478 //      bool signedness;
479 } MMPlayerAudioStreamInfo;
480
481 /**
482  * Subtitle stream info in external demux case
483  *
484 **/
485 typedef struct _SubtitleStreamInfo {
486         const char *mime;
487         unsigned int codec_tag;
488         void *context;  //for smpte text
489 } MMPlayerSubtitleStreamInfo;
490
491 /**
492  * selected subtitle track number callback function type.
493  *
494  * @param       track_num       [in]    Track number of subtitle
495  * @param       user_param      [in]    User defined parameter
496  *
497  *
498  * @return      This callback function have to return MM_ERROR_NONE.
499  */
500 typedef bool (*mm_player_track_selected_subtitle_language_callback)(int track_num, void *user_param);
501
502 /**
503  * Buffer underrun / overflow data callback function type.
504  *
505  * @param       status     [in] buffer status
506  * @param       user_param [in] User defined parameter which is passed when set
507  *                          to enough data callback or need data callback
508  *
509  * @return      This callback function have to return MM_ERROR_NONE.
510  */
511 typedef bool (*mm_player_media_stream_buffer_status_callback)(MMPlayerStreamType type, MMPlayerMediaStreamBufferStatus status, unsigned long long bytes, void *user_param);
512
513 /**
514  * Buffer seek data callback function type.
515  *
516  * @param       offset     [in] offset for the buffer playback
517  * @param       user_param [in] User defined parameter which is passed when set
518  *                          to seek data callback
519  *
520  * @return      This callback function have to return MM_ERROR_NONE.
521  */
522 typedef bool (*mm_player_media_stream_seek_data_callback)(MMPlayerStreamType type, unsigned long long offset, void *user_param);
523
524 /**
525  * Called to notify the stream changed.
526  *
527  * @param user_data [in] The user data passed from the callback registration function
528  *
529  * @return      This callback function have to return MM_ERROR_NONE.
530  */
531 typedef bool (*mm_player_stream_changed_callback)(void *user_param);
532
533
534 /*===========================================================================================
535 |                                                                                           |
536 |  GLOBAL FUNCTION PROTOTYPES                                        |
537 |                                                                                           |
538 ========================================================================================== */
539
540 /**
541  * This function creates a player object for playing multimedia contents. \n
542  * The attributes of player are created to get/set some values with application. \n
543  * And, mutex, gstreamer and other resources are initialized at this time. \n
544  * If player is created, the state will become MM_PLAYER_STATE_NULL.
545  *
546  * @param   player [out] Handle of player
547  *
548  * @return  This function returns zero on success, or negative value with error code. \n
549  *          Please refer 'mm_error.h' to know it in detail.
550  * @pre     None
551  * @post    MM_PLAYER_STATE_NULL
552  * @see     mm_player_destroy
553  * @remark  You can create multiple handles on a context at the same time. \n
554  *          However, player cannot guarantee proper operation because of limitation of resources, \n
555  *          such as audio device or display device.
556  *
557  * @par Example
558  * @code
559 char *g_err_attr_name = NULL;
560
561 if (mm_player_create(&g_player) != MM_ERROR_NONE) {
562         LOGE("failed to create player\n");
563 }
564
565 if (mm_player_set_attribute(g_player,
566                                                 &g_err_attr_name,
567                                                 "profile_uri", filename, strlen(filename),
568                                                 "display_overlay", (void *)&g_win.xid, sizeof(g_win.xid),
569                                                 NULL) != MM_ERROR_NONE) {
570         LOGE("failed to set %s attribute\n", g_err_attr_name);
571         free(g_err_attr_name);
572 }
573
574 mm_player_set_message_callback(g_player, msg_callback, (void *)g_player);
575  * @endcode
576  */
577 int mm_player_create(MMHandleType *player);
578
579 /**
580  * This function releases player object and all resources which were created by mm_player_create(). \n
581  * And, player handle will also be destroyed.
582  *
583  * @param   player [in] Handle of player
584  *
585  * @return  This function returns zero on success, or negative value with error code.
586  * @pre     Player state may be MM_PLAYER_STATE_NULL. \n
587  *          But, it can be called in any state.
588  * @post    Because handle is released, there is no any state.
589  * @see     mm_player_create
590  * @remark  This method can be called with a valid player handle from any state to \n
591  *          completely shutdown the player operation.
592  *
593  * @par Example
594  * @code
595 if (mm_player_destroy(g_player) != MM_ERROR_NONE) {
596         LOGE("failed to destroy player\n");
597 }
598  * @endcode
599  */
600 int mm_player_destroy(MMHandleType player);
601
602 /**
603  * This function parses uri and makes gstreamer pipeline by uri scheme. \n
604  * So, uri should be set before realizing with mm_player_set_attribute(). \n
605  *
606  * @param   player [in] Handle of player
607  *
608  * @return  This function returns zero on success, or negative value with error code.
609  *
610  * @pre     Player state should be MM_PLAYER_STATE_NULL.
611  * @post    player state will be MM_PLAYER_STATE_READY.
612  * @see     mm_player_unrealize
613  * @remark  None
614  * @par Example
615  * @code
616 if (mm_player_realize(g_player) != MM_ERROR_NONE) {
617         LOGE("failed to realize player\n");
618 }
619  * @endcode
620  */
621 int mm_player_realize(MMHandleType player);
622
623 /**
624  * This function uninitializes player object. So, resources and allocated memory \n
625  * will be freed. And, gstreamer pipeline is also destroyed. So, if you want to play \n
626  * other contents, player should be created again after destruction or realized with new uri.
627  *
628  * @param   player [in] Handle of player
629  *
630  * @return  This function returns zero on success, or negative value with error code.
631  * @pre     Player state may be MM_PLAYER_STATE_READY to unrealize. \n
632  *          But, it can be called in any state.
633  * @post    Player state will be MM_PLAYER_STATE_NULL.
634  * @see     mm_player_realize
635  * @remark  This method can be called with a valid player handle from any state.
636  *
637  * @par Example
638  * @code
639 if (mm_player_unrealize(g_player) != MM_ERROR_NONE) {
640         LOGE("failed to unrealize player\n");
641 }
642  * @endcode
643  */
644 int mm_player_unrealize(MMHandleType player);
645
646 /**
647  * This function is to abort pause state transition
648  * for unrealize or destroy.
649  */
650 int mm_player_abort_pause(MMHandleType player);
651
652 /**
653  * This function is to get current state of player. \n
654  * Application have to check current state before doing some action.
655  *
656  * @param player [in]  Handle of player
657  * @param state  [out] current state of player on success
658  *
659  * @return   This function returns zero on success, or negative value with error code.
660  *
661  * @see      MMPlayerStateType
662  * @remark   None
663  * @par Example
664  * @code
665 if (mm_player_get_state(g_player, &state) != MM_ERROR_NONE) {
666         LOGE("failed to get state\n");
667 }
668  * @endcode
669  */
670 int mm_player_get_state(MMHandleType player, MMPlayerStateType *state);
671
672 /**
673  * This function is to set relative volume of player. \n
674  * So, It controls logical volume value. \n
675  * But, if developer want to change system volume, mm sound api should be used.
676  *
677  * @param       player          [in]    Handle of player
678  * @param       volume          [in]    Volume factor of each channel
679  *
680  * @return      This function returns zero on success, or negative value with error code.
681  * @see         MMPlayerVolumeType, mm_player_get_volume
682  * @remark      The range of factor range is from 0 to 1.0. (1.0 = 100%) And, default value is 1.0.
683  * @par Example
684  * @code
685 MMPlayerVolumeType volume;
686 int i = 0;
687
688 for (i = 0; i < MM_VOLUME_CHANNEL_NUM; i++)
689         volume.level[i] = MM_VOLUME_LEVEL_MAX;
690
691 if (mm_player_set_volume(g_player, &volume) != MM_ERROR_NONE)
692 {
693     LOGE("failed to set volume\n");
694 }
695  * @endcode
696  */
697 int mm_player_set_volume(MMHandleType player, MMPlayerVolumeType *volume);
698
699 /**
700  * This function is to get current volume factor of player.
701  *
702  * @param       player          [in]    Handle of player.
703  * @param       volume          [out]   Volume factor of each channel.
704  *
705  * @return      This function returns zero on success, or negative value with error code.
706  *
707  * @see         MMPlayerVolumeType, mm_player_set_volume
708  * @remark  None
709  * @par Example
710  * @code
711 MMPlayerVolumeType volume;
712 int i;
713
714 if (mm_player_get_volume(g_player, &volume) != MM_ERROR_NONE)
715 {
716         LOGW("failed to get volume\n");
717 }
718
719 for (i = 0; i < MM_VOLUME_CHANNEL_NUM; i++)
720         LOGD("channel[%d] = %d \n", i, volume.level[i]);
721  * @endcode
722  */
723 int mm_player_get_volume(MMHandleType player, MMPlayerVolumeType *volume);
724
725 /**
726  * This function is to start playing media contents. Demux(parser), codec and related plugins are decided \n
727  * at this time. And, MM_MESSAGE_BEGIN_OF_STREAM will be posted through callback function registered \n
728  * by mm_player_set_message_callback().
729  *
730  * @param       player          [in]    Handle of player
731  *
732  * @return      This function returns zero on success, or negative value with error code.
733  * @remark
734  *
735  * @pre         Player state may be MM_PLAYER_STATE_READY.
736  * @post                Player state will be MM_PLAYER_STATE_PLAYING.
737  * @see         mm_player_stop
738  * @remark  None
739  * @par Example
740  * @code
741 if (mm_player_start(g_player) != MM_ERROR_NONE)
742 {
743         LOGE("failed to start player\n");
744 }
745  * @endcode
746  */
747 int mm_player_start(MMHandleType player);
748
749 /**
750  * This function is to stop playing media contents and it's different with pause. \n
751  * If mm_player_start() is called after this, content will be started again from the beginning. \n
752  * So, it can be used to close current playback.
753  *
754  * @param       player          [in]    Handle of player
755  *
756  * @return      This function returns zero on success, or negative value with error code.
757  *
758  * @pre         Player state may be MM_PLAYER_STATE_PLAYING.
759  * @post                Player state will be MM_PLAYER_STATE_READY.
760  * @see         mm_player_start
761  * @remark  None
762  * @par Example
763  * @code
764 if (mm_player_stop(g_player) != MM_ERROR_NONE)
765 {
766         LOGE("failed to stop player\n");
767 }
768  * @endcode
769  */
770 int mm_player_stop(MMHandleType player);
771
772 /**
773  * This function is to pause playing media contents.
774  *
775  * @param       player          [in]    Handle of player.
776  *
777  * @return      This function returns zero on success, or negative value with error code.
778  *
779  * @pre         Player state may be MM_PLAYER_STATE_PLAYING.
780  * @post                Player state will be MM_PLAYER_STATE_PAUSED.
781  * @see         mm_player_resume
782  * @remark  None
783  * @par Example
784  * @code
785 if (mm_player_pause(g_player) != MM_ERROR_NONE)
786 {
787         LOGE("failed to pause player\n");
788 }
789  * @endcode
790  */
791 int mm_player_pause(MMHandleType player);
792
793 /**
794  * This function is to resume paused media contents.
795  *
796  * @param       player          [in]    Handle of player.
797  *
798  * @return      This function returns zero on success, or negative value with error code.
799  *
800  * @pre         Player state may be MM_PLAYER_STATE_PAUSED.
801  * @post                Player state will be MM_PLAYER_STATE_PLAYING.
802  * @see         mm_player_pause
803  * @remark  None
804  * @par Example
805  * @code
806 if (mm_player_resume(g_player) != MM_ERROR_NONE)
807 {
808         LOGE("failed to resume player\n");
809 }
810  * @endcode
811  */
812 int mm_player_resume(MMHandleType player);
813
814 /**
815  * This function is to set the position for playback. \n
816  * So, it can be seeked to requested position. \n
817  *
818  * @param       player          [in]    Handle of player
819  * @param       pos                     [in]    Position for playback
820  *
821  * @return      This function returns zero on success, or negative value with error code.
822  * @see         mm_player_get_position
823  * @remark  the unit of time-based format is millisecond and other case is percent.
824  */
825 int mm_player_set_position(MMHandleType player, int64_t pos);
826
827 /**
828  * This function is to get current position of playback content.
829  *
830  * @param       player          [in]    Handle of player.
831  * @param       format          [in]    Format of position.
832  * @param    pos        [out] contains current position on success or zero in case of failure.
833  *
834  * @return      This function returns zero on success, or negative value with errors
835  * @see         mm_player_set_position
836  * @remark  the unit of time-based format is millisecond and other case is percent.
837  */
838 int mm_player_get_position(MMHandleType player, int64_t *pos);
839
840 /**
841  * This function is to get the content time duration.
842  */
843 int mm_player_get_duration(MMHandleType player, int64_t *dur);
844
845 /**
846  * This function is to get current buffer position of playback content.
847  *
848  * @param   player      [in]    Handle of player.
849  * @param   format      [in]    Format of position.
850  * @param   start_pos   [out] contains buffer start  position on success or zero in case of failure.
851  * @param   stop_pos    [out] contains buffer current  position on success or zero in case of failure.
852  *
853  * @return      This function returns zero on success, or negative value with errors
854  * @see         MMPlayerPosFormatType, mm_player_set_position
855  * @remark  the unit of time-based format is millisecond and other case is percent.
856  * @par Example
857  * @code
858 int start_pos = 0, stop_pos = 0;
859
860 mm_player_get_buffer_position(g_player, &start_pos, &end_pos );
861
862 LOGD("buffer position: [%d] ~ [%d] \%\n", start_pos, end_pos );
863  * @endcode
864  */
865 int mm_player_get_buffer_position(MMHandleType player, int *start_pos, int *end_pos);
866
867 /**
868  * This function sets callback function for receiving messages from player.
869  * So, player can notify warning, error and normal cases to application.
870  *
871  * @param       player          [in]    Handle of player.
872  * @param       callback        [in]    Message callback function.
873  * @param       user_param      [in]    User parameter which is passed to callback function.
874  *
875  * @return      This function returns zero on success, or negative value with error code.
876  * @see         MMMessageCallback
877  * @remark  None
878  * @par Example
879  * @code
880 int msg_callback(int message, MMMessageParamType *param, void *user_param)
881 {
882         switch (message)
883         {
884                 case MM_MESSAGE_ERROR:
885                         //do something
886                         break;
887
888                 case MM_MESSAGE_END_OF_STREAM:
889                         //do something
890                         break;
891
892                 case MM_MESSAGE_STATE_CHANGED:
893                         //do something
894                         break;
895
896                 case MM_MESSAGE_BEGIN_OF_STREAM:
897                         //do something
898                         break;
899
900                 default:
901                         break;
902         }
903         return TRUE;
904 }
905
906 mm_player_set_message_callback(g_player, msg_callback, (void *)g_player);
907  * @endcode
908  */
909 int mm_player_set_message_callback(MMHandleType player, MMMessageCallback callback, void *user_param);
910
911 /**
912  * This function is to mute volume of player
913  *
914  * @param       player  [in]    Handle of player
915  * @param       mute    [in]    Mute(1) or not mute(0)
916  *
917  * @return      This function returns zero on success, or negative value with error code
918  * @see         mm_player_get_mute
919  * @remark  None
920  * @par Example
921  * @code
922 if (mm_player_set_mute(g_player, TRUE) != MM_ERROR_NONE)
923 {
924         LOGW("failed to set mute\n");
925 }
926  * @endcode
927  */
928 int mm_player_set_mute(MMHandleType player, int mute);
929
930 /**
931  * This function is to get mute value of player
932  *
933  * @param       player  [in]    Handle of player
934  * @param       mute    [out]   Sound is muted
935  *
936  * @return      This function returns zero on success, or negative value with error code
937  * @see         mm_player_set_mute
938  * @remark  None
939  * @par Example
940  * @code
941 int mute;
942
943 if (mm_player_get_mute(g_player, &mute) != MM_ERROR_NONE)
944 {
945         LOGW("failed to get mute\n");
946 }
947
948 LOGD("mute status:%d\n", mute);
949  * @endcode
950  */
951 int mm_player_get_mute(MMHandleType player, int *mute);
952
953 /**
954  * This function is to adjust subtitle postion. So, subtitle can show at the adjusted position. \n
955  * If pos is negative, subtitle will be displayed previous time, the other hand forward time. \n
956  *
957  * @param       player  [in]    Handle of player
958  * @param       pos             [in]    postion to be adjusted
959  *
960  * @return      This function returns zero on success, or negative value with error
961  *                      code
962  * @see         mm_player_adjust_subtitle_position
963  * @remark  None
964  * @par Example
965  * @code
966 int pos;
967
968 pos = 5000;
969 if (mm_player_adjust_subtitle_position(g_player, MM_PLAYER_POS_FORMAT_TIME, pos) != MM_ERROR_NONE)
970 {
971         LOGW("failed to adjust subtitle postion.\n");
972 }
973  * @endcode
974  */
975
976 int mm_player_adjust_subtitle_position(MMHandleType player, MMPlayerPosFormatType format, int pos);
977
978 /**
979  * This function is to set subtitle silent status. So, subtitle can show or hide during playback \n
980  * by this value. But, one subtitle file should be set with "subtitle_uri" attribute before calling mm_player_realize(); \n
981  * Player FW parses subtitle file and send text data including timestamp to application \n
982  * through message callback with MM_MESSAGE_UPDATE_SUBTITLE will be. \n
983  * So, application have to render it. And, subtitle can be supported only in a seprate file. \n
984  * So, it's not supported for embedded case.
985  *
986  * @param       player  [in]    Handle of player
987  * @param       silent  [in]    silent(integer value except 0) or not silent(0)
988  *
989  * @return      This function returns zero on success, or negative value with error
990  *                      code
991  * @see         mm_player_get_subtitle_silent, MM_MESSAGE_UPDATE_SUBTITLE
992  * @remark  None
993  * @par Example
994  * @code
995 mm_player_set_attribute(g_player,
996                                         &g_err_name,
997                                         "subtitle_uri", g_subtitle_uri, strlen(g_subtitle_uri),
998                                         NULL
999                                         );
1000
1001 if (mm_player_set_subtitle_silent(g_player, TRUE) != MM_ERROR_NONE)
1002 {
1003         LOGW("failed to set subtitle silent\n");
1004 }
1005  * @endcode
1006  */
1007 int mm_player_set_subtitle_silent(MMHandleType player, int silent);
1008
1009 /**
1010  * This function is to get silent status of subtitle.
1011  *
1012  * @param       player  [in]    Handle of player
1013  * @param       silent  [out]   subtitle silent property
1014  *
1015  * @return      This function returns zero on success, or negative value with error
1016  *                      code
1017  * @see         mm_player_set_subtitle_silent, MM_MESSAGE_UPDATE_SUBTITLE
1018  * @remark  None
1019  * @par Example
1020  * @code
1021 int silent = FALSE;
1022
1023 if (mm_player_get_subtitle_silent(g_player, &silent) != MM_ERROR_NONE)
1024 {
1025         LOGW("failed to set subtitle silent\n");
1026 }
1027  * @endcode
1028  */
1029 int mm_player_get_subtitle_silent(MMHandleType player, int *silent);
1030
1031 /**
1032  * This function is to set attributes into player. Multiple attributes can be set simultaneously. \n
1033  * If one of attribute fails, this function will stop at the point and let you know the name which is failed. \n
1034  *
1035  * @param   player                 [in]   Handle of player.
1036  * @param   err_attr_name          [out]  Name of attribute which is failed to set
1037  * @param   first_attribute_name   [in]   Name of the first attribute to set
1038  * @param   ...                    [in]   Value for the first attribute, followed optionally by more name/value pairs, terminated by NULL.
1039  *                                        But, in the case of data or string type, it should be name/value/size.
1040  *
1041  * @return  This function returns zero on success, or negative value with error code.
1042  *
1043  * @see     mm_player_get_attribute
1044  * @remark  This function must be terminated by NULL argument.
1045  *          And, if this function is failed, err_attr_name param must be free.
1046  * @par Example
1047  * @code
1048 char *g_err_attr_name = NULL;
1049
1050 if (mm_player_set_attribute(g_player,
1051                                                 &g_err_attr_name,
1052                                                 "profile_uri", filename, strlen(filename),
1053                                                 "profile_play_count", count,
1054                                                 NULL) != MM_ERROR_NONE) {
1055         LOGW("failed to set %s attribute\n", g_err_attr_name);
1056         free(g_err_attr_name);
1057 }
1058
1059  * @endcode
1060  */
1061 int mm_player_set_attribute(MMHandleType player,  char **err_attr_name, const char *first_attribute_name, ...)G_GNUC_NULL_TERMINATED;
1062
1063 /**
1064  * This function is to get attributes from player. Multiple attributes can be got simultaneously.
1065  *
1066  * @param   player                [in]  Handle of player.
1067  * @param   err_attr_name         [out] Name of attribute which is failed to get
1068  * @param   first_attribute_name  [in]  Name of the first attribute to get
1069  * @param   ...                   [out] Value for the first attribute, followed optionally by more name/value pairs, terminated by NULL.
1070  *                                      But, in the case of data or string type, it should be name/value/size.
1071  *
1072  * @return  This function returns zero on success, or negative value with error
1073  *          code.
1074  * @see     mm_player_set_attribute
1075  * @remark  This function must be terminated by NULL argument.
1076  *          And, if this function is failed, err_attr_name param must be free.
1077  */
1078 int mm_player_get_attribute(MMHandleType player,  char **err_attr_name, const char *first_attribute_name, ...)G_GNUC_NULL_TERMINATED;
1079
1080 /**
1081  * This function is to get detail information of attribute.
1082  *
1083  * @param   player          [in]  Handle of player.
1084  * @param   attribute_name  [in]  Name of the attribute to get
1085  * @param   info            [out] Attribute infomation
1086  *
1087  * @return  This function returns zero on success, or negative value with error
1088  *          code.
1089  *
1090  * @see     mm_player_set_attribute, mm_player_get_attribute
1091  * @remark  None
1092  * @par Example
1093  * @code
1094 if (mm_player_get_attribute_info(g_player, "display_method", &method_info) != MM_ERROR_NONE) {
1095         LOGW("failed to get info\n");
1096 }
1097
1098 LOGD("type:%d \n", method_info.type); //int, double..
1099 LOGD("flag:%d \n", method_info.flag); //readable, writable..
1100 LOGD("validity type:%d \n", method_info.validity_type); //range, array..
1101
1102 if (method_info. validity_type == MM_PLAYER_ATTRS_VALID_TYPE_INT_RANGE) {
1103         LOGD("range min:%d\n", method_info.int_range.min);
1104         LOGD("range max:%d\n", method_info.int_range.max);
1105 }
1106  * @endcode
1107  */
1108 int mm_player_get_attribute_info(MMHandleType player,  const char *attribute_name, MMPlayerAttrsInfo *info);
1109
1110 /**
1111  * This function is to get the track count
1112  *
1113  * @param   player [in]  handle of player.
1114  * @param   track  [in]  type of the track type
1115  * @param   info   [out] the count of the track
1116  *
1117  * @return  This function returns zero on success, or negative value with error
1118  *          code.
1119  *
1120  * @par Example
1121  * @code
1122 gint audio_count = 0;
1123
1124 if (mm_player_get_track_count(g_player, MM_PLAYER_TRACK_TYPE_AUDIO, &audio_count) != MM_ERROR_NONE) {
1125         LOGW("failed to get audio track count\n");
1126 }
1127
1128 LOGD("audio track count : %d \n", audio_count);
1129  * @endcode
1130  */
1131 int mm_player_get_track_count(MMHandleType player,  MMPlayerTrackType type, int *count);
1132
1133 /**
1134  * This function is to select the track
1135  *
1136  * @param   player [in] handle of player.
1137  * @param   type   [in] type of the track type
1138  * @param   index  [in] the index of the track
1139  *
1140  * @return  This function returns zero on success, or negative value with error
1141  *          code.
1142  */
1143 int mm_player_select_track(MMHandleType player, MMPlayerTrackType type, int index);
1144
1145 /**
1146  * This function is to get the track language
1147  *
1148  * @param   player [in]  handle of player.
1149  * @param   type   [in]  type of the track type
1150  * @param   index  [in]  the index of the track
1151  * @param   code   [out] language code in ISO 639-1(string)
1152  *
1153  * @return  This function returns zero on success, or negative value with error
1154  *          code.
1155  */
1156 int mm_player_get_track_language_code(MMHandleType player,  MMPlayerTrackType type, int index, char **code);
1157
1158 /**
1159  * This function is to get the current running track
1160  *
1161  * @param       player          [in]    handle of player.
1162  * @param       type                    [in]    type of the track type
1163  * @param       index           [out]    the index of the track
1164  *
1165  * @return      This function returns zero on success, or negative value with error
1166  *                      code.
1167  */
1168
1169 int mm_player_get_current_track(MMHandleType hplayer, MMPlayerTrackType type, int *index);
1170
1171 /**
1172  * This function is to set the subtitle path
1173  *
1174  * @param       player  [in]    handle of player
1175  * @param       path    [in]    subtitle path
1176  *
1177  * @return      This function returns zero on success, or negative value with error code.
1178  */
1179 int mm_player_set_external_subtitle_path(MMHandleType player, const char *path);
1180
1181 /**
1182  * This function is to set uri.
1183  *
1184  * @param   player [in] handle of player
1185  * @param   uri    [in] uri
1186  * @return  This function returns zero on success, or negative value with error code.
1187  */
1188 int mm_player_set_uri(MMHandleType player, const char *uri);
1189
1190 /**
1191  * This function is to set next uri.
1192  *
1193  * @param   player [in] handle of player
1194  * @param   uri    [in] uri
1195  * @return  This function returns zero on success, or negative value with error code.
1196  */
1197 int mm_player_set_next_uri(MMHandleType player, const char *uri);
1198
1199 /**
1200  * This function is to get next uri.
1201  *
1202  * @param   player   [in]  handle of player
1203  * @param   uri      [out] uri
1204  * @return  This function returns zero on success, or negative value with error code.
1205  */
1206 int mm_player_get_next_uri(MMHandleType player, char **uri);
1207
1208 /**
1209  * This function is to decrease reference count of internal buffer.
1210  *
1211  * @param    buffer [in] video callback internal buffer
1212  * @return   None;
1213  */
1214 void mm_player_video_stream_internal_buffer_unref(void *buffer);
1215
1216 /**mm_player_submit_packet
1217  * This function is to submit buffer to appsrc.  \n
1218  * @param   player                      [in]    Handle of player.
1219  * @param   buf             [in]    buffer to be submit in appsrc in external feeder case.
1220  * @param   len                         [in]    length of buffer.
1221  * @param   pts                         [in]    timestamp of buffer.
1222  * @param   streamtype          [in]    stream type of buffer.
1223  * @return  This function returns zero on success, or negative value with error code.
1224  */
1225 int mm_player_submit_packet(MMHandleType player, media_packet_h packet);
1226
1227 /**mm_player_set_video_info
1228  * This function is to set caps of src pad of video appsrc in external feeder case.  \n
1229  * @param   player         [in] Handle of player.
1230  * @param   media_format_h [in] Video stream info.
1231  * @return  This function returns zero on success, or negative value with error code.
1232  */
1233 int mm_player_set_video_info(MMHandleType player, media_format_h format);
1234
1235 /**mm_player_set_audio_info
1236  * This function is to set caps of src pad of Audio appsrc in external feeder case.  \n
1237  * @param       player                       [in]    Handle of player.
1238  * @param       media_format_h               [in]    Audio stream info.
1239  * @return      This function returns zero on success, or negative value with error code.
1240  */
1241 int mm_player_set_audio_info(MMHandleType player, media_format_h format);
1242
1243 /**mm_player_set_subtitle_info
1244  * This function is to set caps of src pad of subtitle appsrc in external feeder case.  \n
1245  * @param       player                          [in]    Handle of player.
1246  * @param       subtitle_stream_info               [in]    Subtitle stream info.
1247  * @return      This function returns zero on success, or negative value with error code.
1248  */
1249 int mm_player_set_subtitle_info(MMHandleType player, MMPlayerSubtitleStreamInfo *info);
1250
1251 /**
1252  * This function set callback function for receiving need or enough data message from player.
1253  *
1254  * @param   player     [in] Handle of player.
1255  * @param   type       [in] stream type
1256  * @param   callback   [in] data callback function for stream type.
1257  * @param   user_param [in] User parameter.
1258  *
1259  * @return  This function returns zero on success, or negative value with error
1260  *          code.
1261  */
1262 int mm_player_set_media_stream_buffer_status_callback(MMHandleType player, MMPlayerStreamType type, mm_player_media_stream_buffer_status_callback callback, void *user_param);
1263
1264 /**
1265  * This function set callback function for receiving seek data message from player.
1266  *
1267  * @param       player          [in]    Handle of player.
1268  * @param       type            [in]    stream type
1269  * @param       callback        [in]    Seek data callback function for stream type.
1270  * @param       user_param      [in]    User parameter.
1271  *
1272  * @return      This function returns zero on success, or negative value with error
1273  *                      code.
1274  */
1275 int mm_player_set_media_stream_seek_data_callback(MMHandleType player, MMPlayerStreamType type, mm_player_media_stream_seek_data_callback callback, void *user_param);
1276
1277 /**
1278  * This function is to set max size of buffer(appsrc).
1279  *
1280  * @param       player          [in]    Handle of player.
1281  * @param       type            [in]    stream type
1282  * @param       max_size        [in]    max bytes of buffer.
1283  *
1284  * @return      This function returns zero on success, or negative value with error
1285  *                      code.
1286  */
1287 int mm_player_set_media_stream_buffer_max_size(MMHandleType player, MMPlayerStreamType type, unsigned long long max_size);
1288
1289 /**
1290  * This function is to get max size of buffer(appsrc).
1291  *
1292  * @param       player          [in]    Handle of player.
1293  * @param       type            [in]    stream type
1294  * @param       max_size        [out]   max bytes of buffer.
1295  *
1296  * @return      This function returns zero on success, or negative value with error
1297  *                      code.
1298  */
1299 int mm_player_get_media_stream_buffer_max_size(MMHandleType player, MMPlayerStreamType type, unsigned long long *max_size);
1300
1301 /**
1302  * This function is to set min percent of buffer(appsrc).
1303  *
1304  * @param       player          [in]    Handle of player.
1305  * @param       type            [in]    stream type
1306  * @param       min_percent     [in]    min percent of buffer.
1307  *
1308  * @return      This function returns zero on success, or negative value with error
1309  *                      code.
1310  */
1311 int mm_player_set_media_stream_buffer_min_percent(MMHandleType player, MMPlayerStreamType type, unsigned min_percent);
1312
1313 /**
1314  * This function is to get min percent of buffer(appsrc).
1315  *
1316  * @param       player          [in]    Handle of player.
1317  * @param       type            [in]    stream type
1318  * @param       min_percent     [out]   min percent of buffer.
1319  *
1320  * @return      This function returns zero on success, or negative value with error
1321  *                      code.
1322  */
1323 int mm_player_get_media_stream_buffer_min_percent(MMHandleType player, MMPlayerStreamType type, unsigned int *min_percent);
1324
1325 /**
1326  * This function set callback function for changing audio stream from player. \n
1327  * It's only supported when audio stream is included in file. \n
1328  *
1329  * @param       player   [in] Handle of player.
1330  * @param       callback [in] Audio stream changed callback function.
1331  * @param       user_param [in] User parameter.
1332  *
1333  * @return      This function returns zero on success, or negative value with error
1334  *                      code.
1335  * @see         mm_player_stream_changed_callback
1336  * @since
1337  */
1338 int mm_player_set_audio_stream_changed_callback(MMHandleType player, mm_player_stream_changed_callback callback, void *user_param);
1339
1340 /**
1341  * This function set callback function for changing video stream from player. \n
1342  * It's only supported when video stream is included in file. \n
1343  *
1344  * @param       player   [in] Handle of player.
1345  * @param       callback [in] Video stream changed callback function.
1346  * @param       user_param [in] User parameter.
1347  *
1348  * @return      This function returns zero on success, or negative value with error
1349  *                      code.
1350  * @see         mm_player_stream_changed_callback
1351  */
1352 int mm_player_set_video_stream_changed_callback(MMHandleType player, mm_player_stream_changed_callback callback, void *user_param);
1353
1354 /**
1355  * This function is to get timeout value according to the content type for muse. \n
1356  * It's only supported when video stream is included in file. \n
1357  *
1358  * @param       player  [in] Handle of player.
1359  * @param       timeout [out] timeout value (sec).
1360  *
1361  * @return      This function returns zero on success, or negative value with error
1362  *                      code.
1363  * @since 3.0
1364  */
1365 int mm_player_get_timeout(MMHandleType player, int *timeout);
1366
1367 /**
1368  * This function is to get the number of video output buffers. \n
1369  * It's only supported when video stream is included in file. \n
1370  *
1371  * @param       player  [in] Handle of player.
1372  * @param       num     [out] num of buffers.
1373  * @param       extra_num [out] extra num of buffers.
1374  *
1375  * @return      This function returns zero on success, or negative value with error
1376  *                      code.
1377  * @since 3.0
1378  */
1379 int mm_player_get_num_of_video_out_buffers(MMHandleType player, int *num, int *extra_num);
1380
1381 /**
1382  * This function is to set the dynamic resolution information. \n
1383  * It's only supported when video stream is included in file. \n
1384  *
1385  * @param       player  [in] Handle of player.
1386  * @param       drc     [in] dynamic resolution info of media stream data
1387  *
1388  * @return      This function returns zero on success, or negative value with error
1389  *                      code.
1390  * @since 3.0
1391  */
1392 int mm_player_set_media_stream_dynamic_resolution(MMHandleType player, bool drc);
1393
1394 /**
1395  * This function is to release the video stream bo to reuse. \n
1396  * It's only supported when sw codec is used to decode video stream. \n
1397  *
1398  * @param       player  [in] Handle of player.
1399  * @param       bo     [in] bo address to be released
1400  *
1401  * @return      This function returns zero on success, or negative value with error
1402  *                      code.
1403  * @since 3.0
1404  */
1405 int mm_player_release_video_stream_bo(MMHandleType player, void *bo);
1406
1407 /**
1408  * This function is to set sound stream info
1409  */
1410 int mm_player_set_sound_stream_info(MMHandleType player, char *stream_type, int stream_index);
1411
1412 /**
1413  * This function is to manage the playback according to the external storage state
1414  */
1415 int mm_player_manage_external_storage_state(MMHandleType player, int id, int state);
1416
1417 /**
1418  * These functions are to set/get the max variant of HAS
1419  */
1420 int mm_player_get_adaptive_variant_info(MMHandleType player, int *num, char **var_info);
1421 int mm_player_set_max_adaptive_variant_limit(MMHandleType player, int bandwidth, int width, int height);
1422 int mm_player_get_max_adaptive_variant_limit(MMHandleType player, int *bandwidth, int *width, int *height);
1423
1424 /**
1425  * These functions are to set/get the audio only mode
1426  */
1427 int mm_player_set_audio_only(MMHandleType player, bool audio_only);
1428 int mm_player_get_audio_only(MMHandleType player, bool *audio_only);
1429
1430 /**
1431  * These functions are to get the streaming bufferint time
1432  */
1433 int mm_player_get_streaming_buffering_time(MMHandleType player, int *prebuffer_ms, int *rebuffer_ms);
1434
1435 /**
1436  * These functions are to display the 360 video content
1437  */
1438 int mm_player_360_is_content_spherical(MMHandleType player, bool *is_spherical);
1439 int mm_player_360_set_enabled(MMHandleType player, bool enabled);
1440 int mm_player_360_is_enabled(MMHandleType player, bool *enabled);
1441
1442 int mm_player_360_set_direction_of_view(MMHandleType player, float yaw, float pitch);
1443 int mm_player_360_get_direction_of_view(MMHandleType player, float *yaw, float *pitch);
1444
1445 int mm_player_360_set_zoom(MMHandleType player, float level);
1446 int mm_player_360_get_zoom(MMHandleType player, float *level);
1447
1448 int mm_player_360_set_field_of_view(MMHandleType player, int horizontal_degrees, int vertical_degrees);
1449 int mm_player_360_get_field_of_view(MMHandleType player, int *horizontal_degrees, int *vertical_degrees);
1450
1451 /**
1452  * This function is to set codec type
1453  */
1454 int mm_player_set_codec_type(MMHandleType player, MMPlayerStreamType stream_type, MMPlayerVideoCodecType codec_type);
1455
1456 /**
1457  * These functions are to apply the replaygain
1458  */
1459 int mm_player_set_replaygain_enabled(MMHandleType player, bool enabled);
1460 int mm_player_is_replaygain_enabled(MMHandleType player, bool *enabled);
1461
1462 /**
1463  * This function is to set/get video content ROI area
1464  */
1465 int mm_player_set_video_roi_area(MMHandleType player, double scale_x, double scale_y, double scale_width, double scale_height);
1466 int mm_player_get_video_roi_area(MMHandleType player, double *scale_x, double *scale_y, double *scale_width, double *scale_height);
1467
1468 /**
1469         @}
1470  */
1471
1472 #ifdef __cplusplus
1473         }
1474 #endif
1475
1476 #endif  /* __MM_PLAYER_H__ */