4 * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
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>
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
13 * http://www.apache.org/licenses/LICENSE-2.0
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.
23 #ifndef __MM_PLAYER_H__
24 #define __MM_PLAYER_H__
27 /*===========================================================================================
31 ========================================================================================== */
36 #include <mm_message.h>
37 #include <media_packet.h>
43 /*===========================================================================================
45 | GLOBAL DEFINITIONS AND DECLARATIONS |
47 ========================================================================================== */
52 * uri to play (string)
55 #define MM_PLAYER_CONTENT_URI "profile_uri"
57 * MM_PLAYER_CONTENT_DURATION:
59 * get the duration (int) as millisecond, It's guaranteed after calling mm_player_start() or
60 * receiving MM_MESSAGE_BEGIN_OF_STREAM.
63 #define MM_PLAYER_CONTENT_DURATION "content_duration"
65 * MM_PLAYER_VIDEO_ROTATION
67 * can change video angle (int)
68 * @see MMDisplayRotationType
70 #define MM_PLAYER_VIDEO_ROTATION "display_rotation"
72 * MM_PLAYER_VIDEO_WIDTH:
74 * get the video width (int), It's guaranteed after calling mm_player_start() or
75 * receiving MM_MESSAGE_BEGIN_OF_STREAM.
78 #define MM_PLAYER_VIDEO_WIDTH "content_video_width"
80 * MM_PLAYER_VIDEO_HEIGHT:
82 * get the video height (int), It's guaranteed after calling mm_player_start() or
83 * receiving MM_MESSAGE_BEGIN_OF_STREAM.
86 #define MM_PLAYER_VIDEO_HEIGHT "content_video_height"
88 * MM_PLAYER_VIDEO_EVAS_SURFACE_SINK:
90 * get the video evas surface sink plugin name (string), It's guaranteed after calling mm_player_create()
93 #define MM_PLAYER_VIDEO_EVAS_SURFACE_SINK "display_evas_surface_sink"
97 * set memory pointer to play (data)
100 #define MM_PLAYER_MEMORY_SRC "profile_user_param"
102 * MM_PLAYER_PLAYBACK_COUNT
104 * can set playback count (int), Default value is 1 and -1 is for infinity playing until releasing it.
107 #define MM_PLAYER_PLAYBACK_COUNT "profile_play_count"
109 * MM_PLAYER_SUBTITLE_URI
111 * set the subtitle path (string)
113 #define MM_PLAYER_SUBTITLE_URI "subtitle_uri"
115 * MM_PLAYER_STREAMING_USER_AGENT
117 * set the streaming user agent (string)
119 #define MM_PLAYER_STREAMING_USER_AGENT "streaming_user_agent"
121 * MM_PLAYER_STREAMING_COOKIE
123 * set the streaming cookie (int)
125 #define MM_PLAYER_STREAMING_COOKIE "streaming_cookie"
127 * MM_PLAYER_VIDEO_CODEC
129 * codec the video data is stored in (string)
131 #define MM_PLAYER_VIDEO_CODEC "content_video_codec"
133 * MM_PLAYER_AUDIO_CODEC
135 * codec the audio data is stored in (string)
137 #define MM_PLAYER_AUDIO_CODEC "content_audio_codec"
139 * MM_PLAYER_AUDIO_BITRATE
141 * set the streaming proxy port (int)
143 #define MM_PLAYER_AUDIO_BITRATE "content_audio_bitrate"
145 * MM_PLAYER_AUDIO_CHANNEL
147 * the number of audio channel (int)
149 #define MM_PLAYER_AUDIO_CHANNEL "content_audio_channels"
151 * MM_PLAYER_AUDIO_SAMPLERATE
153 * audio samplerate (int)
155 #define MM_PLAYER_AUDIO_SAMPLERATE "content_audio_samplerate"
157 * MM_PLAYER_AUDIO_TRACK_NUM
159 * track number inside a collection (int)
161 #define MM_PLAYER_AUDIO_TRACK_NUM "content_audio_track_num"
163 * MM_PLAYER_TEXT_TRACK_NUM
165 * track number inside a collection (int)
167 #define MM_PLAYER_TEXT_TRACK_NUM "content_text_track_num"
169 * MM_PLAYER_TAG_ARTIST
171 * person(s) responsible for the recording (string)
173 #define MM_PLAYER_TAG_ARTIST "tag_artist"
175 * MM_PLAYER_TAG_TITLE
179 #define MM_PLAYER_TAG_TITLE "tag_title"
181 * MM_PLAYER_TAG_ALBUM
183 * album containing this data (string)
185 #define MM_PLAYER_TAG_ALBUM "tag_album"
187 * MM_PLAYER_TAG_GENRE
189 * genre this data belongs to (string)
191 #define MM_PLAYER_TAG_GENRE "tag_genre"
193 * MM_PLAYER_TAG_AUTHOUR
197 #define MM_PLAYER_TAG_AUTHOUR "tag_author"
199 * MM_PLAYER_TAG_COPYRIGHT
201 * copyright notice of the data (string)
203 #define MM_PLAYER_TAG_COPYRIGHT "tag_copyright"
207 * date the data was created (string)
209 #define MM_PLAYER_TAG_DATE "tag_date"
211 * MM_PLAYER_TAG_DESCRIPRION
213 * short text describing the content of the data (string)
215 #define MM_PLAYER_TAG_DESCRIPRION "tag_description"
217 * MM_PLAYER_TAG_TRACK_NUM
219 * track number inside a collection (int)
221 #define MM_PLAYER_TAG_TRACK_NUM "tag_track_num"
225 * progressive download mode (int)
227 #define MM_PLAYER_PD_MODE "pd_mode"
232 * dynamic resolution change mode (int)
234 #define MM_PLAYER_DRC_MODE "drc_mode"
237 * MM_PLAYER_GAPLESS_MODE
239 * gapless playback mode (int)
241 #define MM_PLAYER_GAPLESS_MODE "gapless_mode"
244 * MM_PLAYER_ENABLE_VIDEO_DECODED_CB
246 * enable video decoded callback (int)
248 #define MM_PLAYER_ENABLE_VIDEO_DECODED_CB "enable_video_decoded_cb"
251 * MM_PLAYER_VIDEO_CODEC_TYPE
253 * video codec type (int)
255 #define MM_PLAYER_VIDEO_CODEC_TYPE "video_codec_type"
258 * MM_PLAYER_AUDIO_CODEC_TYPE
260 * audio codec type (int)
262 #define MM_PLAYER_AUDIO_CODEC_TYPE "audio_codec_type"
264 #define BUFFER_MAX_PLANE_NUM (4)
267 MMPixelFormatType format; /**< image format */
268 int width; /**< width of video buffer */
269 int height; /**< height of video buffer */
270 unsigned int timestamp; /**< timestamp of stream buffer (msec)*/
271 unsigned int length_total; /**< total length of stream buffer (in byte)*/
272 void *data[BUFFER_MAX_PLANE_NUM];
273 void *bo[BUFFER_MAX_PLANE_NUM]; /**< TBM buffer object */
274 void *internal_buffer; /**< Internal buffer pointer */
275 int stride[BUFFER_MAX_PLANE_NUM]; /**< stride of plane */
276 int elevation[BUFFER_MAX_PLANE_NUM]; /**< elevation of plane */
277 } MMPlayerVideoStreamDataType;
280 * Enumerations of player state.
283 MM_PLAYER_STATE_NULL, /**< Player is created, but not realized yet */
284 MM_PLAYER_STATE_READY, /**< Player is ready to play media */
285 MM_PLAYER_STATE_PLAYING, /**< Player is now playing media */
286 MM_PLAYER_STATE_PAUSED, /**< Player is paused while playing media */
287 MM_PLAYER_STATE_NONE, /**< Player is not created yet */
288 MM_PLAYER_STATE_NUM, /**< Number of player states */
292 * Enumerations of position formats.
293 * Used while invoking mm_player_get_position/mm_player_set_position APIs
296 MM_PLAYER_POS_FORMAT_TIME, /**< Format for time based */
297 MM_PLAYER_POS_FORMAT_PERCENT, /**< Format for percentage */
298 MM_PLAYER_POS_FORMAT_NUM, /**< Number of position formats */
299 } MMPlayerPosFormatType;
302 * Enumeration for attribute values types.
305 MM_PLAYER_ATTRS_TYPE_INVALID = -1, /**< Type is invalid */
306 MM_PLAYER_ATTRS_TYPE_INT, /**< Integer type */
307 MM_PLAYER_ATTRS_TYPE_DOUBLE, /**< Double type */
308 MM_PLAYER_ATTRS_TYPE_STRING, /**< UTF-8 String type */
309 MM_PLAYER_ATTRS_TYPE_DATA, /**< Pointer type */
310 MM_PLAYER_ATTRS_TYPE_ARRAY, /**< Array type */
311 MM_PLAYER_ATTRS_TYPE_RANGE, /**< Range type */
312 MM_PLAYER_ATTRS_TYPE_NUM, /**< Number of attribute type */
316 * Enumeration for attribute validation type.
319 MM_PLAYER_ATTRS_VALID_TYPE_INVALID = -1, /**< Invalid validation type */
320 MM_PLAYER_ATTRS_VALID_TYPE_NONE, /**< Do not check validity */
321 MM_PLAYER_ATTRS_VALID_TYPE_INT_ARRAY, /**< validity checking type of integer array */
322 MM_PLAYER_ATTRS_VALID_TYPE_INT_RANGE, /**< validity checking type of integer range */
323 MM_PLAYER_ATTRS_VALID_TYPE_DOUBLE_ARRAY, /**< validity checking type of double array */
324 MM_PLAYER_ATTRS_VALID_TYPE_DOUBLE_RANGE, /**< validity checking type of double range */
325 } MMPlayerAttrsValidType;
328 * Enumeration for attribute access flag.
331 MM_PLAYER_ATTRS_FLAG_NONE = 0, /**< None flag is set */
332 MM_PLAYER_ATTRS_FLAG_READABLE = 1 << 0, /**< Readable */
333 MM_PLAYER_ATTRS_FLAG_WRITABLE = 1 << 1, /**< Writable */
334 MM_PLAYER_ATTRS_FLAG_MODIFIED = 1 << 2, /**< Modified */
336 MM_PLAYER_ATTRS_FLAG_RW = MM_PLAYER_ATTRS_FLAG_READABLE | MM_PLAYER_ATTRS_FLAG_WRITABLE, /**< Readable and Writable */
340 * Enumeration for progressive download
343 MM_PLAYER_PD_MODE_NONE,
344 MM_PLAYER_PD_MODE_URI,
345 MM_PLAYER_PD_MODE_FILE // not tested yet, because of no fixed scenario
349 * Enumeration of track types
352 MM_PLAYER_TRACK_TYPE_AUDIO = 0,
353 MM_PLAYER_TRACK_TYPE_VIDEO,
354 MM_PLAYER_TRACK_TYPE_TEXT,
355 MM_PLAYER_TRACK_TYPE_MAX
359 * Enumeration of runtime buffering mode
362 MM_PLAYER_BUFFERING_MODE_ADAPTIVE = 0, /**< default, If buffering is occurred, player will consider the bandwidth to adjust buffer setting. */
363 MM_PLAYER_BUFFERING_MODE_FIXED, /**< player will set buffer size with this fixed size value. */
364 MM_PLAYER_BUFFERING_MODE_MAX,
365 } MMPlayerBufferingMode;
368 MM_PLAYER_FOCUS_CHANGED_COMPLETED = 0,
369 MM_PLAYER_FOCUS_CHANGED_BY_MEDIA,
370 MM_PLAYER_FOCUS_CHANGED_BY_CALL,
371 MM_PLAYER_FOCUS_CHANGED_BY_EARJACK_UNPLUG,
372 MM_PLAYER_FOCUS_CHANGED_BY_RESOURCE_CONFLICT,
373 MM_PLAYER_FOCUS_CHANGED_BY_ALARM,
374 MM_PLAYER_FOCUS_CHANGED_BY_EMERGENCY,
375 MM_PLAYER_FOCUS_CHANGED_BY_NOTIFICATION,
376 MM_PLAYER_FOCUS_CHANGED_BY_UNKNOWN,
377 } MMPlayerFocusChangedMsg;
381 * Edge Properties of the text.
385 MM_PLAYER_EDGE_RAISED,
386 MM_PLAYER_EDGE_DEPRESSED,
387 MM_PLAYER_EDGE_UNIFORM,
388 MM_PLAYER_EDGE_DROPSHADOW
389 } MMPlayerSubtitleEdge;
392 * Enumeration of media stream buffer status
395 MM_PLAYER_MEDIA_STREAM_BUFFER_UNDERRUN,
396 MM_PLAYER_MEDIA_STREAM_BUFFER_OVERFLOW,
397 } MMPlayerMediaStreamBufferStatus;
400 * Enumeration for stream type.
403 MM_PLAYER_STREAM_TYPE_DEFAULT, /**< Container type */
404 MM_PLAYER_STREAM_TYPE_AUDIO, /**< Audio element stream type */
405 MM_PLAYER_STREAM_TYPE_VIDEO, /**< Video element stream type */
406 MM_PLAYER_STREAM_TYPE_TEXT, /**< Text type */
407 MM_PLAYER_STREAM_TYPE_MAX,
408 } MMPlayerStreamType;
411 MM_PLAYER_CODEC_TYPE_DEFAULT = 0, /**< codec is selected by the priority */
412 MM_PLAYER_CODEC_TYPE_HW, /**< HW codec can only be selected */
413 MM_PLAYER_CODEC_TYPE_SW, /**< SW codec can only be selected */
414 } MMPlayerVideoCodecType;
417 * Attribute validity structure
420 MMPlayerAttrsType type;
421 MMPlayerAttrsValidType validity_type;
422 MMPlayerAttrsFlag flag;
424 * a union that describes validity of the attribute.
425 * Only when type is 'MM_ATTRS_TYPE_INT' or 'MM_ATTRS_TYPE_DOUBLE',
426 * the attribute can have validity.
430 * Validity structure for integer array.
433 int *array; /**< a pointer of array */
434 int count; /**< size of array */
438 * Validity structure for integer range.
441 int min; /**< minimum range */
442 int max; /**< maximum range */
446 * Validity structure for double array.
449 double * array; /**< a pointer of array */
450 int count; /**< size of array */
454 * Validity structure for double range.
457 double min; /**< minimum range */
458 double max; /**< maximum range */
467 * @see mm_player_set_volume, mm_player_get_volume
470 float level[MM_VOLUME_CHANNEL_NUM]; /**< Relative volume factor for each channels */
471 } MMPlayerVolumeType;
474 * Video stream info in external demux case
477 typedef struct _VideoStreamInfo {
479 unsigned int framerate_num;
480 unsigned int framerate_den;
483 unsigned char *codec_extradata;
484 unsigned int extradata_size;
485 unsigned int version;
486 } MMPlayerVideoStreamInfo;
489 * Audio stream info in external demux case
492 typedef struct _AudioStreamInfo {
494 unsigned int channels;
495 unsigned int sample_rate;
496 unsigned char *codec_extradata;
497 unsigned int extradata_size;
498 unsigned int version;
499 unsigned int user_info;
502 // unsigned int width;
503 // unsigned int depth;
504 // unsigned int endianness;
506 } MMPlayerAudioStreamInfo;
509 * Subtitle stream info in external demux case
512 typedef struct _SubtitleStreamInfo {
514 unsigned int codec_tag;
515 void *context; //for smpte text
516 } MMPlayerSubtitleStreamInfo;
519 * Audio stream callback function type.
521 * @param stream [in] Reference pointer to audio frame data
522 * @param stream_size [in] Size of audio frame data
523 * @param user_param [in] User defined parameter which is passed when set
524 * audio stream callback
526 * @return This callback function have to return MM_ERROR_NONE.
528 typedef bool (*mm_player_audio_stream_callback) (void *stream, int stream_size, void *user_param);
532 * selected subtitle track number callback function type.
534 * @param track_num [in] Track number of subtitle
535 * @param user_param [in] User defined parameter
538 * @return This callback function have to return MM_ERROR_NONE.
540 typedef bool (*mm_player_track_selected_subtitle_language_callback)(int track_num, void *user_param);
543 * Buffer underrun / overflow data callback function type.
545 * @param status [in] buffer status
546 * @param user_param [in] User defined parameter which is passed when set
547 * to enough data callback or need data callback
549 * @return This callback function have to return MM_ERROR_NONE.
551 typedef bool (*mm_player_media_stream_buffer_status_callback) (MMPlayerStreamType type, MMPlayerMediaStreamBufferStatus status, unsigned long long bytes, void *user_param);
554 * Buffer seek data callback function type.
556 * @param offset [in] offset for the buffer playback
557 * @param user_param [in] User defined parameter which is passed when set
558 * to seek data callback
560 * @return This callback function have to return MM_ERROR_NONE.
562 typedef bool (*mm_player_media_stream_seek_data_callback) (MMPlayerStreamType type, unsigned long long offset, void *user_param);
565 * Called to notify the stream changed.
567 * @param user_data [in] The user data passed from the callback registration function
569 * @return This callback function have to return MM_ERROR_NONE.
571 typedef bool (*mm_player_stream_changed_callback) (void *user_param);
574 /*===========================================================================================
576 | GLOBAL FUNCTION PROTOTYPES |
578 ========================================================================================== */
581 * This function creates a player object for playing multimedia contents. \n
582 * The attributes of player are created to get/set some values with application. \n
583 * And, mutex, gstreamer and other resources are initialized at this time. \n
584 * If player is created, the state will become MM_PLAYER_STATE_NULL.
586 * @param player [out] Handle of player
588 * @return This function returns zero on success, or negative value with error code. \n
589 * Please refer 'mm_error.h' to know it in detail.
591 * @post MM_PLAYER_STATE_NULL
592 * @see mm_player_destroy
593 * @remark You can create multiple handles on a context at the same time. \n
594 * However, player cannot guarantee proper operation because of limitation of resources, \n
595 * such as audio device or display device.
599 char *g_err_attr_name = NULL;
601 if (mm_player_create(&g_player) != MM_ERROR_NONE) {
602 LOGE("failed to create player\n");
605 if (mm_player_set_attribute(g_player,
607 "profile_uri", filename, strlen(filename),
608 "display_overlay", (void*)&g_win.xid, sizeof(g_win.xid),
609 NULL) != MM_ERROR_NONE) {
610 LOGE("failed to set %s attribute\n", g_err_attr_name);
611 free(g_err_attr_name);
614 mm_player_set_message_callback(g_player, msg_callback, (void*)g_player);
617 int mm_player_create(MMHandleType *player);
620 * This function releases player object and all resources which were created by mm_player_create(). \n
621 * And, player handle will also be destroyed.
623 * @param player [in] Handle of player
625 * @return This function returns zero on success, or negative value with error code.
626 * @pre Player state may be MM_PLAYER_STATE_NULL. \n
627 * But, it can be called in any state.
628 * @post Because handle is released, there is no any state.
629 * @see mm_player_create
630 * @remark This method can be called with a valid player handle from any state to \n
631 * completely shutdown the player operation.
635 if (mm_player_destroy(g_player) != MM_ERROR_NONE) {
636 LOGE("failed to destroy player\n");
640 int mm_player_destroy(MMHandleType player);
643 * This function parses uri and makes gstreamer pipeline by uri scheme. \n
644 * So, uri should be set before realizing with mm_player_set_attribute(). \n
646 * @param player [in] Handle of player
648 * @return This function returns zero on success, or negative value with error code.
650 * @pre Player state should be MM_PLAYER_STATE_NULL.
651 * @post player state will be MM_PLAYER_STATE_READY.
652 * @see mm_player_unrealize
656 if (mm_player_realize(g_player) != MM_ERROR_NONE) {
657 LOGE("failed to realize player\n");
661 int mm_player_realize(MMHandleType player);
664 * This function uninitializes player object. So, resources and allocated memory \n
665 * will be freed. And, gstreamer pipeline is also destroyed. So, if you want to play \n
666 * other contents, player should be created again after destruction or realized with new uri.
668 * @param player [in] Handle of player
670 * @return This function returns zero on success, or negative value with error code.
671 * @pre Player state may be MM_PLAYER_STATE_READY to unrealize. \n
672 * But, it can be called in any state.
673 * @post Player state will be MM_PLAYER_STATE_NULL.
674 * @see mm_player_realize
675 * @remark This method can be called with a valid player handle from any state.
679 if (mm_player_unrealize(g_player) != MM_ERROR_NONE) {
680 LOGE("failed to unrealize player\n");
684 int mm_player_unrealize(MMHandleType player);
687 * This function is to get current state of player. \n
688 * Application have to check current state before doing some action.
690 * @param player [in] Handle of player
691 * @param state [out] current state of player on success
693 * @return This function returns zero on success, or negative value with error code.
695 * @see MMPlayerStateType
699 if (mm_player_get_state(g_player, &state) != MM_ERROR_NONE) {
700 LOGE("failed to get state\n");
704 int mm_player_get_state(MMHandleType player, MMPlayerStateType *state);
707 * This function is to set relative volume of player. \n
708 * So, It controls logical volume value. \n
709 * But, if developer want to change system volume, mm sound api should be used.
711 * @param player [in] Handle of player
712 * @param volume [in] Volume factor of each channel
714 * @return This function returns zero on success, or negative value with error code.
715 * @see MMPlayerVolumeType, mm_player_get_volume
716 * @remark The range of factor range is from 0 to 1.0. (1.0 = 100%) And, default value is 1.0.
719 MMPlayerVolumeType volume;
722 for (i = 0; i < MM_VOLUME_CHANNEL_NUM; i++)
723 volume.level[i] = MM_VOLUME_LEVEL_MAX;
725 if (mm_player_set_volume(g_player, &volume) != MM_ERROR_NONE)
727 LOGE("failed to set volume\n");
731 int mm_player_set_volume(MMHandleType player, MMPlayerVolumeType *volume);
734 * This function is to get current volume factor of player.
736 * @param player [in] Handle of player.
737 * @param volume [out] Volume factor of each channel.
739 * @return This function returns zero on success, or negative value with error code.
741 * @see MMPlayerVolumeType, mm_player_set_volume
745 MMPlayerVolumeType volume;
748 if (mm_player_get_volume(g_player, &volume) != MM_ERROR_NONE)
750 LOGW("failed to get volume\n");
753 for (i = 0; i < MM_VOLUME_CHANNEL_NUM; i++)
754 LOGD("channel[%d] = %d \n", i, volume.level[i]);
757 int mm_player_get_volume(MMHandleType player, MMPlayerVolumeType *volume);
760 * This function is to start playing media contents. Demux(parser), codec and related plugins are decided \n
761 * at this time. And, MM_MESSAGE_BEGIN_OF_STREAM will be posted through callback function registered \n
762 * by mm_player_set_message_callback().
764 * @param player [in] Handle of player
766 * @return This function returns zero on success, or negative value with error code.
769 * @pre Player state may be MM_PLAYER_STATE_READY.
770 * @post Player state will be MM_PLAYER_STATE_PLAYING.
771 * @see mm_player_stop
775 if (mm_player_start(g_player) != MM_ERROR_NONE)
777 LOGE("failed to start player\n");
781 int mm_player_start(MMHandleType player);
784 * This function is to stop playing media contents and it's different with pause. \n
785 * If mm_player_start() is called after this, content will be started again from the beginning. \n
786 * So, it can be used to close current playback.
788 * @param player [in] Handle of player
790 * @return This function returns zero on success, or negative value with error code.
792 * @pre Player state may be MM_PLAYER_STATE_PLAYING.
793 * @post Player state will be MM_PLAYER_STATE_READY.
794 * @see mm_player_start
798 if (mm_player_stop(g_player) != MM_ERROR_NONE)
800 LOGE("failed to stop player\n");
804 int mm_player_stop(MMHandleType player);
807 * This function is to pause playing media contents.
809 * @param player [in] Handle of player.
811 * @return This function returns zero on success, or negative value with error code.
813 * @pre Player state may be MM_PLAYER_STATE_PLAYING.
814 * @post Player state will be MM_PLAYER_STATE_PAUSED.
815 * @see mm_player_resume
819 if (mm_player_pause(g_player) != MM_ERROR_NONE)
821 LOGE("failed to pause player\n");
825 int mm_player_pause(MMHandleType player);
828 * This function is to resume paused media contents.
830 * @param player [in] Handle of player.
832 * @return This function returns zero on success, or negative value with error code.
834 * @pre Player state may be MM_PLAYER_STATE_PAUSED.
835 * @post Player state will be MM_PLAYER_STATE_PLAYING.
836 * @see mm_player_pause
840 if (mm_player_resume(g_player) != MM_ERROR_NONE)
842 LOGE("failed to resume player\n");
846 int mm_player_resume(MMHandleType player);
849 * This function is to set the position for playback. \n
850 * So, it can be seeked to requested position. \n
852 * @param player [in] Handle of player
853 * @param format [in] Format of position.
854 * @param pos [in] Position for playback
856 * @return This function returns zero on success, or negative value with error code.
857 * @see MMPlayerPosFormatType, mm_player_get_position
858 * @remark the unit of time-based format is millisecond and other case is percent.
861 int position = 1000; //1sec
863 if (mm_player_set_position(g_player, MM_PLAYER_POS_FORMAT_TIME, position) != MM_ERROR_NONE)
865 LOGE("failed to set position\n");
869 int mm_player_set_position(MMHandleType player, MMPlayerPosFormatType format, int pos);
872 * This function is to get current position of playback content.
874 * @param player [in] Handle of player.
875 * @param format [in] Format of position.
876 * @param pos [out] contains current position on success or zero in case of failure.
878 * @return This function returns zero on success, or negative value with errors
879 * @see MMPlayerPosFormatType, mm_player_set_position
880 * @remark the unit of time-based format is millisecond and other case is percent.
886 mm_player_get_position(g_player, MM_PLAYER_POS_FORMAT_TIME, &position);
888 mm_player_get_attribute(g_player, &g_err_name, "content_duration", &duration, NULL);
890 LOGD("pos: [%d/%d] msec\n", position, duration);
893 int mm_player_get_position(MMHandleType player, MMPlayerPosFormatType format, unsigned long *pos);
896 * This function is to get current buffer position of playback content.
898 * @param player [in] Handle of player.
899 * @param format [in] Format of position.
900 * @param start_pos [out] contains buffer start position on success or zero in case of failure.
901 * @param stop_pos [out] contains buffer current position on success or zero in case of failure.
903 * @return This function returns zero on success, or negative value with errors
904 * @see MMPlayerPosFormatType, mm_player_set_position
905 * @remark the unit of time-based format is millisecond and other case is percent.
908 int start_pos = 0, stop_pos = 0;
910 mm_player_get_buffer_position(g_player, MM_PLAYER_POS_FORMAT_PERCENT, &start_pos, &stop_pos );
912 LOGD("buffer position: [%d] ~ [%d] \%\n", start_pos, stop_pos );
915 int mm_player_get_buffer_position(MMHandleType player, MMPlayerPosFormatType format, unsigned long *start_pos, unsigned long *stop_pos);
918 * This function sets callback function for receiving messages from player.
919 * So, player can notify warning, error and normal cases to application.
921 * @param player [in] Handle of player.
922 * @param callback [in] Message callback function.
923 * @param user_param [in] User parameter which is passed to callback function.
925 * @return This function returns zero on success, or negative value with error code.
926 * @see MMMessageCallback
930 int msg_callback(int message, MMMessageParamType *param, void *user_param)
934 case MM_MESSAGE_ERROR:
938 case MM_MESSAGE_END_OF_STREAM:
942 case MM_MESSAGE_STATE_CHANGED:
946 case MM_MESSAGE_BEGIN_OF_STREAM:
956 mm_player_set_message_callback(g_player, msg_callback, (void*)g_player);
959 int mm_player_set_message_callback(MMHandleType player, MMMessageCallback callback, void *user_param);
962 * This function set callback function for receiving audio stream from player. \n
963 * So, application can get raw audio data and modify it. \n
964 * But, if callback don't return or holds it for long time, performance can be deteriorated. \n
965 * It's only supported when audio stream is included in file. \n
966 * So, if there is video stream or DRM content, it can't be used.
968 * @param player [in] Handle of player.
969 * @param callback [in] Audio stream callback function.
970 * @param user_param [in] User parameter.
972 * @return This function returns zero on success, or negative value with error
974 * @see mm_player_audio_stream_callback
975 * @remark It can be used for audio playback only.
978 bool audio_callback(void *stream, int stream_size, void *user_param)
980 LOGD("audio stream callback\n");
983 mm_player_set_audio_stream_callback(g_player, audio_callback, NULL);
986 int mm_player_set_audio_stream_callback(MMHandleType player, mm_player_audio_stream_callback callback, void *user_param);
989 * This function is to mute volume of player
991 * @param player [in] Handle of player
992 * @param mute [in] Mute(1) or not mute(0)
994 * @return This function returns zero on success, or negative value with error code
995 * @see mm_player_get_mute
999 if (mm_player_set_mute(g_player, TRUE) != MM_ERROR_NONE)
1001 LOGW("failed to set mute\n");
1005 int mm_player_set_mute(MMHandleType player, int mute);
1008 * This function is to get mute value of player
1010 * @param player [in] Handle of player
1011 * @param mute [out] Sound is muted
1013 * @return This function returns zero on success, or negative value with error code
1014 * @see mm_player_set_mute
1020 if (mm_player_get_mute(g_player, &mute) != MM_ERROR_NONE)
1022 LOGW("failed to get mute\n");
1025 LOGD("mute status:%d\n", mute);
1028 int mm_player_get_mute(MMHandleType player, int *mute);
1031 * This function is to adjust subtitle postion. So, subtitle can show at the adjusted position. \n
1032 * If pos is negative, subtitle will be displayed previous time, the other hand forward time. \n
1034 * @param player [in] Handle of player
1035 * @param pos [in] postion to be adjusted
1037 * @return This function returns zero on success, or negative value with error
1039 * @see mm_player_adjust_subtitle_position
1046 if (mm_player_adjust_subtitle_position(g_player, MM_PLAYER_POS_FORMAT_TIME, pos) != MM_ERROR_NONE)
1048 LOGW("failed to adjust subtitle postion.\n");
1053 int mm_player_adjust_subtitle_position(MMHandleType player, MMPlayerPosFormatType format, int pos);
1056 * This function is to set the offset in timestamps of video so as to bring the a/v sync
1057 * @param player Handle of player
1058 * @param offset offset to be set in milliseconds(can be positive or negative both)
1059 * postive offset to make video lag
1060 * negative offset to make video lead
1062 int mm_player_adjust_video_position(MMHandleType player, int offset);
1064 * This function is to set subtitle silent status. So, subtitle can show or hide during playback \n
1065 * by this value. But, one subtitle file should be set with "subtitle_uri" attribute before calling mm_player_realize(); \n
1066 * Player FW parses subtitle file and send text data including timestamp to application \n
1067 * through message callback with MM_MESSAGE_UPDATE_SUBTITLE will be. \n
1068 * So, application have to render it. And, subtitle can be supported only in a seprate file. \n
1069 * So, it's not supported for embedded case.
1071 * @param player [in] Handle of player
1072 * @param silent [in] silent(integer value except 0) or not silent(0)
1074 * @return This function returns zero on success, or negative value with error
1076 * @see mm_player_get_subtitle_silent, MM_MESSAGE_UPDATE_SUBTITLE
1080 mm_player_set_attribute(g_player,
1082 "subtitle_uri", g_subtitle_uri, strlen(g_subtitle_uri),
1086 if (mm_player_set_subtitle_silent(g_player, TRUE) != MM_ERROR_NONE)
1088 LOGW("failed to set subtitle silent\n");
1092 int mm_player_set_subtitle_silent(MMHandleType player, int silent);
1095 * This function is to get silent status of subtitle.
1097 * @param player [in] Handle of player
1098 * @param silent [out] subtitle silent property
1100 * @return This function returns zero on success, or negative value with error
1102 * @see mm_player_set_subtitle_silent, MM_MESSAGE_UPDATE_SUBTITLE
1108 if (mm_player_get_subtitle_silent(g_player, &silent) != MM_ERROR_NONE)
1110 LOGW("failed to set subtitle silent\n");
1114 int mm_player_get_subtitle_silent(MMHandleType player, int *silent);
1117 * This function is to set attributes into player. Multiple attributes can be set simultaneously. \n
1118 * If one of attribute fails, this function will stop at the point and let you know the name which is failed. \n
1120 * @param player [in] Handle of player.
1121 * @param err_attr_name [out] Name of attribute which is failed to set
1122 * @param first_attribute_name [in] Name of the first attribute to set
1123 * @param ... [in] Value for the first attribute, followed optionally by more name/value pairs, terminated by NULL.
1124 * But, in the case of data or string type, it should be name/value/size.
1126 * @return This function returns zero on success, or negative value with error code.
1128 * @see mm_player_get_attribute
1129 * @remark This function must be terminated by NULL argument.
1130 * And, if this function is failed, err_attr_name param must be free.
1133 char *g_err_attr_name = NULL;
1135 if (mm_player_set_attribute(g_player,
1137 "profile_uri", filename, strlen(filename),
1138 "profile_play_count", count,
1139 NULL) != MM_ERROR_NONE) {
1140 LOGW("failed to set %s attribute\n", g_err_attr_name);
1141 free(g_err_attr_name);
1146 int mm_player_set_attribute(MMHandleType player, char **err_attr_name, const char *first_attribute_name, ...)G_GNUC_NULL_TERMINATED;
1149 * This function is to get attributes from player. Multiple attributes can be got simultaneously.
1151 * @param player [in] Handle of player.
1152 * @param err_attr_name [out] Name of attribute which is failed to get
1153 * @param first_attribute_name [in] Name of the first attribute to get
1154 * @param ... [out] Value for the first attribute, followed optionally by more name/value pairs, terminated by NULL.
1155 * But, in the case of data or string type, it should be name/value/size.
1157 * @return This function returns zero on success, or negative value with error
1159 * @see mm_player_set_attribute
1160 * @remark This function must be terminated by NULL argument.
1161 * And, if this function is failed, err_attr_name param must be free.
1164 char *g_err_attr_name = NULL;
1166 if (mm_player_get_attribute(g_player, &g_err_attr_name, "content_duration", &duration, NULL) != MM_ERROR_NONE) {
1167 LOGW("failed to set %s attribute\n", g_err_attr_name);
1168 free(g_err_attr_name);
1172 int mm_player_get_attribute(MMHandleType player, char **err_attr_name, const char *first_attribute_name, ...)G_GNUC_NULL_TERMINATED;
1175 * This function is to get detail information of attribute.
1177 * @param player [in] Handle of player.
1178 * @param attribute_name [in] Name of the attribute to get
1179 * @param info [out] Attribute infomation
1181 * @return This function returns zero on success, or negative value with error
1184 * @see mm_player_set_attribute, mm_player_get_attribute
1188 if (mm_player_get_attribute_info(g_player, "display_method", &method_info) != MM_ERROR_NONE) {
1189 LOGW("failed to get info\n");
1192 LOGD("type:%d \n", method_info.type); //int, double..
1193 LOGD("flag:%d \n", method_info.flag); //readable, writable..
1194 LOGD("validity type:%d \n", method_info.validity_type); //range, array..
1196 if (method_info. validity_type == MM_PLAYER_ATTRS_VALID_TYPE_INT_RANGE) {
1197 LOGD("range min:%d\n", method_info.int_range.min);
1198 LOGD("range max:%d\n", method_info.int_range.max);
1202 int mm_player_get_attribute_info(MMHandleType player, const char *attribute_name, MMPlayerAttrsInfo *info);
1205 * This function is to get download position and total size of progressive download
1207 * @param player [in] Handle of player.
1208 * @param current_pos [in] Download position currently (bytes)
1209 * @param total_size [in] Total size of file (bytes)
1211 * @return This function returns zero on success, or negative value with error code.
1214 guint64 current_pos = 0LLU;
1215 guint64 total_size = 0LLU;
1217 if (mm_player_get_pd_status(g_player, ¤t_pos, &total_size, NULL) != MM_ERROR_NONE)
1219 LOGD("current download pos = %llu, total size = %llu\n", current_pos, total_size);
1223 int mm_player_get_pd_status(MMHandleType player, guint64 *current_pos, guint64 *total_size);
1226 * This function sets callback function for receiving messages of PD downloader.
1228 * @param player [in] Handle of player.
1229 * @param callback [in] Message callback function.
1230 * @param user_param [in] User parameter which is passed to callback function.
1232 * @return This function returns zero on success, or negative value with error code.
1237 int msg_callback(int message, MMMessageParamType *param, void *user_param)
1241 case MM_MESSAGE_PD_DOWNLOADER_START:
1242 LOGD("Progressive download is started...\n");
1244 case MM_MESSAGE_PD_DOWNLOADER_END:
1245 LOGD("Progressive download is ended...\n");
1253 mm_player_set_pd_message_callback(g_player, msg_callback, NULL);
1256 int mm_player_set_pd_message_callback(MMHandleType player, MMMessageCallback callback, void *user_param);
1259 * This function is to get the track count
1261 * @param player [in] handle of player.
1262 * @param track [in] type of the track type
1263 * @param info [out] the count of the track
1265 * @return This function returns zero on success, or negative value with error
1270 gint audio_count = 0;
1272 if (mm_player_get_track_count(g_player, MM_PLAYER_TRACK_TYPE_AUDIO, &audio_count) != MM_ERROR_NONE) {
1273 LOGW("failed to get audio track count\n");
1276 LOGD("audio track count : %d \n", audio_count);
1279 int mm_player_get_track_count(MMHandleType player, MMPlayerTrackType type, int *count);
1282 * This function is to select the track
1284 * @param player [in] handle of player.
1285 * @param type [in] type of the track type
1286 * @param index [in] the index of the track
1288 * @return This function returns zero on success, or negative value with error
1291 int mm_player_select_track(MMHandleType player, MMPlayerTrackType type, int index);
1294 * This function is to add the track when user want multi subtitle
1296 * @param player [in] handle of player.
1297 * @param index [in] the index of the track
1299 * @return This function returns zero on success, or negative value with error
1302 int mm_player_track_add_subtitle_language(MMHandleType player, int index);
1305 * This function is to remove the track when user want multi subtitle
1307 * @param player [in] handle of player.
1308 * @param index [in] the index of the track
1310 * @return This function returns zero on success, or negative value with error
1313 int mm_player_track_remove_subtitle_language(MMHandleType player, int index);
1316 * This function is to notify which sutitle track is in use
1318 * @param player [in] handle of player.
1319 * @param callback [in] callback function to register
1320 * @param user_data [in] user data to be passed to the callback function
1322 * @return This function returns zero on success, or negative value with error
1325 int mm_player_track_foreach_selected_subtitle_language(MMHandleType player, mm_player_track_selected_subtitle_language_callback callback, void *user_param);
1328 * This function is to get the track language
1330 * @param player [in] handle of player.
1331 * @param type [in] type of the track type
1332 * @param index [in] the index of the track
1333 * @param code [out] language code in ISO 639-1(string)
1335 * @return This function returns zero on success, or negative value with error
1338 int mm_player_get_track_language_code(MMHandleType player, MMPlayerTrackType type, int index, char **code);
1341 * This function is to get the current running track
1343 * @param player [in] handle of player.
1344 * @param type [in] type of the track type
1345 * @param index [out] the index of the track
1347 * @return This function returns zero on success, or negative value with error
1351 int mm_player_get_current_track(MMHandleType hplayer, MMPlayerTrackType type, int *index);
1354 * This function is to set the subtitle path
1356 * @param player [in] handle of player
1357 * @param path [in] subtitle path
1359 * @return This function returns zero on success, or negative value with error code.
1361 int mm_player_set_external_subtitle_path(MMHandleType player, const char* path);
1364 * This function is to set the clock which is from master player
1366 * @param player [in] handle of player
1367 * @param clock [in] clock of master player
1368 * @param clock_delta [in] clock difference between master and slave
1369 * @param video_time [in] current playing position
1370 * @param media_clock [in] media clock information
1371 * @param audio_time [in] audio timestamp information
1372 * @return This function returns zero on success, or negative value with error code.
1374 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);
1376 * This function is to get the master clock
1378 * @param player [in] handle of player
1379 * @param video_time [out] current playing position
1380 * @param media_clock [out] media clock information
1381 * @param audio_time [out] audio timestamp information
1382 * @return This function returns zero on success, or negative value with error code.
1384 int mm_player_get_video_share_master_clock(MMHandleType player, long long *video_time, long long *media_clock, long long *audio_time);
1387 * This function is to set download mode of video hub
1389 * @param player [in] handle of player
1390 * @param mode [in] download mode
1391 * @return This function returns zero on success, or negative value with error code.
1393 int mm_player_set_video_hub_download_mode(MMHandleType player, bool mode);
1396 * This function is to set using sync handler.
1398 * @param player [in] handle of player
1399 * @param enable [in] enable/disable
1400 * @return This function returns zero on success, or negative value with error code.
1402 int mm_player_enable_sync_handler(MMHandleType player, bool enable);
1405 * This function is to set uri.
1407 * @param player [in] handle of player
1408 * @param uri [in] uri
1409 * @return This function returns zero on success, or negative value with error code.
1411 int mm_player_set_uri(MMHandleType player, const char *uri);
1414 * This function is to set next uri.
1416 * @param player [in] handle of player
1417 * @param uri [in] uri
1418 * @return This function returns zero on success, or negative value with error code.
1420 int mm_player_set_next_uri(MMHandleType player, const char *uri);
1423 * This function is to get next uri.
1425 * @param player [in] handle of player
1426 * @param uri [out] uri
1427 * @return This function returns zero on success, or negative value with error code.
1429 int mm_player_get_next_uri(MMHandleType player, char **uri);
1432 * This function is to decrease reference count of internal buffer.
1434 * @param buffer [in] video callback internal buffer
1437 void mm_player_video_stream_internal_buffer_unref(void *buffer);
1439 /**mm_player_submit_packet
1440 * This function is to submit buffer to appsrc. \n
1441 * @param player [in] Handle of player.
1442 * @param buf [in] buffer to be submit in appsrc in external feeder case.
1443 * @param len [in] length of buffer.
1444 * @param pts [in] timestamp of buffer.
1445 * @param streamtype [in] stream type of buffer.
1446 * @return This function returns zero on success, or negative value with error code.
1448 int mm_player_submit_packet(MMHandleType player, media_packet_h packet);
1450 /**mm_player_set_video_info
1451 * This function is to set caps of src pad of video appsrc in external feeder case. \n
1452 * @param player [in] Handle of player.
1453 * @param media_format_h [in] Video stream info.
1454 * @return This function returns zero on success, or negative value with error code.
1456 int mm_player_set_video_info(MMHandleType player, media_format_h format);
1458 /**mm_player_set_audio_info
1459 * This function is to set caps of src pad of Audio appsrc in external feeder case. \n
1460 * @param player [in] Handle of player.
1461 * @param media_format_h [in] Audio stream info.
1462 * @return This function returns zero on success, or negative value with error code.
1464 int mm_player_set_audio_info(MMHandleType player, media_format_h format);
1466 /**mm_player_set_subtitle_info
1467 * This function is to set caps of src pad of subtitle appsrc in external feeder case. \n
1468 * @param player [in] Handle of player.
1469 * @param subtitle_stream_info [in] Subtitle stream info.
1470 * @return This function returns zero on success, or negative value with error code.
1472 int mm_player_set_subtitle_info(MMHandleType player, MMPlayerSubtitleStreamInfo *info);
1475 * This function set callback function for receiving need or enough data message from player.
1477 * @param player [in] Handle of player.
1478 * @param type [in] stream type
1479 * @param callback [in] data callback function for stream type.
1480 * @param user_param [in] User parameter.
1482 * @return This function returns zero on success, or negative value with error
1485 int mm_player_set_media_stream_buffer_status_callback(MMHandleType player, MMPlayerStreamType type, mm_player_media_stream_buffer_status_callback callback, void * user_param);
1488 * This function set callback function for receiving seek data message from player.
1490 * @param player [in] Handle of player.
1491 * @param type [in] stream type
1492 * @param callback [in] Seek data callback function for stream type.
1493 * @param user_param [in] User parameter.
1495 * @return This function returns zero on success, or negative value with error
1498 int mm_player_set_media_stream_seek_data_callback(MMHandleType player, MMPlayerStreamType type, mm_player_media_stream_seek_data_callback callback, void * user_param);
1501 * This function is to set max size of buffer(appsrc).
1503 * @param player [in] Handle of player.
1504 * @param type [in] stream type
1505 * @param max_size [in] max bytes of buffer.
1507 * @return This function returns zero on success, or negative value with error
1510 int mm_player_set_media_stream_buffer_max_size(MMHandleType player, MMPlayerStreamType type, unsigned long long max_size);
1513 * This function is to get max size of buffer(appsrc).
1515 * @param player [in] Handle of player.
1516 * @param type [in] stream type
1517 * @param max_size [out] max bytes of buffer.
1519 * @return This function returns zero on success, or negative value with error
1522 int mm_player_get_media_stream_buffer_max_size(MMHandleType player, MMPlayerStreamType type, unsigned long long *max_size);
1525 * This function is to set min percent of buffer(appsrc).
1527 * @param player [in] Handle of player.
1528 * @param type [in] stream type
1529 * @param min_percent [in] min percent of buffer.
1531 * @return This function returns zero on success, or negative value with error
1534 int mm_player_set_media_stream_buffer_min_percent(MMHandleType player, MMPlayerStreamType type, unsigned min_percent);
1537 * This function is to get min percent of buffer(appsrc).
1539 * @param player [in] Handle of player.
1540 * @param type [in] stream type
1541 * @param min_percent [out] min percent of buffer.
1543 * @return This function returns zero on success, or negative value with error
1546 int mm_player_get_media_stream_buffer_min_percent(MMHandleType player, MMPlayerStreamType type, unsigned int *min_percent);
1549 * This function set callback function for changing audio stream from player. \n
1550 * It's only supported when audio stream is included in file. \n
1552 * @param player [in] Handle of player.
1553 * @param callback [in] Audio stream changed callback function.
1554 * @param user_param [in] User parameter.
1556 * @return This function returns zero on success, or negative value with error
1558 * @see mm_player_stream_changed_callback
1561 int mm_player_set_audio_stream_changed_callback(MMHandleType player, mm_player_stream_changed_callback callback, void *user_param);
1564 * This function set callback function for changing video stream from player. \n
1565 * It's only supported when video stream is included in file. \n
1567 * @param player [in] Handle of player.
1568 * @param callback [in] Video stream changed callback function.
1569 * @param user_param [in] User parameter.
1571 * @return This function returns zero on success, or negative value with error
1573 * @see mm_player_stream_changed_callback
1575 int mm_player_set_video_stream_changed_callback(MMHandleType player, mm_player_stream_changed_callback callback, void *user_param);
1578 * This function is to get timeout value according to the content type for muse. \n
1579 * It's only supported when video stream is included in file. \n
1581 * @param player [in] Handle of player.
1582 * @param timeout [out] timeout value (sec).
1584 * @return This function returns zero on success, or negative value with error
1588 int mm_player_get_timeout(MMHandleType player, int *timeout);
1591 * This function is to get the number of video output buffers. \n
1592 * It's only supported when video stream is included in file. \n
1594 * @param player [in] Handle of player.
1595 * @param num [out] num of buffers.
1596 * @param extra_num [out] extra num of buffers.
1598 * @return This function returns zero on success, or negative value with error
1602 int mm_player_get_num_of_video_out_buffers(MMHandleType player, int *num, int *extra_num);
1605 * This function is to set the dynamic resolution information. \n
1606 * It's only supported when video stream is included in file. \n
1608 * @param player [in] Handle of player.
1609 * @param drc [in] dynamic resolution info of media stream data
1611 * @return This function returns zero on success, or negative value with error
1615 int mm_player_set_media_stream_dynamic_resolution(MMHandleType player, bool drc);
1618 * This function is to release the video stream bo to reuse. \n
1619 * It's only supported when sw codec is used to decode video stream. \n
1621 * @param player [in] Handle of player.
1622 * @param bo [in] bo address to be released
1624 * @return This function returns zero on success, or negative value with error
1628 int mm_player_release_video_stream_bo(MMHandleType player, void* bo);
1631 * This function is to set http file buffering path
1633 * @param player [in] handle of player
1634 * @param file_path [in] file path
1635 * @return This function returns zero on success, or negative value with error code.
1637 int mm_player_set_file_buffering_path(MMHandleType player, const char *file_path);
1640 * This function is to set sound stream info
1642 int mm_player_set_sound_stream_info(MMHandleType player, char *stream_type, int stream_index);
1645 * This function is to manage the playback according to the external storage state
1647 int mm_player_manage_external_storage_state(MMHandleType player, int id, int state);
1650 * These functions are to set/get the max variant of HAS
1652 int mm_player_get_adaptive_variant_info(MMHandleType player, int *num, char **var_info);
1653 int mm_player_set_max_adaptive_variant_limit(MMHandleType player, int bandwidth, int width, int height);
1654 int mm_player_get_max_adaptive_variant_limit(MMHandleType player, int *bandwidth, int *width, int *height);
1657 * These functions are to set/get the audio only mode
1659 int mm_player_set_audio_only(MMHandleType player, bool audio_only);
1660 int mm_player_get_audio_only(MMHandleType player, bool *audio_only);
1663 * These functions are to set/get the streaming bufferint time
1665 int mm_player_set_streaming_buffering_time(MMHandleType player, int buffer_ms, int rebuffer_ms);
1666 int mm_player_get_streaming_buffering_time(MMHandleType player, int *buffer_ms, int *rebuffer_ms);
1669 * These functions are to display the 360 video content
1671 int mm_player_360_is_content_spherical(MMHandleType player, bool *is_spherical);
1672 int mm_player_360_set_enabled(MMHandleType player, bool enabled);
1673 int mm_player_360_is_enabled(MMHandleType player, bool *enabled);
1675 int mm_player_360_set_direction_of_view(MMHandleType player, float yaw, float pitch);
1676 int mm_player_360_get_direction_of_view(MMHandleType player, float *yaw, float *pitch);
1678 int mm_player_360_set_zoom(MMHandleType player, float level);
1679 int mm_player_360_get_zoom(MMHandleType player, float *level);
1681 int mm_player_360_set_field_of_view(MMHandleType player, int horizontal_degrees, int vertical_degrees);
1682 int mm_player_360_get_field_of_view(MMHandleType player, int *horizontal_degrees, int *vertical_degrees);
1685 * This function is to set codec type
1687 int mm_player_set_codec_type(MMHandleType player, MMPlayerStreamType stream_type, MMPlayerVideoCodecType codec_type);
1690 * These functions are to apply the replaygain
1692 int mm_player_set_replaygain_enabled(MMHandleType player, bool enabled);
1693 int mm_player_is_replaygain_enabled(MMHandleType player, bool *enabled);
1702 #endif /* __MM_PLAYER_H__ */