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 int orientation; /**< orientation */
278 } MMPlayerVideoStreamDataType;
281 * Enumerations of player state.
284 MM_PLAYER_STATE_NULL, /**< Player is created, but not realized yet */
285 MM_PLAYER_STATE_READY, /**< Player is ready to play media */
286 MM_PLAYER_STATE_PLAYING, /**< Player is now playing media */
287 MM_PLAYER_STATE_PAUSED, /**< Player is paused while playing media */
288 MM_PLAYER_STATE_NONE, /**< Player is not created yet */
289 MM_PLAYER_STATE_NUM, /**< Number of player states */
293 * Enumerations of position formats.
294 * Used while invoking mm_player_get_position/mm_player_set_position APIs
297 MM_PLAYER_POS_FORMAT_TIME, /**< Format for time based */
298 MM_PLAYER_POS_FORMAT_PERCENT, /**< Format for percentage */
299 MM_PLAYER_POS_FORMAT_NUM, /**< Number of position formats */
300 } MMPlayerPosFormatType;
303 * Enumeration for attribute values types.
306 MM_PLAYER_ATTRS_TYPE_INVALID = -1, /**< Type is invalid */
307 MM_PLAYER_ATTRS_TYPE_INT, /**< Integer type */
308 MM_PLAYER_ATTRS_TYPE_DOUBLE, /**< Double type */
309 MM_PLAYER_ATTRS_TYPE_STRING, /**< UTF-8 String type */
310 MM_PLAYER_ATTRS_TYPE_DATA, /**< Pointer type */
311 MM_PLAYER_ATTRS_TYPE_ARRAY, /**< Array type */
312 MM_PLAYER_ATTRS_TYPE_RANGE, /**< Range type */
313 MM_PLAYER_ATTRS_TYPE_NUM, /**< Number of attribute type */
317 * Enumeration for attribute validation type.
320 MM_PLAYER_ATTRS_VALID_TYPE_INVALID = -1, /**< Invalid validation type */
321 MM_PLAYER_ATTRS_VALID_TYPE_NONE, /**< Do not check validity */
322 MM_PLAYER_ATTRS_VALID_TYPE_INT_ARRAY, /**< validity checking type of integer array */
323 MM_PLAYER_ATTRS_VALID_TYPE_INT_RANGE, /**< validity checking type of integer range */
324 MM_PLAYER_ATTRS_VALID_TYPE_DOUBLE_ARRAY, /**< validity checking type of double array */
325 MM_PLAYER_ATTRS_VALID_TYPE_DOUBLE_RANGE, /**< validity checking type of double range */
326 } MMPlayerAttrsValidType;
329 * Enumeration for attribute access flag.
332 MM_PLAYER_ATTRS_FLAG_NONE = 0, /**< None flag is set */
333 MM_PLAYER_ATTRS_FLAG_READABLE = 1 << 0, /**< Readable */
334 MM_PLAYER_ATTRS_FLAG_WRITABLE = 1 << 1, /**< Writable */
335 MM_PLAYER_ATTRS_FLAG_MODIFIED = 1 << 2, /**< Modified */
337 MM_PLAYER_ATTRS_FLAG_RW = MM_PLAYER_ATTRS_FLAG_READABLE | MM_PLAYER_ATTRS_FLAG_WRITABLE, /**< Readable and Writable */
341 * Enumeration for progressive download
344 MM_PLAYER_PD_MODE_NONE,
345 MM_PLAYER_PD_MODE_URI,
346 MM_PLAYER_PD_MODE_FILE // not tested yet, because of no fixed scenario
350 * Enumeration of track types
353 MM_PLAYER_TRACK_TYPE_AUDIO = 0,
354 MM_PLAYER_TRACK_TYPE_VIDEO,
355 MM_PLAYER_TRACK_TYPE_TEXT,
356 MM_PLAYER_TRACK_TYPE_MAX
360 * Enumeration of runtime buffering mode
363 MM_PLAYER_BUFFERING_MODE_ADAPTIVE = 0, /**< default, If buffering is occurred, player will consider the bandwidth to adjust buffer setting. */
364 MM_PLAYER_BUFFERING_MODE_FIXED, /**< player will set buffer size with this fixed size value. */
365 MM_PLAYER_BUFFERING_MODE_MAX,
366 } MMPlayerBufferingMode;
369 MM_PLAYER_FOCUS_CHANGED_COMPLETED = 0,
370 MM_PLAYER_FOCUS_CHANGED_BY_MEDIA,
371 MM_PLAYER_FOCUS_CHANGED_BY_CALL,
372 MM_PLAYER_FOCUS_CHANGED_BY_EARJACK_UNPLUG,
373 MM_PLAYER_FOCUS_CHANGED_BY_RESOURCE_CONFLICT,
374 MM_PLAYER_FOCUS_CHANGED_BY_ALARM,
375 MM_PLAYER_FOCUS_CHANGED_BY_EMERGENCY,
376 MM_PLAYER_FOCUS_CHANGED_BY_NOTIFICATION,
377 MM_PLAYER_FOCUS_CHANGED_BY_UNKNOWN,
378 } MMPlayerFocusChangedMsg;
382 * Edge Properties of the text.
386 MM_PLAYER_EDGE_RAISED,
387 MM_PLAYER_EDGE_DEPRESSED,
388 MM_PLAYER_EDGE_UNIFORM,
389 MM_PLAYER_EDGE_DROPSHADOW
390 } MMPlayerSubtitleEdge;
393 * Enumeration of media stream buffer status
396 MM_PLAYER_MEDIA_STREAM_BUFFER_UNDERRUN,
397 MM_PLAYER_MEDIA_STREAM_BUFFER_OVERFLOW,
398 } MMPlayerMediaStreamBufferStatus;
401 * Enumeration for stream type.
404 MM_PLAYER_STREAM_TYPE_DEFAULT, /**< Container type */
405 MM_PLAYER_STREAM_TYPE_AUDIO, /**< Audio element stream type */
406 MM_PLAYER_STREAM_TYPE_VIDEO, /**< Video element stream type */
407 MM_PLAYER_STREAM_TYPE_TEXT, /**< Text type */
408 MM_PLAYER_STREAM_TYPE_MAX,
409 } MMPlayerStreamType;
412 MM_PLAYER_CODEC_TYPE_DEFAULT = 0, /**< codec is selected by the priority */
413 MM_PLAYER_CODEC_TYPE_HW, /**< HW codec can only be selected */
414 MM_PLAYER_CODEC_TYPE_SW, /**< SW codec can only be selected */
415 } MMPlayerVideoCodecType;
418 * Attribute validity structure
421 MMPlayerAttrsType type;
422 MMPlayerAttrsValidType validity_type;
423 MMPlayerAttrsFlag flag;
425 * a union that describes validity of the attribute.
426 * Only when type is 'MM_ATTRS_TYPE_INT' or 'MM_ATTRS_TYPE_DOUBLE',
427 * the attribute can have validity.
431 * Validity structure for integer array.
434 int *array; /**< a pointer of array */
435 int count; /**< size of array */
439 * Validity structure for integer range.
442 int min; /**< minimum range */
443 int max; /**< maximum range */
447 * Validity structure for double array.
450 double * array; /**< a pointer of array */
451 int count; /**< size of array */
455 * Validity structure for double range.
458 double min; /**< minimum range */
459 double max; /**< maximum range */
468 * @see mm_player_set_volume, mm_player_get_volume
471 float level[MM_VOLUME_CHANNEL_NUM]; /**< Relative volume factor for each channels */
472 } MMPlayerVolumeType;
475 * Video stream info in external demux case
478 typedef struct _VideoStreamInfo {
480 unsigned int framerate_num;
481 unsigned int framerate_den;
484 unsigned char *codec_extradata;
485 unsigned int extradata_size;
486 unsigned int version;
487 } MMPlayerVideoStreamInfo;
490 * Audio stream info in external demux case
493 typedef struct _AudioStreamInfo {
495 unsigned int channels;
496 unsigned int sample_rate;
497 unsigned char *codec_extradata;
498 unsigned int extradata_size;
499 unsigned int version;
500 unsigned int user_info;
503 // unsigned int width;
504 // unsigned int depth;
505 // unsigned int endianness;
507 } MMPlayerAudioStreamInfo;
510 * Subtitle stream info in external demux case
513 typedef struct _SubtitleStreamInfo {
515 unsigned int codec_tag;
516 void *context; //for smpte text
517 } MMPlayerSubtitleStreamInfo;
520 * Audio stream callback function type.
522 * @param stream [in] Reference pointer to audio frame data
523 * @param stream_size [in] Size of audio frame data
524 * @param user_param [in] User defined parameter which is passed when set
525 * audio stream callback
527 * @return This callback function have to return MM_ERROR_NONE.
529 typedef bool (*mm_player_audio_stream_callback) (void *stream, int stream_size, void *user_param);
533 * selected subtitle track number callback function type.
535 * @param track_num [in] Track number of subtitle
536 * @param user_param [in] User defined parameter
539 * @return This callback function have to return MM_ERROR_NONE.
541 typedef bool (*mm_player_track_selected_subtitle_language_callback)(int track_num, void *user_param);
544 * Buffer underrun / overflow data callback function type.
546 * @param status [in] buffer status
547 * @param user_param [in] User defined parameter which is passed when set
548 * to enough data callback or need data callback
550 * @return This callback function have to return MM_ERROR_NONE.
552 typedef bool (*mm_player_media_stream_buffer_status_callback) (MMPlayerStreamType type, MMPlayerMediaStreamBufferStatus status, unsigned long long bytes, void *user_param);
555 * Buffer seek data callback function type.
557 * @param offset [in] offset for the buffer playback
558 * @param user_param [in] User defined parameter which is passed when set
559 * to seek data callback
561 * @return This callback function have to return MM_ERROR_NONE.
563 typedef bool (*mm_player_media_stream_seek_data_callback) (MMPlayerStreamType type, unsigned long long offset, void *user_param);
566 * Called to notify the stream changed.
568 * @param user_data [in] The user data passed from the callback registration function
570 * @return This callback function have to return MM_ERROR_NONE.
572 typedef bool (*mm_player_stream_changed_callback) (void *user_param);
575 /*===========================================================================================
577 | GLOBAL FUNCTION PROTOTYPES |
579 ========================================================================================== */
582 * This function creates a player object for playing multimedia contents. \n
583 * The attributes of player are created to get/set some values with application. \n
584 * And, mutex, gstreamer and other resources are initialized at this time. \n
585 * If player is created, the state will become MM_PLAYER_STATE_NULL.
587 * @param player [out] Handle of player
589 * @return This function returns zero on success, or negative value with error code. \n
590 * Please refer 'mm_error.h' to know it in detail.
592 * @post MM_PLAYER_STATE_NULL
593 * @see mm_player_destroy
594 * @remark You can create multiple handles on a context at the same time. \n
595 * However, player cannot guarantee proper operation because of limitation of resources, \n
596 * such as audio device or display device.
600 char *g_err_attr_name = NULL;
602 if (mm_player_create(&g_player) != MM_ERROR_NONE) {
603 LOGE("failed to create player\n");
606 if (mm_player_set_attribute(g_player,
608 "profile_uri", filename, strlen(filename),
609 "display_overlay", (void*)&g_win.xid, sizeof(g_win.xid),
610 NULL) != MM_ERROR_NONE) {
611 LOGE("failed to set %s attribute\n", g_err_attr_name);
612 free(g_err_attr_name);
615 mm_player_set_message_callback(g_player, msg_callback, (void*)g_player);
618 int mm_player_create(MMHandleType *player);
621 * This function releases player object and all resources which were created by mm_player_create(). \n
622 * And, player handle will also be destroyed.
624 * @param player [in] Handle of player
626 * @return This function returns zero on success, or negative value with error code.
627 * @pre Player state may be MM_PLAYER_STATE_NULL. \n
628 * But, it can be called in any state.
629 * @post Because handle is released, there is no any state.
630 * @see mm_player_create
631 * @remark This method can be called with a valid player handle from any state to \n
632 * completely shutdown the player operation.
636 if (mm_player_destroy(g_player) != MM_ERROR_NONE) {
637 LOGE("failed to destroy player\n");
641 int mm_player_destroy(MMHandleType player);
644 * This function parses uri and makes gstreamer pipeline by uri scheme. \n
645 * So, uri should be set before realizing with mm_player_set_attribute(). \n
647 * @param player [in] Handle of player
649 * @return This function returns zero on success, or negative value with error code.
651 * @pre Player state should be MM_PLAYER_STATE_NULL.
652 * @post player state will be MM_PLAYER_STATE_READY.
653 * @see mm_player_unrealize
657 if (mm_player_realize(g_player) != MM_ERROR_NONE) {
658 LOGE("failed to realize player\n");
662 int mm_player_realize(MMHandleType player);
665 * This function uninitializes player object. So, resources and allocated memory \n
666 * will be freed. And, gstreamer pipeline is also destroyed. So, if you want to play \n
667 * other contents, player should be created again after destruction or realized with new uri.
669 * @param player [in] Handle of player
671 * @return This function returns zero on success, or negative value with error code.
672 * @pre Player state may be MM_PLAYER_STATE_READY to unrealize. \n
673 * But, it can be called in any state.
674 * @post Player state will be MM_PLAYER_STATE_NULL.
675 * @see mm_player_realize
676 * @remark This method can be called with a valid player handle from any state.
680 if (mm_player_unrealize(g_player) != MM_ERROR_NONE) {
681 LOGE("failed to unrealize player\n");
685 int mm_player_unrealize(MMHandleType player);
688 * This function is to get current state of player. \n
689 * Application have to check current state before doing some action.
691 * @param player [in] Handle of player
692 * @param state [out] current state of player on success
694 * @return This function returns zero on success, or negative value with error code.
696 * @see MMPlayerStateType
700 if (mm_player_get_state(g_player, &state) != MM_ERROR_NONE) {
701 LOGE("failed to get state\n");
705 int mm_player_get_state(MMHandleType player, MMPlayerStateType *state);
708 * This function is to set relative volume of player. \n
709 * So, It controls logical volume value. \n
710 * But, if developer want to change system volume, mm sound api should be used.
712 * @param player [in] Handle of player
713 * @param volume [in] Volume factor of each channel
715 * @return This function returns zero on success, or negative value with error code.
716 * @see MMPlayerVolumeType, mm_player_get_volume
717 * @remark The range of factor range is from 0 to 1.0. (1.0 = 100%) And, default value is 1.0.
720 MMPlayerVolumeType volume;
723 for (i = 0; i < MM_VOLUME_CHANNEL_NUM; i++)
724 volume.level[i] = MM_VOLUME_LEVEL_MAX;
726 if (mm_player_set_volume(g_player, &volume) != MM_ERROR_NONE)
728 LOGE("failed to set volume\n");
732 int mm_player_set_volume(MMHandleType player, MMPlayerVolumeType *volume);
735 * This function is to get current volume factor of player.
737 * @param player [in] Handle of player.
738 * @param volume [out] Volume factor of each channel.
740 * @return This function returns zero on success, or negative value with error code.
742 * @see MMPlayerVolumeType, mm_player_set_volume
746 MMPlayerVolumeType volume;
749 if (mm_player_get_volume(g_player, &volume) != MM_ERROR_NONE)
751 LOGW("failed to get volume\n");
754 for (i = 0; i < MM_VOLUME_CHANNEL_NUM; i++)
755 LOGD("channel[%d] = %d \n", i, volume.level[i]);
758 int mm_player_get_volume(MMHandleType player, MMPlayerVolumeType *volume);
761 * This function is to start playing media contents. Demux(parser), codec and related plugins are decided \n
762 * at this time. And, MM_MESSAGE_BEGIN_OF_STREAM will be posted through callback function registered \n
763 * by mm_player_set_message_callback().
765 * @param player [in] Handle of player
767 * @return This function returns zero on success, or negative value with error code.
770 * @pre Player state may be MM_PLAYER_STATE_READY.
771 * @post Player state will be MM_PLAYER_STATE_PLAYING.
772 * @see mm_player_stop
776 if (mm_player_start(g_player) != MM_ERROR_NONE)
778 LOGE("failed to start player\n");
782 int mm_player_start(MMHandleType player);
785 * This function is to stop playing media contents and it's different with pause. \n
786 * If mm_player_start() is called after this, content will be started again from the beginning. \n
787 * So, it can be used to close current playback.
789 * @param player [in] Handle of player
791 * @return This function returns zero on success, or negative value with error code.
793 * @pre Player state may be MM_PLAYER_STATE_PLAYING.
794 * @post Player state will be MM_PLAYER_STATE_READY.
795 * @see mm_player_start
799 if (mm_player_stop(g_player) != MM_ERROR_NONE)
801 LOGE("failed to stop player\n");
805 int mm_player_stop(MMHandleType player);
808 * This function is to pause playing media contents.
810 * @param player [in] Handle of player.
812 * @return This function returns zero on success, or negative value with error code.
814 * @pre Player state may be MM_PLAYER_STATE_PLAYING.
815 * @post Player state will be MM_PLAYER_STATE_PAUSED.
816 * @see mm_player_resume
820 if (mm_player_pause(g_player) != MM_ERROR_NONE)
822 LOGE("failed to pause player\n");
826 int mm_player_pause(MMHandleType player);
829 * This function is to resume paused media contents.
831 * @param player [in] Handle of player.
833 * @return This function returns zero on success, or negative value with error code.
835 * @pre Player state may be MM_PLAYER_STATE_PAUSED.
836 * @post Player state will be MM_PLAYER_STATE_PLAYING.
837 * @see mm_player_pause
841 if (mm_player_resume(g_player) != MM_ERROR_NONE)
843 LOGE("failed to resume player\n");
847 int mm_player_resume(MMHandleType player);
850 * This function is to set the position for playback. \n
851 * So, it can be seeked to requested position. \n
853 * @param player [in] Handle of player
854 * @param format [in] Format of position.
855 * @param pos [in] Position for playback
857 * @return This function returns zero on success, or negative value with error code.
858 * @see MMPlayerPosFormatType, mm_player_get_position
859 * @remark the unit of time-based format is millisecond and other case is percent.
862 int position = 1000; //1sec
864 if (mm_player_set_position(g_player, MM_PLAYER_POS_FORMAT_TIME, position) != MM_ERROR_NONE)
866 LOGE("failed to set position\n");
870 int mm_player_set_position(MMHandleType player, MMPlayerPosFormatType format, int pos);
873 * This function is to get current position of playback content.
875 * @param player [in] Handle of player.
876 * @param format [in] Format of position.
877 * @param pos [out] contains current position on success or zero in case of failure.
879 * @return This function returns zero on success, or negative value with errors
880 * @see MMPlayerPosFormatType, mm_player_set_position
881 * @remark the unit of time-based format is millisecond and other case is percent.
887 mm_player_get_position(g_player, MM_PLAYER_POS_FORMAT_TIME, &position);
889 mm_player_get_attribute(g_player, &g_err_name, "content_duration", &duration, NULL);
891 LOGD("pos: [%d/%d] msec\n", position, duration);
894 int mm_player_get_position(MMHandleType player, MMPlayerPosFormatType format, unsigned long *pos);
897 * This function is to get current buffer position of playback content.
899 * @param player [in] Handle of player.
900 * @param format [in] Format of position.
901 * @param start_pos [out] contains buffer start position on success or zero in case of failure.
902 * @param stop_pos [out] contains buffer current position on success or zero in case of failure.
904 * @return This function returns zero on success, or negative value with errors
905 * @see MMPlayerPosFormatType, mm_player_set_position
906 * @remark the unit of time-based format is millisecond and other case is percent.
909 int start_pos = 0, stop_pos = 0;
911 mm_player_get_buffer_position(g_player, MM_PLAYER_POS_FORMAT_PERCENT, &start_pos, &stop_pos );
913 LOGD("buffer position: [%d] ~ [%d] \%\n", start_pos, stop_pos );
916 int mm_player_get_buffer_position(MMHandleType player, MMPlayerPosFormatType format, unsigned long *start_pos, unsigned long *stop_pos);
919 * This function sets callback function for receiving messages from player.
920 * So, player can notify warning, error and normal cases to application.
922 * @param player [in] Handle of player.
923 * @param callback [in] Message callback function.
924 * @param user_param [in] User parameter which is passed to callback function.
926 * @return This function returns zero on success, or negative value with error code.
927 * @see MMMessageCallback
931 int msg_callback(int message, MMMessageParamType *param, void *user_param)
935 case MM_MESSAGE_ERROR:
939 case MM_MESSAGE_END_OF_STREAM:
943 case MM_MESSAGE_STATE_CHANGED:
947 case MM_MESSAGE_BEGIN_OF_STREAM:
957 mm_player_set_message_callback(g_player, msg_callback, (void*)g_player);
960 int mm_player_set_message_callback(MMHandleType player, MMMessageCallback callback, void *user_param);
963 * This function set callback function for receiving audio stream from player. \n
964 * So, application can get raw audio data and modify it. \n
965 * But, if callback don't return or holds it for long time, performance can be deteriorated. \n
966 * It's only supported when audio stream is included in file. \n
967 * So, if there is video stream or DRM content, it can't be used.
969 * @param player [in] Handle of player.
970 * @param callback [in] Audio stream callback function.
971 * @param user_param [in] User parameter.
973 * @return This function returns zero on success, or negative value with error
975 * @see mm_player_audio_stream_callback
976 * @remark It can be used for audio playback only.
979 bool audio_callback(void *stream, int stream_size, void *user_param)
981 LOGD("audio stream callback\n");
984 mm_player_set_audio_stream_callback(g_player, audio_callback, NULL);
987 int mm_player_set_audio_stream_callback(MMHandleType player, mm_player_audio_stream_callback callback, void *user_param);
990 * This function is to mute volume of player
992 * @param player [in] Handle of player
993 * @param mute [in] Mute(1) or not mute(0)
995 * @return This function returns zero on success, or negative value with error code
996 * @see mm_player_get_mute
1000 if (mm_player_set_mute(g_player, TRUE) != MM_ERROR_NONE)
1002 LOGW("failed to set mute\n");
1006 int mm_player_set_mute(MMHandleType player, int mute);
1009 * This function is to get mute value of player
1011 * @param player [in] Handle of player
1012 * @param mute [out] Sound is muted
1014 * @return This function returns zero on success, or negative value with error code
1015 * @see mm_player_set_mute
1021 if (mm_player_get_mute(g_player, &mute) != MM_ERROR_NONE)
1023 LOGW("failed to get mute\n");
1026 LOGD("mute status:%d\n", mute);
1029 int mm_player_get_mute(MMHandleType player, int *mute);
1032 * This function is to adjust subtitle postion. So, subtitle can show at the adjusted position. \n
1033 * If pos is negative, subtitle will be displayed previous time, the other hand forward time. \n
1035 * @param player [in] Handle of player
1036 * @param pos [in] postion to be adjusted
1038 * @return This function returns zero on success, or negative value with error
1040 * @see mm_player_adjust_subtitle_position
1047 if (mm_player_adjust_subtitle_position(g_player, MM_PLAYER_POS_FORMAT_TIME, pos) != MM_ERROR_NONE)
1049 LOGW("failed to adjust subtitle postion.\n");
1054 int mm_player_adjust_subtitle_position(MMHandleType player, MMPlayerPosFormatType format, int pos);
1057 * This function is to set the offset in timestamps of video so as to bring the a/v sync
1058 * @param player Handle of player
1059 * @param offset offset to be set in milliseconds(can be positive or negative both)
1060 * postive offset to make video lag
1061 * negative offset to make video lead
1063 int mm_player_adjust_video_position(MMHandleType player, int offset);
1065 * This function is to set subtitle silent status. So, subtitle can show or hide during playback \n
1066 * by this value. But, one subtitle file should be set with "subtitle_uri" attribute before calling mm_player_realize(); \n
1067 * Player FW parses subtitle file and send text data including timestamp to application \n
1068 * through message callback with MM_MESSAGE_UPDATE_SUBTITLE will be. \n
1069 * So, application have to render it. And, subtitle can be supported only in a seprate file. \n
1070 * So, it's not supported for embedded case.
1072 * @param player [in] Handle of player
1073 * @param silent [in] silent(integer value except 0) or not silent(0)
1075 * @return This function returns zero on success, or negative value with error
1077 * @see mm_player_get_subtitle_silent, MM_MESSAGE_UPDATE_SUBTITLE
1081 mm_player_set_attribute(g_player,
1083 "subtitle_uri", g_subtitle_uri, strlen(g_subtitle_uri),
1087 if (mm_player_set_subtitle_silent(g_player, TRUE) != MM_ERROR_NONE)
1089 LOGW("failed to set subtitle silent\n");
1093 int mm_player_set_subtitle_silent(MMHandleType player, int silent);
1096 * This function is to get silent status of subtitle.
1098 * @param player [in] Handle of player
1099 * @param silent [out] subtitle silent property
1101 * @return This function returns zero on success, or negative value with error
1103 * @see mm_player_set_subtitle_silent, MM_MESSAGE_UPDATE_SUBTITLE
1109 if (mm_player_get_subtitle_silent(g_player, &silent) != MM_ERROR_NONE)
1111 LOGW("failed to set subtitle silent\n");
1115 int mm_player_get_subtitle_silent(MMHandleType player, int *silent);
1118 * This function is to set attributes into player. Multiple attributes can be set simultaneously. \n
1119 * If one of attribute fails, this function will stop at the point and let you know the name which is failed. \n
1121 * @param player [in] Handle of player.
1122 * @param err_attr_name [out] Name of attribute which is failed to set
1123 * @param first_attribute_name [in] Name of the first attribute to set
1124 * @param ... [in] Value for the first attribute, followed optionally by more name/value pairs, terminated by NULL.
1125 * But, in the case of data or string type, it should be name/value/size.
1127 * @return This function returns zero on success, or negative value with error code.
1129 * @see mm_player_get_attribute
1130 * @remark This function must be terminated by NULL argument.
1131 * And, if this function is failed, err_attr_name param must be free.
1134 char *g_err_attr_name = NULL;
1136 if (mm_player_set_attribute(g_player,
1138 "profile_uri", filename, strlen(filename),
1139 "profile_play_count", count,
1140 NULL) != MM_ERROR_NONE) {
1141 LOGW("failed to set %s attribute\n", g_err_attr_name);
1142 free(g_err_attr_name);
1147 int mm_player_set_attribute(MMHandleType player, char **err_attr_name, const char *first_attribute_name, ...)G_GNUC_NULL_TERMINATED;
1150 * This function is to get attributes from player. Multiple attributes can be got simultaneously.
1152 * @param player [in] Handle of player.
1153 * @param err_attr_name [out] Name of attribute which is failed to get
1154 * @param first_attribute_name [in] Name of the first attribute to get
1155 * @param ... [out] Value for the first attribute, followed optionally by more name/value pairs, terminated by NULL.
1156 * But, in the case of data or string type, it should be name/value/size.
1158 * @return This function returns zero on success, or negative value with error
1160 * @see mm_player_set_attribute
1161 * @remark This function must be terminated by NULL argument.
1162 * And, if this function is failed, err_attr_name param must be free.
1165 char *g_err_attr_name = NULL;
1167 if (mm_player_get_attribute(g_player, &g_err_attr_name, "content_duration", &duration, NULL) != MM_ERROR_NONE) {
1168 LOGW("failed to set %s attribute\n", g_err_attr_name);
1169 free(g_err_attr_name);
1173 int mm_player_get_attribute(MMHandleType player, char **err_attr_name, const char *first_attribute_name, ...)G_GNUC_NULL_TERMINATED;
1176 * This function is to get detail information of attribute.
1178 * @param player [in] Handle of player.
1179 * @param attribute_name [in] Name of the attribute to get
1180 * @param info [out] Attribute infomation
1182 * @return This function returns zero on success, or negative value with error
1185 * @see mm_player_set_attribute, mm_player_get_attribute
1189 if (mm_player_get_attribute_info(g_player, "display_method", &method_info) != MM_ERROR_NONE) {
1190 LOGW("failed to get info\n");
1193 LOGD("type:%d \n", method_info.type); //int, double..
1194 LOGD("flag:%d \n", method_info.flag); //readable, writable..
1195 LOGD("validity type:%d \n", method_info.validity_type); //range, array..
1197 if (method_info. validity_type == MM_PLAYER_ATTRS_VALID_TYPE_INT_RANGE) {
1198 LOGD("range min:%d\n", method_info.int_range.min);
1199 LOGD("range max:%d\n", method_info.int_range.max);
1203 int mm_player_get_attribute_info(MMHandleType player, const char *attribute_name, MMPlayerAttrsInfo *info);
1206 * This function is to get download position and total size of progressive download
1208 * @param player [in] Handle of player.
1209 * @param current_pos [in] Download position currently (bytes)
1210 * @param total_size [in] Total size of file (bytes)
1212 * @return This function returns zero on success, or negative value with error code.
1215 guint64 current_pos = 0LLU;
1216 guint64 total_size = 0LLU;
1218 if (mm_player_get_pd_status(g_player, ¤t_pos, &total_size, NULL) != MM_ERROR_NONE)
1220 LOGD("current download pos = %llu, total size = %llu\n", current_pos, total_size);
1224 int mm_player_get_pd_status(MMHandleType player, guint64 *current_pos, guint64 *total_size);
1227 * This function sets callback function for receiving messages of PD downloader.
1229 * @param player [in] Handle of player.
1230 * @param callback [in] Message callback function.
1231 * @param user_param [in] User parameter which is passed to callback function.
1233 * @return This function returns zero on success, or negative value with error code.
1238 int msg_callback(int message, MMMessageParamType *param, void *user_param)
1242 case MM_MESSAGE_PD_DOWNLOADER_START:
1243 LOGD("Progressive download is started...\n");
1245 case MM_MESSAGE_PD_DOWNLOADER_END:
1246 LOGD("Progressive download is ended...\n");
1254 mm_player_set_pd_message_callback(g_player, msg_callback, NULL);
1257 int mm_player_set_pd_message_callback(MMHandleType player, MMMessageCallback callback, void *user_param);
1260 * This function is to get the track count
1262 * @param player [in] handle of player.
1263 * @param track [in] type of the track type
1264 * @param info [out] the count of the track
1266 * @return This function returns zero on success, or negative value with error
1271 gint audio_count = 0;
1273 if (mm_player_get_track_count(g_player, MM_PLAYER_TRACK_TYPE_AUDIO, &audio_count) != MM_ERROR_NONE) {
1274 LOGW("failed to get audio track count\n");
1277 LOGD("audio track count : %d \n", audio_count);
1280 int mm_player_get_track_count(MMHandleType player, MMPlayerTrackType type, int *count);
1283 * This function is to select the track
1285 * @param player [in] handle of player.
1286 * @param type [in] type of the track type
1287 * @param index [in] the index of the track
1289 * @return This function returns zero on success, or negative value with error
1292 int mm_player_select_track(MMHandleType player, MMPlayerTrackType type, int index);
1295 * This function is to add the track when user want multi subtitle
1297 * @param player [in] handle of player.
1298 * @param index [in] the index of the track
1300 * @return This function returns zero on success, or negative value with error
1303 int mm_player_track_add_subtitle_language(MMHandleType player, int index);
1306 * This function is to remove the track when user want multi subtitle
1308 * @param player [in] handle of player.
1309 * @param index [in] the index of the track
1311 * @return This function returns zero on success, or negative value with error
1314 int mm_player_track_remove_subtitle_language(MMHandleType player, int index);
1317 * This function is to notify which sutitle track is in use
1319 * @param player [in] handle of player.
1320 * @param callback [in] callback function to register
1321 * @param user_data [in] user data to be passed to the callback function
1323 * @return This function returns zero on success, or negative value with error
1326 int mm_player_track_foreach_selected_subtitle_language(MMHandleType player, mm_player_track_selected_subtitle_language_callback callback, void *user_param);
1329 * This function is to get the track language
1331 * @param player [in] handle of player.
1332 * @param type [in] type of the track type
1333 * @param index [in] the index of the track
1334 * @param code [out] language code in ISO 639-1(string)
1336 * @return This function returns zero on success, or negative value with error
1339 int mm_player_get_track_language_code(MMHandleType player, MMPlayerTrackType type, int index, char **code);
1342 * This function is to get the current running track
1344 * @param player [in] handle of player.
1345 * @param type [in] type of the track type
1346 * @param index [out] the index of the track
1348 * @return This function returns zero on success, or negative value with error
1352 int mm_player_get_current_track(MMHandleType hplayer, MMPlayerTrackType type, int *index);
1355 * This function is to set the subtitle path
1357 * @param player [in] handle of player
1358 * @param path [in] subtitle path
1360 * @return This function returns zero on success, or negative value with error code.
1362 int mm_player_set_external_subtitle_path(MMHandleType player, const char* path);
1365 * This function is to set the clock which is from master player
1367 * @param player [in] handle of player
1368 * @param clock [in] clock of master player
1369 * @param clock_delta [in] clock difference between master and slave
1370 * @param video_time [in] current playing position
1371 * @param media_clock [in] media clock information
1372 * @param audio_time [in] audio timestamp information
1373 * @return This function returns zero on success, or negative value with error code.
1375 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);
1377 * This function is to get the master clock
1379 * @param player [in] handle of player
1380 * @param video_time [out] current playing position
1381 * @param media_clock [out] media clock information
1382 * @param audio_time [out] audio timestamp information
1383 * @return This function returns zero on success, or negative value with error code.
1385 int mm_player_get_video_share_master_clock(MMHandleType player, long long *video_time, long long *media_clock, long long *audio_time);
1388 * This function is to set download mode of video hub
1390 * @param player [in] handle of player
1391 * @param mode [in] download mode
1392 * @return This function returns zero on success, or negative value with error code.
1394 int mm_player_set_video_hub_download_mode(MMHandleType player, bool mode);
1397 * This function is to set using sync handler.
1399 * @param player [in] handle of player
1400 * @param enable [in] enable/disable
1401 * @return This function returns zero on success, or negative value with error code.
1403 int mm_player_enable_sync_handler(MMHandleType player, bool enable);
1406 * This function is to set uri.
1408 * @param player [in] handle of player
1409 * @param uri [in] uri
1410 * @return This function returns zero on success, or negative value with error code.
1412 int mm_player_set_uri(MMHandleType player, const char *uri);
1415 * This function is to set next uri.
1417 * @param player [in] handle of player
1418 * @param uri [in] uri
1419 * @return This function returns zero on success, or negative value with error code.
1421 int mm_player_set_next_uri(MMHandleType player, const char *uri);
1424 * This function is to get next uri.
1426 * @param player [in] handle of player
1427 * @param uri [out] uri
1428 * @return This function returns zero on success, or negative value with error code.
1430 int mm_player_get_next_uri(MMHandleType player, char **uri);
1433 * This function is to decrease reference count of internal buffer.
1435 * @param buffer [in] video callback internal buffer
1438 void mm_player_video_stream_internal_buffer_unref(void *buffer);
1440 /**mm_player_submit_packet
1441 * This function is to submit buffer to appsrc. \n
1442 * @param player [in] Handle of player.
1443 * @param buf [in] buffer to be submit in appsrc in external feeder case.
1444 * @param len [in] length of buffer.
1445 * @param pts [in] timestamp of buffer.
1446 * @param streamtype [in] stream type of buffer.
1447 * @return This function returns zero on success, or negative value with error code.
1449 int mm_player_submit_packet(MMHandleType player, media_packet_h packet);
1451 /**mm_player_set_video_info
1452 * This function is to set caps of src pad of video appsrc in external feeder case. \n
1453 * @param player [in] Handle of player.
1454 * @param media_format_h [in] Video stream info.
1455 * @return This function returns zero on success, or negative value with error code.
1457 int mm_player_set_video_info(MMHandleType player, media_format_h format);
1459 /**mm_player_set_audio_info
1460 * This function is to set caps of src pad of Audio appsrc in external feeder case. \n
1461 * @param player [in] Handle of player.
1462 * @param media_format_h [in] Audio stream info.
1463 * @return This function returns zero on success, or negative value with error code.
1465 int mm_player_set_audio_info(MMHandleType player, media_format_h format);
1467 /**mm_player_set_subtitle_info
1468 * This function is to set caps of src pad of subtitle appsrc in external feeder case. \n
1469 * @param player [in] Handle of player.
1470 * @param subtitle_stream_info [in] Subtitle stream info.
1471 * @return This function returns zero on success, or negative value with error code.
1473 int mm_player_set_subtitle_info(MMHandleType player, MMPlayerSubtitleStreamInfo *info);
1476 * This function set callback function for receiving need or enough data message from player.
1478 * @param player [in] Handle of player.
1479 * @param type [in] stream type
1480 * @param callback [in] data callback function for stream type.
1481 * @param user_param [in] User parameter.
1483 * @return This function returns zero on success, or negative value with error
1486 int mm_player_set_media_stream_buffer_status_callback(MMHandleType player, MMPlayerStreamType type, mm_player_media_stream_buffer_status_callback callback, void * user_param);
1489 * This function set callback function for receiving seek data message from player.
1491 * @param player [in] Handle of player.
1492 * @param type [in] stream type
1493 * @param callback [in] Seek data callback function for stream type.
1494 * @param user_param [in] User parameter.
1496 * @return This function returns zero on success, or negative value with error
1499 int mm_player_set_media_stream_seek_data_callback(MMHandleType player, MMPlayerStreamType type, mm_player_media_stream_seek_data_callback callback, void * user_param);
1502 * This function is to set max size of buffer(appsrc).
1504 * @param player [in] Handle of player.
1505 * @param type [in] stream type
1506 * @param max_size [in] max bytes of buffer.
1508 * @return This function returns zero on success, or negative value with error
1511 int mm_player_set_media_stream_buffer_max_size(MMHandleType player, MMPlayerStreamType type, unsigned long long max_size);
1514 * This function is to get max size of buffer(appsrc).
1516 * @param player [in] Handle of player.
1517 * @param type [in] stream type
1518 * @param max_size [out] max bytes of buffer.
1520 * @return This function returns zero on success, or negative value with error
1523 int mm_player_get_media_stream_buffer_max_size(MMHandleType player, MMPlayerStreamType type, unsigned long long *max_size);
1526 * This function is to set min percent of buffer(appsrc).
1528 * @param player [in] Handle of player.
1529 * @param type [in] stream type
1530 * @param min_percent [in] min percent of buffer.
1532 * @return This function returns zero on success, or negative value with error
1535 int mm_player_set_media_stream_buffer_min_percent(MMHandleType player, MMPlayerStreamType type, unsigned min_percent);
1538 * This function is to get min percent of buffer(appsrc).
1540 * @param player [in] Handle of player.
1541 * @param type [in] stream type
1542 * @param min_percent [out] min percent of buffer.
1544 * @return This function returns zero on success, or negative value with error
1547 int mm_player_get_media_stream_buffer_min_percent(MMHandleType player, MMPlayerStreamType type, unsigned int *min_percent);
1550 * This function set callback function for changing audio stream from player. \n
1551 * It's only supported when audio stream is included in file. \n
1553 * @param player [in] Handle of player.
1554 * @param callback [in] Audio stream changed callback function.
1555 * @param user_param [in] User parameter.
1557 * @return This function returns zero on success, or negative value with error
1559 * @see mm_player_stream_changed_callback
1562 int mm_player_set_audio_stream_changed_callback(MMHandleType player, mm_player_stream_changed_callback callback, void *user_param);
1565 * This function set callback function for changing video stream from player. \n
1566 * It's only supported when video stream is included in file. \n
1568 * @param player [in] Handle of player.
1569 * @param callback [in] Video stream changed callback function.
1570 * @param user_param [in] User parameter.
1572 * @return This function returns zero on success, or negative value with error
1574 * @see mm_player_stream_changed_callback
1576 int mm_player_set_video_stream_changed_callback(MMHandleType player, mm_player_stream_changed_callback callback, void *user_param);
1579 * This function is to get timeout value according to the content type for muse. \n
1580 * It's only supported when video stream is included in file. \n
1582 * @param player [in] Handle of player.
1583 * @param timeout [out] timeout value (sec).
1585 * @return This function returns zero on success, or negative value with error
1589 int mm_player_get_timeout(MMHandleType player, int *timeout);
1592 * This function is to get the number of video output buffers. \n
1593 * It's only supported when video stream is included in file. \n
1595 * @param player [in] Handle of player.
1596 * @param num [out] num of buffers.
1597 * @param extra_num [out] extra num of buffers.
1599 * @return This function returns zero on success, or negative value with error
1603 int mm_player_get_num_of_video_out_buffers(MMHandleType player, int *num, int *extra_num);
1606 * This function is to set the dynamic resolution information. \n
1607 * It's only supported when video stream is included in file. \n
1609 * @param player [in] Handle of player.
1610 * @param drc [in] dynamic resolution info of media stream data
1612 * @return This function returns zero on success, or negative value with error
1616 int mm_player_set_media_stream_dynamic_resolution(MMHandleType player, bool drc);
1619 * This function is to release the video stream bo to reuse. \n
1620 * It's only supported when sw codec is used to decode video stream. \n
1622 * @param player [in] Handle of player.
1623 * @param bo [in] bo address to be released
1625 * @return This function returns zero on success, or negative value with error
1629 int mm_player_release_video_stream_bo(MMHandleType player, void* bo);
1632 * This function is to set http file buffering path
1634 * @param player [in] handle of player
1635 * @param file_path [in] file path
1636 * @return This function returns zero on success, or negative value with error code.
1638 int mm_player_set_file_buffering_path(MMHandleType player, const char *file_path);
1641 * This function is to set sound stream info
1643 int mm_player_set_sound_stream_info(MMHandleType player, char *stream_type, int stream_index);
1646 * This function is to manage the playback according to the external storage state
1648 int mm_player_manage_external_storage_state(MMHandleType player, int id, int state);
1651 * These functions are to set/get the max variant of HAS
1653 int mm_player_get_adaptive_variant_info(MMHandleType player, int *num, char **var_info);
1654 int mm_player_set_max_adaptive_variant_limit(MMHandleType player, int bandwidth, int width, int height);
1655 int mm_player_get_max_adaptive_variant_limit(MMHandleType player, int *bandwidth, int *width, int *height);
1658 * These functions are to set/get the audio only mode
1660 int mm_player_set_audio_only(MMHandleType player, bool audio_only);
1661 int mm_player_get_audio_only(MMHandleType player, bool *audio_only);
1664 * These functions are to set/get the streaming bufferint time
1666 int mm_player_set_streaming_buffering_time(MMHandleType player, int buffer_ms, int rebuffer_ms);
1667 int mm_player_get_streaming_buffering_time(MMHandleType player, int *buffer_ms, int *rebuffer_ms);
1670 * These functions are to display the 360 video content
1672 int mm_player_360_is_content_spherical(MMHandleType player, bool *is_spherical);
1673 int mm_player_360_set_enabled(MMHandleType player, bool enabled);
1674 int mm_player_360_is_enabled(MMHandleType player, bool *enabled);
1676 int mm_player_360_set_direction_of_view(MMHandleType player, float yaw, float pitch);
1677 int mm_player_360_get_direction_of_view(MMHandleType player, float *yaw, float *pitch);
1679 int mm_player_360_set_zoom(MMHandleType player, float level);
1680 int mm_player_360_get_zoom(MMHandleType player, float *level);
1682 int mm_player_360_set_field_of_view(MMHandleType player, int horizontal_degrees, int vertical_degrees);
1683 int mm_player_360_get_field_of_view(MMHandleType player, int *horizontal_degrees, int *vertical_degrees);
1686 * This function is to set codec type
1688 int mm_player_set_codec_type(MMHandleType player, MMPlayerStreamType stream_type, MMPlayerVideoCodecType codec_type);
1691 * These functions are to apply the replaygain
1693 int mm_player_set_replaygain_enabled(MMHandleType player, bool enabled);
1694 int mm_player_is_replaygain_enabled(MMHandleType player, bool *enabled);
1703 #endif /* __MM_PLAYER_H__ */