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