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