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 is to activate the section repeat. If it's set, selected section will be played \n
919 * continually before deactivating it by mm_player_deactivate_section_repeat(). \n
920 * The unit for setting is millisecond.
922 * @param player [in] Handle of player.
923 * @param start_pos [in] start position.
924 * @param end_pos [in] end position.
926 * @return This function returns zero on success, or negative value with error code.
927 * @see mm_player_deactivate_section_repeat
932 int endtime = 4000; //msec
934 mm_player_get_position(g_player, MM_PLAYER_POS_FORMAT_TIME, &position);
936 mm_player_activate_section_repeat(g_player, position, position+endtime);
939 int mm_player_activate_section_repeat(MMHandleType player, int start_pos, int end_pos);
942 * This function is to deactivate the section repeat.
944 * @param player [in] Handle of player.
946 * @return This function returns zero on success, or negative value with error code.
947 * @see mm_player_activate_section_repeat
951 if ( mm_player_deactivate_section_repeat(g_player) != MM_ERROR_NONE)
953 LOGW("failed to deactivate section repeat\n");
957 int mm_player_deactivate_section_repeat(MMHandleType player);
960 * This function sets callback function for receiving messages from player.
961 * So, player can notify warning, error and normal cases to application.
963 * @param player [in] Handle of player.
964 * @param callback [in] Message callback function.
965 * @param user_param [in] User parameter which is passed to callback function.
967 * @return This function returns zero on success, or negative value with error code.
968 * @see MMMessageCallback
972 int msg_callback(int message, MMMessageParamType *param, void *user_param)
976 case MM_MESSAGE_ERROR:
980 case MM_MESSAGE_END_OF_STREAM:
984 case MM_MESSAGE_STATE_CHANGED:
988 case MM_MESSAGE_BEGIN_OF_STREAM:
998 mm_player_set_message_callback(g_player, msg_callback, (void*)g_player);
1001 int mm_player_set_message_callback(MMHandleType player, MMMessageCallback callback, void *user_param);
1004 * This function set callback function for receiving audio stream from player. \n
1005 * So, application can get raw audio data and modify it. \n
1006 * But, if callback don't return or holds it for long time, performance can be deteriorated. \n
1007 * It's only supported when audio stream is included in file. \n
1008 * So, if there is video stream or DRM content, it can't be used.
1010 * @param player [in] Handle of player.
1011 * @param callback [in] Audio stream callback function.
1012 * @param user_param [in] User parameter.
1014 * @return This function returns zero on success, or negative value with error
1016 * @see mm_player_audio_stream_callback
1017 * @remark It can be used for audio playback only.
1020 bool audio_callback(void *stream, int stream_size, void *user_param)
1022 LOGD("audio stream callback\n");
1025 mm_player_set_audio_stream_callback(g_player, audio_callback, NULL);
1028 int mm_player_set_audio_stream_callback(MMHandleType player, mm_player_audio_stream_callback callback, void *user_param);
1031 * This function is to mute volume of player
1033 * @param player [in] Handle of player
1034 * @param mute [in] Mute(1) or not mute(0)
1036 * @return This function returns zero on success, or negative value with error code
1037 * @see mm_player_get_mute
1041 if (mm_player_set_mute(g_player, TRUE) != MM_ERROR_NONE)
1043 LOGW("failed to set mute\n");
1047 int mm_player_set_mute(MMHandleType player, int mute);
1050 * This function is to get mute value of player
1052 * @param player [in] Handle of player
1053 * @param mute [out] Sound is muted
1055 * @return This function returns zero on success, or negative value with error code
1056 * @see mm_player_set_mute
1062 if (mm_player_get_mute(g_player, &mute) != MM_ERROR_NONE)
1064 LOGW("failed to get mute\n");
1067 LOGD("mute status:%d\n", mute);
1070 int mm_player_get_mute(MMHandleType player, int *mute);
1073 * This function is to adjust subtitle postion. So, subtitle can show at the adjusted position. \n
1074 * If pos is negative, subtitle will be displayed previous time, the other hand forward time. \n
1076 * @param player [in] Handle of player
1077 * @param pos [in] postion to be adjusted
1079 * @return This function returns zero on success, or negative value with error
1081 * @see mm_player_adjust_subtitle_position
1088 if (mm_player_adjust_subtitle_position(g_player, MM_PLAYER_POS_FORMAT_TIME, pos) != MM_ERROR_NONE)
1090 LOGW("failed to adjust subtitle postion.\n");
1095 int mm_player_adjust_subtitle_position(MMHandleType player, MMPlayerPosFormatType format, int pos);
1098 * This function is to set the offset in timestamps of video so as to bring the a/v sync
1099 * @param player Handle of player
1100 * @param offset offset to be set in milliseconds(can be positive or negative both)
1101 * postive offset to make video lag
1102 * negative offset to make video lead
1104 int mm_player_adjust_video_position(MMHandleType player, int offset);
1106 * This function is to set subtitle silent status. So, subtitle can show or hide during playback \n
1107 * by this value. But, one subtitle file should be set with "subtitle_uri" attribute before calling mm_player_realize(); \n
1108 * Player FW parses subtitle file and send text data including timestamp to application \n
1109 * through message callback with MM_MESSAGE_UPDATE_SUBTITLE will be. \n
1110 * So, application have to render it. And, subtitle can be supported only in a seprate file. \n
1111 * So, it's not supported for embedded case.
1113 * @param player [in] Handle of player
1114 * @param silent [in] silent(integer value except 0) or not silent(0)
1116 * @return This function returns zero on success, or negative value with error
1118 * @see mm_player_get_subtitle_silent, MM_MESSAGE_UPDATE_SUBTITLE
1122 mm_player_set_attribute(g_player,
1124 "subtitle_uri", g_subtitle_uri, strlen(g_subtitle_uri),
1128 if (mm_player_set_subtitle_silent(g_player, TRUE) != MM_ERROR_NONE)
1130 LOGW("failed to set subtitle silent\n");
1134 int mm_player_set_subtitle_silent(MMHandleType player, int silent);
1137 * This function is to get silent status of subtitle.
1139 * @param player [in] Handle of player
1140 * @param silent [out] subtitle silent property
1142 * @return This function returns zero on success, or negative value with error
1144 * @see mm_player_set_subtitle_silent, MM_MESSAGE_UPDATE_SUBTITLE
1150 if (mm_player_get_subtitle_silent(g_player, &silent) != MM_ERROR_NONE)
1152 LOGW("failed to set subtitle silent\n");
1156 int mm_player_get_subtitle_silent(MMHandleType player, int *silent);
1159 * This function is to set attributes into player. Multiple attributes can be set simultaneously. \n
1160 * If one of attribute fails, this function will stop at the point and let you know the name which is failed. \n
1162 * @param player [in] Handle of player.
1163 * @param err_attr_name [out] Name of attribute which is failed to set
1164 * @param first_attribute_name [in] Name of the first attribute to set
1165 * @param ... [in] Value for the first attribute, followed optionally by more name/value pairs, terminated by NULL.
1166 * But, in the case of data or string type, it should be name/value/size.
1168 * @return This function returns zero on success, or negative value with error code.
1170 * @see mm_player_get_attribute
1171 * @remark This function must be terminated by NULL argument.
1172 * And, if this function is failed, err_attr_name param must be free.
1175 char *g_err_attr_name = NULL;
1177 if (mm_player_set_attribute(g_player,
1179 "profile_uri", filename, strlen(filename),
1180 "profile_play_count", count,
1181 NULL) != MM_ERROR_NONE) {
1182 LOGW("failed to set %s attribute\n", g_err_attr_name);
1183 free(g_err_attr_name);
1188 int mm_player_set_attribute(MMHandleType player, char **err_attr_name, const char *first_attribute_name, ...)G_GNUC_NULL_TERMINATED;
1191 * This function is to get attributes from player. Multiple attributes can be got simultaneously.
1193 * @param player [in] Handle of player.
1194 * @param err_attr_name [out] Name of attribute which is failed to get
1195 * @param first_attribute_name [in] Name of the first attribute to get
1196 * @param ... [out] Value for the first attribute, followed optionally by more name/value pairs, terminated by NULL.
1197 * But, in the case of data or string type, it should be name/value/size.
1199 * @return This function returns zero on success, or negative value with error
1201 * @see mm_player_set_attribute
1202 * @remark This function must be terminated by NULL argument.
1203 * And, if this function is failed, err_attr_name param must be free.
1206 char *g_err_attr_name = NULL;
1208 if (mm_player_get_attribute(g_player, &g_err_attr_name, "content_duration", &duration, NULL) != MM_ERROR_NONE) {
1209 LOGW("failed to set %s attribute\n", g_err_attr_name);
1210 free(g_err_attr_name);
1214 int mm_player_get_attribute(MMHandleType player, char **err_attr_name, const char *first_attribute_name, ...)G_GNUC_NULL_TERMINATED;
1217 * This function is to get detail information of attribute.
1219 * @param player [in] Handle of player.
1220 * @param attribute_name [in] Name of the attribute to get
1221 * @param info [out] Attribute infomation
1223 * @return This function returns zero on success, or negative value with error
1226 * @see mm_player_set_attribute, mm_player_get_attribute
1230 if (mm_player_get_attribute_info(g_player, "display_method", &method_info) != MM_ERROR_NONE) {
1231 LOGW("failed to get info\n");
1234 LOGD("type:%d \n", method_info.type); //int, double..
1235 LOGD("flag:%d \n", method_info.flag); //readable, writable..
1236 LOGD("validity type:%d \n", method_info.validity_type); //range, array..
1238 if (method_info. validity_type == MM_PLAYER_ATTRS_VALID_TYPE_INT_RANGE) {
1239 LOGD("range min:%d\n", method_info.int_range.min);
1240 LOGD("range max:%d\n", method_info.int_range.max);
1244 int mm_player_get_attribute_info(MMHandleType player, const char *attribute_name, MMPlayerAttrsInfo *info);
1247 * This function is to get download position and total size of progressive download
1249 * @param player [in] Handle of player.
1250 * @param current_pos [in] Download position currently (bytes)
1251 * @param total_size [in] Total size of file (bytes)
1253 * @return This function returns zero on success, or negative value with error code.
1256 guint64 current_pos = 0LLU;
1257 guint64 total_size = 0LLU;
1259 if (mm_player_get_pd_status(g_player, ¤t_pos, &total_size, NULL) != MM_ERROR_NONE)
1261 LOGD("current download pos = %llu, total size = %llu\n", current_pos, total_size);
1265 int mm_player_get_pd_status(MMHandleType player, guint64 *current_pos, guint64 *total_size);
1268 * This function sets callback function for receiving messages of PD downloader.
1270 * @param player [in] Handle of player.
1271 * @param callback [in] Message callback function.
1272 * @param user_param [in] User parameter which is passed to callback function.
1274 * @return This function returns zero on success, or negative value with error code.
1279 int msg_callback(int message, MMMessageParamType *param, void *user_param)
1283 case MM_MESSAGE_PD_DOWNLOADER_START:
1284 LOGD("Progressive download is started...\n");
1286 case MM_MESSAGE_PD_DOWNLOADER_END:
1287 LOGD("Progressive download is ended...\n");
1295 mm_player_set_pd_message_callback(g_player, msg_callback, NULL);
1298 int mm_player_set_pd_message_callback(MMHandleType player, MMMessageCallback callback, void *user_param);
1301 * This function is to get the track count
1303 * @param player [in] handle of player.
1304 * @param track [in] type of the track type
1305 * @param info [out] the count of the track
1307 * @return This function returns zero on success, or negative value with error
1312 gint audio_count = 0;
1314 if (mm_player_get_track_count(g_player, MM_PLAYER_TRACK_TYPE_AUDIO, &audio_count) != MM_ERROR_NONE) {
1315 LOGW("failed to get audio track count\n");
1318 LOGD("audio track count : %d \n", audio_count);
1321 int mm_player_get_track_count(MMHandleType player, MMPlayerTrackType type, int *count);
1324 * This function is to select the track
1326 * @param player [in] handle of player.
1327 * @param type [in] type of the track type
1328 * @param index [in] the index of the track
1330 * @return This function returns zero on success, or negative value with error
1333 int mm_player_select_track(MMHandleType player, MMPlayerTrackType type, int index);
1336 * This function is to add the track when user want multi subtitle
1338 * @param player [in] handle of player.
1339 * @param index [in] the index of the track
1341 * @return This function returns zero on success, or negative value with error
1344 int mm_player_track_add_subtitle_language(MMHandleType player, int index);
1347 * This function is to remove the track when user want multi subtitle
1349 * @param player [in] handle of player.
1350 * @param index [in] the index of the track
1352 * @return This function returns zero on success, or negative value with error
1355 int mm_player_track_remove_subtitle_language(MMHandleType player, int index);
1358 * This function is to notify which sutitle track is in use
1360 * @param player [in] handle of player.
1361 * @param callback [in] callback function to register
1362 * @param user_data [in] user data to be passed to the callback function
1364 * @return This function returns zero on success, or negative value with error
1367 int mm_player_track_foreach_selected_subtitle_language(MMHandleType player, mm_player_track_selected_subtitle_language_callback callback, void *user_param);
1370 * This function is to get the track language
1372 * @param player [in] handle of player.
1373 * @param type [in] type of the track type
1374 * @param index [in] the index of the track
1375 * @param code [out] language code in ISO 639-1(string)
1377 * @return This function returns zero on success, or negative value with error
1380 int mm_player_get_track_language_code(MMHandleType player, MMPlayerTrackType type, int index, char **code);
1383 * This function is to get the current running track
1385 * @param player [in] handle of player.
1386 * @param type [in] type of the track type
1387 * @param index [out] the index of the track
1389 * @return This function returns zero on success, or negative value with error
1393 int mm_player_get_current_track(MMHandleType hplayer, MMPlayerTrackType type, int *index);
1396 * This function is to set the subtitle path
1398 * @param player [in] handle of player
1399 * @param path [in] subtitle path
1401 * @return This function returns zero on success, or negative value with error code.
1403 int mm_player_set_external_subtitle_path(MMHandleType player, const char* path);
1406 * This function is to set the clock which is from master player
1408 * @param player [in] handle of player
1409 * @param clock [in] clock of master player
1410 * @param clock_delta [in] clock difference between master and slave
1411 * @param video_time [in] current playing position
1412 * @param media_clock [in] media clock information
1413 * @param audio_time [in] audio timestamp information
1414 * @return This function returns zero on success, or negative value with error code.
1416 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);
1418 * This function is to get the master clock
1420 * @param player [in] handle of player
1421 * @param video_time [out] current playing position
1422 * @param media_clock [out] media clock information
1423 * @param audio_time [out] audio timestamp information
1424 * @return This function returns zero on success, or negative value with error code.
1426 int mm_player_get_video_share_master_clock(MMHandleType player, long long *video_time, long long *media_clock, long long *audio_time);
1429 * This function is to set download mode of video hub
1431 * @param player [in] handle of player
1432 * @param mode [in] download mode
1433 * @return This function returns zero on success, or negative value with error code.
1435 int mm_player_set_video_hub_download_mode(MMHandleType player, bool mode);
1438 * This function is to set using sync handler.
1440 * @param player [in] handle of player
1441 * @param enable [in] enable/disable
1442 * @return This function returns zero on success, or negative value with error code.
1444 int mm_player_enable_sync_handler(MMHandleType player, bool enable);
1447 * This function is to set uri.
1449 * @param player [in] handle of player
1450 * @param uri [in] uri
1451 * @return This function returns zero on success, or negative value with error code.
1453 int mm_player_set_uri(MMHandleType player, const char *uri);
1456 * This function is to set next uri.
1458 * @param player [in] handle of player
1459 * @param uri [in] uri
1460 * @return This function returns zero on success, or negative value with error code.
1462 int mm_player_set_next_uri(MMHandleType player, const char *uri);
1465 * This function is to get next uri.
1467 * @param player [in] handle of player
1468 * @param uri [out] uri
1469 * @return This function returns zero on success, or negative value with error code.
1471 int mm_player_get_next_uri(MMHandleType player, char **uri);
1474 * This function is to decrease reference count of internal buffer.
1476 * @param buffer [in] video callback internal buffer
1479 void mm_player_video_stream_internal_buffer_unref(void *buffer);
1481 /**mm_player_submit_packet
1482 * This function is to submit buffer to appsrc. \n
1483 * @param player [in] Handle of player.
1484 * @param buf [in] buffer to be submit in appsrc in external feeder case.
1485 * @param len [in] length of buffer.
1486 * @param pts [in] timestamp of buffer.
1487 * @param streamtype [in] stream type of buffer.
1488 * @return This function returns zero on success, or negative value with error code.
1490 int mm_player_submit_packet(MMHandleType player, media_packet_h packet);
1492 /**mm_player_set_video_info
1493 * This function is to set caps of src pad of video appsrc in external feeder case. \n
1494 * @param player [in] Handle of player.
1495 * @param media_format_h [in] Video stream info.
1496 * @return This function returns zero on success, or negative value with error code.
1498 int mm_player_set_video_info(MMHandleType player, media_format_h format);
1500 /**mm_player_set_audio_info
1501 * This function is to set caps of src pad of Audio appsrc in external feeder case. \n
1502 * @param player [in] Handle of player.
1503 * @param media_format_h [in] Audio stream info.
1504 * @return This function returns zero on success, or negative value with error code.
1506 int mm_player_set_audio_info(MMHandleType player, media_format_h format);
1508 /**mm_player_set_subtitle_info
1509 * This function is to set caps of src pad of subtitle appsrc in external feeder case. \n
1510 * @param player [in] Handle of player.
1511 * @param subtitle_stream_info [in] Subtitle stream info.
1512 * @return This function returns zero on success, or negative value with error code.
1514 int mm_player_set_subtitle_info(MMHandleType player, MMPlayerSubtitleStreamInfo *info);
1517 * This function set callback function for receiving need or enough data message from player.
1519 * @param player [in] Handle of player.
1520 * @param type [in] stream type
1521 * @param callback [in] data callback function for stream type.
1522 * @param user_param [in] User parameter.
1524 * @return This function returns zero on success, or negative value with error
1527 int mm_player_set_media_stream_buffer_status_callback(MMHandleType player, MMPlayerStreamType type, mm_player_media_stream_buffer_status_callback callback, void * user_param);
1530 * This function set callback function for receiving seek data message from player.
1532 * @param player [in] Handle of player.
1533 * @param type [in] stream type
1534 * @param callback [in] Seek data callback function for stream type.
1535 * @param user_param [in] User parameter.
1537 * @return This function returns zero on success, or negative value with error
1540 int mm_player_set_media_stream_seek_data_callback(MMHandleType player, MMPlayerStreamType type, mm_player_media_stream_seek_data_callback callback, void * user_param);
1543 * This function is to set max size of buffer(appsrc).
1545 * @param player [in] Handle of player.
1546 * @param type [in] stream type
1547 * @param max_size [in] max bytes of buffer.
1549 * @return This function returns zero on success, or negative value with error
1552 int mm_player_set_media_stream_buffer_max_size(MMHandleType player, MMPlayerStreamType type, unsigned long long max_size);
1555 * This function is to get max size of buffer(appsrc).
1557 * @param player [in] Handle of player.
1558 * @param type [in] stream type
1559 * @param max_size [out] max bytes of buffer.
1561 * @return This function returns zero on success, or negative value with error
1564 int mm_player_get_media_stream_buffer_max_size(MMHandleType player, MMPlayerStreamType type, unsigned long long *max_size);
1567 * This function is to set min percent of buffer(appsrc).
1569 * @param player [in] Handle of player.
1570 * @param type [in] stream type
1571 * @param min_percent [in] min percent of buffer.
1573 * @return This function returns zero on success, or negative value with error
1576 int mm_player_set_media_stream_buffer_min_percent(MMHandleType player, MMPlayerStreamType type, unsigned min_percent);
1579 * This function is to get min percent of buffer(appsrc).
1581 * @param player [in] Handle of player.
1582 * @param type [in] stream type
1583 * @param min_percent [out] min percent of buffer.
1585 * @return This function returns zero on success, or negative value with error
1588 int mm_player_get_media_stream_buffer_min_percent(MMHandleType player, MMPlayerStreamType type, unsigned int *min_percent);
1591 * This function set callback function for changing audio stream from player. \n
1592 * It's only supported when audio stream is included in file. \n
1594 * @param player [in] Handle of player.
1595 * @param callback [in] Audio stream changed callback function.
1596 * @param user_param [in] User parameter.
1598 * @return This function returns zero on success, or negative value with error
1600 * @see mm_player_stream_changed_callback
1603 int mm_player_set_audio_stream_changed_callback(MMHandleType player, mm_player_stream_changed_callback callback, void *user_param);
1606 * This function set callback function for changing video stream from player. \n
1607 * It's only supported when video stream is included in file. \n
1609 * @param player [in] Handle of player.
1610 * @param callback [in] Video stream changed callback function.
1611 * @param user_param [in] User parameter.
1613 * @return This function returns zero on success, or negative value with error
1615 * @see mm_player_stream_changed_callback
1617 int mm_player_set_video_stream_changed_callback(MMHandleType player, mm_player_stream_changed_callback callback, void *user_param);
1620 * This function is to get timeout value according to the content type for muse. \n
1621 * It's only supported when video stream is included in file. \n
1623 * @param player [in] Handle of player.
1624 * @param timeout [out] timeout value (sec).
1626 * @return This function returns zero on success, or negative value with error
1630 int mm_player_get_timeout(MMHandleType player, int *timeout);
1633 * This function is to get the number of video output buffers. \n
1634 * It's only supported when video stream is included in file. \n
1636 * @param player [in] Handle of player.
1637 * @param num [out] num of buffers.
1638 * @param extra_num [out] extra num of buffers.
1640 * @return This function returns zero on success, or negative value with error
1644 int mm_player_get_num_of_video_out_buffers(MMHandleType player, int *num, int *extra_num);
1647 * This function is to set the dynamic resolution information. \n
1648 * It's only supported when video stream is included in file. \n
1650 * @param player [in] Handle of player.
1651 * @param drc [in] dynamic resolution info of media stream data
1653 * @return This function returns zero on success, or negative value with error
1657 int mm_player_set_media_stream_dynamic_resolution(MMHandleType player, bool drc);
1660 * This function is to release the video stream bo to reuse. \n
1661 * It's only supported when sw codec is used to decode video stream. \n
1663 * @param player [in] Handle of player.
1664 * @param bo [in] bo address to be released
1666 * @return This function returns zero on success, or negative value with error
1670 int mm_player_release_video_stream_bo(MMHandleType player, void* bo);
1673 * This function is to set http file buffering path
1675 * @param player [in] handle of player
1676 * @param file_path [in] file path
1677 * @return This function returns zero on success, or negative value with error code.
1679 int mm_player_set_file_buffering_path(MMHandleType player, const char *file_path);
1682 * This function is to set sound stream info
1684 int mm_player_set_sound_stream_info(MMHandleType player, char *stream_type, int stream_index);
1687 * This function is to manage the playback according to the external storage state
1689 int mm_player_manage_external_storage_state(MMHandleType player, int id, int state);
1692 * These functions are to set/get the max variant of HAS
1694 int mm_player_get_adaptive_variant_info(MMHandleType player, int *num, char **var_info);
1695 int mm_player_set_max_adaptive_variant_limit(MMHandleType player, int bandwidth, int width, int height);
1696 int mm_player_get_max_adaptive_variant_limit(MMHandleType player, int *bandwidth, int *width, int *height);
1699 * These functions are to set/get the audio only mode
1701 int mm_player_set_audio_only(MMHandleType player, bool audio_only);
1702 int mm_player_get_audio_only(MMHandleType player, bool *audio_only);
1705 * These functions are to set/get the streaming bufferint time
1707 int mm_player_set_streaming_buffering_time(MMHandleType player, int buffer_ms, int rebuffer_ms);
1708 int mm_player_get_streaming_buffering_time(MMHandleType player, int *buffer_ms, int *rebuffer_ms);
1711 * These functions are to display the 360 video content
1713 int mm_player_360_is_content_spherical(MMHandleType player, bool *is_spherical);
1714 int mm_player_360_set_enabled(MMHandleType player, bool enabled);
1715 int mm_player_360_is_enabled(MMHandleType player, bool *enabled);
1717 int mm_player_360_set_direction_of_view(MMHandleType player, float yaw, float pitch);
1718 int mm_player_360_get_direction_of_view(MMHandleType player, float *yaw, float *pitch);
1720 int mm_player_360_set_zoom(MMHandleType player, float level);
1721 int mm_player_360_get_zoom(MMHandleType player, float *level);
1723 int mm_player_360_set_field_of_view(MMHandleType player, int horizontal_degrees, int vertical_degrees);
1724 int mm_player_360_get_field_of_view(MMHandleType player, int *horizontal_degrees, int *vertical_degrees);
1727 * This function is to set codec type
1729 int mm_player_set_codec_type(MMHandleType player, MMPlayerStreamType stream_type, MMPlayerVideoCodecType codec_type);
1732 * These functions are to apply the replaygain
1734 int mm_player_set_replaygain_enabled(MMHandleType player, bool enabled);
1735 int mm_player_is_replaygain_enabled(MMHandleType player, bool *enabled);
1744 #endif /* __MM_PLAYER_H__ */