[0.6.64] remove dead code
[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         @addtogroup PLAYER
45         @{
46
47         @par
48         This part describes APIs used for playback of multimedia contents.
49         All multimedia contents are created by a media player through handle of playback.
50         In creating a player, it displays the player's status or information
51         by registering callback function.
52
53         @par
54         In case of streaming playback, network has to be opend by using datanetwork API.
55         If proxy, cookies and the other attributes for streaming playback are needed,
56         set those attributes using mm_player_set_attribute() before create player.
57
58         @par
59         The subtitle for local video playback is supported. Set "subtitle_uri" attribute
60         using mm_player_set_attribute() before the application creates the player.
61         Then the application could receive MMMessageParamType which includes subtitle string and duration.
62
63         @par
64         Player can have 5 states, and each state can be changed by calling
65         described functions on "Figure1. State of Player".
66
67         @par
68         @image html             player_state.jpg        "Figure1. State of Player"      width=12cm
69         @image latex    player_state.jpg        "Figure1. State of Player"      width=12cm
70
71         @par
72         Most of functions which change player state work as synchronous. But, mm_player_start() should be used
73         asynchronously. Both mm_player_pause() and mm_player_resume() should also be used asynchronously
74         in the case of streaming data.
75         So, application have to confirm the result of those APIs through message callback function.
76
77         @par
78         Note that "None" and Null" state could be reached from any state
79         by calling mm_player_destroy() and mm_player_unrealize().
80
81         @par
82         <div><table>
83         <tr>
84         <td><B>FUNCTION</B></td>
85         <td><B>PRE-STATE</B></td>
86         <td><B>POST-STATE</B></td>
87         <td><B>SYNC TYPE</B></td>
88         </tr>
89         <tr>
90         <td>mm_player_create()</td>
91         <td>NONE</td>
92         <td>NULL</td>
93         <td>SYNC</td>
94         </tr>
95         <tr>
96         <td>mm_player_destroy()</td>
97         <td>NULL</td>
98         <td>NONE</td>
99         <td>SYNC</td>
100         </tr>
101         <tr>
102         <td>mm_player_realize()</td>
103         <td>NULL</td>
104         <td>READY</td>
105         <td>SYNC</td>
106         </tr>
107         <tr>
108         <td>mm_player_unrealize()</td>
109         <td>READY</td>
110         <td>NULL</td>
111         <td>SYNC</td>
112         </tr>
113         <tr>
114         <td>mm_player_start()</td>
115         <td>READY</td>
116         <td>PLAYING</td>
117         <td>ASYNC</td>
118         </tr>
119         <tr>
120         <td>mm_player_stop()</td>
121         <td>PLAYING</td>
122         <td>READY</td>
123         <td>SYNC</td>
124         </tr>
125         <tr>
126         <td>mm_player_pause()</td>
127         <td>PLAYING</td>
128         <td>PAUSED</td>
129         <td>ASYNC</td>
130         </tr>
131         <tr>
132         <td>mm_player_resume()</td>
133         <td>PAUSED</td>
134         <td>PLAYING</td>
135         <td>ASYNC</td>
136         </tr>
137         <tr>
138         <td>mm_player_set_message_callback()</td>
139         <td>N/A</td>
140         <td>N/A</td>
141         <td>SYNC</td>
142         </tr>
143         <tr>
144         <td>mm_player_get_state()</td>
145         <td>N/A</td>
146         <td>N/A</td>
147         <td>SYNC</td>
148         </tr>
149         <tr>
150         <td>mm_player_set_volume()</td>
151         <td>N/A</td>
152         <td>N/A</td>
153         <td>SYNC</td>
154         </tr>
155         <tr>
156         <td>mm_player_get_volume()</td>
157         <td>N/A</td>
158         <td>N/A</td>
159         <td>SYNC</td>
160         </tr>
161         <tr>
162         <td>mm_player_set_position()</td>
163         <td>N/A</td>
164         <td>N/A</td>
165         <td>SYNC</td>
166         </tr>
167         <tr>
168         <td>mm_player_get_position()</td>
169         <td>N/A</td>
170         <td>N/A</td>
171         <td>SYNC</td>
172         </tr>
173         <tr>
174         <td>mm_player_get_attribute()</td>
175         <td>N/A</td>
176         <td>N/A</td>
177         <td>SYNC</td>
178         </tr>
179         <tr>
180         <td>mm_player_set_attribute()</td>
181         <td>N/A</td>
182         <td>N/A</td>
183         <td>SYNC</td>
184         </tr>
185         </table></div>
186
187         @par
188         Following are the attributes supported in player which may be set after initialization. \n
189         Those are handled as a string.
190
191         @par
192         <div><table>
193         <tr>
194         <td>PROPERTY</td>
195         <td>TYPE</td>
196         <td>VALID TYPE</td>
197         </tr>
198         <tr>
199         <td>"profile_uri"</td>
200         <td>string</td>
201         <td>N/A</td>
202         </tr>
203         <tr>
204         <td>"content_duration"</td>
205         <td>int</td>
206         <td>range</td>
207         </tr>
208         <tr>
209         <td>"content_video_width"</td>
210         <td>int</td>
211         <td>range</td>
212         </tr>
213         <tr>
214         <td>"content_video_height"</td>
215         <td>int</td>
216         <td>range</td>
217         </tr>
218         <tr>
219         <td>"display_evas_do_scaling"</td>
220         <td>int</td>
221         <td>range</td>
222         </tr>
223         <tr>
224         <td>"display_evas_surface_sink"</td>
225         <td>string</td>
226         <td>N/A</td>
227         </tr>
228         <tr>
229         <td>"profile_user_param"</td>
230         <td>data</td>
231         <td>N/A</td>
232         </tr>
233         <tr>
234         <td>"profile_play_count"</td>
235         <td>int</td>
236         <td>range</td>
237         </tr>
238         <tr>
239         <td>"streaming_type"</td>
240         <td>int</td>
241         <td>range</td>
242         </tr>
243         <tr>
244         <td>"streaming_udp_timeout"</td>
245         <td>int</td>
246         <td>range</td>
247         </tr>
248         <tr>
249         <td>"streaming_user_agent"</td>
250         <td>string</td>
251         <td>N/A</td>
252         </tr>
253         <tr>
254         <td>"streaming_wap_profile"</td>
255         <td>string</td>
256         <td>N/A</td>
257         </tr>
258         <tr>
259         <td>"streaming_network_bandwidth"</td>
260         <td>int</td>
261         <td>range</td>
262         </tr>
263         <tr>
264         <td>"streaming_cookie"</td>
265         <td>string</td>
266         <td>N/A</td>
267         </tr>
268         <tr>
269         <td>"streaming_proxy_ip"</td>
270         <td>string</td>
271         <td>N/A</td>
272         </tr>
273         <tr>
274         <td>"streaming_proxy_port"</td>
275         <td>int</td>
276         <td>range</td>
277         </tr>
278         <tr>
279         <td>"streaming_timeout"</td>
280         <td>int</td>
281         <td>range</td>
282         </tr>
283         <tr>
284         <td>"display_overlay"</td>
285         <td>data</td>
286         <td>N/A</td>
287         </tr>
288         <tr>
289         <td>"display_rotation"</td>
290         <td>int</td>
291         <td>range</td>
292         </tr>
293         <tr>
294         <td>"subtitle_uri"</td>
295         <td>string</td>
296         <td>N/A</td>
297         </tr>
298         </table></div>
299
300         @par
301         Following attributes are supported for playing stream data. Those value can be readable only and valid after starting playback.\n
302         Please use mm_fileinfo for local playback.
303
304         @par
305         <div><table>
306         <tr>
307         <td>PROPERTY</td>
308         <td>TYPE</td>
309         <td>VALID TYPE</td>
310         </tr>
311         <tr>
312         <td>"content_video_found"</td>
313         <td>string</td>
314         <td>N/A</td>
315         </tr>
316         <tr>
317         <td>"content_video_codec"</td>
318         <td>string</td>
319         <td>N/A</td>
320         </tr>
321         <tr>
322         <td>"content_video_track_num"</td>
323         <td>int</td>
324         <td>range</td>
325         </tr>
326         <tr>
327         <td>"content_audio_found"</td>
328         <td>string</td>
329         <td>N/A</td>
330         </tr>
331         <tr>
332         <td>"content_audio_codec"</td>
333         <td>string</td>
334         <td>N/A</td>
335         </tr>
336         <tr>
337         <td>"content_audio_bitrate"</td>
338         <td>int</td>
339         <td>array</td>
340         </tr>
341         <tr>
342         <td>"content_audio_channels"</td>
343         <td>int</td>
344         <td>range</td>
345         </tr>
346         <tr>
347         <td>"content_audio_samplerate"</td>
348         <td>int</td>
349         <td>array</td>
350         </tr>
351         <tr>
352         <td>"content_audio_track_num"</td>
353         <td>int</td>
354         <td>range</td>
355         </tr>
356         <tr>
357         <td>"content_text_track_num"</td>
358         <td>int</td>
359         <td>range</td>
360         </tr>
361         <tr>
362         <td>"tag_artist"</td>
363         <td>string</td>
364         <td>N/A</td>
365         </tr>
366         <tr>
367         <td>"tag_title"</td>
368         <td>string</td>
369         <td>N/A</td>
370         </tr>
371         <tr>
372         <td>"tag_album"</td>
373         <td>string</td>
374         <td>N/A</td>
375         </tr>
376         <tr>
377         <td>"tag_genre"</td>
378         <td>string</td>
379         <td>N/A</td>
380         </tr>
381         <tr>
382         <td>"tag_author"</td>
383         <td>string</td>
384         <td>N/A</td>
385         </tr>
386         <tr>
387         <td>"tag_copyright"</td>
388         <td>string</td>
389         <td>N/A</td>
390         </tr>
391         <tr>
392         <td>"tag_date"</td>
393         <td>string</td>
394         <td>N/A</td>
395         </tr>
396         <tr>
397         <td>"tag_description"</td>
398         <td>string</td>
399         <td>N/A</td>
400         </tr>
401         <tr>
402         <td>"tag_track_num"</td>
403         <td>int</td>
404         <td>range</td>
405         </tr>
406         </table></div>
407
408  */
409
410
411 /*===========================================================================================
412 |                                                                                           |
413 |  GLOBAL DEFINITIONS AND DECLARATIONS                                        |
414 |                                                                                           |
415 ========================================================================================== */
416
417 /**
418  * MM_PLAYER_URI:
419  *
420  * uri to play (string)
421  *
422  */
423 #define MM_PLAYER_CONTENT_URI                                   "profile_uri"
424 /**
425  * MM_PLAYER_CONTENT_DURATION:
426  *
427  * get the duration (int) as millisecond, It's guaranteed after calling mm_player_start() or
428  * receiving MM_MESSAGE_BEGIN_OF_STREAM.
429  *
430  */
431 #define MM_PLAYER_CONTENT_DURATION                      "content_duration"
432 /**
433  * MM_PLAYER_VIDEO_ROTATION
434  *
435  * can change video angle (int)
436  * @see MMDisplayRotationType
437  */
438 #define MM_PLAYER_VIDEO_ROTATION                                "display_rotation"
439 /**
440  * MM_PLAYER_VIDEO_WIDTH:
441  *
442  * get the video width (int), It's guaranteed after calling mm_player_start() or
443  * receiving MM_MESSAGE_BEGIN_OF_STREAM.
444  *
445  */
446 #define MM_PLAYER_VIDEO_WIDTH                           "content_video_width"
447 /**
448  * MM_PLAYER_VIDEO_HEIGHT:
449  *
450  * get the video height (int), It's guaranteed after calling mm_player_start() or
451  * receiving MM_MESSAGE_BEGIN_OF_STREAM.
452  *
453  */
454 #define MM_PLAYER_VIDEO_HEIGHT                          "content_video_height"
455 /**
456  * MM_PLAYER_VIDEO_EVAS_SURFACE_DO_SCALING:
457  *
458  * set whether or not to scale frames size for evas surface.
459  * if TRUE, it scales down width, height size of frames with given size.
460  * if FALSE, it does not scale down any frames.
461  *
462  */
463 #define MM_PLAYER_VIDEO_EVAS_SURFACE_DO_SCALING         "display_evas_do_scaling"
464 /**
465  * MM_PLAYER_VIDEO_EVAS_SURFACE_SINK:
466  *
467  * get the video evas surface sink plugin name (string), It's guaranteed after calling mm_player_create()
468  *
469  */
470 #define MM_PLAYER_VIDEO_EVAS_SURFACE_SINK               "display_evas_surface_sink"
471 /**
472  * MM_PLAYER_MEM_SRC:
473  *
474  * set memory pointer to play (data)
475  *
476  */
477 #define MM_PLAYER_MEMORY_SRC                                    "profile_user_param"
478 /**
479  * MM_PLAYER_PLAYBACK_COUNT
480  *
481  * can set playback count (int), Default value is 1 and -1 is for infinity playing until releasing it.
482  *
483  */
484 #define MM_PLAYER_PLAYBACK_COUNT                                "profile_play_count"
485 /**
486  * MM_PLAYER_SUBTITLE_URI
487  *
488  * set the subtitle path (string)
489  */
490 #define MM_PLAYER_SUBTITLE_URI                                  "subtitle_uri"
491 /**
492  * MM_PLAYER_STREAMING_TYPE
493  *
494  * set the streaming type (int)
495  * @see MMStreamingType
496  */
497 #define MM_PLAYER_STREAMING_TYPE                                "streaming_type"
498 /**
499  * MM_PLAYER_STREAMING_UDP_TIMEOUT
500  *
501  * set the streaming udp timeout(int)
502  */
503 #define MM_PLAYER_STREAMING_UDP_TIMEOUT         "streaming_udp_timeout"
504 /**
505  * MM_PLAYER_STREAMING_USER_AGENT
506  *
507  * set the streaming user agent (string)
508  */
509 #define MM_PLAYER_STREAMING_USER_AGENT          "streaming_user_agent"
510 /**
511  * MM_PLAYER_STREAMING_WAP_PROFILE
512  *
513  * set the streaming wap profile (int)
514  */
515 #define MM_PLAYER_STREAMING_WAP_PROFILE         "streaming_wap_profile"
516 /**
517  * MM_PLAYER_STREAMING_NET_BANDWIDTH
518  *
519  * set the streaming network bandwidth (int)
520  */
521 #define MM_PLAYER_STREAMING_NET_BANDWIDTH       "streaming_network_bandwidth"
522 /**
523  * MM_PLAYER_STREAMING_COOKIE
524  *
525  * set the streaming cookie (int)
526  */
527 #define MM_PLAYER_STREAMING_COOKIE                      "streaming_cookie"
528 /**
529  * MM_PLAYER_STREAMING_PROXY_IP
530  *
531  * set the streaming proxy ip (string)
532  */
533 #define MM_PLAYER_STREAMING_PROXY_IP                    "streaming_proxy_ip"
534 /**
535  * MM_PLAYER_STREAMING_PROXY_PORT
536  *
537  * set the streaming proxy port (int)
538  */
539 #define MM_PLAYER_STREAMING_PROXY_PORT          "streaming_proxy_port"
540 /**
541  * MM_PLAYER_STREAMING_TIMEOUT
542  *
543  * set the streaming timeout (int)
544  */
545 #define MM_PLAYER_STREAMING_TIMEOUT                     "streaming_timeout"
546 /**
547  * MM_PLAYER_VIDEO_CODEC
548  *
549  * codec the video data is stored in (string)
550  */
551 #define MM_PLAYER_VIDEO_CODEC                           "content_video_codec"
552 /**
553  * MM_PLAYER_VIDEO_TRACK_NUM
554  *
555  * track number inside a collection  (int)
556  */
557 #define MM_PLAYER_VIDEO_TRACK_NUM                       "content_video_track_num"
558 /**
559  * MM_PLAYER_AUDIO_CODEC
560  *
561  * codec the audio data is stored in (string)
562  */
563 #define MM_PLAYER_AUDIO_CODEC                           "content_audio_codec"
564 /**
565  * MM_PLAYER_AUDIO_BITRATE
566  *
567  * set the streaming proxy port (int)
568  */
569 #define MM_PLAYER_AUDIO_BITRATE                         "content_audio_bitrate"
570 /**
571  * MM_PLAYER_AUDIO_CHANNEL
572  *
573  * the number of audio channel (int)
574  */
575 #define MM_PLAYER_AUDIO_CHANNEL                         "content_audio_channels"
576 /**
577  * MM_PLAYER_AUDIO_SAMPLERATE
578  *
579  * audio samplerate  (int)
580  */
581 #define MM_PLAYER_AUDIO_SAMPLERATE                      "content_audio_samplerate"
582 /**
583  * MM_PLAYER_AUDIO_TRACK_NUM
584  *
585  * track number inside a collection (int)
586  */
587 #define MM_PLAYER_AUDIO_TRACK_NUM                       "content_audio_track_num"
588 /**
589  * MM_PLAYER_TEXT_TRACK_NUM
590  *
591  * track number inside a collection (int)
592  */
593 #define MM_PLAYER_TEXT_TRACK_NUM                        "content_text_track_num"
594 /**
595  * MM_PLAYER_TAG_ARTIST
596  *
597  * person(s) responsible for the recording (string)
598  */
599 #define MM_PLAYER_TAG_ARTIST                                    "tag_artist"
600 /**
601  * MM_PLAYER_TAG_ARTIST
602  *
603  * title (string)
604  */
605 #define MM_PLAYER_TAG_TITLE                                     "tag_title"
606 /**
607  * MM_PLAYER_TAG_ARTIST
608  *
609  * album containing this data (string)
610  */
611 #define MM_PLAYER_TAG_ALBUM                                     "tag_album"
612 /**
613  * MM_PLAYER_TAG_ARTIST
614  *
615  * genre this data belongs to (string)
616  */
617 #define MM_PLAYER_TAG_GENRE                                     "tag_genre"
618 /**
619  * MM_PLAYER_TAG_ARTIST
620  *
621  * author (string)
622  */
623 #define MM_PLAYER_TAG_AUTHOUR                           "tag_author"
624 /**
625  * MM_PLAYER_TAG_ARTIST
626  *
627  * copyright notice of the data (string)
628  */
629 #define MM_PLAYER_TAG_COPYRIGHT                         "tag_copyright"
630 /**
631  * MM_PLAYER_TAG_ARTIST
632  *
633  * date the data was created (string)
634  */
635 #define MM_PLAYER_TAG_DATE                                      "tag_date"
636 /**
637  * MM_PLAYER_TAG_ARTIST
638  *
639  * short text describing the content of the data (string)
640  */
641 #define MM_PLAYER_TAG_DESCRIPRION                               "tag_description"
642 /**
643  * MM_PLAYER_TAG_ARTIST
644  *
645  * track number inside a collection (int)
646  */
647 #define MM_PLAYER_TAG_TRACK_NUM                         "tag_track_num"
648 /**
649  * MM_PLAYER_PD_MODE
650  *
651  * progressive download mode (int)
652  */
653 #define MM_PLAYER_PD_MODE                                               "pd_mode"
654
655 /**
656  * MM_PLAYER_DRC_MODE
657  *
658  * dynamic resolution change mode (int)
659  */
660 #define MM_PLAYER_DRC_MODE                                              "drc_mode"
661
662 /**
663  * MM_PLAYER_GAPLESS_MODE
664  *
665  * gapless playback mode (int)
666  */
667 #define MM_PLAYER_GAPLESS_MODE                                  "gapless_mode"
668
669 /**
670  * MM_PLAYER_ENABLE_VIDEO_DECODED_CB
671  *
672  * enable video decoded callback (int)
673  */
674 #define MM_PLAYER_ENABLE_VIDEO_DECODED_CB               "enable_video_decoded_cb"
675
676 #define BUFFER_MAX_PLANE_NUM (4)
677
678 typedef struct {
679         MMPixelFormatType format;                       /**< image format */
680         int width;                                              /**< width of video buffer */
681         int height;                                             /**< height of video buffer */
682         unsigned int timestamp;                         /**< timestamp of stream buffer (msec)*/
683         unsigned int length_total;                      /**< total length of stream buffer (in byte)*/
684         void *data[BUFFER_MAX_PLANE_NUM];
685         void *bo[BUFFER_MAX_PLANE_NUM];  /**< TBM buffer object */
686         void *internal_buffer;                          /**< Internal buffer pointer */
687         int stride[BUFFER_MAX_PLANE_NUM];               /**< stride of plane */
688         int elevation[BUFFER_MAX_PLANE_NUM];    /**< elevation of plane */
689 }MMPlayerVideoStreamDataType;
690
691 /**
692  * Enumerations of player state.
693  */
694 typedef enum {
695         MM_PLAYER_STATE_NULL,                           /**< Player is created, but not realized yet */
696         MM_PLAYER_STATE_READY,                          /**< Player is ready to play media */
697         MM_PLAYER_STATE_PLAYING,                        /**< Player is now playing media */
698         MM_PLAYER_STATE_PAUSED,                         /**< Player is paused while playing media */
699         MM_PLAYER_STATE_NONE,                           /**< Player is not created yet */
700         MM_PLAYER_STATE_NUM,                            /**< Number of player states */
701 } MMPlayerStateType;
702
703 /**
704  * Enumerations of position formats.
705  * Used while invoking mm_player_get_position/mm_player_set_position APIs
706  */
707 typedef enum {
708         MM_PLAYER_POS_FORMAT_TIME,                      /**< Format for time based */
709         MM_PLAYER_POS_FORMAT_PERCENT,                   /**< Format for percentage */
710         MM_PLAYER_POS_FORMAT_NUM,                       /**< Number of position formats */
711 } MMPlayerPosFormatType;
712
713 /**
714  * Enumeration for attribute values types.
715  */
716 typedef enum {
717  MM_PLAYER_ATTRS_TYPE_INVALID = -1,        /**< Type is invalid */
718  MM_PLAYER_ATTRS_TYPE_INT,                 /**< Integer type */
719  MM_PLAYER_ATTRS_TYPE_DOUBLE,              /**< Double type */
720  MM_PLAYER_ATTRS_TYPE_STRING,              /**< UTF-8 String type */
721  MM_PLAYER_ATTRS_TYPE_DATA,                /**< Pointer type */
722  MM_PLAYER_ATTRS_TYPE_ARRAY,               /**< Array type */
723  MM_PLAYER_ATTRS_TYPE_RANGE,               /**< Range type */
724  MM_PLAYER_ATTRS_TYPE_NUM,                 /**< Number of attribute type */
725 } MMPlayerAttrsType;
726
727 /**
728  * Enumeration for attribute validation type.
729  */
730 typedef enum {
731  MM_PLAYER_ATTRS_VALID_TYPE_INVALID = -1,               /**< Invalid validation type */
732  MM_PLAYER_ATTRS_VALID_TYPE_NONE,                               /**< Do not check validity */
733  MM_PLAYER_ATTRS_VALID_TYPE_INT_ARRAY,          /**< validity checking type of integer array */
734  MM_PLAYER_ATTRS_VALID_TYPE_INT_RANGE,          /**< validity checking type of integer range */
735  MM_PLAYER_ATTRS_VALID_TYPE_DOUBLE_ARRAY,               /**< validity checking type of double array */
736  MM_PLAYER_ATTRS_VALID_TYPE_DOUBLE_RANGE,       /**< validity checking type of double range */
737 } MMPlayerAttrsValidType;
738
739 /**
740  * Enumeration for attribute access flag.
741  */
742 typedef enum {
743  MM_PLAYER_ATTRS_FLAG_NONE = 0,                                 /**< None flag is set */
744  MM_PLAYER_ATTRS_FLAG_READABLE = 1 << 0,                        /**< Readable */
745  MM_PLAYER_ATTRS_FLAG_WRITABLE = 1 << 1,                        /**< Writable */
746  MM_PLAYER_ATTRS_FLAG_MODIFIED = 1 << 2,                        /**< Modified */
747
748  MM_PLAYER_ATTRS_FLAG_RW = MM_PLAYER_ATTRS_FLAG_READABLE | MM_PLAYER_ATTRS_FLAG_WRITABLE, /**< Readable and Writable */
749 } MMPlayerAttrsFlag;
750
751 /**
752  * Enumeration for progressive download
753  */
754 typedef enum {
755         MM_PLAYER_PD_MODE_NONE,
756         MM_PLAYER_PD_MODE_URI,
757         MM_PLAYER_PD_MODE_FILE  // not tested yet, because of no fixed scenario
758 }MMPlayerPDMode;
759
760 /**
761  * Enumeration of track types
762  */
763 typedef enum {
764         MM_PLAYER_TRACK_TYPE_AUDIO = 0,
765         MM_PLAYER_TRACK_TYPE_VIDEO,
766         MM_PLAYER_TRACK_TYPE_TEXT,
767         MM_PLAYER_TRACK_TYPE_MAX
768 }MMPlayerTrackType;
769
770 /**
771  * Enumeration of runtime buffering mode
772  */
773 typedef enum {
774         MM_PLAYER_BUFFERING_MODE_ADAPTIVE = 0,  /**< default, If buffering is occurred, player will consider the bandwidth to adjust buffer setting. */
775         MM_PLAYER_BUFFERING_MODE_FIXED,                 /**< player will set buffer size with this fixed size value. */
776         MM_PLAYER_BUFFERING_MODE_MAX,
777 }MMPlayerBufferingMode;
778
779 typedef enum
780 {
781         MM_PLAYER_FOCUS_CHANGED_COMPLETED = 0,
782         MM_PLAYER_FOCUS_CHANGED_BY_MEDIA,
783         MM_PLAYER_FOCUS_CHANGED_BY_CALL,
784         MM_PLAYER_FOCUS_CHANGED_BY_EARJACK_UNPLUG,
785         MM_PLAYER_FOCUS_CHANGED_BY_RESOURCE_CONFLICT,
786         MM_PLAYER_FOCUS_CHANGED_BY_ALARM,
787         MM_PLAYER_FOCUS_CHANGED_BY_EMERGENCY,
788         MM_PLAYER_FOCUS_CHANGED_BY_NOTIFICATION,
789         MM_PLAYER_FOCUS_CHANGED_BY_UNKNOWN,
790 } MMPlayerFocusChangedMsg;
791
792
793 /**
794  * Edge Properties of the text.
795  */
796 typedef enum {
797         MM_PLAYER_EDGE_NO,
798         MM_PLAYER_EDGE_RAISED,
799         MM_PLAYER_EDGE_DEPRESSED,
800         MM_PLAYER_EDGE_UNIFORM,
801         MM_PLAYER_EDGE_DROPSHADOW
802 } MMPlayerSubtitleEdge;
803
804 /**
805  * Enumeration of media stream buffer status
806  */
807 typedef enum
808 {
809         MM_PLAYER_MEDIA_STREAM_BUFFER_UNDERRUN,
810         MM_PLAYER_MEDIA_STREAM_BUFFER_OVERFLOW,
811 } MMPlayerMediaStreamBufferStatus;
812
813 /**
814  * Enumeration for stream type.
815  */
816 typedef enum
817 {
818         MM_PLAYER_STREAM_TYPE_DEFAULT,  /**< Container type */
819         MM_PLAYER_STREAM_TYPE_AUDIO,    /**< Audio element stream type */
820         MM_PLAYER_STREAM_TYPE_VIDEO,    /**< Video element stream type */
821         MM_PLAYER_STREAM_TYPE_TEXT,     /**< Text type */
822         MM_PLAYER_STREAM_TYPE_MAX,
823 } MMPlayerStreamType;
824
825 /**
826  * Attribute validity structure
827  */
828 typedef struct {
829          MMPlayerAttrsType type;
830          MMPlayerAttrsValidType validity_type;
831          MMPlayerAttrsFlag flag;
832         /**
833           * a union that describes validity of the attribute.
834           * Only when type is 'MM_ATTRS_TYPE_INT' or 'MM_ATTRS_TYPE_DOUBLE',
835           * the attribute can have validity.
836          */
837          union {
838                 /**
839                    * Validity structure for integer array.
840                  */
841                 struct {
842                         int *array;  /**< a pointer of array */
843                         int count;   /**< size of array */
844                         int d_val;
845                 } int_array;
846                 /**
847                    * Validity structure for integer range.
848                  */
849                 struct {
850                         int min;   /**< minimum range */
851                         int max;   /**< maximum range */
852                         int d_val;
853                 } int_range;
854                 /**
855                 * Validity structure for double array.
856                 */
857                 struct {
858                         double   * array;  /**< a pointer of array */
859                         int    count;   /**< size of array */
860                         double d_val;
861                 } double_array;
862                 /**
863                 * Validity structure for double range.
864                 */
865                 struct {
866                         double   min;   /**< minimum range */
867                         double   max;   /**< maximum range */
868                         double d_val;
869                 } double_range;
870         };
871 } MMPlayerAttrsInfo;
872
873 /**
874  * Volume type.
875  *
876  * @see         mm_player_set_volume, mm_player_get_volume
877  */
878 typedef struct {
879         float   level[MM_VOLUME_CHANNEL_NUM];   /**< Relative volume factor for each channels */
880 } MMPlayerVolumeType;
881
882 /**
883  * Video stream info in external demux case
884  *
885 **/
886 typedef struct _VideoStreamInfo
887 {
888         const char *mime;
889         unsigned int framerate_num;
890         unsigned int framerate_den;
891         unsigned int width;
892         unsigned int height;
893         unsigned char *codec_extradata;
894         unsigned int extradata_size;
895         unsigned int version;
896 }MMPlayerVideoStreamInfo;
897
898 /**
899  * Audio stream info in external demux case
900  *
901 **/
902 typedef struct _AudioStreamInfo
903 {
904         const char *mime;
905         unsigned int channels;
906         unsigned int sample_rate;
907         unsigned char *codec_extradata;
908         unsigned int extradata_size;
909         unsigned int version;
910         unsigned int user_info;
911
912         /* for pcm */
913 //      unsigned int width;
914 //      unsigned int depth;
915 //      unsigned int endianness;
916 //      bool signedness;
917 }MMPlayerAudioStreamInfo;
918
919 /**
920  * Subtitle stream info in external demux case
921  *
922 **/
923 typedef struct _SubtitleStreamInfo
924 {
925         const char *mime;
926         unsigned int codec_tag;
927         void *context;  //for smpte text
928 }MMPlayerSubtitleStreamInfo;
929
930 /**
931  * Audio stream callback function type.
932  *
933  * @param       stream          [in]    Reference pointer to audio frame data
934  * @param       stream_size     [in]    Size of audio frame data
935  * @param       user_param      [in]    User defined parameter which is passed when set
936  *                                                              audio stream callback
937  *
938  * @return      This callback function have to return MM_ERROR_NONE.
939  */
940 typedef bool    (*mm_player_audio_stream_callback) (void *stream, int stream_size, void *user_param);
941
942
943 /**
944  * selected subtitle track number callback function type.
945  *
946  * @param       track_num       [in]    Track number of subtitle
947  * @param       user_param      [in]    User defined parameter
948  *
949  *
950  * @return      This callback function have to return MM_ERROR_NONE.
951  */
952 typedef bool            (*mm_player_track_selected_subtitle_language_callback)(int track_num, void *user_param);
953
954 /**
955  * Buffer underrun / overflow data callback function type.
956  *
957  * @param       status     [in] buffer status
958  * @param       user_param [in] User defined parameter which is passed when set
959  *                              to enough data callback or need data callback
960  *
961  * @return      This callback function have to return MM_ERROR_NONE.
962  */
963 typedef bool    (*mm_player_media_stream_buffer_status_callback) (MMPlayerStreamType type, MMPlayerMediaStreamBufferStatus status, unsigned long long bytes, void *user_param);
964
965 /**
966  * Buffer seek data callback function type.
967  *
968  * @param       offset     [in] offset for the buffer playback
969  * @param       user_param [in] User defined parameter which is passed when set
970  *                              to seek data callback
971  *
972  * @return      This callback function have to return MM_ERROR_NONE.
973  */
974 typedef bool    (*mm_player_media_stream_seek_data_callback) (MMPlayerStreamType type, unsigned long long offset, void *user_param);
975
976 /**
977  * Called to notify the stream changed.
978  *
979  * @param user_data [in] The user data passed from the callback registration function
980  *
981  * @return      This callback function have to return MM_ERROR_NONE.
982  */
983 typedef bool    (*mm_player_stream_changed_callback) (void *user_param);
984
985
986 /*===========================================================================================
987 |                                                                                           |
988 |  GLOBAL FUNCTION PROTOTYPES                                        |
989 |                                                                                           |
990 ========================================================================================== */
991
992 /**
993  * This function creates a player object for playing multimedia contents. \n
994  * The attributes of player are created to get/set some values with application. \n
995  * And, mutex, gstreamer and other resources are initialized at this time. \n
996  * If player is created, the state will become MM_PLAYER_STATE_NULL.
997  *
998  * @param       player          [out]   Handle of player
999  *
1000  * @return      This function returns zero on success, or negative value with error code. \n
1001  *                      Please refer 'mm_error.h' to know it in detail.
1002  * @pre         None
1003  * @post        MM_PLAYER_STATE_NULL
1004  * @see         mm_player_destroy
1005  * @remark      You can create multiple handles on a context at the same time. \n
1006  *                      However, player cannot guarantee proper operation because of limitation of resources, \n
1007  *                      such as audio device or display device.
1008  *
1009  * @par Example
1010  * @code
1011 char *g_err_attr_name = NULL;
1012
1013 if (mm_player_create(&g_player) != MM_ERROR_NONE)
1014 {
1015         LOGE("failed to create player\n");
1016 }
1017
1018 if (mm_player_set_attribute(g_player,
1019                                                 &g_err_attr_name,
1020                                                 "profile_uri", filename, strlen(filename),
1021                                                 "display_overlay", (void*)&g_win.xid, sizeof(g_win.xid),
1022                                                 NULL) != MM_ERROR_NONE)
1023 {
1024         LOGE("failed to set %s attribute\n", g_err_attr_name);
1025         free(g_err_attr_name);
1026 }
1027
1028 mm_player_set_message_callback(g_player, msg_callback, (void*)g_player);
1029  * @endcode
1030  */
1031 int mm_player_create(MMHandleType *player);
1032
1033 /**
1034  * This function releases player object and all resources which were created by mm_player_create(). \n
1035  * And, player handle will also be destroyed.
1036  *
1037  * @param       player          [in]    Handle of player
1038  *
1039  * @return      This function returns zero on success, or negative value with error code.
1040  * @pre         Player state may be MM_PLAYER_STATE_NULL. \n
1041  *                      But, it can be called in any state.
1042  * @post                Because handle is released, there is no any state.
1043  * @see         mm_player_create
1044  * @remark      This method can be called with a valid player handle from any state to \n
1045  *                      completely shutdown the player operation.
1046  *
1047  * @par Example
1048  * @code
1049 if (mm_player_destroy(g_player) != MM_ERROR_NONE)
1050 {
1051         LOGE("failed to destroy player\n");
1052 }
1053  * @endcode
1054  */
1055 int mm_player_destroy(MMHandleType player);
1056
1057 /**
1058  * This function register the sound focus using application PID \n
1059  * So, application PID should be set before realizing with mm_player_set_attribute(). \n
1060  *
1061  * @param       player          [in]    Handle of player
1062  * @param       pid                     [in]    application PID
1063  *
1064  * @return      This function returns zero on success, or negative value with error code.
1065  *
1066  * @pre         Player state should be MM_PLAYER_STATE_NULL.
1067  * @remark      None
1068  */
1069 int mm_player_sound_register(MMHandleType player, int pid);
1070
1071 /**
1072  * This function get the application PID that is registered \n
1073  * So, application PID should be set before realizing with mm_player_set_attribute(). \n
1074  *
1075  * @param       player          [in]    Handle of player
1076  * @param       pid                     [out]   application PID
1077  *
1078  * @return      This function returns zero on success, or negative value with error code.
1079  *
1080  * @pre         Player state should be MM_PLAYER_STATE_NULL.
1081  * @remark      None
1082  */
1083 int mm_player_get_client_pid (MMHandleType player, int* pid);
1084
1085 /**
1086  * This function parses uri and makes gstreamer pipeline by uri scheme. \n
1087  * So, uri should be set before realizing with mm_player_set_attribute(). \n
1088  *
1089  * @param       player          [in]    Handle of player
1090  *
1091  * @return      This function returns zero on success, or negative value with error code.
1092  *
1093  * @pre         Player state should be MM_PLAYER_STATE_NULL.
1094  * @post                Player state will be MM_PLAYER_STATE_READY.
1095  * @see         mm_player_unrealize
1096  * @remark      None
1097  * @par Example
1098  * @code
1099 if (mm_player_realize(g_player) != MM_ERROR_NONE)
1100 {
1101         LOGE("failed to realize player\n");
1102 }
1103  * @endcode
1104  */
1105 int mm_player_realize(MMHandleType player) ;
1106
1107 /**
1108  * This function uninitializes player object. So, resources and allocated memory \n
1109  * will be freed. And, gstreamer pipeline is also destroyed. So, if you want to play \n
1110  * other contents, player should be created again after destruction or realized with new uri.
1111  *
1112  * @param       player          [in]    Handle of player
1113  *
1114  * @return      This function returns zero on success, or negative value with error code.
1115  * @pre         Player state may be MM_PLAYER_STATE_READY to unrealize. \n
1116  *                      But, it can be called in any state.
1117  * @post                Player state will be MM_PLAYER_STATE_NULL.
1118  * @see         mm_player_realize
1119  * @remark      This method can be called with a valid player handle from any state.
1120  *
1121  * @par Example
1122  * @code
1123 if (mm_player_unrealize(g_player) != MM_ERROR_NONE)
1124 {
1125         LOGE("failed to unrealize player\n");
1126 }
1127  * @endcode
1128  */
1129 int mm_player_unrealize(MMHandleType player);
1130
1131 /**
1132  * This function is to get current state of player. \n
1133  * Application have to check current state before doing some action.
1134  *
1135  * @param       player          [in]    Handle of player
1136  * @param       state       [out] current state of player on success
1137  *
1138  * @return      This function returns zero on success, or negative value with error code.
1139  *
1140  * @see         MMPlayerStateType
1141  * @remark      None
1142  * @par Example
1143  * @code
1144 if (mm_player_get_state(g_player, &state) != MM_ERROR_NONE)
1145 {
1146         LOGE("failed to get state\n");
1147 }
1148  * @endcode
1149  */
1150 int mm_player_get_state(MMHandleType player, MMPlayerStateType *state);
1151
1152 /**
1153  * This function is to set relative volume of player. \n
1154  * So, It controls logical volume value. \n
1155  * But, if developer want to change system volume, mm sound api should be used.
1156  *
1157  * @param       player          [in]    Handle of player
1158  * @param       volume          [in]    Volume factor of each channel
1159  *
1160  * @return      This function returns zero on success, or negative value with error code.
1161  * @see         MMPlayerVolumeType, mm_player_get_volume
1162  * @remark      The range of factor range is from 0 to 1.0. (1.0 = 100%) And, default value is 1.0.
1163  * @par Example
1164  * @code
1165 MMPlayerVolumeType volume;
1166 int i = 0;
1167
1168 for (i = 0; i < MM_VOLUME_CHANNEL_NUM; i++)
1169         volume.level[i] = MM_VOLUME_LEVEL_MAX;
1170
1171 if (mm_player_set_volume(g_player, &volume) != MM_ERROR_NONE)
1172 {
1173     LOGE("failed to set volume\n");
1174 }
1175  * @endcode
1176  */
1177 int mm_player_set_volume(MMHandleType player, MMPlayerVolumeType *volume);
1178
1179 /**
1180  * This function is to get current volume factor of player.
1181  *
1182  * @param       player          [in]    Handle of player.
1183  * @param       volume          [out]   Volume factor of each channel.
1184  *
1185  * @return      This function returns zero on success, or negative value with error code.
1186  *
1187  * @see         MMPlayerVolumeType, mm_player_set_volume
1188  * @remark      None
1189  * @par Example
1190  * @code
1191 MMPlayerVolumeType volume;
1192 int i;
1193
1194 if (mm_player_get_volume(g_player, &volume) != MM_ERROR_NONE)
1195 {
1196         LOGW("failed to get volume\n");
1197 }
1198
1199 for (i = 0; i < MM_VOLUME_CHANNEL_NUM; i++)
1200         LOGD("channel[%d] = %d \n", i, volume.level[i]);
1201  * @endcode
1202  */
1203 int mm_player_get_volume(MMHandleType player, MMPlayerVolumeType *volume);
1204
1205 /**
1206  * This function is to start playing media contents. Demux(parser), codec and related plugins are decided \n
1207  * at this time. And, MM_MESSAGE_BEGIN_OF_STREAM will be posted through callback function registered \n
1208  * by mm_player_set_message_callback().
1209  *
1210  * @param       player          [in]    Handle of player
1211  *
1212  * @return      This function returns zero on success, or negative value with error code.
1213  * @remark
1214  *
1215  * @pre         Player state may be MM_PLAYER_STATE_READY.
1216  * @post                Player state will be MM_PLAYER_STATE_PLAYING.
1217  * @see         mm_player_stop
1218  * @remark      None
1219  * @par Example
1220  * @code
1221 if (mm_player_start(g_player) != MM_ERROR_NONE)
1222 {
1223         LOGE("failed to start player\n");
1224 }
1225  * @endcode
1226  */
1227 int mm_player_start(MMHandleType player);
1228
1229 /**
1230  * This function is to stop playing media contents and it's different with pause. \n
1231  * If mm_player_start() is called after this, content will be started again from the beginning. \n
1232  * So, it can be used to close current playback.
1233  *
1234  * @param       player          [in]    Handle of player
1235  *
1236  * @return      This function returns zero on success, or negative value with error code.
1237  *
1238  * @pre         Player state may be MM_PLAYER_STATE_PLAYING.
1239  * @post                Player state will be MM_PLAYER_STATE_READY.
1240  * @see         mm_player_start
1241  * @remark      None
1242  * @par Example
1243  * @code
1244 if (mm_player_stop(g_player) != MM_ERROR_NONE)
1245 {
1246         LOGE("failed to stop player\n");
1247 }
1248  * @endcode
1249  */
1250 int mm_player_stop(MMHandleType player);
1251
1252 /**
1253  * This function is to pause playing media contents.
1254  *
1255  * @param       player          [in]    Handle of player.
1256  *
1257  * @return      This function returns zero on success, or negative value with error code.
1258  *
1259  * @pre         Player state may be MM_PLAYER_STATE_PLAYING.
1260  * @post                Player state will be MM_PLAYER_STATE_PAUSED.
1261  * @see         mm_player_resume
1262  * @remark      None
1263  * @par Example
1264  * @code
1265 if (mm_player_pause(g_player) != MM_ERROR_NONE)
1266 {
1267         LOGE("failed to pause player\n");
1268 }
1269  * @endcode
1270  */
1271 int mm_player_pause(MMHandleType player);
1272
1273 /**
1274  * This function is to resume paused media contents.
1275  *
1276  * @param       player          [in]    Handle of player.
1277  *
1278  * @return      This function returns zero on success, or negative value with error code.
1279  *
1280  * @pre         Player state may be MM_PLAYER_STATE_PAUSED.
1281  * @post                Player state will be MM_PLAYER_STATE_PLAYING.
1282  * @see         mm_player_pause
1283  * @remark      None
1284  * @par Example
1285  * @code
1286 if (mm_player_resume(g_player) != MM_ERROR_NONE)
1287 {
1288         LOGE("failed to resume player\n");
1289 }
1290  * @endcode
1291  */
1292 int mm_player_resume(MMHandleType player);
1293
1294 /**
1295  * This function is to set the position for playback. \n
1296  * So, it can be seeked to requested position. \n
1297  *
1298  * @param       player          [in]    Handle of player
1299  * @param       format          [in]    Format of position.
1300  * @param       pos                     [in]    Position for playback
1301  *
1302  * @return      This function returns zero on success, or negative value with error code.
1303  * @see         MMPlayerPosFormatType, mm_player_get_position
1304  * @remark  the unit of time-based format is millisecond and other case is percent.
1305  * @par Example
1306  * @code
1307 int position = 1000; //1sec
1308
1309 if (mm_player_set_position(g_player, MM_PLAYER_POS_FORMAT_TIME, position) != MM_ERROR_NONE)
1310 {
1311         LOGE("failed to set position\n");
1312 }
1313  * @endcode
1314  */
1315 int mm_player_set_position(MMHandleType player, MMPlayerPosFormatType format, int pos);
1316
1317 /**
1318  * This function is to get current position of playback content.
1319  *
1320  * @param       player          [in]    Handle of player.
1321  * @param       format          [in]    Format of position.
1322  * @param    pos        [out] contains current position on success or zero in case of failure.
1323  *
1324  * @return      This function returns zero on success, or negative value with errors
1325  * @see         MMPlayerPosFormatType, mm_player_set_position
1326  * @remark      the unit of time-based format is millisecond and other case is percent.
1327  * @par Example
1328  * @code
1329 int position = 0;
1330 int duration = 0;
1331
1332 mm_player_get_position(g_player, MM_PLAYER_POS_FORMAT_TIME, &position);
1333
1334 mm_player_get_attribute(g_player, &g_err_name, "content_duration", &duration, NULL);
1335
1336 LOGD("pos: [%d/%d] msec\n", position, duration);
1337  * @endcode
1338  */
1339 int mm_player_get_position(MMHandleType player, MMPlayerPosFormatType format, unsigned long *pos);
1340
1341 /**
1342  * This function is to get current buffer position of playback content.
1343  *
1344  * @param       player          [in]    Handle of player.
1345  * @param       format          [in]    Format of position.
1346  * @param       start_pos               [out] contains buffer start  position on success or zero in case of failure.
1347  * @param       stop_pos        [out] contains buffer current  position on success or zero in case of failure.
1348  *
1349  * @return      This function returns zero on success, or negative value with errors
1350  * @see         MMPlayerPosFormatType, mm_player_set_position
1351  * @remark      the unit of time-based format is millisecond and other case is percent.
1352  * @par Example
1353  * @code
1354 int start_pos = 0, stop_pos = 0;
1355
1356 mm_player_get_buffer_position(g_player, MM_PLAYER_POS_FORMAT_PERCENT, &start_pos, &stop_pos );
1357
1358 LOGD("buffer position: [%d] ~ [%d] \%\n", start_pos, stop_pos );
1359  * @endcode
1360  */
1361 int mm_player_get_buffer_position(MMHandleType player, MMPlayerPosFormatType format, unsigned long *start_pos, unsigned long *stop_pos);
1362
1363 /**
1364  * This function is to activate the section repeat. If it's set, selected section will be played \n
1365  * continually before deactivating it by mm_player_deactivate_section_repeat(). \n
1366  * The unit for setting is millisecond.
1367  *
1368  * @param       player          [in]    Handle of player.
1369  * @param       start_pos               [in]    start position.
1370  * @param       end_pos                 [in]    end position.
1371  *
1372  * @return      This function returns zero on success, or negative value with error code.
1373  * @see         mm_player_deactivate_section_repeat
1374  * @remark      None
1375  * @par Example
1376  * @code
1377 int position;
1378 int endtime = 4000; //msec
1379
1380 mm_player_get_position(g_player, MM_PLAYER_POS_FORMAT_TIME, &position);
1381
1382 mm_player_activate_section_repeat(g_player, position, position+endtime);
1383  * @endcode
1384  */
1385 int mm_player_activate_section_repeat(MMHandleType player, int start_pos, int end_pos);
1386
1387 /**
1388  * This function is to deactivate the section repeat.
1389  *
1390  * @param       player          [in]    Handle of player.
1391  *
1392  * @return      This function returns zero on success, or negative value with error code.
1393  * @see         mm_player_activate_section_repeat
1394  * @remark      None
1395  * @par Example
1396  * @code
1397 if ( mm_player_deactivate_section_repeat(g_player) != MM_ERROR_NONE)
1398 {
1399         LOGW("failed to deactivate section repeat\n");
1400 }
1401  * @endcode
1402  */
1403 int mm_player_deactivate_section_repeat(MMHandleType player);
1404
1405 /**
1406  * This function sets callback function for receiving messages from player.
1407  * So, player can notify warning, error and normal cases to application.
1408  *
1409  * @param       player          [in]    Handle of player.
1410  * @param       callback        [in]    Message callback function.
1411  * @param       user_param      [in]    User parameter which is passed to callback function.
1412  *
1413  * @return      This function returns zero on success, or negative value with error code.
1414  * @see         MMMessageCallback
1415  * @remark      None
1416  * @par Example
1417  * @code
1418 int msg_callback(int message, MMMessageParamType *param, void *user_param)
1419 {
1420         switch (message)
1421         {
1422                 case MM_MESSAGE_ERROR:
1423                         //do something
1424                         break;
1425
1426                 case MM_MESSAGE_END_OF_STREAM:
1427                         //do something
1428                         break;
1429
1430                 case MM_MESSAGE_STATE_CHANGED:
1431                         //do something
1432                         break;
1433
1434                 case MM_MESSAGE_BEGIN_OF_STREAM:
1435                         //do something
1436                         break;
1437
1438                 default:
1439                         break;
1440         }
1441         return TRUE;
1442 }
1443
1444 mm_player_set_message_callback(g_player, msg_callback, (void*)g_player);
1445  * @endcode
1446  */
1447 int mm_player_set_message_callback(MMHandleType player, MMMessageCallback callback, void *user_param);
1448
1449 /**
1450  * This function set callback function for receiving audio stream from player. \n
1451  * So, application can get raw audio data and modify it. \n
1452  * But, if callback don't return or holds it for long time, performance can be deteriorated. \n
1453  * It's only supported when audio stream is included in file. \n
1454  * So, if there is video stream or DRM content, it can't be used.
1455  *
1456  * @param       player          [in]    Handle of player.
1457  * @param       callback                [in]    Audio stream callback function.
1458  * @param       user_param      [in]    User parameter.
1459  *
1460  * @return      This function returns zero on success, or negative value with error
1461  *                      code.
1462  * @see         mm_player_audio_stream_callback
1463  * @remark      It can be used for audio playback only.
1464  * @par Example
1465  * @code
1466 bool audio_callback(void *stream, int stream_size, void *user_param)
1467 {
1468         LOGD("audio stream callback\n");
1469         return TRUE;
1470 }
1471 mm_player_set_audio_stream_callback(g_player, audio_callback, NULL);
1472  * @endcode
1473  */
1474  int mm_player_set_audio_stream_callback(MMHandleType player, mm_player_audio_stream_callback callback, void *user_param);
1475
1476 /**
1477  * This function is to mute volume of player
1478  *
1479  * @param       player  [in]    Handle of player
1480  * @param       mute    [in]    Mute(1) or not mute(0)
1481  *
1482  * @return      This function returns zero on success, or negative value with error code
1483  * @see         mm_player_get_mute
1484  * @remark      None
1485  * @par Example
1486  * @code
1487 if (mm_player_set_mute(g_player, TRUE) != MM_ERROR_NONE)
1488 {
1489         LOGW("failed to set mute\n");
1490 }
1491  * @endcode
1492  */
1493 int mm_player_set_mute(MMHandleType player, int mute);
1494
1495 /**
1496  * This function is to get mute value of player
1497  *
1498  * @param       player  [in]    Handle of player
1499  * @param       mute    [out]   Sound is muted
1500  *
1501  * @return      This function returns zero on success, or negative value with error code
1502  * @see         mm_player_set_mute
1503  * @remark      None
1504  * @par Example
1505  * @code
1506 int mute;
1507
1508 if (mm_player_get_mute(g_player, &mute) != MM_ERROR_NONE)
1509 {
1510         LOGW("failed to get mute\n");
1511 }
1512
1513 LOGD("mute status:%d\n", mute);
1514  * @endcode
1515  */
1516 int mm_player_get_mute(MMHandleType player, int *mute);
1517
1518 /**
1519  * This function is to adjust subtitle postion. So, subtitle can show at the adjusted position. \n
1520  * If pos is negative, subtitle will be displayed previous time, the other hand forward time. \n
1521  *
1522  * @param       player  [in]    Handle of player
1523  * @param       pos             [in]    postion to be adjusted
1524  *
1525  * @return      This function returns zero on success, or negative value with error
1526  *                      code
1527  * @see         mm_player_adjust_subtitle_position
1528  * @remark      None
1529  * @par Example
1530  * @code
1531 int pos;
1532
1533 pos = 5000;
1534 if (mm_player_adjust_subtitle_position(g_player, MM_PLAYER_POS_FORMAT_TIME, pos) != MM_ERROR_NONE)
1535 {
1536         LOGW("failed to adjust subtitle postion.\n");
1537 }
1538  * @endcode
1539  */
1540
1541 int mm_player_adjust_subtitle_position(MMHandleType player, MMPlayerPosFormatType format, int pos);
1542
1543 /**
1544  * This function is to set the offset in timestamps of video so as to bring the a/v sync
1545  * @param      player          Handle of player
1546  * @param      offset          offset to be set in milliseconds(can be positive or negative both)
1547  * postive offset to make video lag
1548  * negative offset to make video lead
1549  */
1550 int mm_player_adjust_video_position(MMHandleType player,int offset);
1551 /**
1552  * This function is to set subtitle silent status. So, subtitle can show or hide during playback \n
1553  * by this value. But, one subtitle file should be set with "subtitle_uri" attribute before calling mm_player_realize(); \n
1554  * Player FW parses subtitle file and send text data including timestamp to application \n
1555  * through message callback with MM_MESSAGE_UPDATE_SUBTITLE will be. \n
1556  * So, application have to render it. And, subtitle can be supported only in a seprate file. \n
1557  * So, it's not supported for embedded case.
1558  *
1559  * @param       player  [in]    Handle of player
1560  * @param       silent  [in]    silent(integer value except 0) or not silent(0)
1561  *
1562  * @return      This function returns zero on success, or negative value with error
1563  *                      code
1564  * @see         mm_player_get_subtitle_silent, MM_MESSAGE_UPDATE_SUBTITLE
1565  * @remark      None
1566  * @par Example
1567  * @code
1568 mm_player_set_attribute(g_player,
1569                                         &g_err_name,
1570                                         "subtitle_uri", g_subtitle_uri, strlen(g_subtitle_uri),
1571                                         NULL
1572                                         );
1573
1574 if (mm_player_set_subtitle_silent(g_player, TRUE) != MM_ERROR_NONE)
1575 {
1576         LOGW("failed to set subtitle silent\n");
1577 }
1578  * @endcode
1579  */
1580 int mm_player_set_subtitle_silent(MMHandleType player, int silent);
1581
1582 /**
1583  * This function is to get silent status of subtitle.
1584  *
1585  * @param       player  [in]    Handle of player
1586  * @param       silent  [out]   subtitle silent property
1587  *
1588  * @return      This function returns zero on success, or negative value with error
1589  *                      code
1590  * @see         mm_player_set_subtitle_silent, MM_MESSAGE_UPDATE_SUBTITLE
1591  * @remark      None
1592  * @par Example
1593  * @code
1594 int silent = FALSE;
1595
1596 if (mm_player_get_subtitle_silent(g_player, &silent) != MM_ERROR_NONE)
1597 {
1598         LOGW("failed to set subtitle silent\n");
1599 }
1600  * @endcode
1601  */
1602 int mm_player_get_subtitle_silent(MMHandleType player, int *silent);
1603
1604 /**
1605  * This function is to set attributes into player. Multiple attributes can be set simultaneously. \n
1606  * If one of attribute fails, this function will stop at the point and let you know the name which is failed. \n
1607  *
1608  * @param       player                          [in]    Handle of player.
1609  * @param       err_attr_name                   [out]  Name of attribute which is failed to set
1610  * @param       first_attribute_name    [in]    Name of the first attribute to set
1611  * @param   ...                                 [in]    Value for the first attribute, followed optionally by more name/value pairs, terminated by NULL.
1612  *                                                                       But, in the case of data or string type, it should be name/value/size.
1613  *
1614  * @return      This function returns zero on success, or negative value with error code.
1615  *
1616  * @see         mm_player_get_attribute
1617  * @remark      This function must be terminated by NULL argument.
1618  *                      And, if this function is failed, err_attr_name param must be free.
1619  * @par Example
1620  * @code
1621 char *g_err_attr_name = NULL;
1622
1623 if (mm_player_set_attribute(g_player,
1624                                                 &g_err_attr_name,
1625                                                 "profile_uri", filename, strlen(filename),
1626                                                 "profile_play_count", count,
1627                                                 NULL) != MM_ERROR_NONE)
1628 {
1629         LOGW("failed to set %s attribute\n", g_err_attr_name);
1630         free(g_err_attr_name);
1631 }
1632
1633  * @endcode
1634  */
1635 int mm_player_set_attribute(MMHandleType player,  char **err_attr_name, const char *first_attribute_name, ...)G_GNUC_NULL_TERMINATED;
1636
1637 /**
1638  * This function is to get attributes from player. Multiple attributes can be got simultaneously.
1639  *
1640  * @param       player                          [in]    Handle of player.
1641  * @param       err_attr_name                   [out]  Name of attribute which is failed to get
1642  * @param       first_attribute_name    [in]    Name of the first attribute to get
1643  * @param       ...                                     [out] Value for the first attribute, followed optionally by more name/value pairs, terminated by NULL.
1644  *                                                                       But, in the case of data or string type, it should be name/value/size.
1645  *
1646  * @return      This function returns zero on success, or negative value with error
1647  *                      code.
1648  * @see         mm_player_set_attribute
1649  * @remark      This function must be terminated by NULL argument.
1650  *                      And, if this function is failed, err_attr_name param must be free.
1651  * @par Example
1652  * @code
1653 char *g_err_attr_name = NULL;
1654
1655 if (mm_player_get_attribute(g_player, &g_err_attr_name, "content_duration", &duration, NULL) != MM_ERROR_NONE)
1656 {
1657         LOGW("failed to set %s attribute\n", g_err_attr_name);
1658         free(g_err_attr_name);
1659 }
1660  * @endcode
1661  */
1662 int mm_player_get_attribute(MMHandleType player,  char **err_attr_name, const char *first_attribute_name, ...)G_GNUC_NULL_TERMINATED;
1663
1664 /**
1665  * This function is to get detail information of attribute.
1666  *
1667  * @param       player                           [in]   Handle of player.
1668  * @param   attribute_name               [in]   Name of the attribute to get
1669  * @param   info                                 [out]  Attribute infomation
1670  *
1671  * @return      This function returns zero on success, or negative value with error
1672  *                      code.
1673  *
1674  * @see         mm_player_set_attribute, mm_player_get_attribute
1675  * @remark      None
1676  * @par Example
1677  * @code
1678 if (mm_player_get_attribute_info (g_player, "display_method", &method_info) != MM_ERROR_NONE)
1679 {
1680         LOGW("failed to get info\n");
1681 }
1682
1683 LOGD("type:%d \n", method_info.type); //int, double..
1684 LOGD("flag:%d \n", method_info.flag); //readable, writable..
1685 LOGD("validity type:%d \n", method_info.validity_type); //range, array..
1686
1687 if (method_info. validity_type == MM_PLAYER_ATTRS_VALID_TYPE_INT_RANGE)
1688 {
1689         LOGD("range min:%d\n", method_info.int_range.min);
1690         LOGD("range max:%d\n", method_info.int_range.max);
1691 }
1692  * @endcode
1693  */
1694 int mm_player_get_attribute_info(MMHandleType player,  const char *attribute_name, MMPlayerAttrsInfo *info);
1695
1696 /**
1697  * This function is to get download position and total size of progressive download
1698  *
1699  * @param       player          [in]    Handle of player.
1700  * @param       current_pos     [in]    Download position currently (bytes)
1701  * @param       total_size      [in]    Total size of file (bytes)
1702  *
1703  * @return      This function returns zero on success, or negative value with error code.
1704  *
1705  * @see
1706  * @remark
1707  * @par Example
1708  * @code
1709 guint64 current_pos = 0LLU;
1710 guint64 total_size = 0LLU;
1711
1712 if (mm_player_get_pd_status(g_player, &current_pos, &total_size, NULL) != MM_ERROR_NONE)
1713 {
1714         LOGD("current download pos = %llu, total size = %llu\n", current_pos, total_size);
1715 }
1716  * @endcode
1717  */
1718 int mm_player_get_pd_status(MMHandleType player, guint64 *current_pos, guint64 *total_size);
1719
1720 /**
1721  * This function sets callback function for receiving messages of PD downloader.
1722  *
1723  * @param       player          [in]    Handle of player.
1724  * @param       callback                [in]    Message callback function.
1725  * @param       user_param      [in]    User parameter which is passed to callback function.
1726  *
1727  * @return      This function returns zero on success, or negative value with error code.
1728  * @see
1729  * @remark      None
1730  * @par Example
1731  * @code
1732 int msg_callback(int message, MMMessageParamType *param, void *user_param)
1733 {
1734         switch (message)
1735         {
1736                 case MM_MESSAGE_PD_DOWNLOADER_START:
1737                         LOGD("Progressive download is started...\n");
1738                         break;
1739                 case MM_MESSAGE_PD_DOWNLOADER_END:
1740                         LOGD("Progressive download is ended...\n");
1741                         break;
1742                 default:
1743                         break;
1744         }
1745         return TRUE;
1746 }
1747
1748 mm_player_set_pd_message_callback(g_player, msg_callback, NULL);
1749  * @endcode
1750  */
1751 int mm_player_set_pd_message_callback(MMHandleType player, MMMessageCallback callback, void *user_param);
1752
1753 /**
1754  * This function is to get the track count
1755  *
1756  * @param       player          [in]    handle of player.
1757  * @param       track                   [in]    type of the track type
1758  * @param       info                    [out]   the count of the track
1759  *
1760  * @return      This function returns zero on success, or negative value with error
1761  *                      code.
1762  *
1763  * @see
1764  * @remark      None
1765  * @par Example
1766  * @code
1767 gint audio_count = 0;
1768
1769 if (mm_player_get_track_count (g_player, MM_PLAYER_TRACK_TYPE_AUDIO, &audio_count) != MM_ERROR_NONE)
1770 {
1771         LOGW("failed to get audio track count\n");
1772 }
1773
1774 LOGD("audio track count : %d \n", audio_count);
1775  * @endcode
1776  */
1777 int mm_player_get_track_count(MMHandleType player,  MMPlayerTrackType type, int *count);
1778
1779 /**
1780  * This function is to select the track
1781  *
1782  * @param       player          [in]    handle of player.
1783  * @param       type                    [in]    type of the track type
1784  * @param       index           [in]    the index of the track
1785  *
1786  * @return      This function returns zero on success, or negative value with error
1787  *                      code.
1788  *
1789  * @see
1790  * @remark      None
1791  */
1792 int mm_player_select_track(MMHandleType player, MMPlayerTrackType type, int index);
1793 #ifdef _MULTI_TRACK
1794 /**
1795  * This function is to add the track when user want multi subtitle
1796  *
1797  * @param       player          [in]    handle of player.
1798  * @param       index           [in]    the index of the track
1799  *
1800  * @return      This function returns zero on success, or negative value with error
1801  *                      code.
1802  *
1803  * @see
1804  * @remark      None
1805  */
1806 int mm_player_track_add_subtitle_language(MMHandleType player, int index);
1807
1808 /**
1809  * This function is to remove the track when user want multi subtitle
1810  *
1811  * @param       player          [in]    handle of player.
1812  * @param       index           [in]    the index of the track
1813  *
1814  * @return      This function returns zero on success, or negative value with error
1815  *                      code.
1816  *
1817  * @see
1818  * @remark      None
1819  */
1820 int mm_player_track_remove_subtitle_language(MMHandleType player, int index);
1821
1822 /**
1823  * This function is to notify which sutitle track is in use
1824  *
1825  * @param       player          [in]    handle of player.
1826  * @param       callback                        [in]    callback function to register
1827  * @param       user_data       [in]    user data to be passed to the callback function
1828  *
1829  * @return      This function returns zero on success, or negative value with error
1830  *                      code.
1831  *
1832  * @see
1833  * @remark      None
1834  */
1835 int mm_player_track_foreach_selected_subtitle_language(MMHandleType player, mm_player_track_selected_subtitle_language_callback callback, void *user_param);
1836 #endif
1837 /**
1838  * This function is to get the track language
1839  *
1840  * @param       player          [in]    handle of player.
1841  * @param       type                    [in]    type of the track type
1842  * @param       index           [in]    the index of the track
1843  * @param       code                    [out] language code in ISO 639-1(string)
1844  *
1845  * @return      This function returns zero on success, or negative value with error
1846  *                      code.
1847  *
1848  * @see
1849  * @remark      None
1850  */
1851 int mm_player_get_track_language_code(MMHandleType player,  MMPlayerTrackType type, int index, char **code);
1852
1853 /**
1854  * This function is to get the current running track
1855  *
1856  * @param       player          [in]    handle of player.
1857  * @param       type                    [in]    type of the track type
1858  * @param       index           [out]    the index of the track
1859  *
1860  * @return      This function returns zero on success, or negative value with error
1861  *                      code.
1862  *
1863  * @see
1864  * @remark      None
1865  */
1866
1867 int mm_player_get_current_track(MMHandleType hplayer, MMPlayerTrackType type, int *index);
1868
1869 /**
1870  * This function is to set the subtitle path
1871  *
1872  * @param       player  [in]    handle of player
1873  * @param       path    [in]    subtitle path
1874  *
1875  * @return      This function returns zero on success, or negative value with error code.
1876  *
1877  * @see
1878  * @remark      None
1879  */
1880 int mm_player_set_external_subtitle_path(MMHandleType player, const char* path);
1881
1882 /**
1883  * This function is to set the clock which is from master player
1884  *
1885  * @param       player  [in]    handle of player
1886  * @param       clock   [in]    clock of master player
1887  * @param       clock_delta [in]        clock difference between master and slave
1888  * @param       video_time      [in]    current playing position
1889  * @param       media_clock     [in]    media clock information
1890  * @param       audio_time      [in]    audio timestamp information
1891  * @return      This function returns zero on success, or negative value with error code.
1892  *
1893  * @see
1894  * @remark      None
1895  */
1896 int mm_player_set_video_share_master_clock(MMHandleType player, long long clock, long long clock_delta, long long video_time, long long media_clock, long long audio_time);
1897 /**
1898  * This function is to get the master clock
1899  *
1900  * @param       player          [in]    handle of player
1901  * @param       video_time      [out]   current playing position
1902  * @param       media_clock     [out]   media clock information
1903  * @param       audio_time      [out]   audio timestamp information
1904  * @return      This function returns zero on success, or negative value with error code.
1905  *
1906  * @see
1907  * @remark      None
1908  */
1909 int mm_player_get_video_share_master_clock(MMHandleType player, long long *video_time, long long *media_clock, long long *audio_time);
1910
1911 /**
1912  * This function is to get the content angle
1913  *
1914  * @param       player          [in]    handle of player
1915  * @param       angle           [out]   orignal angle from content
1916  * @return      This function returns zero on success, or negative value with error code.
1917  *
1918  * @see
1919  * @remark      None
1920  */
1921 int mm_player_get_video_rotate_angle(MMHandleType player, int *angle);
1922
1923 /**
1924  * This function is to set download mode of video hub
1925  *
1926  * @param       player          [in]    handle of player
1927  * @param       mode            [in]    download mode
1928  * @return      This function returns zero on success, or negative value with error code.
1929  *
1930  * @see
1931  * @remark      None
1932  */
1933 int mm_player_set_video_hub_download_mode(MMHandleType player, bool mode);
1934
1935 /**
1936  * This function is to set using sync handler.
1937  *
1938  * @param       player          [in]    handle of player
1939  * @param       enable          [in]    enable/disable
1940  * @return      This function returns zero on success, or negative value with error code.
1941  *
1942  * @see
1943  * @remark      None
1944  */
1945 int mm_player_enable_sync_handler(MMHandleType player, bool enable);
1946
1947 /**
1948  * This function is to set uri.
1949  *
1950  * @param       player          [in]    handle of player
1951  * @param       uri             [in]    uri
1952  * @return      This function returns zero on success, or negative value with error code.
1953  *
1954  * @see
1955  * @remark      None
1956  */
1957 int mm_player_set_uri(MMHandleType player, const char *uri);
1958
1959 /**
1960  * This function is to set next uri.
1961  *
1962  * @param       player          [in]    handle of player
1963  * @param       uri             [in]    uri
1964  * @return      This function returns zero on success, or negative value with error code.
1965  *
1966  * @see
1967  * @remark      None
1968  */
1969 int mm_player_set_next_uri(MMHandleType player, const char *uri);
1970
1971 /**
1972  * This function is to get next uri.
1973  *
1974  * @param       player          [in]    handle of player
1975  * @param       uri             [out]   uri
1976  * @return      This function returns zero on success, or negative value with error code.
1977  *
1978  * @see
1979  * @remark      None
1980  */
1981 int mm_player_get_next_uri(MMHandleType player, char **uri);
1982
1983 /**
1984  * This function is to increase reference count of internal buffer.
1985  *
1986  * @param       buffer          [in]   video callback internal buffer
1987  * @return      This function returns buffer point;
1988  *
1989  * @see
1990  * @remark      None
1991  */
1992 void * mm_player_media_packet_video_stream_internal_buffer_ref(void *buffer);
1993
1994 /**
1995  * This function is to decrease reference count of internal buffer.
1996  *
1997  * @param       buffer          [in]   video callback internal buffer
1998  * @return      None;
1999  *
2000  * @see
2001  * @remark      None
2002  */
2003 void mm_player_media_packet_video_stream_internal_buffer_unref(void *buffer);
2004
2005 /**mm_player_submit_packet
2006  * This function is to submit buffer to appsrc.  \n
2007  * @param       player                  [in]    Handle of player.
2008  * @param       buf             [in]    buffer to be submit in appsrc in external feeder case.
2009  * @param       len                             [in]    length of buffer.
2010  * @param       pts                             [in]    timestamp of buffer.
2011  * @param       streamtype              [in]    stream type of buffer.
2012  * @return      This function returns zero on success, or negative value with error code.
2013  * @par Example
2014  *
2015  * @endcode
2016  */
2017 int mm_player_submit_packet(MMHandleType player, media_packet_h packet);
2018
2019 /**mm_player_set_video_info
2020  * This function is to set caps of src pad of video appsrc in external feeder case.  \n
2021  * @param       player                          [in]    Handle of player.
2022  * @param       media_format_h                  [in]    Video stream info.
2023  * @return      This function returns zero on success, or negative value with error code.
2024  * @par Example
2025  *
2026  * @endcode
2027  */
2028 int mm_player_set_video_info (MMHandleType player, media_format_h format);
2029
2030 /**mm_player_set_audio_info
2031  * This function is to set caps of src pad of Audio appsrc in external feeder case.  \n
2032  * @param       player                       [in]    Handle of player.
2033  * @param       media_format_h               [in]    Audio stream info.
2034  * @return      This function returns zero on success, or negative value with error code.
2035  * @par Example
2036  *
2037  * @endcode
2038  */
2039 int mm_player_set_audio_info (MMHandleType player, media_format_h format);
2040
2041 /**mm_player_set_subtitle_info
2042  * This function is to set caps of src pad of subtitle appsrc in external feeder case.  \n
2043  * @param       player                          [in]    Handle of player.
2044  * @param       subtitle_stream_info               [in]    Subtitle stream info.
2045  * @return      This function returns zero on success, or negative value with error code.
2046  * @par Example
2047  *
2048  * @endcode
2049  */
2050 int mm_player_set_subtitle_info (MMHandleType player, MMPlayerSubtitleStreamInfo *info);
2051
2052 /**
2053  * This function set callback function for receiving need or enough data message from player.
2054  *
2055  * @param       player          [in]    Handle of player.
2056  * @param       type            [in]    stream type
2057  * @param       callback        [in]    data callback function for stream type.
2058  * @param       user_param      [in]    User parameter.
2059  *
2060  * @return      This function returns zero on success, or negative value with error
2061  *                      code.
2062  * @remark
2063  * @see
2064  * @since
2065  */
2066 int mm_player_set_media_stream_buffer_status_callback(MMHandleType player, MMPlayerStreamType type, mm_player_media_stream_buffer_status_callback callback, void * user_param);
2067
2068 /**
2069  * This function set callback function for receiving seek data message from player.
2070  *
2071  * @param       player          [in]    Handle of player.
2072  * @param       type            [in]    stream type
2073  * @param       callback        [in]    Seek data callback function for stream type.
2074  * @param       user_param      [in]    User parameter.
2075  *
2076  * @return      This function returns zero on success, or negative value with error
2077  *                      code.
2078  * @remark
2079  * @see
2080  * @since
2081  */
2082 int mm_player_set_media_stream_seek_data_callback(MMHandleType player, MMPlayerStreamType type, mm_player_media_stream_seek_data_callback callback, void * user_param);
2083
2084 /**
2085  * This function is to set max size of buffer(appsrc).
2086  *
2087  * @param       player          [in]    Handle of player.
2088  * @param       type            [in]    stream type
2089  * @param       max_size        [in]    max bytes of buffer.
2090  *
2091  * @return      This function returns zero on success, or negative value with error
2092  *                      code.
2093  * @remark
2094  * @see
2095  * @since
2096  */
2097 int mm_player_set_media_stream_buffer_max_size(MMHandleType player, MMPlayerStreamType type, unsigned long long max_size);
2098
2099 /**
2100  * This function is to get max size of buffer(appsrc).
2101  *
2102  * @param       player          [in]    Handle of player.
2103  * @param       type            [in]    stream type
2104  * @param       max_size        [out]   max bytes of buffer.
2105  *
2106  * @return      This function returns zero on success, or negative value with error
2107  *                      code.
2108  * @remark
2109  * @see
2110  * @since
2111  */
2112 int mm_player_get_media_stream_buffer_max_size(MMHandleType player, MMPlayerStreamType type, unsigned long long *max_size);
2113
2114 /**
2115  * This function is to set min percent of buffer(appsrc).
2116  *
2117  * @param       player          [in]    Handle of player.
2118  * @param       type            [in]    stream type
2119  * @param       min_percent     [in]    min percent of buffer.
2120  *
2121  * @return      This function returns zero on success, or negative value with error
2122  *                      code.
2123  * @remark
2124  * @see
2125  * @since
2126  */
2127 int mm_player_set_media_stream_buffer_min_percent(MMHandleType player, MMPlayerStreamType type, unsigned min_percent);
2128
2129 /**
2130  * This function is to get min percent of buffer(appsrc).
2131  *
2132  * @param       player          [in]    Handle of player.
2133  * @param       type            [in]    stream type
2134  * @param       min_percent     [out]   min percent of buffer.
2135  *
2136  * @return      This function returns zero on success, or negative value with error
2137  *                      code.
2138  * @remark
2139  * @see
2140  * @since
2141  */
2142 int mm_player_get_media_stream_buffer_min_percent(MMHandleType player, MMPlayerStreamType type, unsigned int *min_percent);
2143
2144 /**
2145  * This function set callback function for changing audio stream from player. \n
2146  * It's only supported when audio stream is included in file. \n
2147  *
2148  * @param       player   [in] Handle of player.
2149  * @param       callback [in] Audio stream changed callback function.
2150  * @param       user_param [in] User parameter.
2151  *
2152  * @return      This function returns zero on success, or negative value with error
2153  *                      code.
2154  * @see         mm_player_stream_changed_callback
2155  * @since
2156  */
2157 int mm_player_set_audio_stream_changed_callback(MMHandleType player, mm_player_stream_changed_callback callback, void *user_param);
2158
2159 /**
2160  * This function set callback function for changing video stream from player. \n
2161  * It's only supported when video stream is included in file. \n
2162  *
2163  * @param       player   [in] Handle of player.
2164  * @param       callback [in] Video stream changed callback function.
2165  * @param       user_param [in] User parameter.
2166  *
2167  * @return      This function returns zero on success, or negative value with error
2168  *                      code.
2169  * @see         mm_player_stream_changed_callback
2170  * @since
2171  */
2172 int mm_player_set_video_stream_changed_callback(MMHandleType player, mm_player_stream_changed_callback callback, void *user_param);
2173
2174 /**
2175  * This function is to get timeout value according to the content type for muse. \n
2176  * It's only supported when video stream is included in file. \n
2177  *
2178  * @param       player  [in] Handle of player.
2179  * @param       timeout [out] timeout value (sec).
2180  *
2181  * @return      This function returns zero on success, or negative value with error
2182  *                      code.
2183  * @since 3.0
2184  */
2185 int mm_player_get_timeout(MMHandleType player, int *timeout);
2186
2187 /**
2188  * This function is to get the number of video output buffers. \n
2189  * It's only supported when video stream is included in file. \n
2190  *
2191  * @param       player  [in] Handle of player.
2192  * @param       num     [out] num of buffers.
2193  * @param       extra_num [out] extra num of buffers.
2194  *
2195  * @return      This function returns zero on success, or negative value with error
2196  *                      code.
2197  * @since 3.0
2198  */
2199 int mm_player_get_num_of_video_out_buffers(MMHandleType player, int *num, int *extra_num);
2200
2201 /**
2202  * This function is to set the dynamic resolution information. \n
2203  * It's only supported when video stream is included in file. \n
2204  *
2205  * @param       player  [in] Handle of player.
2206  * @param       drc     [in] dynamic resolution info of media stream data
2207  *
2208  * @return      This function returns zero on success, or negative value with error
2209  *                      code.
2210  * @since 3.0
2211  */
2212 int mm_player_set_media_stream_dynamic_resolution(MMHandleType player, bool drc);
2213
2214 /**
2215  * This function is to release the video stream bo to reuse. \n
2216  * It's only supported when sw codec is used to decode video stream. \n
2217  *
2218  * @param       player  [in] Handle of player.
2219  * @param       bo     [in] bo address to be released
2220  *
2221  * @return      This function returns zero on success, or negative value with error
2222  *                      code.
2223  * @since 3.0
2224  */
2225 int mm_player_release_video_stream_bo(MMHandleType player, void* bo);
2226
2227 /**
2228  * This function is to set http file buffering path
2229  *
2230  * @param       player          [in]    handle of player
2231  * @param       file_path       [in]    file path
2232  * @return      This function returns zero on success, or negative value with error code.
2233  *
2234  * @see
2235  * @remark      None
2236  */
2237 int mm_player_set_file_buffering_path(MMHandleType player, const char *file_path);
2238
2239 /**
2240  * This function is to set sound stream info
2241  */
2242 int mm_player_set_sound_stream_info(MMHandleType player, char *stream_type, int stream_index);
2243
2244 /**
2245  * This function is to manage the playback according to the external storage state
2246  */
2247 int mm_player_manage_external_storage_state(MMHandleType player, int state);
2248
2249 /**
2250  * These functions are to set/get the max variant of HAS
2251  */
2252 int mm_player_get_adaptive_variant_info(MMHandleType player, int *num, char **var_info);
2253 int mm_player_set_max_adaptive_variant_limit(MMHandleType player, int bandwidth, int width, int height);
2254 int mm_player_get_max_adaptive_variant_limit(MMHandleType player, int *bandwidth, int *width, int *height);
2255
2256 /**
2257  * These functions are to set/get the audio only mode
2258  */
2259 int mm_player_set_audio_only(MMHandleType player, bool audio_only);
2260 int mm_player_get_audio_only(MMHandleType player, bool *audio_only);
2261
2262 /**
2263  * These functions are to set/get the streaming bufferint time
2264  */
2265 int mm_player_set_streaming_buffering_time(MMHandleType player, int buffer_ms, int rebuffer_ms);
2266 int mm_player_get_streaming_buffering_time(MMHandleType player, int *buffer_ms, int *rebuffer_ms);
2267
2268 /**
2269  * These functions are to display the 360 video content
2270  */
2271 int mm_player_360_set_enable(MMHandleType player, bool enable);
2272 int mm_player_360_is_enabled(MMHandleType player, bool *enabled);
2273
2274 int mm_player_360_set_direction_of_view(MMHandleType player, float yaw, float pitch);
2275 int mm_player_360_get_direction_of_view(MMHandleType player, float *yaw, float *pitch);
2276
2277 int mm_player_360_set_zoom(MMHandleType player, float level);
2278 int mm_player_360_get_zoom(MMHandleType player, float *level);
2279
2280 int mm_player_360_set_field_of_view(MMHandleType player, int horizontal_degrees, int vertical_degrees);
2281 int mm_player_360_get_field_of_view(MMHandleType player, int *horizontal_degrees, int *vertical_degrees);
2282
2283 /**
2284         @}
2285  */
2286
2287 #ifdef __cplusplus
2288         }
2289 #endif
2290
2291 #endif  /* __MM_PLAYER_H__ */