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