Remove unused function
[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 #define BUFFER_MAX_PLANE_NUM (4)
656
657 typedef struct {
658         MMPixelFormatType format;                       /**< image format */
659         int width;                                              /**< width of video buffer */
660         int height;                                             /**< height of video buffer */
661         unsigned int timestamp;                         /**< timestamp of stream buffer (msec)*/
662         unsigned int length_total;                      /**< total length of stream buffer (in byte)*/
663         void *data[BUFFER_MAX_PLANE_NUM];
664         void *bo[BUFFER_MAX_PLANE_NUM];  /**< TBM buffer object */
665         void *internal_buffer;                          /**< Internal buffer pointer */
666         int stride[BUFFER_MAX_PLANE_NUM];               /**< stride of plane */
667         int elevation[BUFFER_MAX_PLANE_NUM];    /**< elevation of plane */
668 }MMPlayerVideoStreamDataType;
669
670 /**
671  * Enumerations of player state.
672  */
673 typedef enum {
674         MM_PLAYER_STATE_NULL,                           /**< Player is created, but not realized yet */
675         MM_PLAYER_STATE_READY,                          /**< Player is ready to play media */
676         MM_PLAYER_STATE_PLAYING,                        /**< Player is now playing media */
677         MM_PLAYER_STATE_PAUSED,                         /**< Player is paused while playing media */
678         MM_PLAYER_STATE_NONE,                           /**< Player is not created yet */
679         MM_PLAYER_STATE_NUM,                            /**< Number of player states */
680 } MMPlayerStateType;
681
682 /**
683  * Enumerations of position formats.
684  * Used while invoking mm_player_get_position/mm_player_set_position APIs
685  */
686 typedef enum {
687         MM_PLAYER_POS_FORMAT_TIME,                      /**< Format for time based */
688         MM_PLAYER_POS_FORMAT_PERCENT,                   /**< Format for percentage */
689         MM_PLAYER_POS_FORMAT_NUM,                       /**< Number of position formats */
690 } MMPlayerPosFormatType;
691
692 /**
693  * Enumeration for attribute values types.
694  */
695 typedef enum {
696  MM_PLAYER_ATTRS_TYPE_INVALID = -1,        /**< Type is invalid */
697  MM_PLAYER_ATTRS_TYPE_INT,                 /**< Integer type */
698  MM_PLAYER_ATTRS_TYPE_DOUBLE,              /**< Double type */
699  MM_PLAYER_ATTRS_TYPE_STRING,              /**< UTF-8 String type */
700  MM_PLAYER_ATTRS_TYPE_DATA,                /**< Pointer type */
701  MM_PLAYER_ATTRS_TYPE_ARRAY,               /**< Array type */
702  MM_PLAYER_ATTRS_TYPE_RANGE,               /**< Range type */
703  MM_PLAYER_ATTRS_TYPE_NUM,                 /**< Number of attribute type */
704 } MMPlayerAttrsType;
705
706 /**
707  * Enumeration for attribute validation type.
708  */
709 typedef enum {
710  MM_PLAYER_ATTRS_VALID_TYPE_INVALID = -1,               /**< Invalid validation type */
711  MM_PLAYER_ATTRS_VALID_TYPE_NONE,                               /**< Do not check validity */
712  MM_PLAYER_ATTRS_VALID_TYPE_INT_ARRAY,          /**< validity checking type of integer array */
713  MM_PLAYER_ATTRS_VALID_TYPE_INT_RANGE,          /**< validity checking type of integer range */
714  MM_PLAYER_ATTRS_VALID_TYPE_DOUBLE_ARRAY,               /**< validity checking type of double array */
715  MM_PLAYER_ATTRS_VALID_TYPE_DOUBLE_RANGE,       /**< validity checking type of double range */
716 } MMPlayerAttrsValidType;
717
718 /**
719  * Enumeration for attribute access flag.
720  */
721 typedef enum {
722  MM_PLAYER_ATTRS_FLAG_NONE = 0,                                 /**< None flag is set */
723  MM_PLAYER_ATTRS_FLAG_READABLE = 1 << 0,                        /**< Readable */
724  MM_PLAYER_ATTRS_FLAG_WRITABLE = 1 << 1,                        /**< Writable */
725  MM_PLAYER_ATTRS_FLAG_MODIFIED = 1 << 2,                        /**< Modified */
726
727  MM_PLAYER_ATTRS_FLAG_RW = MM_PLAYER_ATTRS_FLAG_READABLE | MM_PLAYER_ATTRS_FLAG_WRITABLE, /**< Readable and Writable */
728 } MMPlayerAttrsFlag;
729
730 /**
731  * Enumeration for progressive download
732  */
733 typedef enum {
734         MM_PLAYER_PD_MODE_NONE,
735         MM_PLAYER_PD_MODE_URI,
736         MM_PLAYER_PD_MODE_FILE  // not tested yet, because of no fixed scenario
737 }MMPlayerPDMode;
738
739 /**
740  * Enumeration of track types
741  */
742 typedef enum {
743         MM_PLAYER_TRACK_TYPE_AUDIO = 0,
744         MM_PLAYER_TRACK_TYPE_VIDEO,
745         MM_PLAYER_TRACK_TYPE_TEXT,
746         MM_PLAYER_TRACK_TYPE_MAX
747 }MMPlayerTrackType;
748
749 /**
750  * Enumeration of runtime buffering mode
751  */
752 typedef enum {
753         MM_PLAYER_BUFFERING_MODE_ADAPTIVE = 0,  /**< default, If buffering is occurred, player will consider the bandwidth to adjust buffer setting. */
754         MM_PLAYER_BUFFERING_MODE_FIXED,                 /**< player will set buffer size with this fixed size value. */
755         MM_PLAYER_BUFFERING_MODE_SLINK,                 /**< If buffering is occurred, player will adjust buffer setting and no more buffering will be occurred again. */
756         MM_PLAYER_BUFFERING_MODE_MAX = MM_PLAYER_BUFFERING_MODE_SLINK,
757 }MMPlayerBufferingMode;
758
759 /**
760  * Enumeration of audio channel for video share
761  */
762 typedef enum
763 {
764         MM_PLAYER_AUDIO_CH_MONO_LEFT = 0,
765         MM_PLAYER_AUDIO_CH_MONO_RIGHT,
766         MM_PLAYER_AUDIO_CH_STEREO,
767 } MMPlayerAudioChannel;
768
769 typedef enum
770 {
771         MM_PLAYER_SOUND_RESOURCE_PRELISTENING_RINGTONE = 0,
772         MM_PLAYER_SOUND_RESOURCE_PRELISTENING_NOTIFICATION,
773         MM_PLAYER_SOUND_RESOURCE_PRELISTENING_ALARM,
774         MM_PLAYER_SOUND_RESOURCE_PRELISTENING_MEDIA,
775 } MMPlayerSoundResource;
776
777 typedef enum
778 {
779         MM_PLAYER_FOCUS_CHANGED_COMPLETED = 0,
780         MM_PLAYER_FOCUS_CHANGED_BY_MEDIA,
781         MM_PLAYER_FOCUS_CHANGED_BY_CALL,
782         MM_PLAYER_FOCUS_CHANGED_BY_EARJACK_UNPLUG,
783         MM_PLAYER_FOCUS_CHANGED_BY_RESOURCE_CONFLICT,
784         MM_PLAYER_FOCUS_CHANGED_BY_ALARM,
785         MM_PLAYER_FOCUS_CHANGED_BY_EMERGENCY,
786         MM_PLAYER_FOCUS_CHANGED_BY_NOTIFICATION,
787         MM_PLAYER_FOCUS_CHANGED_BY_UNKNOWN,
788 } MMPlayerFocusChangedMsg;
789
790
791 /**
792  * Edge Properties of the text.
793  */
794 typedef enum {
795         MM_PLAYER_EDGE_NO,
796         MM_PLAYER_EDGE_RAISED,
797         MM_PLAYER_EDGE_DEPRESSED,
798         MM_PLAYER_EDGE_UNIFORM,
799         MM_PLAYER_EDGE_DROPSHADOW
800 } MMPlayerSubtitleEdge;
801
802 /**
803  * Enumeration of media stream buffer status
804  */
805 typedef enum
806 {
807         MM_PLAYER_MEDIA_STREAM_BUFFER_UNDERRUN,
808         MM_PLAYER_MEDIA_STREAM_BUFFER_OVERFLOW,
809 } MMPlayerMediaStreamBufferStatus;
810
811 /**
812  * Enumeration for stream type.
813  */
814 typedef enum
815 {
816         MM_PLAYER_STREAM_TYPE_DEFAULT,  /**< Container type */
817         MM_PLAYER_STREAM_TYPE_AUDIO,    /**< Audio element stream type */
818         MM_PLAYER_STREAM_TYPE_VIDEO,    /**< Video element stream type */
819         MM_PLAYER_STREAM_TYPE_TEXT,     /**< Text type */
820         MM_PLAYER_STREAM_TYPE_MAX,
821 } MMPlayerStreamType;
822
823 /**
824  * Attribute validity structure
825  */
826 typedef struct {
827          MMPlayerAttrsType type;
828          MMPlayerAttrsValidType validity_type;
829          MMPlayerAttrsFlag flag;
830         /**
831           * a union that describes validity of the attribute.
832           * Only when type is 'MM_ATTRS_TYPE_INT' or 'MM_ATTRS_TYPE_DOUBLE',
833           * the attribute can have validity.
834          */
835          union {
836                 /**
837                    * Validity structure for integer array.
838                  */
839                 struct {
840                         int *array;  /**< a pointer of array */
841                         int count;   /**< size of array */
842                         int d_val;
843                 } int_array;
844                 /**
845                    * Validity structure for integer range.
846                  */
847                 struct {
848                         int min;   /**< minimum range */
849                         int max;   /**< maximum range */
850                         int d_val;
851                 } int_range;
852                 /**
853                 * Validity structure for double array.
854                 */
855                 struct {
856                         double   * array;  /**< a pointer of array */
857                         int    count;   /**< size of array */
858                         double d_val;
859                 } double_array;
860                 /**
861                 * Validity structure for double range.
862                 */
863                 struct {
864                         double   min;   /**< minimum range */
865                         double   max;   /**< maximum range */
866                         double d_val;
867                 } double_range;
868         };
869 } MMPlayerAttrsInfo;
870
871 /**
872  * Volume type.
873  *
874  * @see         mm_player_set_volume, mm_player_get_volume
875  */
876 typedef struct {
877         float   level[MM_VOLUME_CHANNEL_NUM];   /**< Relative volume factor for each channels */
878 } MMPlayerVolumeType;
879
880 /**
881  * Video stream info in external demux case
882  *
883 **/
884 typedef struct _VideoStreamInfo
885 {
886         const char *mime;
887         unsigned int framerate_num;
888         unsigned int framerate_den;
889         unsigned int width;
890         unsigned int height;
891         unsigned char *codec_extradata;
892         unsigned int extradata_size;
893         unsigned int version;
894 }MMPlayerVideoStreamInfo;
895
896 /**
897  * Audio stream info in external demux case
898  *
899 **/
900 typedef struct _AudioStreamInfo
901 {
902         const char *mime;
903         unsigned int channels;
904         unsigned int sample_rate;
905         unsigned char *codec_extradata;
906         unsigned int extradata_size;
907         unsigned int version;
908         unsigned int user_info;
909
910         /* for pcm */
911 //      unsigned int width;
912 //      unsigned int depth;
913 //      unsigned int endianness;
914 //      bool signedness;
915 }MMPlayerAudioStreamInfo;
916
917 /**
918  * Subtitle stream info in external demux case
919  *
920 **/
921 typedef struct _SubtitleStreamInfo
922 {
923         const char *mime;
924         unsigned int codec_tag;
925         void *context;  //for smpte text
926 }MMPlayerSubtitleStreamInfo;
927
928 /**
929  * Audio stream callback function type.
930  *
931  * @param       stream          [in]    Reference pointer to audio frame data
932  * @param       stream_size     [in]    Size of audio frame data
933  * @param       user_param      [in]    User defined parameter which is passed when set
934  *                                                              audio stream callback
935  *
936  * @return      This callback function have to return MM_ERROR_NONE.
937  */
938 typedef bool    (*mm_player_audio_stream_callback) (void *stream, int stream_size, void *user_param);
939
940
941 /**
942  * selected subtitle track number callback function type.
943  *
944  * @param       track_num       [in]    Track number of subtitle
945  * @param       user_param      [in]    User defined parameter
946  *
947  *
948  * @return      This callback function have to return MM_ERROR_NONE.
949  */
950 typedef bool            (*mm_player_track_selected_subtitle_language_callback)(int track_num, void *user_param);
951
952 /**
953  * Buffer underrun / overflow data callback function type.
954  *
955  * @param       status     [in] buffer status
956  * @param       user_param [in] User defined parameter which is passed when set
957  *                              to enough data callback or need data callback
958  *
959  * @return      This callback function have to return MM_ERROR_NONE.
960  */
961 typedef bool    (*mm_player_media_stream_buffer_status_callback) (MMPlayerStreamType type, MMPlayerMediaStreamBufferStatus status, void *user_param);
962
963 /**
964  * Buffer seek data callback function type.
965  *
966  * @param       offset     [in] offset for the buffer playback
967  * @param       user_param [in] User defined parameter which is passed when set
968  *                              to seek data callback
969  *
970  * @return      This callback function have to return MM_ERROR_NONE.
971  */
972 typedef bool    (*mm_player_media_stream_seek_data_callback) (MMPlayerStreamType type, unsigned long long offset, void *user_param);
973
974 /**
975  * Called to notify the stream changed.
976  *
977  * @param user_data [in] The user data passed from the callback registration function
978  *
979  * @return      This callback function have to return MM_ERROR_NONE.
980  */
981 typedef bool    (*mm_player_stream_changed_callback) (void *user_param);
982
983
984 /*===========================================================================================
985 |                                                                                           |
986 |  GLOBAL FUNCTION PROTOTYPES                                        |
987 |                                                                                           |
988 ========================================================================================== */
989
990 /**
991  * This function creates a player object for playing multimedia contents. \n
992  * The attributes of player are created to get/set some values with application. \n
993  * And, mutex, gstreamer and other resources are initialized at this time. \n
994  * If player is created, the state will become MM_PLAYER_STATE_NULL.
995  *
996  * @param       player          [out]   Handle of player
997  *
998  * @return      This function returns zero on success, or negative value with error code. \n
999  *                      Please refer 'mm_error.h' to know it in detail.
1000  * @pre         None
1001  * @post        MM_PLAYER_STATE_NULL
1002  * @see         mm_player_destroy
1003  * @remark      You can create multiple handles on a context at the same time. \n
1004  *                      However, player cannot guarantee proper operation because of limitation of resources, \n
1005  *                      such as audio device or display device.
1006  *
1007  * @par Example
1008  * @code
1009 char *g_err_attr_name = NULL;
1010
1011 if (mm_player_create(&g_player) != MM_ERROR_NONE)
1012 {
1013         debug_error("failed to create player\n");
1014 }
1015
1016 if (mm_player_set_attribute(g_player,
1017                                                 &g_err_attr_name,
1018                                                 "profile_uri", filename, strlen(filename),
1019                                                 "display_overlay", (void*)&g_win.xid, sizeof(g_win.xid),
1020                                                 NULL) != MM_ERROR_NONE)
1021 {
1022         debug_error("failed to set %s attribute\n", g_err_attr_name);
1023         free(g_err_attr_name);
1024 }
1025
1026 mm_player_set_message_callback(g_player, msg_callback, (void*)g_player);
1027  * @endcode
1028  */
1029 int mm_player_create(MMHandleType *player);
1030
1031 /**
1032  * This function releases player object and all resources which were created by mm_player_create(). \n
1033  * And, player handle will also be destroyed.
1034  *
1035  * @param       player          [in]    Handle of player
1036  *
1037  * @return      This function returns zero on success, or negative value with error code.
1038  * @pre         Player state may be MM_PLAYER_STATE_NULL. \n
1039  *                      But, it can be called in any state.
1040  * @post                Because handle is released, there is no any state.
1041  * @see         mm_player_create
1042  * @remark      This method can be called with a valid player handle from any state to \n
1043  *                      completely shutdown the player operation.
1044  *
1045  * @par Example
1046  * @code
1047 if (mm_player_destroy(g_player) != MM_ERROR_NONE)
1048 {
1049         debug_error("failed to destroy player\n");
1050 }
1051  * @endcode
1052  */
1053 int mm_player_destroy(MMHandleType player);
1054
1055 /**
1056  * This function register the sound focus using application PID \n
1057  * So, application PID should be set before realizing with mm_player_set_attribute(). \n
1058  *
1059  * @param       player          [in]    Handle of player
1060  *
1061  * @return      This function returns zero on success, or negative value with error code.
1062  *
1063  * @pre         Player state should be MM_PLAYER_STATE_NULL.
1064  * @remark      None
1065  */
1066 int mm_player_sound_register(MMHandleType player, int pid);
1067
1068 /**
1069  * This function parses uri and makes gstreamer pipeline by uri scheme. \n
1070  * So, uri should be set before realizing with mm_player_set_attribute(). \n
1071  *
1072  * @param       player          [in]    Handle of player
1073  *
1074  * @return      This function returns zero on success, or negative value with error code.
1075  *
1076  * @pre         Player state should be MM_PLAYER_STATE_NULL.
1077  * @post                Player state will be MM_PLAYER_STATE_READY.
1078  * @see         mm_player_unrealize
1079  * @remark      None
1080  * @par Example
1081  * @code
1082 if (mm_player_realize(g_player) != MM_ERROR_NONE)
1083 {
1084         debug_error("failed to realize player\n");
1085 }
1086  * @endcode
1087  */
1088 int mm_player_realize(MMHandleType player) ;
1089
1090 /**
1091  * This function uninitializes player object. So, resources and allocated memory \n
1092  * will be freed. And, gstreamer pipeline is also destroyed. So, if you want to play \n
1093  * other contents, player should be created again after destruction or realized with new uri.
1094  *
1095  * @param       player          [in]    Handle of player
1096  *
1097  * @return      This function returns zero on success, or negative value with error code.
1098  * @pre         Player state may be MM_PLAYER_STATE_READY to unrealize. \n
1099  *                      But, it can be called in any state.
1100  * @post                Player state will be MM_PLAYER_STATE_NULL.
1101  * @see         mm_player_realize
1102  * @remark      This method can be called with a valid player handle from any state.
1103  *
1104  * @par Example
1105  * @code
1106 if (mm_player_unrealize(g_player) != MM_ERROR_NONE)
1107 {
1108         debug_error("failed to unrealize player\n");
1109 }
1110  * @endcode
1111  */
1112 int mm_player_unrealize(MMHandleType player);
1113
1114 /**
1115  * This function is to get current state of player. \n
1116  * Application have to check current state before doing some action.
1117  *
1118  * @param       player          [in]    Handle of player
1119  * @param       state       [out] current state of player on success
1120  *
1121  * @return      This function returns zero on success, or negative value with error code.
1122  *
1123  * @see         MMPlayerStateType
1124  * @remark      None
1125  * @par Example
1126  * @code
1127 if (mm_player_get_state(g_player, &state) != MM_ERROR_NONE)
1128 {
1129         debug_error("failed to get state\n");
1130 }
1131  * @endcode
1132  */
1133 int mm_player_get_state(MMHandleType player, MMPlayerStateType *state);
1134
1135 /**
1136  * This function is to set relative volume of player. \n
1137  * So, It controls logical volume value. \n
1138  * But, if developer want to change system volume, mm sound api should be used.
1139  *
1140  * @param       player          [in]    Handle of player
1141  * @param       volume          [in]    Volume factor of each channel
1142  *
1143  * @return      This function returns zero on success, or negative value with error code.
1144  * @see         MMPlayerVolumeType, mm_player_get_volume
1145  * @remark      The range of factor range is from 0 to 1.0. (1.0 = 100%) And, default value is 1.0.
1146  * @par Example
1147  * @code
1148 MMPlayerVolumeType volume;
1149 int i = 0;
1150
1151 for (i = 0; i < MM_VOLUME_CHANNEL_NUM; i++)
1152         volume.level[i] = MM_VOLUME_LEVEL_MAX;
1153
1154 if (mm_player_set_volume(g_player, &volume) != MM_ERROR_NONE)
1155 {
1156     debug_error("failed to set volume\n");
1157 }
1158  * @endcode
1159  */
1160 int mm_player_set_volume(MMHandleType player, MMPlayerVolumeType *volume);
1161
1162 /**
1163  * This function is to get current volume factor of player.
1164  *
1165  * @param       player          [in]    Handle of player.
1166  * @param       volume          [out]   Volume factor of each channel.
1167  *
1168  * @return      This function returns zero on success, or negative value with error code.
1169  *
1170  * @see         MMPlayerVolumeType, mm_player_set_volume
1171  * @remark      None
1172  * @par Example
1173  * @code
1174 MMPlayerVolumeType volume;
1175 int i;
1176
1177 if (mm_player_get_volume(g_player, &volume) != MM_ERROR_NONE)
1178 {
1179         debug_warning("failed to get volume\n");
1180 }
1181
1182 for (i = 0; i < MM_VOLUME_CHANNEL_NUM; i++)
1183         debug_log("channel[%d] = %d \n", i, volume.level[i]);
1184  * @endcode
1185  */
1186 int mm_player_get_volume(MMHandleType player, MMPlayerVolumeType *volume);
1187
1188 /**
1189  * This function is to start playing media contents. Demux(parser), codec and related plugins are decided \n
1190  * at this time. And, MM_MESSAGE_BEGIN_OF_STREAM will be posted through callback function registered \n
1191  * by mm_player_set_message_callback().
1192  *
1193  * @param       player          [in]    Handle of player
1194  *
1195  * @return      This function returns zero on success, or negative value with error code.
1196  * @remark
1197  *
1198  * @pre         Player state may be MM_PLAYER_STATE_READY.
1199  * @post                Player state will be MM_PLAYER_STATE_PLAYING.
1200  * @see         mm_player_stop
1201  * @remark      None
1202  * @par Example
1203  * @code
1204 if (mm_player_start(g_player) != MM_ERROR_NONE)
1205 {
1206         debug_error("failed to start player\n");
1207 }
1208  * @endcode
1209  */
1210 int mm_player_start(MMHandleType player);
1211
1212 /**
1213  * This function is to stop playing media contents and it's different with pause. \n
1214  * If mm_player_start() is called after this, content will be started again from the beginning. \n
1215  * So, it can be used to close current playback.
1216  *
1217  * @param       player          [in]    Handle of player
1218  *
1219  * @return      This function returns zero on success, or negative value with error code.
1220  *
1221  * @pre         Player state may be MM_PLAYER_STATE_PLAYING.
1222  * @post                Player state will be MM_PLAYER_STATE_READY.
1223  * @see         mm_player_start
1224  * @remark      None
1225  * @par Example
1226  * @code
1227 if (mm_player_stop(g_player) != MM_ERROR_NONE)
1228 {
1229         debug_error("failed to stop player\n");
1230 }
1231  * @endcode
1232  */
1233 int mm_player_stop(MMHandleType player);
1234
1235 /**
1236  * This function is to pause playing media contents.
1237  *
1238  * @param       player          [in]    Handle of player.
1239  *
1240  * @return      This function returns zero on success, or negative value with error code.
1241  *
1242  * @pre         Player state may be MM_PLAYER_STATE_PLAYING.
1243  * @post                Player state will be MM_PLAYER_STATE_PAUSED.
1244  * @see         mm_player_resume
1245  * @remark      None
1246  * @par Example
1247  * @code
1248 if (mm_player_pause(g_player) != MM_ERROR_NONE)
1249 {
1250         debug_error("failed to pause player\n");
1251 }
1252  * @endcode
1253  */
1254 int mm_player_pause(MMHandleType player);
1255
1256 /**
1257  * This function is to resume paused media contents.
1258  *
1259  * @param       player          [in]    Handle of player.
1260  *
1261  * @return      This function returns zero on success, or negative value with error code.
1262  *
1263  * @pre         Player state may be MM_PLAYER_STATE_PAUSED.
1264  * @post                Player state will be MM_PLAYER_STATE_PLAYING.
1265  * @see         mm_player_pause
1266  * @remark      None
1267  * @par Example
1268  * @code
1269 if (mm_player_resume(g_player) != MM_ERROR_NONE)
1270 {
1271         debug_error("failed to resume player\n");
1272 }
1273  * @endcode
1274  */
1275 int mm_player_resume(MMHandleType player);
1276
1277 /**
1278  * This function is to set the position for playback. \n
1279  * So, it can be seeked to requested position. \n
1280  *
1281  * @param       player          [in]    Handle of player
1282  * @param       format          [in]    Format of position.
1283  * @param       pos                     [in]    Position for playback
1284  *
1285  * @return      This function returns zero on success, or negative value with error code.
1286  * @see         MMPlayerPosFormatType, mm_player_get_position
1287  * @remark  the unit of time-based format is millisecond and other case is percent.
1288  * @par Example
1289  * @code
1290 int position = 1000; //1sec
1291
1292 if (mm_player_set_position(g_player, MM_PLAYER_POS_FORMAT_TIME, position) != MM_ERROR_NONE)
1293 {
1294         debug_error("failed to set position\n");
1295 }
1296  * @endcode
1297  */
1298 int mm_player_set_position(MMHandleType player, MMPlayerPosFormatType format, int pos);
1299
1300 /**
1301  * This function is to get current position of playback content.
1302  *
1303  * @param       player          [in]    Handle of player.
1304  * @param       format          [in]    Format of position.
1305  * @param    pos        [out] contains current position on success or zero in case of failure.
1306  *
1307  * @return      This function returns zero on success, or negative value with errors
1308  * @see         MMPlayerPosFormatType, mm_player_set_position
1309  * @remark      the unit of time-based format is millisecond and other case is percent.
1310  * @par Example
1311  * @code
1312 int position = 0;
1313 int duration = 0;
1314
1315 mm_player_get_position(g_player, MM_PLAYER_POS_FORMAT_TIME, &position);
1316
1317 mm_player_get_attribute(g_player, &g_err_name, "content_duration", &duration, NULL);
1318
1319 debug_log("pos: [%d/%d] msec\n", position, duration);
1320  * @endcode
1321  */
1322 int mm_player_get_position(MMHandleType player, MMPlayerPosFormatType format, unsigned long *pos);
1323
1324 /**
1325  * This function is to get current buffer position of playback content.
1326  *
1327  * @param       player          [in]    Handle of player.
1328  * @param       format          [in]    Format of position.
1329  * @param       start_pos               [out] contains buffer start  position on success or zero in case of failure.
1330  * @param       stop_pos        [out] contains buffer current  position on success or zero in case of failure.
1331  *
1332  * @return      This function returns zero on success, or negative value with errors
1333  * @see         MMPlayerPosFormatType, mm_player_set_position
1334  * @remark      the unit of time-based format is millisecond and other case is percent.
1335  * @par Example
1336  * @code
1337 int start_pos = 0, stop_pos = 0;
1338
1339 mm_player_get_buffer_position(g_player, MM_PLAYER_POS_FORMAT_PERCENT, &start_pos, &stop_pos );
1340
1341 debug_log("buffer position: [%d] ~ [%d] \%\n", start_pos, stop_pos );
1342  * @endcode
1343  */
1344 int mm_player_get_buffer_position(MMHandleType player, MMPlayerPosFormatType format, unsigned long *start_pos, unsigned long *stop_pos);
1345
1346 /**
1347  * This function is to activate the section repeat. If it's set, selected section will be played \n
1348  * continually before deactivating it by mm_player_deactivate_section_repeat(). \n
1349  * The unit for setting is millisecond.
1350  *
1351  * @param       player          [in]    Handle of player.
1352  * @param       start_pos               [in]    start position.
1353  * @param       end_pos                 [in]    end position.
1354  *
1355  * @return      This function returns zero on success, or negative value with error code.
1356  * @see         mm_player_deactivate_section_repeat
1357  * @remark      None
1358  * @par Example
1359  * @code
1360 int position;
1361 int endtime = 4000; //msec
1362
1363 mm_player_get_position(g_player, MM_PLAYER_POS_FORMAT_TIME, &position);
1364
1365 mm_player_activate_section_repeat(g_player, position, position+endtime);
1366  * @endcode
1367  */
1368 int mm_player_activate_section_repeat(MMHandleType player, int start_pos, int end_pos);
1369
1370 /**
1371  * This function is to deactivate the section repeat.
1372  *
1373  * @param       player          [in]    Handle of player.
1374  *
1375  * @return      This function returns zero on success, or negative value with error code.
1376  * @see         mm_player_activate_section_repeat
1377  * @remark      None
1378  * @par Example
1379  * @code
1380 if ( mm_player_deactivate_section_repeat(g_player) != MM_ERROR_NONE)
1381 {
1382         debug_warning("failed to deactivate section repeat\n");
1383 }
1384  * @endcode
1385  */
1386 int mm_player_deactivate_section_repeat(MMHandleType player);
1387
1388 /**
1389  * This function sets callback function for receiving messages from player.
1390  * So, player can notify warning, error and normal cases to application.
1391  *
1392  * @param       player          [in]    Handle of player.
1393  * @param       callback        [in]    Message callback function.
1394  * @param       user_param      [in]    User parameter which is passed to callback function.
1395  *
1396  * @return      This function returns zero on success, or negative value with error code.
1397  * @see         MMMessageCallback
1398  * @remark      None
1399  * @par Example
1400  * @code
1401 int msg_callback(int message, MMMessageParamType *param, void *user_param)
1402 {
1403         switch (message)
1404         {
1405                 case MM_MESSAGE_ERROR:
1406                         //do something
1407                         break;
1408
1409                 case MM_MESSAGE_END_OF_STREAM:
1410                         //do something
1411                         break;
1412
1413                 case MM_MESSAGE_STATE_CHANGED:
1414                         //do something
1415                         break;
1416
1417                 case MM_MESSAGE_BEGIN_OF_STREAM:
1418                         //do something
1419                         break;
1420
1421                 default:
1422                         break;
1423         }
1424         return TRUE;
1425 }
1426
1427 mm_player_set_message_callback(g_player, msg_callback, (void*)g_player);
1428  * @endcode
1429  */
1430 int mm_player_set_message_callback(MMHandleType player, MMMessageCallback callback, void *user_param);
1431
1432 /**
1433  * This function set callback function for receiving audio stream from player. \n
1434  * So, application can get raw audio data and modify it. \n
1435  * But, if callback don't return or holds it for long time, performance can be deteriorated. \n
1436  * It's only supported when audio stream is included in file. \n
1437  * So, if there is video stream or DRM content, it can't be used.
1438  *
1439  * @param       player          [in]    Handle of player.
1440  * @param       callback                [in]    Audio stream callback function.
1441  * @param       user_param      [in]    User parameter.
1442  *
1443  * @return      This function returns zero on success, or negative value with error
1444  *                      code.
1445  * @see         mm_player_audio_stream_callback
1446  * @remark      It can be used for audio playback only.
1447  * @par Example
1448  * @code
1449 bool audio_callback(void *stream, int stream_size, void *user_param)
1450 {
1451         debug_log("audio stream callback\n");
1452         return TRUE;
1453 }
1454 mm_player_set_audio_stream_callback(g_player, audio_callback, NULL);
1455  * @endcode
1456  */
1457  int mm_player_set_audio_stream_callback(MMHandleType player, mm_player_audio_stream_callback callback, void *user_param);
1458
1459 /**
1460  * This function is to mute volume of player
1461  *
1462  * @param       player  [in]    Handle of player
1463  * @param       mute    [in]    Mute(1) or not mute(0)
1464  *
1465  * @return      This function returns zero on success, or negative value with error code
1466  * @see         mm_player_get_mute
1467  * @remark      None
1468  * @par Example
1469  * @code
1470 if (mm_player_set_mute(g_player, TRUE) != MM_ERROR_NONE)
1471 {
1472         debug_warning("failed to set mute\n");
1473 }
1474  * @endcode
1475  */
1476 int mm_player_set_mute(MMHandleType player, int mute);
1477
1478 /**
1479  * This function is to get mute value of player
1480  *
1481  * @param       player  [in]    Handle of player
1482  * @param       mute    [out]   Sound is muted
1483  *
1484  * @return      This function returns zero on success, or negative value with error code
1485  * @see         mm_player_set_mute
1486  * @remark      None
1487  * @par Example
1488  * @code
1489 int mute;
1490
1491 if (mm_player_get_mute(g_player, &mute) != MM_ERROR_NONE)
1492 {
1493         debug_warning("failed to get mute\n");
1494 }
1495
1496 debug_log("mute status:%d\n", mute);
1497  * @endcode
1498  */
1499 int mm_player_get_mute(MMHandleType player, int *mute);
1500
1501 /**
1502  * This function is to adjust subtitle postion. So, subtitle can show at the adjusted position. \n
1503  * If pos is negative, subtitle will be displayed previous time, the other hand forward time. \n
1504  *
1505  * @param       player  [in]    Handle of player
1506  * @param       pos             [in]    postion to be adjusted
1507  *
1508  * @return      This function returns zero on success, or negative value with error
1509  *                      code
1510  * @see         mm_player_adjust_subtitle_position
1511  * @remark      None
1512  * @par Example
1513  * @code
1514 int pos;
1515
1516 pos = 5000;
1517 if (mm_player_adjust_subtitle_position(g_player, MM_PLAYER_POS_FORMAT_TIME, pos) != MM_ERROR_NONE)
1518 {
1519         debug_warning("failed to adjust subtitle postion.\n");
1520 }
1521  * @endcode
1522  */
1523
1524 int mm_player_adjust_subtitle_position(MMHandleType player, MMPlayerPosFormatType format, int pos);
1525
1526 /**
1527  * This function is to set the offset in timestamps of video so as to bring the a/v sync
1528  * @param      player          Handle of player
1529  * @param      offset          offset to be set in milliseconds(can be positive or negative both)
1530  * postive offset to make video lag
1531  * negative offset to make video lead
1532  */
1533 int mm_player_adjust_video_position(MMHandleType player,int offset);
1534 /**
1535  * This function is to set subtitle silent status. So, subtitle can show or hide during playback \n
1536  * by this value. But, one subtitle file should be set with "subtitle_uri" attribute before calling mm_player_realize(); \n
1537  * Player FW parses subtitle file and send text data including timestamp to application \n
1538  * through message callback with MM_MESSAGE_UPDATE_SUBTITLE will be. \n
1539  * So, application have to render it. And, subtitle can be supported only in a seprate file. \n
1540  * So, it's not supported for embedded case.
1541  *
1542  * @param       player  [in]    Handle of player
1543  * @param       silent  [in]    silent(integer value except 0) or not silent(0)
1544  *
1545  * @return      This function returns zero on success, or negative value with error
1546  *                      code
1547  * @see         mm_player_get_subtitle_silent, MM_MESSAGE_UPDATE_SUBTITLE
1548  * @remark      None
1549  * @par Example
1550  * @code
1551 mm_player_set_attribute(g_player,
1552                                         &g_err_name,
1553                                         "subtitle_uri", g_subtitle_uri, strlen(g_subtitle_uri),
1554                                         NULL
1555                                         );
1556
1557 if (mm_player_set_subtitle_silent(g_player, TRUE) != MM_ERROR_NONE)
1558 {
1559         debug_warning("failed to set subtitle silent\n");
1560 }
1561  * @endcode
1562  */
1563 int mm_player_set_subtitle_silent(MMHandleType player, int silent);
1564
1565 /**
1566  * This function is to get silent status of subtitle.
1567  *
1568  * @param       player  [in]    Handle of player
1569  * @param       silent  [out]   subtitle silent property
1570  *
1571  * @return      This function returns zero on success, or negative value with error
1572  *                      code
1573  * @see         mm_player_set_subtitle_silent, MM_MESSAGE_UPDATE_SUBTITLE
1574  * @remark      None
1575  * @par Example
1576  * @code
1577 int silent = FALSE;
1578
1579 if (mm_player_get_subtitle_silent(g_player, &silent) != MM_ERROR_NONE)
1580 {
1581         debug_warning("failed to set subtitle silent\n");
1582 }
1583  * @endcode
1584  */
1585 int mm_player_get_subtitle_silent(MMHandleType player, int *silent);
1586
1587 /**
1588  * This function is to set attributes into player. Multiple attributes can be set simultaneously. \n
1589  * If one of attribute fails, this function will stop at the point and let you know the name which is failed. \n
1590  *
1591  * @param       player                          [in]    Handle of player.
1592  * @param       err_attr_name                   [out]  Name of attribute which is failed to set
1593  * @param       first_attribute_name    [in]    Name of the first attribute to set
1594  * @param   ...                                 [in]    Value for the first attribute, followed optionally by more name/value pairs, terminated by NULL.
1595  *                                                                       But, in the case of data or string type, it should be name/value/size.
1596  *
1597  * @return      This function returns zero on success, or negative value with error code.
1598  *
1599  * @see         mm_player_get_attribute
1600  * @remark      This function must be terminated by NULL argument.
1601  *                      And, if this function is failed, err_attr_name param must be free.
1602  * @par Example
1603  * @code
1604 char *g_err_attr_name = NULL;
1605
1606 if (mm_player_set_attribute(g_player,
1607                                                 &g_err_attr_name,
1608                                                 "profile_uri", filename, strlen(filename),
1609                                                 "profile_play_count", count,
1610                                                 NULL) != MM_ERROR_NONE)
1611 {
1612         debug_warning("failed to set %s attribute\n", g_err_attr_name);
1613         free(g_err_attr_name);
1614 }
1615
1616  * @endcode
1617  */
1618 int mm_player_set_attribute(MMHandleType player,  char **err_attr_name, const char *first_attribute_name, ...)G_GNUC_NULL_TERMINATED;
1619
1620 /**
1621  * This function is to get attributes from player. Multiple attributes can be got simultaneously.
1622  *
1623  * @param       player                          [in]    Handle of player.
1624  * @param       err_attr_name                   [out]  Name of attribute which is failed to get
1625  * @param       first_attribute_name    [in]    Name of the first attribute to get
1626  * @param       ...                                     [out] Value for the first attribute, followed optionally by more name/value pairs, terminated by NULL.
1627  *                                                                       But, in the case of data or string type, it should be name/value/size.
1628  *
1629  * @return      This function returns zero on success, or negative value with error
1630  *                      code.
1631  * @see         mm_player_set_attribute
1632  * @remark      This function must be terminated by NULL argument.
1633  *                      And, if this function is failed, err_attr_name param must be free.
1634  * @par Example
1635  * @code
1636 char *g_err_attr_name = NULL;
1637
1638 if (mm_player_get_attribute(g_player, &g_err_attr_name, "content_duration", &duration, NULL) != MM_ERROR_NONE)
1639 {
1640         debug_warning("failed to set %s attribute\n", g_err_attr_name);
1641         free(g_err_attr_name);
1642 }
1643  * @endcode
1644  */
1645 int mm_player_get_attribute(MMHandleType player,  char **err_attr_name, const char *first_attribute_name, ...)G_GNUC_NULL_TERMINATED;
1646
1647 /**
1648  * This function is to get detail information of attribute.
1649  *
1650  * @param       player                           [in]   Handle of player.
1651  * @param   attribute_name               [in]   Name of the attribute to get
1652  * @param   info                                 [out]  Attribute infomation
1653  *
1654  * @return      This function returns zero on success, or negative value with error
1655  *                      code.
1656  *
1657  * @see         mm_player_set_attribute, mm_player_get_attribute
1658  * @remark      None
1659  * @par Example
1660  * @code
1661 if (mm_player_get_attribute_info (g_player, "display_method", &method_info) != MM_ERROR_NONE)
1662 {
1663         debug_warning("failed to get info\n");
1664 }
1665
1666 debug_log("type:%d \n", method_info.type); //int, double..
1667 debug_log("flag:%d \n", method_info.flag); //readable, writable..
1668 debug_log("validity type:%d \n", method_info.validity_type); //range, array..
1669
1670 if (method_info. validity_type == MM_PLAYER_ATTRS_VALID_TYPE_INT_RANGE)
1671 {
1672         debug_log("range min:%d\n", method_info.int_range.min);
1673         debug_log("range max:%d\n", method_info.int_range.max);
1674 }
1675  * @endcode
1676  */
1677 int mm_player_get_attribute_info(MMHandleType player,  const char *attribute_name, MMPlayerAttrsInfo *info);
1678
1679 /**
1680  * This function is to get download position and total size of progressive download
1681  *
1682  * @param       player          [in]    Handle of player.
1683  * @param       current_pos     [in]    Download position currently (bytes)
1684  * @param       total_size      [in]    Total size of file (bytes)
1685  *
1686  * @return      This function returns zero on success, or negative value with error code.
1687  *
1688  * @see
1689  * @remark
1690  * @par Example
1691  * @code
1692 guint64 current_pos = 0LLU;
1693 guint64 total_size = 0LLU;
1694
1695 if (mm_player_get_pd_status(g_player, &current_pos, &total_size, NULL) != MM_ERROR_NONE)
1696 {
1697         debug_log("current download pos = %llu, total size = %llu\n", current_pos, total_size);
1698 }
1699  * @endcode
1700  */
1701 int mm_player_get_pd_status(MMHandleType player, guint64 *current_pos, guint64 *total_size);
1702
1703 /**
1704  * This function sets callback function for receiving messages of PD downloader.
1705  *
1706  * @param       player          [in]    Handle of player.
1707  * @param       callback                [in]    Message callback function.
1708  * @param       user_param      [in]    User parameter which is passed to callback function.
1709  *
1710  * @return      This function returns zero on success, or negative value with error code.
1711  * @see
1712  * @remark      None
1713  * @par Example
1714  * @code
1715 int msg_callback(int message, MMMessageParamType *param, void *user_param)
1716 {
1717         switch (message)
1718         {
1719                 case MM_MESSAGE_PD_DOWNLOADER_START:
1720                         debug_log("Progressive download is started...\n");
1721                         break;
1722                 case MM_MESSAGE_PD_DOWNLOADER_END:
1723                         debug_log("Progressive download is ended...\n");
1724                         break;
1725                 default:
1726                         break;
1727         }
1728         return TRUE;
1729 }
1730
1731 mm_player_set_pd_message_callback(g_player, msg_callback, NULL);
1732  * @endcode
1733  */
1734 int mm_player_set_pd_message_callback(MMHandleType player, MMMessageCallback callback, void *user_param);
1735
1736 /**
1737  * This function is to get the track count
1738  *
1739  * @param       player          [in]    handle of player.
1740  * @param       track                   [in]    type of the track type
1741  * @param       info                    [out]   the count of the track
1742  *
1743  * @return      This function returns zero on success, or negative value with error
1744  *                      code.
1745  *
1746  * @see
1747  * @remark      None
1748  * @par Example
1749  * @code
1750 gint audio_count = 0;
1751
1752 if (mm_player_get_track_count (g_player, MM_PLAYER_TRACK_TYPE_AUDIO, &audio_count) != MM_ERROR_NONE)
1753 {
1754         debug_warning("failed to get audio track count\n");
1755 }
1756
1757 debug_log("audio track count : %d \n", audio_count);
1758  * @endcode
1759  */
1760 int mm_player_get_track_count(MMHandleType player,  MMPlayerTrackType type, int *count);
1761
1762 /**
1763  * This function is to select the track
1764  *
1765  * @param       player          [in]    handle of player.
1766  * @param       type                    [in]    type of the track type
1767  * @param       index           [in]    the index of the track
1768  *
1769  * @return      This function returns zero on success, or negative value with error
1770  *                      code.
1771  *
1772  * @see
1773  * @remark      None
1774  */
1775 int mm_player_select_track(MMHandleType player, MMPlayerTrackType type, int index);
1776 #ifdef _MULTI_TRACK
1777 /**
1778  * This function is to add the track when user want multi subtitle
1779  *
1780  * @param       player          [in]    handle of player.
1781  * @param       index           [in]    the index of the track
1782  *
1783  * @return      This function returns zero on success, or negative value with error
1784  *                      code.
1785  *
1786  * @see
1787  * @remark      None
1788  */
1789 int mm_player_track_add_subtitle_language(MMHandleType player, int index);
1790
1791 /**
1792  * This function is to remove the track when user want multi subtitle
1793  *
1794  * @param       player          [in]    handle of player.
1795  * @param       index           [in]    the index of the track
1796  *
1797  * @return      This function returns zero on success, or negative value with error
1798  *                      code.
1799  *
1800  * @see
1801  * @remark      None
1802  */
1803 int mm_player_track_remove_subtitle_language(MMHandleType player, int index);
1804
1805 /**
1806  * This function is to notify which sutitle track is in use
1807  *
1808  * @param       player          [in]    handle of player.
1809  * @param       callback                        [in]    callback function to register
1810  * @param       user_data       [in]    user data to be passed to the callback function
1811  *
1812  * @return      This function returns zero on success, or negative value with error
1813  *                      code.
1814  *
1815  * @see
1816  * @remark      None
1817  */
1818 int mm_player_track_foreach_selected_subtitle_language(MMHandleType player, mm_player_track_selected_subtitle_language_callback callback, void *user_param);
1819 #endif
1820 /**
1821  * This function is to get the track language
1822  *
1823  * @param       player          [in]    handle of player.
1824  * @param       type                    [in]    type of the track type
1825  * @param       index           [in]    the index of the track
1826  * @param       code                    [out] language code in ISO 639-1(string)
1827  *
1828  * @return      This function returns zero on success, or negative value with error
1829  *                      code.
1830  *
1831  * @see
1832  * @remark      None
1833  */
1834 int mm_player_get_track_language_code(MMHandleType player,  MMPlayerTrackType type, int index, char **code);
1835
1836 /**
1837  * This function is to get the current running track
1838  *
1839  * @param       player          [in]    handle of player.
1840  * @param       type                    [in]    type of the track type
1841  * @param       index           [out]    the index of the track
1842  *
1843  * @return      This function returns zero on success, or negative value with error
1844  *                      code.
1845  *
1846  * @see
1847  * @remark      None
1848  */
1849
1850 int mm_player_get_current_track(MMHandleType hplayer, MMPlayerTrackType type, int *index);
1851
1852 /**
1853  * This function is to set the buffer size for streaming playback. \n
1854  *
1855  * @param       player          [in]    Handle of player
1856  * @param       second          [in]    Size of initial buffer
1857  *
1858  * @return      This function returns zero on success, or negative value with error code.
1859  * @remark  None
1860  * @par Example
1861  * @code
1862 gint second = 10; //10sec
1863
1864 if (mm_player_set_prepare_buffering_time(g_player, second) != MM_ERROR_NONE)
1865 {
1866         debug_error("failed to set buffer size\n");
1867 }
1868  * @endcode
1869  */
1870
1871 int mm_player_set_prepare_buffering_time(MMHandleType player, int second);
1872
1873 /**
1874  * This function is to set the runtime buffering mode for streaming playback. \n
1875  *
1876  * @param       player          [in]    Handle of player
1877  * @param       mode            [in]    mode of runtime buffering
1878  * @param       second          [in]    max size of buffering
1879  *
1880  * @return      This function returns zero on success, or negative value with error code.
1881  * @remark  None
1882  * @par Example
1883  * @code
1884
1885 if (mm_player_set_runtime_buffering_mode(g_player, MM_PLAYER_BUFFERING_MODE_ADAPTIVE, 10) != MM_ERROR_NONE)
1886 {
1887         debug_error("failed to set buffering mode\n");
1888 }
1889  * @endcode
1890  */
1891
1892 int mm_player_set_runtime_buffering_mode(MMHandleType player, MMPlayerBufferingMode mode, int second);
1893
1894 /**
1895  * This function is to set the start position of zoom
1896  *
1897  * @param       player          [in]    handle of player
1898  * @param       level           [in]    level of zoom
1899  * @param       x               [in]    start x position
1900  * @param       y               [in]    start y position
1901  *
1902  * @return      This function returns zero on success, or negative value with error
1903  *                      code.
1904  *
1905  * @see
1906  * @remark      None
1907  */
1908 int mm_player_set_display_zoom(MMHandleType player, float level, int x, int y);
1909
1910 /**
1911  * This function is to get the start position of zoom
1912  *
1913  * @param       player           [in]    handle of player
1914  * @param       type            [out]    current level of zoom
1915  * @param       x               [out]    start x position
1916  * @param       y               [out]    start y position
1917  *
1918  * @return      This function returns zero on success, or negative value with error
1919  *                      code.
1920  *
1921  * @see
1922  * @remark      None
1923  */
1924 int mm_player_get_display_zoom(MMHandleType player, float *level, int *x, int *y);
1925
1926 /**
1927  * This function is to set the subtitle path
1928  *
1929  * @param       player  [in]    handle of player
1930  * @param       path    [in]    subtitle path
1931  *
1932  * @return      This function returns zero on success, or negative value with error code.
1933  *
1934  * @see
1935  * @remark      None
1936  */
1937 int mm_player_set_external_subtitle_path(MMHandleType player, const char* path);
1938
1939 /**
1940  * This function is to set the clock which is from master player
1941  *
1942  * @param       player  [in]    handle of player
1943  * @param       clock   [in]    clock of master player
1944  * @param       clock_delta [in]        clock difference between master and slave
1945  * @param       video_time      [in]    current playing position
1946  * @param       media_clock     [in]    media clock information
1947  * @param       audio_time      [in]    audio timestamp information
1948  * @return      This function returns zero on success, or negative value with error code.
1949  *
1950  * @see
1951  * @remark      None
1952  */
1953 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);
1954 /**
1955  * This function is to get the master clock
1956  *
1957  * @param       player          [in]    handle of player
1958  * @param       video_time      [out]   current playing position
1959  * @param       media_clock     [out]   media clock information
1960  * @param       audio_time      [out]   audio timestamp information
1961  * @return      This function returns zero on success, or negative value with error code.
1962  *
1963  * @see
1964  * @remark      None
1965  */
1966 int mm_player_get_video_share_master_clock(MMHandleType player, long long *video_time, long long *media_clock, long long *audio_time);
1967 /**
1968  * This function is to set audio channel
1969  *
1970  * @param       player          [in]    handle of player
1971  * @param       ch                      [in]    audio channel
1972  * @return      This function returns zero on success, or negative value with error code.
1973  *
1974  * @see
1975  * @remark      None
1976  */
1977 int mm_player_gst_set_audio_channel(MMHandleType player, MMPlayerAudioChannel ch);
1978
1979 /**
1980  * This function is to get the content angle
1981  *
1982  * @param       player          [in]    handle of player
1983  * @param       angle           [out]   orignal angle from content
1984  * @return      This function returns zero on success, or negative value with error code.
1985  *
1986  * @see
1987  * @remark      None
1988  */
1989 int mm_player_get_video_rotate_angle(MMHandleType player, int *angle);
1990
1991 /**
1992  * This function is to set download mode of video hub
1993  *
1994  * @param       player          [in]    handle of player
1995  * @param       mode            [in]    download mode
1996  * @return      This function returns zero on success, or negative value with error code.
1997  *
1998  * @see
1999  * @remark      None
2000  */
2001 int mm_player_set_video_hub_download_mode(MMHandleType player, bool mode);
2002
2003 /**
2004  * This function is to set using sync handler.
2005  *
2006  * @param       player          [in]    handle of player
2007  * @param       enable          [in]    enable/disable
2008  * @return      This function returns zero on success, or negative value with error code.
2009  *
2010  * @see
2011  * @remark      None
2012  */
2013 int mm_player_enable_sync_handler(MMHandleType player, bool enable);
2014
2015 /**
2016  * This function is to set uri.
2017  *
2018  * @param       player          [in]    handle of player
2019  * @param       uri             [in]    uri
2020  * @return      This function returns zero on success, or negative value with error code.
2021  *
2022  * @see
2023  * @remark      None
2024  */
2025 int mm_player_set_uri(MMHandleType player, const char *uri);
2026
2027 /**
2028  * This function is to set next uri.
2029  *
2030  * @param       player          [in]    handle of player
2031  * @param       uri             [in]    uri
2032  * @return      This function returns zero on success, or negative value with error code.
2033  *
2034  * @see
2035  * @remark      None
2036  */
2037 int mm_player_set_next_uri(MMHandleType player, const char *uri);
2038
2039 /**
2040  * This function is to get next uri.
2041  *
2042  * @param       player          [in]    handle of player
2043  * @param       uri             [out]   uri
2044  * @return      This function returns zero on success, or negative value with error code.
2045  *
2046  * @see
2047  * @remark      None
2048  */
2049 int mm_player_get_next_uri(MMHandleType player, char **uri);
2050
2051 int mm_player_enable_media_packet_video_stream(MMHandleType player, bool enable);
2052
2053 /**
2054  * This function is to increase reference count of internal buffer.
2055  *
2056  * @param       buffer          [in]   video callback internal buffer
2057  * @return      This function returns buffer point;
2058  *
2059  * @see
2060  * @remark      None
2061  */
2062 void * mm_player_media_packet_video_stream_internal_buffer_ref(void *buffer);
2063
2064 /**
2065  * This function is to decrease reference count of internal buffer.
2066  *
2067  * @param       buffer          [in]   video callback internal buffer
2068  * @return      None;
2069  *
2070  * @see
2071  * @remark      None
2072  */
2073 void mm_player_media_packet_video_stream_internal_buffer_unref(void *buffer);
2074
2075 /**mm_player_submit_packet
2076  * This function is to submit buffer to appsrc.  \n
2077  * @param       player                  [in]    Handle of player.
2078  * @param       buf             [in]    buffer to be submit in appsrc in external feeder case.
2079  * @param       len                             [in]    length of buffer.
2080  * @param       pts                             [in]    timestamp of buffer.
2081  * @param       streamtype              [in]    stream type of buffer.
2082  * @return      This function returns zero on success, or negative value with error code.
2083  * @par Example
2084  *
2085  * @endcode
2086  */
2087 int mm_player_submit_packet(MMHandleType player, media_packet_h packet);
2088
2089 /**mm_player_set_video_info
2090  * This function is to set caps of src pad of video appsrc in external feeder case.  \n
2091  * @param       player                          [in]    Handle of player.
2092  * @param       media_format_h                  [in]    Video stream info.
2093  * @return      This function returns zero on success, or negative value with error code.
2094  * @par Example
2095  *
2096  * @endcode
2097  */
2098
2099 int mm_player_set_video_info (MMHandleType player, media_format_h format);
2100
2101 /**mm_player_set_audio_info
2102  * This function is to set caps of src pad of Audio appsrc in external feeder case.  \n
2103  * @param       player                       [in]    Handle of player.
2104  * @param       media_format_h               [in]    Audio stream info.
2105  * @return      This function returns zero on success, or negative value with error code.
2106  * @par Example
2107  *
2108  * @endcode
2109  */
2110
2111 int mm_player_set_audio_info (MMHandleType player, media_format_h format);
2112
2113 /**mm_player_set_subtitle_info
2114  * This function is to set caps of src pad of subtitle appsrc in external feeder case.  \n
2115  * @param       player                          [in]    Handle of player.
2116  * @param       subtitle_stream_info               [in]    Subtitle stream info.
2117  * @return      This function returns zero on success, or negative value with error code.
2118  * @par Example
2119  *
2120  * @endcode
2121  */
2122
2123 int mm_player_set_subtitle_info (MMHandleType player, MMPlayerSubtitleStreamInfo *info);
2124
2125 /**
2126  * This function set callback function for receiving need or enough data message from player.
2127  *
2128  * @param       player          [in]    Handle of player.
2129  * @param       type            [in]    stream type
2130  * @param       callback        [in]    data callback function for stream type.
2131  * @param       user_param      [in]    User parameter.
2132  *
2133  * @return      This function returns zero on success, or negative value with error
2134  *                      code.
2135  * @remark
2136  * @see
2137  * @since
2138  */
2139 int mm_player_set_media_stream_buffer_status_callback(MMHandleType player, MMPlayerStreamType type, mm_player_media_stream_buffer_status_callback callback, void * user_param);
2140
2141 /**
2142  * This function set callback function for receiving seek data message from player.
2143  *
2144  * @param       player          [in]    Handle of player.
2145  * @param       type            [in]    stream type
2146  * @param       callback        [in]    Seek data callback function for stream type.
2147  * @param       user_param      [in]    User parameter.
2148  *
2149  * @return      This function returns zero on success, or negative value with error
2150  *                      code.
2151  * @remark
2152  * @see
2153  * @since
2154  */
2155 int mm_player_set_media_stream_seek_data_callback(MMHandleType player, MMPlayerStreamType type, mm_player_media_stream_seek_data_callback callback, void * user_param);
2156
2157 /**
2158  * This function is to set max size of buffer(appsrc).
2159  *
2160  * @param       player          [in]    Handle of player.
2161  * @param       type            [in]    stream type
2162  * @param       max_size        [in]    max bytes of buffer.
2163  *
2164  * @return      This function returns zero on success, or negative value with error
2165  *                      code.
2166  * @remark
2167  * @see
2168  * @since
2169  */
2170 int mm_player_set_media_stream_buffer_max_size(MMHandleType player, MMPlayerStreamType type, unsigned long long max_size);
2171
2172 /**
2173  * This function is to get max size of buffer(appsrc).
2174  *
2175  * @param       player          [in]    Handle of player.
2176  * @param       type            [in]    stream type
2177  * @param       max_size        [out]   max bytes of buffer.
2178  *
2179  * @return      This function returns zero on success, or negative value with error
2180  *                      code.
2181  * @remark
2182  * @see
2183  * @since
2184  */
2185 int mm_player_get_media_stream_buffer_max_size(MMHandleType player, MMPlayerStreamType type, unsigned long long *max_size);
2186
2187 /**
2188  * This function is to set min percent of buffer(appsrc).
2189  *
2190  * @param       player          [in]    Handle of player.
2191  * @param       type            [in]    stream type
2192  * @param       min_percent     [in]    min percent of buffer.
2193  *
2194  * @return      This function returns zero on success, or negative value with error
2195  *                      code.
2196  * @remark
2197  * @see
2198  * @since
2199  */
2200 int mm_player_set_media_stream_buffer_min_percent(MMHandleType player, MMPlayerStreamType type, unsigned min_percent);
2201
2202 /**
2203  * This function is to get min percent of buffer(appsrc).
2204  *
2205  * @param       player          [in]    Handle of player.
2206  * @param       type            [in]    stream type
2207  * @param       min_percent     [out]   min percent of buffer.
2208  *
2209  * @return      This function returns zero on success, or negative value with error
2210  *                      code.
2211  * @remark
2212  * @see
2213  * @since
2214  */
2215 int mm_player_get_media_stream_buffer_min_percent(MMHandleType player, MMPlayerStreamType type, unsigned int *min_percent);
2216
2217 /**
2218  * This function set callback function for changing audio stream from player. \n
2219  * It's only supported when audio stream is included in file. \n
2220  *
2221  * @param       player   [in] Handle of player.
2222  * @param       callback [in] Audio stream changed callback function.
2223  * @param       user_param [in] User parameter.
2224  *
2225  * @return      This function returns zero on success, or negative value with error
2226  *                      code.
2227  * @see         mm_player_stream_changed_callback
2228  * @since
2229  */
2230 int mm_player_set_audio_stream_changed_callback(MMHandleType player, mm_player_stream_changed_callback callback, void *user_param);
2231
2232 /**
2233  * This function set callback function for changing video stream from player. \n
2234  * It's only supported when video stream is included in file. \n
2235  *
2236  * @param       player   [in] Handle of player.
2237  * @param       callback [in] Video stream changed callback function.
2238  * @param       user_param [in] User parameter.
2239  *
2240  * @return      This function returns zero on success, or negative value with error
2241  *                      code.
2242  * @see         mm_player_stream_changed_callback
2243  * @since
2244  */
2245 int mm_player_set_video_stream_changed_callback(MMHandleType player, mm_player_stream_changed_callback callback, void *user_param);
2246
2247 /**
2248         @}
2249  */
2250
2251 #ifdef __cplusplus
2252         }
2253 #endif
2254
2255 #endif  /* __MM_PLAYER_H__ */