3a29bfc03d96622da6f55bb5a9952b8db8215651
[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>,
7  * Seungbae Shin <seungbae.shin@samsung.com>, YoungHwan An <younghwan_.an@samsung.com>
8  *
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
12  *
13  * http://www.apache.org/licenses/LICENSE-2.0
14  *
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.
20  *
21  */
22
23 #ifndef __MM_PLAYER_PRIV_H__
24 #define __MM_PLAYER_PRIV_H__
25
26 /*===========================================================================================
27 |                                                                                                                                                                                       |
28 |  INCLUDE FILES                                                                                                                                                        |
29 |                                                                                                                                                                                       |
30 ========================================================================================== */
31 #include <glib.h>
32 #include <gst/gst.h>
33 #include <mm_types.h>
34 #include <mm_attrs.h>
35 #include <mm_ta.h>
36 #include <mm_debug.h>
37
38 #include "mm_player.h"
39 #include "mm_player_internal.h"
40 #include "mm_player_sndeffect.h"
41 #include "mm_message.h"
42 #include "mm_player_utils.h"
43 #include "mm_player_asm.h"
44 #include "mm_player_ahs.h"
45 #include "mm_player_pd.h"
46 #include "mm_player_streaming.h"
47
48 /*===========================================================================================
49 |                                                                                                                                                                                       |
50 |  GLOBAL DEFINITIONS AND DECLARATIONS FOR MODULE                                                                                       |
51 |                                                                                                                                                                                       |
52 ========================================================================================== */
53
54 /*---------------------------------------------------------------------------
55 |    GLOBAL #defines:                                                                                                           |
56 ---------------------------------------------------------------------------*/
57
58 #define MM_PLAYER_IMGB_MPLANE_MAX       4
59 #define MM_PLAYER_STREAM_COUNT_MAX      3
60
61 #define MM_PLAYER_CAST(x_player)                ((mm_player_t *)(x_player))
62 /**
63  * @x_player: MMHandleType of player
64  *
65  * Get the PD downloader of this player.
66  */
67 #define MM_PLAYER_GET_PD(x_player)      (MM_PLAYER_CAST(x_player)->pd_downloader)
68 /**
69  * @x_player: MMHandleType of player
70  *
71  * Get the attributes handle of this player.
72  */
73 #define MM_PLAYER_GET_ATTRS(x_player)   (MM_PLAYER_CAST(x_player)->attrs)
74
75 /*---------------------------------------------------------------------------
76 |    GLOBAL CONSTANT DEFINITIONS:                                                                                       |
77 ---------------------------------------------------------------------------*/
78 enum tag_info
79 {
80         TAG_AUDIO_CODEC = 0x0001,
81         TAG_VIDEO_CODEC = 0x0002,
82         TAG_ARTIST              = 0x0004,
83         TAG_TITLE               = 0x0008,
84         TAG_ALBUM               = 0x0010,
85         TAG_GENRE               = 0x0020,
86         TAG_COPYRIGHT   = 0x0040,
87         TAG_DATE                = 0x0080,
88         TAG_DESCRIPTION = 0x0100,
89         TAG_TRACK_NUMBER = 0x0200
90 };
91
92 /* async mode makes trouble. alsasink sometimes fails to pause. */
93 enum alassink_sync
94 {
95         ALSASINK_SYNC,
96         ALSASINK_ASYNC
97 };
98
99
100 /**
101  * Enumerations of Player Mode
102  */
103 enum MMPlayerMode {
104         MM_PLAYER_MODE_NONE,                    /**< Player mode None */
105         MM_PLAYER_MODE_MIDI,                    /**< Player mode Midi */
106         MM_PLAYER_MODE_GST,                     /**< Player mode Gstreamer */
107 };
108
109
110 /**
111  * Enumerations of Player Uri type
112  */
113 enum MMPlayerUriType {
114         MM_PLAYER_URI_TYPE_NONE,                /**< Player URI type None */
115         MM_PLAYER_URI_TYPE_URL_RTSP,    /**< Player URI type RTSP */
116         MM_PLAYER_URI_TYPE_URL_HTTP,/**< Player URI type HTTP */
117         MM_PLAYER_URI_TYPE_URL_MMS,/**< Player URI type MMS */
118         MM_PLAYER_URI_TYPE_MEM,         /**< Player URI type Mem */
119         MM_PLAYER_URI_TYPE_FILE,                /**< Player URI type File */
120         MM_PLAYER_URI_TYPE_URL,                 /**< Player URI type URL */
121         MM_PLAYER_URI_TYPE_BUFF,                /**< Player URI type Buffer */
122         MM_PLAYER_URI_TYPE_HLS,                 /**< Player URI type http live streaming */     
123         MM_PLAYER_URI_TYPE_TEMP,                        /**< Player URI type Temp */
124 };
125
126 typedef enum _MissingCodec
127 {
128         MISSING_PLUGIN_NONE                     = 0x00,
129         MISSING_PLUGIN_AUDIO                    = 0x01,
130         MISSING_PLUGIN_VIDEO                    = 0x02
131 }MissingCodec;
132
133
134 typedef enum _FoundCodec
135 {
136         FOUND_PLUGIN_NONE                       = 0x00,
137         FOUND_PLUGIN_AUDIO                      = 0x01,
138         FOUND_PLUGIN_VIDEO                      = 0x02
139 }FoundCodec;
140
141 /* main pipeline's element id */
142 enum MainElementID
143 {
144         MMPLAYER_M_PIPE = 0, /* NOTE : MMPLAYER_M_PIPE should be zero */
145         MMPLAYER_M_SRC,
146
147         /* it could be a decodebin or could be a typefind. depends on player ini */
148         MMPLAYER_M_AUTOPLUG,
149
150         /* NOTE : we need two fakesink to autoplug without decodebin.
151          * first one will hold whole pipeline state. and second one will hold state of
152          * a sink-decodebin for an elementary stream. no metter if there's more then one
153          * elementary streams because MSL reuse it.
154          */
155         MMPLAYER_M_SRC_FAKESINK,
156         MMPLAYER_M_SRC_2ND_FAKESINK,
157
158         /* streaming plugin */
159         MMPLAYER_M_S_BUFFER, 
160         MMPLAYER_M_S_ADEC, 
161         MMPLAYER_M_S_VDEC, 
162         
163         /* FIXIT : if there's really no usage for following IDs. remove it */
164         MMPLAYER_M_DEC1,
165         MMPLAYER_M_DEC2,
166         MMPLAYER_M_Q1,
167         MMPLAYER_M_Q2,
168         MMPLAYER_M_DEMUX,
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_TEE,
195         MMPLAYER_V_SINK,
196         MMPLAYER_V_SINK_EXT,
197         MMPLAYER_V_NUM
198 };
199
200 /* text pipeline's element id */
201 enum TextElementID
202 {
203         MMPLAYER_T_BIN = 0, /* NOTE : MMPLAYER_V_BIN should be zero */
204         MMPLAYER_T_QUEUE,
205         MMPLAYER_T_OVERLAY,
206         MMPLAYER_T_SINK,
207         MMPLAYER_T_NUM
208 };
209
210 /* subtitle pipeline's element id */
211 enum SubtitleElementID
212 {
213         MMPLAYER_SUB_PIPE = 0, /* NOTE : MMPLAYER_SUB_PIPE should be zero */
214         MMPLAYER_SUB_SRC,
215         MMPLAYER_SUB_QUEUE,
216         MMPLAYER_SUB_SUBPARSE,
217         MMPLAYER_SUB_TEXTRENDER,
218         MMPLAYER_SUB_FLIP,
219         MMPLAYER_SUB_CONV1,
220         MMPLAYER_SUB_CONV2,
221         MMPLAYER_SUB_SCALE,
222         MMPLAYER_SUB_SINK,
223         MMPLAYER_SUB_NUM
224 };
225
226 /* midi main pipeline's element id */
227 enum MidiElementID
228 {
229         MMPLAYER_MIDI_PIPE,
230         MMPLAYER_MIDI_PLAYER,
231         MMPLAYER_MIDI_NUM
232 };
233
234 enum PlayerCommandState
235 {
236         MMPLAYER_COMMAND_NONE,
237         MMPLAYER_COMMAND_CREATE,
238         MMPLAYER_COMMAND_DESTROY,
239         MMPLAYER_COMMAND_REALIZE,
240         MMPLAYER_COMMAND_UNREALIZE,
241         MMPLAYER_COMMAND_START,
242         MMPLAYER_COMMAND_STOP,
243         MMPLAYER_COMMAND_PAUSE,
244         MMPLAYER_COMMAND_RESUME,
245         MMPLAYER_COMMAND_NUM
246 };
247
248 /* Note : StreamingSrcError is error enum for streaming source which post error message
249  *      using custom message made by itself. The enum value must start with zero,
250  *      because the streaming source(secrtspsrc) also does.
251  */
252 enum StreamingSrcError
253 {
254         MMPLAYER_STREAMING_ERROR_NONE = 0,
255         MMPLAYER_STREAMING_ERROR_UNSUPPORTED_AUDIO,
256         MMPLAYER_STREAMING_ERROR_UNSUPPORTED_VIDEO,
257         MMPLAYER_STREAMING_ERROR_CONNECTION_FAIL,
258         MMPLAYER_STREAMING_ERROR_DNS_FAIL,
259         MMPLAYER_STREAMING_ERROR_SERVER_DISCONNECTED,
260         MMPLAYER_STREAMING_ERROR_BAD_SERVER,
261         MMPLAYER_STREAMING_ERROR_INVALID_PROTOCOL,
262         MMPLAYER_STREAMING_ERROR_INVALID_URL,
263         MMPLAYER_STREAMING_ERROR_UNEXPECTED_MSG,
264         MMPLAYER_STREAMING_ERROR_OUT_OF_MEMORIES,
265         MMPLAYER_STREAMING_ERROR_RTSP_TIMEOUT,
266         MMPLAYER_STREAMING_ERROR_BAD_REQUEST,
267         MMPLAYER_STREAMING_ERROR_NOT_AUTHORIZED,
268         MMPLAYER_STREAMING_ERROR_PAYMENT_REQUIRED,
269         MMPLAYER_STREAMING_ERROR_FORBIDDEN,
270         MMPLAYER_STREAMING_ERROR_CONTENT_NOT_FOUND,
271         MMPLAYER_STREAMING_ERROR_METHOD_NOT_ALLOWED,
272         MMPLAYER_STREAMING_ERROR_NOT_ACCEPTABLE,
273         MMPLAYER_STREAMING_ERROR_PROXY_AUTHENTICATION_REQUIRED,
274         MMPLAYER_STREAMING_ERROR_SERVER_TIMEOUT,
275         MMPLAYER_STREAMING_ERROR_GONE,
276         MMPLAYER_STREAMING_ERROR_LENGTH_REQUIRED,
277         MMPLAYER_STREAMING_ERROR_PRECONDITION_FAILED,
278         MMPLAYER_STREAMING_ERROR_REQUEST_ENTITY_TOO_LARGE,
279         MMPLAYER_STREAMING_ERROR_REQUEST_URI_TOO_LARGE,
280         MMPLAYER_STREAMING_ERROR_UNSUPPORTED_MEDIA_TYPE,
281         MMPLAYER_STREAMING_ERROR_PARAMETER_NOT_UNDERSTOOD,
282         MMPLAYER_STREAMING_ERROR_CONFERENCE_NOT_FOUND,
283         MMPLAYER_STREAMING_ERROR_NOT_ENOUGH_BANDWIDTH,
284         MMPLAYER_STREAMING_ERROR_NO_SESSION_ID,
285         MMPLAYER_STREAMING_ERROR_METHOD_NOT_VALID_IN_THIS_STATE,
286         MMPLAYER_STREAMING_ERROR_HEADER_FIELD_NOT_VALID_FOR_SOURCE,
287         MMPLAYER_STREAMING_ERROR_INVALID_RANGE,
288         MMPLAYER_STREAMING_ERROR_PARAMETER_IS_READONLY,
289         MMPLAYER_STREAMING_ERROR_AGGREGATE_OP_NOT_ALLOWED,
290         MMPLAYER_STREAMING_ERROR_ONLY_AGGREGATE_OP_ALLOWED,
291         MMPLAYER_STREAMING_ERROR_BAD_TRANSPORT,
292         MMPLAYER_STREAMING_ERROR_DESTINATION_UNREACHABLE,
293         MMPLAYER_STREAMING_ERROR_INTERNAL_SERVER_ERROR,
294         MMPLAYER_STREAMING_ERROR_NOT_IMPLEMENTED,
295         MMPLAYER_STREAMING_ERROR_BAD_GATEWAY,
296         MMPLAYER_STREAMING_ERROR_SERVICE_UNAVAILABLE,
297         MMPLAYER_STREAMING_ERROR_GATEWAY_TIME_OUT       ,
298         MMPLAYER_STREAMING_ERROR_RTSP_VERSION_NOT_SUPPORTED,
299         MMPLAYER_STREAMING_ERROR_OPTION_NOT_SUPPORTED,
300 };
301
302
303 /*---------------------------------------------------------------------------
304 |    GLOBAL DATA TYPE DEFINITIONS:                                                                                      |
305 ---------------------------------------------------------------------------*/
306
307 typedef struct
308 {
309         int id;
310         GstElement *gst;
311 } MMPlayerGstElement;
312
313 typedef struct
314 {
315         GstTagList                      *tag_list;
316         MMPlayerGstElement      *mainbin;
317         MMPlayerGstElement      *subtitlebin;
318         MMPlayerGstElement      *audiobin;
319         MMPlayerGstElement      *videobin;
320         MMPlayerGstElement      *textbin;
321 } MMPlayerGstPipelineInfo;
322
323 typedef struct
324 {
325         char    device[MAX_SOUND_DEVICE_LEN];
326         float volume;
327         int mute;
328         int bluetooth;  /* enable/disable */
329 } MMPlayerSoundInfo;
330
331 typedef struct {
332         char *buf;
333         int len;
334         int offset;
335
336 } tBuffer; /* FIXIT : choose better name */
337
338 typedef struct {
339         int uri_type;
340         int     play_mode;
341         void *mem;
342         int     mem_size;
343         char uri[MM_MAX_URL_LEN];
344         char urgent[MM_MAX_FILENAME_LEN];
345 } MMPlayerParseProfile;
346
347 typedef struct {
348         bool is_pending;
349         MMPlayerPosFormatType format;
350         unsigned long pos;
351 }MMPlayerPendingSeek;
352
353 typedef struct {
354         GObject* obj;
355         gulong sig;
356 } MMPlayerSignalItem;
357
358 /* image buffer definition ***************************************************
359
360     +------------------------------------------+ ---
361     |                                          |  ^
362     |     a[], p[]                             |  |
363     |     +---------------------------+ ---    |  |
364     |     |                           |  ^     |  |
365     |     |<---------- w[] ---------->|  |     |  |
366     |     |                           |  |     |  |
367     |     |                           |        |
368     |     |                           |  h[]   |  e[]
369     |     |                           |        |
370     |     |                           |  |     |  |
371     |     |                           |  |     |  |
372     |     |                           |  v     |  |
373     |     +---------------------------+ ---    |  |
374     |                                          |  v
375     +------------------------------------------+ ---
376
377     |<----------------- s[] ------------------>|
378 */
379 typedef struct
380 {
381         /* width of each image plane */
382         int     w[MM_PLAYER_IMGB_MPLANE_MAX];
383         /* height of each image plane */
384         int     h[MM_PLAYER_IMGB_MPLANE_MAX];
385         /* stride of each image plane */
386         int     s[MM_PLAYER_IMGB_MPLANE_MAX];
387         /* elevation of each image plane */
388         int     e[MM_PLAYER_IMGB_MPLANE_MAX];
389         /* user space address of each image plane */
390         void    *a[MM_PLAYER_IMGB_MPLANE_MAX];
391         /* physical address of each image plane, if needs */
392         void    *p[MM_PLAYER_IMGB_MPLANE_MAX];
393         /* color space type of image */
394         int     cs;
395         /* left postion, if needs */
396         int     x;
397         /* top position, if needs */
398         int     y;
399         /* to align memory */
400         int     __dummy2;
401         /* arbitrary data */
402         int     data[16];
403 } MMPlayerMPlaneImage;
404
405 typedef struct {
406         /* STATE */
407         int state;                                      // player current state
408         int prev_state;                         // player previous state
409         int pending_state;                      // player state which is going to now
410         int target_state;                               // player state which user want to go to
411         guint state_change_timeout;     
412
413         gboolean section_repeat;
414         gint section_repeat_start;
415         gint section_repeat_end;
416
417         gchar *album_art;
418
419         int cmd;
420
421         /* command lock */
422         GMutex* cmd_lock;
423
424         /* handle of adaptive http streaming */
425         mm_player_ahs_t *ahs_player;
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_location;
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         /* for 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 display */
489         GstPad* tee_src_pad[2];
490         gboolean use_multi_surface;
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 filter infomation */
502         MMAudioFilterInfo audio_filter_info;
503         gboolean bypass_sound_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 posted_msg;
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 need_update_content_attrs;
590         gboolean need_update_content_dur;
591
592         gboolean is_sound_extraction;
593
594         gdouble playback_rate;
595        /* player state resumed by fast rewind */
596         gboolean resumed_by_rewind;
597
598         gboolean is_nv12_tiled;
599
600         MMPlayerASM     sm;
601
602         gboolean is_subtitle_off;
603
604         /* contents bitrate for buffering management */
605         guint bitrate[MM_PLAYER_STREAM_COUNT_MAX];
606         guint total_bitrate;
607         guint updated_bitrate_count;
608         guint maximum_bitrate[MM_PLAYER_STREAM_COUNT_MAX];
609         guint total_maximum_bitrate;
610         guint updated_maximum_bitrate_count;
611
612         /* prevent it from posting duplicatly*/
613         gboolean sent_bos;
614
615         /* timeout source for lazy pause */
616         guint lazy_pause_event_id;
617
618         gboolean keep_detecting_vcodec;
619
620         gboolean play_subtitle;
621
622         /* PD downloader message callback and param */
623         MMMessageCallback pd_msg_cb;
624         void* pd_msg_cb_param;
625 } mm_player_t;
626
627 /*===========================================================================================
628 |                                                                                                                                                                                       |
629 |  GLOBAL FUNCTION PROTOTYPES                                                                                                                           |
630 |                                                                                                                                                                                       |
631 ========================================================================================== */
632 #ifdef __cplusplus
633         extern "C" {
634 #endif
635
636 int _mmplayer_create_player(MMHandleType hplayer);
637 int _mmplayer_destroy(MMHandleType hplayer);
638 int _mmplayer_realize(MMHandleType hplayer);
639 int _mmplayer_unrealize(MMHandleType hplayer);
640 int _mmplayer_get_state(MMHandleType hplayer, int* pstate);
641 int _mmplayer_set_volume(MMHandleType hplayer, MMPlayerVolumeType volume);
642 int _mmplayer_get_volume(MMHandleType hplayer, MMPlayerVolumeType *volume);
643 int _mmplayer_set_mute(MMHandleType hplayer, int mute);
644 int _mmplayer_get_mute(MMHandleType hplayer, int* pmute);
645 int _mmplayer_start(MMHandleType hplayer);
646 int _mmplayer_stop(MMHandleType hplayer);
647 int _mmplayer_pause(MMHandleType hplayer);
648 int _mmplayer_resume(MMHandleType hplayer);
649 int _mmplayer_set_position(MMHandleType hplayer, int format, int pos);
650 int _mmplayer_get_position(MMHandleType hplayer, int format, unsigned long *pos);
651 int _mmplayer_adjust_subtitle_postion(MMHandleType hplayer, int format,  int pos);
652 int _mmplayer_activate_section_repeat(MMHandleType hplayer, unsigned long start, unsigned long end);
653 int _mmplayer_deactivate_section_repeat(MMHandleType hplayer);
654 int _mmplayer_push_buffer(MMHandleType hplayer, unsigned char *buf, int size);
655 int _mmplayer_set_buffer_need_data_cb(MMHandleType hplayer,mm_player_buffer_need_data_callback callback, void *user_param);
656 int _mmplayer_set_buffer_enough_data_cb(MMHandleType hplayer,mm_player_buffer_enough_data_callback callback, void *user_param);
657 int _mmplayer_set_buffer_seek_data_cb(MMHandleType hplayer,mm_player_buffer_seek_data_callback callback, void *user_param);
658 int _mmplayer_set_playspeed(MMHandleType hplayer, gdouble rate);
659 int _mmplayer_set_message_callback(MMHandleType hplayer, MMMessageCallback callback, void *user_param);
660 int _mmplayer_set_videostream_cb(MMHandleType hplayer,mm_player_video_stream_callback callback, void *user_param);
661 int _mmplayer_set_audiostream_cb(MMHandleType hplayer,mm_player_audio_stream_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_buffer_position(MMHandleType hplayer, int format, unsigned long* start_pos, unsigned long* stop_pos);
665 gboolean        _mmplayer_update_content_attrs(mm_player_t* player);
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
673 #ifdef __cplusplus
674         }
675 #endif
676
677 #endif  /* __MM_PLAYER_PRIV_H__ */