Turn out remaining gst-1.0 code
[platform/core/multimedia/libmm-player.git] / src / mm_player.c
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 #include <gst/gst.h>
23 #include <string.h>
24
25 #include <mm_types.h>
26 #include <mm_message.h>
27
28 #include "mm_player.h"
29 #include "mm_player_priv.h"
30 #include "mm_player_attrs.h"
31 #include "mm_player_utils.h"
32 #include "mm_player_ini.h"
33 #include "mm_debug.h"
34 #include "mm_player_capture.h"
35
36 int mm_player_create(MMHandleType *player)
37 {
38         int result = MM_ERROR_NONE;
39         mm_player_t* new_player = NULL;
40
41         debug_log("\n");
42
43         return_val_if_fail(player, MM_ERROR_PLAYER_NOT_INITIALIZED);
44
45         MMTA_INIT();
46
47         __ta__("mm_player_ini_load",
48         result = mm_player_ini_load();
49         )
50         if(result != MM_ERROR_NONE)
51                 return result;
52
53         __ta__("mm_player_audio_effect_ini_load",
54         result = mm_player_audio_effect_ini_load();
55         )
56         if(result != MM_ERROR_NONE)
57                 return result;
58
59         /* alloc player structure */
60         new_player = g_malloc(sizeof(mm_player_t));
61         if ( ! new_player )
62         {
63                 debug_critical("Cannot allocate memory for player\n");
64                 goto ERROR;
65         }
66         memset(new_player, 0, sizeof(mm_player_t));
67
68         /* create player lock */
69         new_player->cmd_lock = g_mutex_new();
70
71         if ( ! new_player->cmd_lock )
72         {
73                 debug_critical("failed to create player lock\n");
74                 goto ERROR;
75         }
76
77         /* create msg callback lock */
78         new_player->msg_cb_lock = g_mutex_new();
79
80         if ( ! new_player->msg_cb_lock )
81         {
82                 debug_critical("failed to create msg cb lock\n");
83                 goto ERROR;
84         }
85         __ta__("[KPI] create media player service",
86         result = _mmplayer_create_player((MMHandleType)new_player);
87         )
88
89         if(result != MM_ERROR_NONE)
90                 goto ERROR;
91
92         *player = (MMHandleType)new_player;
93
94         return result;
95
96 ERROR:
97
98         if ( new_player )
99         {
100                 if (new_player->cmd_lock)
101                 {
102                         g_mutex_free(new_player->cmd_lock);
103                         new_player->cmd_lock = NULL;
104                 }
105
106                 _mmplayer_destroy( (MMHandleType)new_player );
107                 MMPLAYER_FREEIF( new_player );
108         }
109
110         *player = (MMHandleType)0;
111         return MM_ERROR_PLAYER_NO_FREE_SPACE; // are you sure?
112 }
113
114 int  mm_player_destroy(MMHandleType player)
115 {
116         int result = MM_ERROR_NONE;
117
118         debug_log("\n");
119
120         return_val_if_fail(player, MM_ERROR_PLAYER_NOT_INITIALIZED);
121
122         MMPLAYER_CMD_LOCK( player );
123
124         __ta__("[KPI] destroy media player service",
125         result = _mmplayer_destroy(player);
126         )
127
128         MMPLAYER_CMD_UNLOCK( player );
129
130         if (((mm_player_t*)player)->cmd_lock)
131         {
132                 g_mutex_free(((mm_player_t*)player)->cmd_lock);
133                 ((mm_player_t*)player)->cmd_lock = NULL;
134         }
135
136         memset( (mm_player_t*)player, 0x00, sizeof(mm_player_t) );
137
138         /* free player */
139         g_free( (void*)player );
140
141         MMTA_ACUM_ITEM_SHOW_RESULT_TO(MMTA_SHOW_FILE);
142
143         MMTA_RELEASE();
144
145         return result;
146 }
147
148 int mm_player_realize(MMHandleType player)
149 {
150         int result = MM_ERROR_NONE;
151
152         debug_log("\n");
153
154         return_val_if_fail(player, MM_ERROR_PLAYER_NOT_INITIALIZED);
155
156         MMPLAYER_CMD_LOCK( player );
157
158         __ta__("[KPI] initialize media player service",
159         result = _mmplayer_realize(player);
160         )
161
162         MMPLAYER_CMD_UNLOCK( player );
163
164         return result;
165 }
166
167 int mm_player_unrealize(MMHandleType player)
168 {
169         int result = MM_ERROR_NONE;
170
171         debug_log("\n");
172
173         return_val_if_fail(player, MM_ERROR_PLAYER_NOT_INITIALIZED);
174
175         MMPLAYER_CMD_LOCK( player );
176
177         __ta__("[KPI] cleanup media player service",
178         result = _mmplayer_unrealize(player);
179         )
180
181         MMPLAYER_CMD_UNLOCK( player );
182
183         return result;
184 }
185
186 int mm_player_set_message_callback(MMHandleType player, MMMessageCallback callback, void *user_param)
187 {
188         int result = MM_ERROR_NONE;
189
190         debug_log("\n");
191
192         return_val_if_fail(player, MM_ERROR_PLAYER_NOT_INITIALIZED);
193
194         MMPLAYER_CMD_LOCK( player );
195
196         result = _mmplayer_set_message_callback(player, callback, user_param);
197
198         MMPLAYER_CMD_UNLOCK( player );
199
200         return result;
201 }
202
203 int mm_player_set_pd_message_callback(MMHandleType player, MMMessageCallback callback, void *user_param)
204 {
205         int result = MM_ERROR_NONE;
206
207         debug_log("\n");
208
209         return_val_if_fail(player, MM_ERROR_PLAYER_NOT_INITIALIZED);
210
211         result = _mm_player_set_pd_downloader_message_cb(player, callback, user_param);
212
213         return result;
214 }
215
216 int mm_player_set_audio_stream_callback(MMHandleType player, mm_player_audio_stream_callback callback, void *user_param)
217 {
218         int result = MM_ERROR_NONE;
219
220         debug_log("\n");
221
222         return_val_if_fail(player, MM_ERROR_PLAYER_NOT_INITIALIZED);
223
224         MMPLAYER_CMD_LOCK( player );
225
226         result = _mmplayer_set_audiostream_cb(player, callback, user_param);
227
228         MMPLAYER_CMD_UNLOCK( player );
229
230         return result;
231 }
232
233 int mm_player_set_audio_buffer_callback(MMHandleType player, mm_player_audio_stream_callback callback, void *user_param)
234 {
235         int result = MM_ERROR_NONE;
236
237         debug_log("\n");
238
239         return_val_if_fail(player, MM_ERROR_PLAYER_NOT_INITIALIZED);
240
241         MMPLAYER_CMD_LOCK( player );
242
243         result = _mmplayer_set_audiobuffer_cb(player, callback, user_param);
244
245         MMPLAYER_CMD_UNLOCK( player );
246
247         return result;
248 }
249
250 int mm_player_set_video_stream_callback(MMHandleType player, mm_player_video_stream_callback callback, void *user_param)
251 {
252         int result = MM_ERROR_NONE;
253
254         debug_log("\n");
255
256         return_val_if_fail(player, MM_ERROR_PLAYER_NOT_INITIALIZED);
257
258         MMPLAYER_CMD_LOCK( player );
259
260         result = _mmplayer_set_videostream_cb(player, callback, user_param);
261
262         MMPLAYER_CMD_UNLOCK( player );
263
264         return result;
265 }
266
267 int mm_player_set_video_frame_render_error_callback(MMHandleType player, mm_player_video_frame_render_error_callback callback, void *user_param)
268 {
269         int result = MM_ERROR_NONE;
270
271         debug_log("\n");
272
273         return_val_if_fail(player, MM_ERROR_PLAYER_NOT_INITIALIZED);
274
275         MMPLAYER_CMD_LOCK( player );
276
277         result = _mmplayer_set_videoframe_render_error_cb(player, callback, user_param);
278
279         MMPLAYER_CMD_UNLOCK( player );
280
281         return result;
282 }
283
284 int mm_player_do_video_capture(MMHandleType player)
285 {
286         int result = MM_ERROR_NONE;
287
288         debug_log("\n");
289
290         return_val_if_fail(player, MM_ERROR_PLAYER_NOT_INITIALIZED);
291
292         MMPLAYER_CMD_LOCK( player );
293
294         result = _mmplayer_do_video_capture(player);
295
296         MMPLAYER_CMD_UNLOCK( player );
297
298         return result;
299 }
300
301 int mm_player_set_buffer_need_data_callback(MMHandleType player, mm_player_buffer_need_data_callback callback, void * user_param)
302 {
303         int result = MM_ERROR_NONE;
304
305         debug_log("\n");
306
307         return_val_if_fail(player, MM_ERROR_PLAYER_NOT_INITIALIZED);
308
309         MMPLAYER_CMD_LOCK( player );
310
311         result = _mmplayer_set_buffer_need_data_cb(player, callback, user_param);
312
313         MMPLAYER_CMD_UNLOCK( player );
314
315         return result;
316 }
317
318 int mm_player_set_buffer_enough_data_callback(MMHandleType player, mm_player_buffer_enough_data_callback callback, void * user_param)
319 {
320         int result = MM_ERROR_NONE;
321
322         debug_log("\n");
323
324         return_val_if_fail(player, MM_ERROR_PLAYER_NOT_INITIALIZED);
325
326         MMPLAYER_CMD_LOCK( player );
327
328         result = _mmplayer_set_buffer_enough_data_cb(player, callback, user_param);
329
330         MMPLAYER_CMD_UNLOCK( player );
331
332         return result;
333 }
334
335
336 int mm_player_set_buffer_seek_data_callback(MMHandleType player, mm_player_buffer_seek_data_callback callback, void * user_param)
337 {
338         int result = MM_ERROR_NONE;
339
340         debug_log("\n");
341
342         return_val_if_fail(player, MM_ERROR_PLAYER_NOT_INITIALIZED);
343
344         MMPLAYER_CMD_LOCK( player );
345
346         result = _mmplayer_set_buffer_seek_data_cb(player, callback, user_param);
347
348         MMPLAYER_CMD_UNLOCK( player );
349
350         return result;
351 }
352
353 int mm_player_set_volume(MMHandleType player, MMPlayerVolumeType *volume)
354 {
355         int result = MM_ERROR_NONE;
356
357         debug_log("\n");
358
359         return_val_if_fail(player, MM_ERROR_PLAYER_NOT_INITIALIZED);
360         return_val_if_fail(volume, MM_ERROR_INVALID_ARGUMENT);
361
362         MMPLAYER_CMD_LOCK( player );
363
364         result = _mmplayer_set_volume(player, *volume);
365
366         MMPLAYER_CMD_UNLOCK( player );
367
368         return result;
369 }
370
371 int mm_player_get_volume(MMHandleType player, MMPlayerVolumeType *volume)
372 {
373         int result = MM_ERROR_NONE;
374
375         debug_log("\n");
376
377         return_val_if_fail(player, MM_ERROR_PLAYER_NOT_INITIALIZED);
378         return_val_if_fail(volume, MM_ERROR_INVALID_ARGUMENT);
379
380         MMPLAYER_CMD_LOCK( player );
381
382         result = _mmplayer_get_volume(player, volume);
383
384         MMPLAYER_CMD_UNLOCK( player );
385
386         return result;
387 }
388
389 int mm_player_set_mute(MMHandleType player, int mute)
390 {
391         int result = MM_ERROR_NONE;
392
393         debug_log("\n");
394
395         return_val_if_fail(player, MM_ERROR_PLAYER_NOT_INITIALIZED);
396
397         MMPLAYER_CMD_LOCK( player );
398
399         result = _mmplayer_set_mute(player, mute);
400
401         MMPLAYER_CMD_UNLOCK( player );
402
403         return result;
404 }
405
406 int mm_player_get_mute(MMHandleType player, int *mute)
407 {
408         int result = MM_ERROR_NONE;
409
410         debug_log("\n");
411
412         return_val_if_fail(player, MM_ERROR_PLAYER_NOT_INITIALIZED);
413         return_val_if_fail(mute, MM_ERROR_INVALID_ARGUMENT);
414
415         MMPLAYER_CMD_LOCK( player );
416
417         result = _mmplayer_get_mute(player, mute);
418
419         MMPLAYER_CMD_UNLOCK( player );
420
421         return result;
422 }
423
424 int mm_player_get_state(MMHandleType player, MMPlayerStateType *state)
425 {
426         int result = MM_ERROR_NONE;
427
428         debug_log("\n");
429
430         return_val_if_fail(player, MM_ERROR_PLAYER_NOT_INITIALIZED);
431         return_val_if_fail(state, MM_ERROR_COMMON_INVALID_ARGUMENT);
432
433         *state = MM_PLAYER_STATE_NULL;
434
435         result = _mmplayer_get_state(player, (int*)state);
436
437         return result;
438 }
439
440 /* NOTE : Not supported */
441 int mm_player_change_videosink(MMHandleType player, MMDisplaySurfaceType display_surface_type, void *display_overlay)
442 {
443         int result = MM_ERROR_NONE;
444
445         debug_log("\n");
446
447         return_val_if_fail(player, MM_ERROR_PLAYER_NOT_INITIALIZED);
448
449         return MM_ERROR_NOT_SUPPORT_API;
450 }
451
452 int mm_player_push_buffer(MMHandleType player, unsigned char *buf, int size)
453 {
454         int result = MM_ERROR_NONE;
455
456         debug_log("\n");
457
458         return_val_if_fail(player, MM_ERROR_PLAYER_NOT_INITIALIZED);
459
460         //MMPLAYER_CMD_LOCK( player );
461
462         //MMTA_ACUM_ITEM_BEGIN("[KPI] start media player service", false);
463         result = _mmplayer_push_buffer(player, buf, size);
464
465         //MMPLAYER_CMD_UNLOCK( player );
466
467         return result;
468 }
469
470 int mm_player_start(MMHandleType player)
471 {
472         int result = MM_ERROR_NONE;
473
474         debug_log("\n");
475
476         return_val_if_fail(player, MM_ERROR_PLAYER_NOT_INITIALIZED);
477
478         MMPLAYER_CMD_LOCK( player );
479
480         MMTA_ACUM_ITEM_BEGIN("[KPI] start media player service", false);
481         result = _mmplayer_start(player);
482
483         MMPLAYER_CMD_UNLOCK( player );
484
485         return result;
486 }
487
488 int  mm_player_stop(MMHandleType player)
489 {
490         int result = MM_ERROR_NONE;
491
492         debug_log("\n");
493
494         return_val_if_fail(player, MM_ERROR_PLAYER_NOT_INITIALIZED);
495
496         MMPLAYER_CMD_LOCK( player );
497
498         __ta__("[KPI] stop media player service",
499         result = _mmplayer_stop(player);
500         )
501
502         MMPLAYER_CMD_UNLOCK( player );
503
504         return result;
505 }
506
507 int mm_player_pause(MMHandleType player)
508 {
509         int result = MM_ERROR_NONE;
510
511         debug_log("\n");
512
513         return_val_if_fail(player, MM_ERROR_PLAYER_NOT_INITIALIZED);
514
515         MMPLAYER_CMD_LOCK( player );
516
517         __ta__("[KPI] pause media player service",
518         result = _mmplayer_pause(player);
519         )
520
521         MMPLAYER_CMD_UNLOCK( player );
522
523         return result;
524 }
525
526 int mm_player_resume(MMHandleType player)
527 {
528         int result = MM_ERROR_NONE;
529
530         debug_log("\n");
531
532         return_val_if_fail(player, MM_ERROR_PLAYER_NOT_INITIALIZED);
533
534         MMPLAYER_CMD_LOCK( player );
535
536         __ta__("[KPI] resume media player service",
537         result = _mmplayer_resume(player);
538         )
539
540         MMPLAYER_CMD_UNLOCK( player );
541
542         return result;
543 }
544
545 int mm_player_activate_section_repeat(MMHandleType player, int start_pos, int end_pos)
546 {
547         int result = MM_ERROR_NONE;
548
549         return_val_if_fail(player, MM_ERROR_PLAYER_NOT_INITIALIZED);
550
551         MMPLAYER_CMD_LOCK( player );
552
553         result = _mmplayer_activate_section_repeat(player, start_pos, end_pos);
554
555         MMPLAYER_CMD_UNLOCK( player );
556
557         return result;
558 }
559
560 int mm_player_deactivate_section_repeat(MMHandleType player)
561 {
562         int result = MM_ERROR_NONE;
563
564         return_val_if_fail(player, MM_ERROR_PLAYER_NOT_INITIALIZED);
565
566         MMPLAYER_CMD_LOCK( player );
567
568         result = _mmplayer_deactivate_section_repeat(player);
569
570         MMPLAYER_CMD_UNLOCK( player );
571
572         return result;
573 }
574
575 int mm_player_set_play_speed(MMHandleType player, float rate)
576 {
577         int result = MM_ERROR_NONE;
578
579         return_val_if_fail(player, MM_ERROR_PLAYER_NOT_INITIALIZED);
580
581         MMPLAYER_CMD_LOCK( player );
582
583         result = _mmplayer_set_playspeed(player, rate);
584
585         MMPLAYER_CMD_UNLOCK( player );
586
587         return result;
588 }
589
590 int mm_player_set_position(MMHandleType player, MMPlayerPosFormatType format, int pos)
591 {
592         int result = MM_ERROR_NONE;
593
594         debug_log("\n");
595
596         return_val_if_fail(player, MM_ERROR_PLAYER_NOT_INITIALIZED);
597
598         if (format >= MM_PLAYER_POS_FORMAT_NUM)
599         {
600                 debug_error("wrong format\n");
601                 return MM_ERROR_COMMON_INVALID_ARGUMENT;
602         }
603
604         MMPLAYER_CMD_LOCK( player );
605
606         result = _mmplayer_set_position(player, format, pos);
607
608         MMPLAYER_CMD_UNLOCK( player );
609
610         return result;
611 }
612
613 int mm_player_get_position(MMHandleType player, MMPlayerPosFormatType format, int *pos)
614 {
615         int result = MM_ERROR_NONE;
616
617         debug_log("\n");
618
619         return_val_if_fail(player, MM_ERROR_PLAYER_NOT_INITIALIZED);
620         return_val_if_fail(pos, MM_ERROR_COMMON_INVALID_ARGUMENT);
621
622         if (format >= MM_PLAYER_POS_FORMAT_NUM)
623         {
624                 debug_error("wrong format\n");
625                 return MM_ERROR_COMMON_INVALID_ARGUMENT;
626         }
627
628         MMPLAYER_CMD_LOCK( player );
629
630         result = _mmplayer_get_position(player, (int)format, (unsigned long*)pos);
631
632         MMPLAYER_CMD_UNLOCK( player );
633
634         return result;
635 }
636
637 int mm_player_get_buffer_position(MMHandleType player, MMPlayerPosFormatType format, int  *start_pos, int  *stop_pos)
638 {
639         int result = MM_ERROR_NONE;
640
641         debug_log("\n");
642
643         return_val_if_fail(player, MM_ERROR_PLAYER_NOT_INITIALIZED);
644         return_val_if_fail(start_pos && stop_pos, MM_ERROR_COMMON_INVALID_ARGUMENT);
645
646         MMPLAYER_CMD_LOCK( player );
647
648         result = _mmplayer_get_buffer_position(player, (int)format, (unsigned long*)start_pos, (unsigned long*)stop_pos );
649
650         MMPLAYER_CMD_UNLOCK( player );
651
652         return result;
653 }
654
655 int mm_player_adjust_subtitle_position(MMHandleType player, MMPlayerPosFormatType format, int pos)
656 {
657         int result = MM_ERROR_NONE;
658
659         debug_log("\n");
660
661         return_val_if_fail(player, MM_ERROR_PLAYER_NOT_INITIALIZED);
662
663         if (format >= MM_PLAYER_POS_FORMAT_NUM)
664         {
665                 debug_error("wrong format\n");
666                 return MM_ERROR_COMMON_INVALID_ARGUMENT;
667         }
668
669         MMPLAYER_CMD_LOCK( player );
670
671         result = _mmplayer_adjust_subtitle_postion(player, format, pos);
672
673         MMPLAYER_CMD_UNLOCK( player );
674
675         return result;
676 }
677
678 int mm_player_set_subtitle_silent(MMHandleType player, int silent)
679 {
680         int result = MM_ERROR_NONE;
681
682         debug_log("\n");
683
684         return_val_if_fail(player, MM_ERROR_PLAYER_NOT_INITIALIZED);
685
686         MMPLAYER_CMD_LOCK( player );
687
688         result = _mmplayer_set_subtitle_silent(player, silent);
689
690         MMPLAYER_CMD_UNLOCK( player );
691
692         return result;
693 }
694
695 int mm_player_get_subtitle_silent(MMHandleType player, int* silent)
696 {
697         int result = MM_ERROR_NONE;
698
699         debug_log("\n");
700
701         return_val_if_fail(player, MM_ERROR_PLAYER_NOT_INITIALIZED);
702
703         MMPLAYER_CMD_LOCK( player );
704
705         result = _mmplayer_get_subtitle_silent(player, silent);
706
707         MMPLAYER_CMD_UNLOCK( player );
708
709         return result;
710 }
711
712 int mm_player_set_attribute(MMHandleType player,  char **err_attr_name, const char *first_attribute_name, ...)
713 {
714         int result = MM_ERROR_NONE;
715         va_list var_args;
716
717         debug_log("\n");
718
719         return_val_if_fail(player, MM_ERROR_PLAYER_NOT_INITIALIZED);
720         return_val_if_fail(first_attribute_name, MM_ERROR_COMMON_INVALID_ARGUMENT);
721
722         va_start (var_args, first_attribute_name);
723         result = _mmplayer_set_attribute(player, err_attr_name, first_attribute_name, var_args);
724         va_end (var_args);
725
726         return result;
727 }
728
729 int mm_player_get_attribute(MMHandleType player,  char **err_attr_name, const char *first_attribute_name, ...)
730 {
731         int result = MM_ERROR_NONE;
732         va_list var_args;
733
734         debug_log("\n");
735
736         return_val_if_fail(player, MM_ERROR_PLAYER_NOT_INITIALIZED);
737         return_val_if_fail(first_attribute_name, MM_ERROR_COMMON_INVALID_ARGUMENT);
738
739         va_start (var_args, first_attribute_name);
740         result = _mmplayer_get_attribute(player, err_attr_name, first_attribute_name, var_args);
741         va_end (var_args);
742
743         return result;
744 }
745
746 int mm_player_get_attribute_info(MMHandleType player,  const char *attribute_name, MMPlayerAttrsInfo *info)
747 {
748         int result = MM_ERROR_NONE;
749         debug_log("\n");
750
751         return_val_if_fail(player, MM_ERROR_PLAYER_NOT_INITIALIZED);
752         return_val_if_fail(attribute_name, MM_ERROR_COMMON_INVALID_ARGUMENT);
753         return_val_if_fail(info, MM_ERROR_COMMON_INVALID_ARGUMENT);
754
755         result = _mmplayer_get_attributes_info((MMHandleType)player, attribute_name, info);
756
757         return result;
758 }
759
760 int mm_player_get_pd_status(MMHandleType player, guint64 *current_pos, guint64 *total_size)
761 {
762         int result = MM_ERROR_NONE;
763
764         debug_log("\n");
765
766         return_val_if_fail(player, MM_ERROR_PLAYER_NOT_INITIALIZED);
767         return_val_if_fail(current_pos, MM_ERROR_COMMON_INVALID_ARGUMENT);
768         return_val_if_fail(total_size, MM_ERROR_COMMON_INVALID_ARGUMENT);
769
770         result = _mmplayer_get_pd_downloader_status(player, current_pos, total_size);
771
772         return result;
773 }
774
775 int mm_player_get_track_count(MMHandleType player, MMPlayerTrackType track_type, int *count)
776 {
777         int result = MM_ERROR_NONE;
778
779         debug_log("\n");
780
781         return_val_if_fail(player, MM_ERROR_PLAYER_NOT_INITIALIZED);
782         return_val_if_fail(count, MM_ERROR_COMMON_INVALID_ARGUMENT);
783
784         result = _mmplayer_get_track_count(player, track_type, count);
785
786         return result;
787
788 }
789
790 int mm_player_ignore_session(MMHandleType player)
791 {
792         int result = MM_ERROR_NONE;
793
794         debug_log("\n");
795
796         return_val_if_fail(player, MM_ERROR_PLAYER_NOT_INITIALIZED);
797
798         result = _mmplayer_asm_ignore_session(player);
799
800         return result;
801 }