resolve build break (2)
[platform/core/multimedia/libmm-player.git] / src / include / mm_player_priv.h
1 /*
2  * libmm-player
3  *
4  * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
5  *
6  * Contact: JongHyuk Choi <jhchoi.choi@samsung.com>, YeJin Cho <cho.yejin@samsung.com>, YoungHwan An <younghwan_.an@samsung.com>
7  *
8  * Licensed under the Apache License, Version 2.0 (the "License");
9  * you may not use this file except in compliance with the License.
10  * You may obtain a copy of the License at
11  *
12  * http://www.apache.org/licenses/LICENSE-2.0
13  *
14  * Unless required by applicable law or agreed to in writing, software
15  * distributed under the License is distributed on an "AS IS" BASIS,
16  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17  * See the License for the specific language governing permissions and
18  * limitations under the License.
19  *
20  */
21
22 #ifndef __MM_PLAYER_PRIV_H__
23 #define __MM_PLAYER_PRIV_H__
24
25 /*===========================================================================================
26 |                                                                                                                                                                                       |
27 |  INCLUDE FILES                                                                                                                                                        |
28 |                                                                                                                                                                                       |
29 ========================================================================================== */
30 #include <glib.h>
31 #include <gst/gst.h>
32 #include <mm_types.h>
33 #include <mm_attrs.h>
34 #include <mm_ta.h>
35 #include <mm_debug.h>
36
37 #include "mm_player.h"
38 #include "mm_player_internal.h"
39 #include "mm_player_audioeffect.h"
40 #include "mm_message.h"
41 #include "mm_player_utils.h"
42 #include "mm_player_asm.h"
43 #include "mm_player_pd.h"
44 #include "mm_player_streaming.h"
45
46 /*===========================================================================================
47 |                                                                                                                                                                                       |
48 |  GLOBAL DEFINITIONS AND DECLARATIONS FOR MODULE                                                                                       |
49 |                                                                                                                                                                                       |
50 ========================================================================================== */
51
52 /*---------------------------------------------------------------------------
53 |    GLOBAL #defines:                                                                                                           |
54 ---------------------------------------------------------------------------*/
55
56 #define MM_PLAYER_IMGB_MPLANE_MAX       4
57 #define MM_PLAYER_STREAM_COUNT_MAX      3
58
59 #define MM_PLAYER_CAST(x_player)                ((mm_player_t *)(x_player))
60 /**
61  * @x_player: MMHandleType of player
62  *
63  * Get the PD downloader of this player.
64  */
65 #define MM_PLAYER_GET_PD(x_player)      (MM_PLAYER_CAST(x_player)->pd_downloader)
66 /**
67  * @x_player: MMHandleType of player
68  *
69  * Get the attributes handle of this player.
70  */
71 #define MM_PLAYER_GET_ATTRS(x_player)   (MM_PLAYER_CAST(x_player)->attrs)
72
73 /*---------------------------------------------------------------------------
74 |    GLOBAL CONSTANT DEFINITIONS:                                                                                       |
75 ---------------------------------------------------------------------------*/
76 enum tag_info
77 {
78         TAG_AUDIO_CODEC = 0x0001,
79         TAG_VIDEO_CODEC = 0x0002,
80         TAG_ARTIST              = 0x0004,
81         TAG_TITLE               = 0x0008,
82         TAG_ALBUM               = 0x0010,
83         TAG_GENRE               = 0x0020,
84         TAG_COPYRIGHT   = 0x0040,
85         TAG_DATE                = 0x0080,
86         TAG_DESCRIPTION = 0x0100,
87         TAG_TRACK_NUMBER = 0x0200
88 };
89
90 enum content_attr_flag
91 {
92         ATTR_MISSING_ONLY = 0x0001,
93         ATTR_DURATION = 0x0002,
94         ATTR_AUDIO  = 0x0004,
95         ATTR_VIDEO = 0x0008,
96         ATTR_BITRATE = 0x0010,
97         ATTR_ALL = 0x0020,
98 };
99
100 /* async mode makes trouble. alsasink sometimes fails to pause. */
101 enum alassink_sync
102 {
103         ALSASINK_SYNC,
104         ALSASINK_ASYNC
105 };
106
107
108 /**
109  * Enumerations of Player Mode
110  */
111 enum MMPlayerMode {
112         MM_PLAYER_MODE_NONE,                    /**< Player mode None */
113         MM_PLAYER_MODE_MIDI,                    /**< Player mode Midi */
114         MM_PLAYER_MODE_GST,                     /**< Player mode Gstreamer */
115 };
116
117
118 /**
119  * Enumerations of Player Uri type
120  */
121 enum MMPlayerUriType {
122         MM_PLAYER_URI_TYPE_NONE,                /**< Player URI type None */
123         MM_PLAYER_URI_TYPE_URL_RTSP,    /**< Player URI type RTSP */
124         MM_PLAYER_URI_TYPE_URL_HTTP,/**< Player URI type HTTP */
125         MM_PLAYER_URI_TYPE_URL_MMS,/**< Player URI type MMS */
126         MM_PLAYER_URI_TYPE_MEM,         /**< Player URI type Mem */
127         MM_PLAYER_URI_TYPE_FILE,                /**< Player URI type File */
128         MM_PLAYER_URI_TYPE_URL,                 /**< Player URI type URL */
129         MM_PLAYER_URI_TYPE_BUFF,                /**< Player URI type Buffer */
130         MM_PLAYER_URI_TYPE_HLS,                 /**< Player URI type http live streaming */
131         MM_PLAYER_URI_TYPE_TEMP,                        /**< Player URI type Temp */
132 };
133
134 typedef enum _MissingCodec
135 {
136         MISSING_PLUGIN_NONE                     = 0x00,
137         MISSING_PLUGIN_AUDIO                    = 0x01,
138         MISSING_PLUGIN_VIDEO                    = 0x02
139 }MissingCodec;
140
141
142 typedef enum _FoundCodec
143 {
144         FOUND_PLUGIN_NONE                       = 0x00,
145         FOUND_PLUGIN_AUDIO                      = 0x01,
146         FOUND_PLUGIN_VIDEO                      = 0x02
147 }FoundCodec;
148
149 /* main pipeline's element id */
150 enum MainElementID
151 {
152         MMPLAYER_M_PIPE = 0, /* NOTE : MMPLAYER_M_PIPE should be zero */
153         MMPLAYER_M_SRC,
154         MMPLAYER_M_SUBSRC,
155
156         /* it could be a decodebin or could be a typefind. depends on player ini */
157         MMPLAYER_M_AUTOPLUG,
158
159         /* NOTE : we need two fakesink to autoplug without decodebin.
160          * first one will hold whole pipeline state. and second one will hold state of
161          * a sink-decodebin for an elementary stream. no metter if there's more then one
162          * elementary streams because MSL reuse it.
163          */
164         MMPLAYER_M_SRC_FAKESINK,
165         MMPLAYER_M_SRC_2ND_FAKESINK,
166
167         /* streaming plugin */
168         MMPLAYER_M_S_BUFFER,
169         MMPLAYER_M_S_ADEC,
170         MMPLAYER_M_S_VDEC,
171
172         /* FIXIT : if there's really no usage for following IDs. remove it */
173         MMPLAYER_M_DEC1,
174         MMPLAYER_M_DEC2,
175         MMPLAYER_M_Q1,
176         MMPLAYER_M_Q2,
177         MMPLAYER_M_DEMUX,
178         MMPLAYER_M_SUBPARSE,
179         MMPLAYER_M_NUM
180 };
181
182 /* audio pipeline's element id */
183 enum AudioElementID
184 {
185         MMPLAYER_A_BIN = 0, /* NOTE : MMPLAYER_A_BIN should be zero */
186         MMPLAYER_A_TP,
187         MMPLAYER_A_CONV,
188         MMPLAYER_A_VOL,
189         MMPLAYER_A_FILTER,
190         MMPLAYER_A_CAPS_DEFAULT,
191         MMPLAYER_A_SINK,
192         MMPLAYER_A_RESAMPLER,
193         MMPLAYER_A_NUM
194 };
195
196 /* video pipeline's element id */
197 enum VideoElementID
198 {
199         MMPLAYER_V_BIN = 0, /* NOTE : MMPLAYER_V_BIN should be zero */
200         MMPLAYER_V_FLIP,
201         MMPLAYER_V_CONV,
202         MMPLAYER_V_SCALE,
203         MMPLAYER_V_CAPS,
204         MMPLAYER_V_SINK,
205         MMPLAYER_V_NUM
206 };
207
208 /* text pipeline's element id */
209 enum TextElementID
210 {
211         MMPLAYER_T_BIN = 0, /* NOTE : MMPLAYER_V_BIN should be zero */
212         MMPLAYER_T_TEXT_QUEUE,
213         MMPLAYER_T_VIDEO_QUEUE,
214         MMPLAYER_T_VIDEO_CONVERTER,
215         MMPLAYER_T_OVERLAY,
216         MMPLAYER_T_SINK,
217         MMPLAYER_T_NUM
218 };
219
220 /* midi main pipeline's element id */
221 enum MidiElementID
222 {
223         MMPLAYER_MIDI_PIPE,
224         MMPLAYER_MIDI_PLAYER,
225         MMPLAYER_MIDI_NUM
226 };
227
228 enum PlayerCommandState
229 {
230         MMPLAYER_COMMAND_NONE,
231         MMPLAYER_COMMAND_CREATE,
232         MMPLAYER_COMMAND_DESTROY,
233         MMPLAYER_COMMAND_UNREALIZE,
234         MMPLAYER_COMMAND_START,
235         MMPLAYER_COMMAND_REALIZE,
236         MMPLAYER_COMMAND_STOP,
237         MMPLAYER_COMMAND_PAUSE,
238         MMPLAYER_COMMAND_RESUME,
239         MMPLAYER_COMMAND_NUM
240 };
241
242 /* Note : StreamingSrcError is error enum for streaming source which post error message
243  *      using custom message made by itself. The enum value must start with zero,
244  *      because the streaming source(secrtspsrc) also does.
245  */
246 enum StreamingSrcError
247 {
248         MMPLAYER_STREAMING_ERROR_NONE = 0,
249         MMPLAYER_STREAMING_ERROR_UNSUPPORTED_AUDIO,
250         MMPLAYER_STREAMING_ERROR_UNSUPPORTED_VIDEO,
251         MMPLAYER_STREAMING_ERROR_CONNECTION_FAIL,
252         MMPLAYER_STREAMING_ERROR_DNS_FAIL,
253         MMPLAYER_STREAMING_ERROR_SERVER_DISCONNECTED,
254         MMPLAYER_STREAMING_ERROR_BAD_SERVER,
255         MMPLAYER_STREAMING_ERROR_INVALID_PROTOCOL,
256         MMPLAYER_STREAMING_ERROR_INVALID_URL,
257         MMPLAYER_STREAMING_ERROR_UNEXPECTED_MSG,
258         MMPLAYER_STREAMING_ERROR_OUT_OF_MEMORIES,
259         MMPLAYER_STREAMING_ERROR_RTSP_TIMEOUT,
260         MMPLAYER_STREAMING_ERROR_BAD_REQUEST,
261         MMPLAYER_STREAMING_ERROR_NOT_AUTHORIZED,
262         MMPLAYER_STREAMING_ERROR_PAYMENT_REQUIRED,
263         MMPLAYER_STREAMING_ERROR_FORBIDDEN,
264         MMPLAYER_STREAMING_ERROR_CONTENT_NOT_FOUND,
265         MMPLAYER_STREAMING_ERROR_METHOD_NOT_ALLOWED,
266         MMPLAYER_STREAMING_ERROR_NOT_ACCEPTABLE,
267         MMPLAYER_STREAMING_ERROR_PROXY_AUTHENTICATION_REQUIRED,
268         MMPLAYER_STREAMING_ERROR_SERVER_TIMEOUT,
269         MMPLAYER_STREAMING_ERROR_GONE,
270         MMPLAYER_STREAMING_ERROR_LENGTH_REQUIRED,
271         MMPLAYER_STREAMING_ERROR_PRECONDITION_FAILED,
272         MMPLAYER_STREAMING_ERROR_REQUEST_ENTITY_TOO_LARGE,
273         MMPLAYER_STREAMING_ERROR_REQUEST_URI_TOO_LARGE,
274         MMPLAYER_STREAMING_ERROR_UNSUPPORTED_MEDIA_TYPE,
275         MMPLAYER_STREAMING_ERROR_PARAMETER_NOT_UNDERSTOOD,
276         MMPLAYER_STREAMING_ERROR_CONFERENCE_NOT_FOUND,
277         MMPLAYER_STREAMING_ERROR_NOT_ENOUGH_BANDWIDTH,
278         MMPLAYER_STREAMING_ERROR_NO_SESSION_ID,
279         MMPLAYER_STREAMING_ERROR_METHOD_NOT_VALID_IN_THIS_STATE,
280         MMPLAYER_STREAMING_ERROR_HEADER_FIELD_NOT_VALID_FOR_SOURCE,
281         MMPLAYER_STREAMING_ERROR_INVALID_RANGE,
282         MMPLAYER_STREAMING_ERROR_PARAMETER_IS_READONLY,
283         MMPLAYER_STREAMING_ERROR_AGGREGATE_OP_NOT_ALLOWED,
284         MMPLAYER_STREAMING_ERROR_ONLY_AGGREGATE_OP_ALLOWED,
285         MMPLAYER_STREAMING_ERROR_BAD_TRANSPORT,
286         MMPLAYER_STREAMING_ERROR_DESTINATION_UNREACHABLE,
287         MMPLAYER_STREAMING_ERROR_INTERNAL_SERVER_ERROR,
288         MMPLAYER_STREAMING_ERROR_NOT_IMPLEMENTED,
289         MMPLAYER_STREAMING_ERROR_BAD_GATEWAY,
290         MMPLAYER_STREAMING_ERROR_SERVICE_UNAVAILABLE,
291         MMPLAYER_STREAMING_ERROR_GATEWAY_TIME_OUT       ,
292         MMPLAYER_STREAMING_ERROR_RTSP_VERSION_NOT_SUPPORTED,
293         MMPLAYER_STREAMING_ERROR_OPTION_NOT_SUPPORTED,
294 };
295
296
297 /*---------------------------------------------------------------------------
298 |    GLOBAL DATA TYPE DEFINITIONS:                                                                                      |
299 ---------------------------------------------------------------------------*/
300
301 typedef struct
302 {
303         int id;
304         GstElement *gst;
305 } MMPlayerGstElement;
306
307 typedef struct
308 {
309         GstTagList                      *tag_list;
310         MMPlayerGstElement      *mainbin;
311         MMPlayerGstElement      *audiobin;
312         MMPlayerGstElement      *videobin;
313         MMPlayerGstElement      *textbin;
314 } MMPlayerGstPipelineInfo;
315
316 typedef struct
317 {
318         char    device[MAX_SOUND_DEVICE_LEN];
319         float volume;
320         int mute;
321         int bluetooth;  /* enable/disable */
322 } MMPlayerSoundInfo;
323
324 typedef struct {
325         char *buf;
326         int len;
327         int offset;
328
329 } tBuffer; /* FIXIT : choose better name */
330
331 typedef struct {
332         int uri_type;
333         int     play_mode;
334         void *mem;
335         int     mem_size;
336         char uri[MM_MAX_URL_LEN];
337         char urgent[MM_MAX_FILENAME_LEN];
338 } MMPlayerParseProfile;
339
340 typedef struct {
341         bool is_pending;
342         MMPlayerPosFormatType format;
343         unsigned long pos;
344 }MMPlayerPendingSeek;
345
346 typedef struct {
347         GObject* obj;
348         gulong sig;
349 } MMPlayerSignalItem;
350
351 /* image buffer definition ***************************************************
352
353     +------------------------------------------+ ---
354     |                                          |  ^
355     |     a[], p[]                             |  |
356     |     +---------------------------+ ---    |  |
357     |     |                           |  ^     |  |
358     |     |<---------- w[] ---------->|  |     |  |
359     |     |                           |  |     |  |
360     |     |                           |        |
361     |     |                           |  h[]   |  e[]
362     |     |                           |        |
363     |     |                           |  |     |  |
364     |     |                           |  |     |  |
365     |     |                           |  v     |  |
366     |     +---------------------------+ ---    |  |
367     |                                          |  v
368     +------------------------------------------+ ---
369
370     |<----------------- s[] ------------------>|
371 */
372 typedef struct
373 {
374         /* width of each image plane */
375         int     w[MM_PLAYER_IMGB_MPLANE_MAX];
376         /* height of each image plane */
377         int     h[MM_PLAYER_IMGB_MPLANE_MAX];
378         /* stride of each image plane */
379         int     s[MM_PLAYER_IMGB_MPLANE_MAX];
380         /* elevation of each image plane */
381         int     e[MM_PLAYER_IMGB_MPLANE_MAX];
382         /* user space address of each image plane */
383         void    *a[MM_PLAYER_IMGB_MPLANE_MAX];
384         /* physical address of each image plane, if needs */
385         void    *p[MM_PLAYER_IMGB_MPLANE_MAX];
386         /* color space type of image */
387         int     cs;
388         /* left postion, if needs */
389         int     x;
390         /* top position, if needs */
391         int     y;
392         /* to align memory */
393         int     __dummy2;
394         /* arbitrary data */
395         int     data[16];
396
397     /* dmabuf fd */
398     int fd[MM_PLAYER_IMGB_MPLANE_MAX];
399
400     /* flag for buffer share */
401     int buf_share_method;
402
403    /*y, cbcr size for bookmark */
404     int y_size;
405     int uv_size;
406 } MMPlayerMPlaneImage;
407
408 typedef struct {
409         /* STATE */
410         int state;                                      // player current state
411         int prev_state;                         // player previous state
412         int pending_state;                      // player state which is going to now
413         int target_state;                               // player state which user want to go to
414         guint state_change_timeout;
415
416         gboolean section_repeat;
417         gint section_repeat_start;
418         gint section_repeat_end;
419
420         gchar *album_art;
421
422         int cmd;
423
424         /* command lock */
425         GMutex* cmd_lock;
426
427         /* repeat thread lock */
428         GCond* repeat_thread_cond;
429         GMutex* repeat_thread_mutex;
430         GThread* repeat_thread;
431         gboolean repeat_thread_exit;
432
433         /* capture thread */
434         GThread* capture_thread;
435         gboolean capture_thread_exit;
436         GCond* capture_thread_cond;
437         GMutex* capture_thread_mutex;
438         MMPlayerVideoCapture capture;
439         MMPlayerVideoColorspace video_cs;
440         MMPlayerMPlaneImage captured;
441
442         /* fakesink handling lock */
443         GMutex* fsink_lock;
444
445         /* player attributes */
446         MMHandleType attrs;
447
448         /* message callback */
449         MMMessageCallback msg_cb;
450         void* msg_cb_param;
451         GMutex* msg_cb_lock;
452
453         /* progressive download */
454         mm_player_pd_t *pd_downloader;
455         gchar *pd_file_save_path;
456         MMPlayerPDMode pd_mode;
457
458         /* streaming player */
459         mm_player_streaming_t *streamer;
460
461         /* gstreamer pipeline */
462         MMPlayerGstPipelineInfo *pipeline;
463         gboolean pipeline_is_constructed;
464
465         /* buffering support cbs*/
466         mm_player_buffer_need_data_callback need_data_cb;
467         mm_player_buffer_enough_data_callback enough_data_cb;
468         mm_player_buffer_seek_data_callback seek_data_cb;
469
470         void* buffer_cb_user_param;
471
472         /* video stream callback */
473         mm_player_video_stream_callback video_stream_cb;
474         void* video_stream_cb_user_param;
475         int use_video_stream;
476
477         /* audio stram callback */
478         mm_player_audio_stream_callback audio_stream_cb;
479         void* audio_stream_cb_user_param;
480
481         /* audio buffer callback */
482         mm_player_audio_stream_callback audio_buffer_cb;
483         void* audio_buffer_cb_user_param;
484
485         /* video capture callback*/
486         gulong video_capture_cb_probe_id;
487
488         /* video frame render error callback */
489         mm_player_video_frame_render_error_callback video_frame_render_error_cb;
490         void* video_frame_render_error_cb_user_param;
491
492         /* sound info */
493         MMPlayerSoundInfo       sound;
494
495         /* type string */
496         gchar *type;
497
498         /* video stream caps parsed by demuxer */
499         GstCaps* v_stream_caps;
500
501         /* audio effect infomation */
502         MMAudioEffectInfo audio_effect_info;
503         gboolean bypass_audio_effect;
504
505         gulong audio_cb_probe_id;
506
507         /* for appsrc */
508         tBuffer mem_buf;
509
510         /* content profile */
511         MMPlayerParseProfile profile;
512
513         /* streaming service type */
514         MMStreamingType streaming_type;
515
516         /* autoplugging */
517         GList* factories;
518         gboolean have_dynamic_pad;
519         GList* parsers; // list of linked parser name
520         gboolean no_more_pad;
521         gint num_dynamic_pad;
522         gboolean has_many_types;
523
524         /* progress callback timer */
525         /* FIXIT : since duplicated functionality with get_position
526          * this function will be deprecated after fixing all application
527          * which are using it.
528          */
529         guint progress_timer;
530
531         /* timer for sending delayed EOS */
532         guint eos_timer;
533
534         /* last point (msec) that player is paused or seeking */
535         gint64 last_position;
536
537         /* duration */
538         gint64 duration;
539
540         /* data size of http streaming  */
541         guint64 http_content_size;
542
543         /* last error */
544         gchar last_error_msg[1024]; /* FIXIT : should it be dynamic ? */
545
546         gint videodec_linked;
547         gint audiodec_linked;
548         gint videosink_linked;
549         gint audiosink_linked;
550         gint textsink_linked;
551
552         /* missing plugin during autoplugging */
553         MissingCodec not_supported_codec;
554
555         /*unlinked audio/video mime type */
556         gchar *unlinked_video_mime;
557         gchar *unlinked_audio_mime;
558         gchar *unlinked_demuxer_mime;
559
560         /* found codec during autoplugging */
561         FoundCodec can_support_codec;
562
563         gboolean not_found_demuxer;
564
565         /* support seek even though player is not start */
566         MMPlayerPendingSeek pending_seek;
567
568         gboolean doing_seek;
569
570         /* prevent to post msg over and over */
571         gboolean msg_posted;
572
573         /* list of sink elements */
574         GList* sink_elements;
575
576         /* signal notifiers */
577         GList* signals;
578         guint bus_watcher;
579
580         /* NOTE : if sink elements receive flush start event then it's state will be lost.
581          * this can happen when doing buffering in streaming pipeline since all control operation
582          * (play/pause/resume/seek) is requiring server interaction. during 'state lost' situation
583          * _set_state will not work correctely and state transition message will not posted to our
584          * gst_callback.
585          * So. we need to do some special care on the situation.
586          */
587         gboolean state_lost;
588
589         gboolean is_sound_extraction;
590
591         gdouble playback_rate;
592
593        /* player state resumed by fast rewind */
594         gboolean resumed_by_rewind;
595
596         gboolean is_nv12_tiled;
597
598         MMPlayerASM     sm;
599
600         gboolean is_subtitle_off;
601
602         /* contents bitrate for buffering management */
603         guint bitrate[MM_PLAYER_STREAM_COUNT_MAX];
604         guint total_bitrate;
605         guint updated_bitrate_count;
606         guint maximum_bitrate[MM_PLAYER_STREAM_COUNT_MAX];
607         guint total_maximum_bitrate;
608         guint updated_maximum_bitrate_count;
609
610         /* prevent it from posting duplicatly*/
611         gboolean sent_bos;
612
613         /* timeout source for lazy pause */
614         guint lazy_pause_event_id;
615
616         gboolean keep_detecting_vcodec;
617
618         gboolean play_subtitle;
619         gboolean use_textoverlay;
620
621         /* PD downloader message callback and param */
622         MMMessageCallback pd_msg_cb;
623         void* pd_msg_cb_param;
624 } mm_player_t;
625
626 /*===========================================================================================
627 |                                                                                                                                                                                       |
628 |  GLOBAL FUNCTION PROTOTYPES                                                                                                                           |
629 |                                                                                                                                                                                       |
630 ========================================================================================== */
631 #ifdef __cplusplus
632         extern "C" {
633 #endif
634
635 int _mmplayer_create_player(MMHandleType hplayer);
636 int _mmplayer_destroy(MMHandleType hplayer);
637 int _mmplayer_realize(MMHandleType hplayer);
638 int _mmplayer_unrealize(MMHandleType hplayer);
639 int _mmplayer_get_state(MMHandleType hplayer, int* pstate);
640 int _mmplayer_set_volume(MMHandleType hplayer, MMPlayerVolumeType volume);
641 int _mmplayer_get_volume(MMHandleType hplayer, MMPlayerVolumeType *volume);
642 int _mmplayer_set_mute(MMHandleType hplayer, int mute);
643 int _mmplayer_get_mute(MMHandleType hplayer, int* pmute);
644 int _mmplayer_start(MMHandleType hplayer);
645 int _mmplayer_stop(MMHandleType hplayer);
646 int _mmplayer_pause(MMHandleType hplayer);
647 int _mmplayer_resume(MMHandleType hplayer);
648 int _mmplayer_set_position(MMHandleType hplayer, int format, int pos);
649 int _mmplayer_get_position(MMHandleType hplayer, int format, unsigned long *pos);
650 int _mmplayer_adjust_subtitle_postion(MMHandleType hplayer, int format,  int pos);
651 int _mmplayer_activate_section_repeat(MMHandleType hplayer, unsigned long start, unsigned long end);
652 int _mmplayer_deactivate_section_repeat(MMHandleType hplayer);
653 int _mmplayer_push_buffer(MMHandleType hplayer, unsigned char *buf, int size);
654 int _mmplayer_set_buffer_need_data_cb(MMHandleType hplayer,mm_player_buffer_need_data_callback callback, void *user_param);
655 int _mmplayer_set_buffer_enough_data_cb(MMHandleType hplayer,mm_player_buffer_enough_data_callback callback, void *user_param);
656 int _mmplayer_set_buffer_seek_data_cb(MMHandleType hplayer,mm_player_buffer_seek_data_callback callback, void *user_param);
657 int _mmplayer_set_playspeed(MMHandleType hplayer, gdouble rate);
658 int _mmplayer_set_message_callback(MMHandleType hplayer, MMMessageCallback callback, void *user_param);
659 int _mmplayer_set_videostream_cb(MMHandleType hplayer,mm_player_video_stream_callback callback, void *user_param);
660 int _mmplayer_set_audiostream_cb(MMHandleType hplayer,mm_player_audio_stream_callback callback, void *user_param);
661 int _mmplayer_set_videoframe_render_error_cb(MMHandleType hplayer, mm_player_video_frame_render_error_callback callback, void *user_param);
662 int _mmplayer_set_subtitle_silent (MMHandleType hplayer, int silent);
663 int _mmplayer_get_subtitle_silent (MMHandleType hplayer, int* silent);
664 int _mmplayer_get_track_count(MMHandleType hplayer,  MMPlayerTrackType track_type, int *count);
665 int _mmplayer_get_buffer_position(MMHandleType hplayer, int format, unsigned long* start_pos, unsigned long* stop_pos);
666 /* test API for tuning audio gain. this API should be
667  * deprecated before the day of final release
668  */
669 int _mmplayer_set_volume_tune(MMHandleType hplayer, MMPlayerVolumeType volume);
670 int _mmplayer_update_video_param(mm_player_t* player);
671 int _mmplayer_set_audiobuffer_cb(MMHandleType hplayer, mm_player_audio_stream_callback callback, void *user_param);
672 int _mmplayer_audio_effect_preset_apply(mm_player_t *player, MMAudioEffectPresetType effect_type);
673 int _mmplayer_audio_effect_custom_apply(mm_player_t *player);
674
675 #ifdef __cplusplus
676         }
677 #endif
678
679 #endif  /* __MM_PLAYER_PRIV_H__ */