Remove SMACK rule file(.rule) according three domain model
[apps/core/preloaded/video-player.git] / src / mp-video-player-mgr.c
1 /*
2  * Copyright (c) [2012] Samsung Electronics Co., Ltd.
3  *
4  * Licensed under the Flora License, Version 1.1 (the License);
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *     http://floralicense.org/license/
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an AS IS BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16
17 #include <stdio.h>
18 #include <string.h>
19 #include <stdlib.h>
20 #include <sys/stat.h>
21
22 #include "mp-video-log.h"
23 #include "mp-video-player-mgr.h"
24
25 #define MAX_PATH_LEN 2048
26
27
28 static player_h pPlayerHandle;
29
30
31 bool MpPlayerMgrIsActive(void)
32 {
33         return pPlayerHandle ? true : false;
34 }
35
36 bool MpPlayerMgrRegistePlayerCallback(void *PlayerCompletedCbFunc, void *PlayerInterruptedCbFunc, void *PlayerErrorCbFunc, void *PlayerBufferingCbFunc, void *PlayerSubtitleCbFunc, void *pUserData)
37 {
38         VideoLogInfo("");
39
40         if(!pUserData)
41         {
42                 VideoLogInfo("[ERR]");
43                 return false;
44         }
45
46         if(!MpPlayerMgrIsActive())
47         {
48                 VideoLogInfo("[ERR]");
49                 return false;
50         }
51
52         if(player_set_completed_cb(pPlayerHandle, PlayerCompletedCbFunc, pUserData) != PLAYER_ERROR_NONE)
53         {
54                 VideoLogInfo("[ERR]");
55                 return false;
56         }
57
58         if(player_set_interrupted_cb(pPlayerHandle, PlayerInterruptedCbFunc, pUserData) != PLAYER_ERROR_NONE)
59         {
60                 VideoLogInfo("[ERR]");
61                 return false;
62         }
63
64         if(player_set_error_cb(pPlayerHandle, PlayerErrorCbFunc, pUserData) != PLAYER_ERROR_NONE)
65         {
66                 VideoLogInfo("[ERR]");
67                 return false;
68         }
69
70         if(player_set_buffering_cb(pPlayerHandle, PlayerBufferingCbFunc, pUserData) != PLAYER_ERROR_NONE)
71         {
72                 VideoLogInfo("[ERR]");
73                 return false;
74         }
75
76         if(player_set_subtitle_updated_cb(pPlayerHandle, PlayerSubtitleCbFunc, pUserData) != PLAYER_ERROR_NONE)
77         {
78                 VideoLogInfo("[ERR]");
79                 return false;
80 }
81
82         return true;
83 }
84
85 bool MpPlayerMgrCreate(const char *szPath)
86 {
87         VideoLogInfo("");
88
89         if(!szPath)
90         {
91                 VideoLogInfo("[ERR] Not correct Meida URI.");
92                 return false;
93         }
94
95         int nPathLength = strlen(szPath);
96         int nErr = PLAYER_ERROR_NONE;
97
98         VideoLogInfo(" Media path (%s)", szPath);
99
100         if(nPathLength > 0 && nPathLength < MAX_PATH_LEN)
101         {
102                 nErr = player_create(&pPlayerHandle);
103                 if(nErr != PLAYER_ERROR_NONE)
104                 {
105                         VideoLogInfo("[ERR] Fail to create player handle. (MMF Error code : %x)", nErr);
106                         return false;
107                 }
108
109                 nErr = player_set_uri(pPlayerHandle, szPath);
110                 if(nErr != PLAYER_ERROR_NONE)
111                 {
112                         VideoLogInfo("[ERR] (%x) Fail to set attribute ", nErr);
113                         return false;
114                 }
115         }
116         else
117         {
118                 VideoLogInfo("[ERR] File path is too long.");
119                 return false;
120         }
121
122         nErr = player_set_sound_type(pPlayerHandle, SOUND_TYPE_MEDIA);
123         if(nErr != PLAYER_ERROR_NONE)
124         {
125                 VideoLogInfo("[ERR] (%x):: Fail to set attribute ", nErr);
126                 return false;
127         }
128
129         return true;
130 }
131
132 bool MpPlayerMgrDestroy(void)
133 {
134         VideoLogInfo("");
135
136         if(!MpPlayerMgrIsActive())
137         {
138                 VideoLogInfo("[ERR]");
139                 return false;
140         }
141
142         int nErr = player_destroy(pPlayerHandle);
143         if(nErr != PLAYER_ERROR_NONE)
144         {
145                 VideoLogInfo("[ERR] Error code : 0x%x", nErr);
146                 return false;
147         }
148         pPlayerHandle = NULL;
149
150         return true;
151 }
152
153 bool MpPlayerMgrRealize(void)
154 {
155         VideoLogInfo("");
156
157         if(!MpPlayerMgrIsActive())
158         {
159                 VideoLogInfo("[ERR]");
160                 return false;
161         }
162
163         int nErr = player_prepare(pPlayerHandle);
164         if(nErr != PLAYER_ERROR_NONE)
165         {
166                 VideoLogInfo("[ERR] Error code : 0x%x", nErr);
167                 return false;
168         }
169
170         return true;
171 }
172
173 bool MpPlayerMgrRealizeAsync(void *pPrepareCb, void *pUserData)
174 {
175         VideoLogInfo("");
176
177         if(!MpPlayerMgrIsActive())
178         {
179                 VideoLogInfo("[ERR]");
180                 return false;
181         }
182
183         int nErr = player_prepare_async(pPlayerHandle, pPrepareCb, pUserData);
184         if(nErr != PLAYER_ERROR_NONE)
185         {
186                 VideoLogInfo("[ERR] Error code : 0x%x", nErr);
187                 return false;
188         }
189
190         return true;
191 }
192
193 bool MpPlayerMgrUnrealize(void)
194 {
195         VideoLogInfo("");
196
197         if(!MpPlayerMgrIsActive())
198         {
199                 VideoLogInfo("[ERR]");
200                 return false;
201         }
202
203         int nErr = player_unprepare (pPlayerHandle);
204         if(nErr != PLAYER_ERROR_NONE)
205         {
206                 VideoLogInfo("[ERR] Error code : 0x%x", nErr);
207                 return false;
208         }
209
210         return true;
211 }
212
213 bool MpPlayerMgrPlay(void)
214 {
215         VideoLogInfo("");
216
217         if(!MpPlayerMgrIsActive())
218         {
219                 VideoLogInfo("[ERR]");
220                 return false;
221         }
222
223         int nErr = player_start(pPlayerHandle);
224         if(nErr != PLAYER_ERROR_NONE)
225         {
226                 VideoLogInfo("[ERR] Error code : 0x%x", nErr);
227                 return false;
228         }
229
230         return true;
231 }
232
233 bool MpPlayerMgrStop(void)
234 {
235         VideoLogInfo("");
236
237         if(!MpPlayerMgrIsActive())
238         {
239                 VideoLogInfo("[ERR]");
240                 return false;
241         }
242
243         int nErr = player_stop (pPlayerHandle);
244         if(nErr != PLAYER_ERROR_NONE)
245         {
246                 VideoLogInfo("[ERR] Error code : 0x%x", nErr);
247                 return false;
248         }
249
250         return true;
251 }
252
253 bool MpPlayerMgrResume(void)
254 {
255         VideoLogInfo("");
256
257         if(!MpPlayerMgrIsActive())
258         {
259                 VideoLogInfo("[ERR]");
260                 return false;
261         }
262
263         int nErr = player_start(pPlayerHandle);
264         if(nErr != PLAYER_ERROR_NONE)
265         {
266                 VideoLogInfo("[ERR] Error code : 0x%x", nErr);
267                 return false;
268         }
269
270         return true;
271 }
272
273 bool MpPlayerMgrPause(void)
274 {
275         VideoLogInfo("");
276
277         if(!MpPlayerMgrIsActive())
278         {
279                 VideoLogInfo("[ERR]");
280                 return false;
281         }
282
283         int nErr = player_pause(pPlayerHandle);
284         if(nErr != PLAYER_ERROR_NONE)
285         {
286                 VideoLogInfo("[ERR] Error code : 0x%x", nErr);
287                 return false;
288         }
289
290         return true;
291 }
292
293 int MpPlayerMgrGetPosition(void)
294 {
295         if(!MpPlayerMgrIsActive())
296         {
297                 return 0;
298         }
299
300         int nPos = 0;
301         int nErr = 0;
302
303         nErr = player_get_position(pPlayerHandle, &nPos);
304         if(nErr != PLAYER_ERROR_NONE)
305         {
306                 VideoLogInfo("[ERR] Error code : 0x%x ", nErr);
307                 return 0;
308         }
309
310         return nPos;
311 }
312
313 void MpPlayerMgrSetPosition(unsigned int nPos, void *pSeekCb, void *pUserData)
314 {
315         VideoLogInfo("");
316
317         if(!MpPlayerMgrIsActive())
318         {
319                 VideoLogInfo("[ERR]");
320                 return;
321         }
322
323         VideoLogInfo("Set position - %d", nPos);
324
325         int nErr = player_set_position(pPlayerHandle, (int)nPos, pSeekCb, pUserData);
326         if(nErr != PLAYER_ERROR_NONE)
327         {
328                 VideoLogInfo("[ERR] Error code : 0x%x ", nErr);
329         }
330 }
331
332 void MpPlayerMgrSetSubtitlePosition(unsigned int nPos)
333 {
334         VideoLogInfo("");
335
336         if(!MpPlayerMgrIsActive())
337         {
338                 VideoLogInfo("[ERR]");
339                 return;
340         }
341
342         int nErr = player_set_subtitle_position(pPlayerHandle, nPos);
343
344         if(nErr != PLAYER_ERROR_NONE)
345         {
346                 VideoLogInfo("[ERR] Error code : 0x%x ", nErr);
347         }
348 }
349
350
351 void MpPlayerMgrSetMute(bool bMuteEnable)
352 {
353         VideoLogInfo("");
354
355         if(!MpPlayerMgrIsActive())
356         {
357                 VideoLogInfo("[ERR]");
358                 return;
359         }
360
361         if(player_set_mute(pPlayerHandle, bMuteEnable) != PLAYER_ERROR_NONE)
362         {
363                 VideoLogInfo("[ERR] Fail to set mute.");
364         }
365 }
366
367 bool MpPlayerMgrGetMute(void)
368 {
369         VideoLogInfo("");
370
371         if(!MpPlayerMgrIsActive())
372         {
373                 VideoLogInfo("[ERR]");
374                 return false;
375         }
376
377         bool bIsMute = false;
378
379         if(player_is_muted(pPlayerHandle, &bIsMute) != PLAYER_ERROR_NONE)
380         {
381                 VideoLogInfo("[ERR] Fail to get mute state.");
382                 return false;
383         }
384
385         return bIsMute;
386 }
387
388 bool MpPlayerMgrSetSurroundFilters(int nSurround)
389 {
390         VideoLogInfo("");
391
392         if(!MpPlayerMgrIsActive())
393         {
394                 VideoLogInfo("[ERR]");
395                 return false;
396         }
397
398         audio_effect_preset_e ePresetValue = (audio_effect_preset_e)nSurround;
399
400         bool available = false;
401
402         player_audio_effect_preset_is_available (pPlayerHandle, ePresetValue, &available);
403
404         if(available == false)
405         {
406                 VideoLogInfo("[ERR] unavailable to set audio effect.");
407                 return false;
408         }
409
410         if(player_audio_effect_set_preset(pPlayerHandle,ePresetValue) != PLAYER_ERROR_NONE)
411         {
412                 VideoLogInfo("[ERR] Fail to set audio effect.");
413                 return false;
414         }
415
416         return true;
417 }
418
419 int MpPlayerMgrGetDuration(void)
420 {
421         VideoLogInfo("");
422
423         if(!MpPlayerMgrIsActive())
424         {
425                 VideoLogInfo("[ERR]");
426                 return 0;
427         }
428
429         int nDuration = -1;
430
431         int nErr = player_get_duration(pPlayerHandle, &nDuration);
432         if(nErr != PLAYER_ERROR_NONE)
433         {
434                 VideoLogInfo("[ERR] Error code : %x - Fail to get attribute ", nErr);
435                 return 0;
436         }
437
438         return nDuration;
439 }
440
441 bool MpPlayerMgrSetOverlayXid(void *pOverlayXid)
442 {
443         if(!MpPlayerMgrIsActive())
444         {
445                 VideoLogInfo("[ERR]");
446                 return false;
447         }
448 /*
449         if(!pOverlayXid)
450         {
451                 VideoLogInfo("[ERR]");
452                 return false;
453         }
454 */
455         VideoLogInfo("XID : %x, %d", pOverlayXid, (int)pOverlayXid);
456         int nErr = player_set_display(pPlayerHandle, PLAYER_DISPLAY_TYPE_X11, (void*)pOverlayXid);
457         if(nErr != PLAYER_ERROR_NONE)
458         {
459                 VideoLogInfo("[ERR] Error code : %x - Fail to set attribute ", nErr);
460                 return false;
461         }
462         return true;
463 }
464
465 bool MpPlayerMgrSetEvasSinkID(void *pEvasSinkID)
466 {
467         if(!MpPlayerMgrIsActive())
468         {
469                 VideoLogInfo("[ERR]");
470                 return false;
471         }
472 /*
473         if(!pEvasSinkID)
474         {
475                 VideoLogInfo("[ERR]");
476                 return false;
477         }
478 */
479         VideoLogInfo("Evas Sink ID : %x", pEvasSinkID);
480
481         int nErr = player_set_display(pPlayerHandle, PLAYER_DISPLAY_TYPE_EVAS, (void*)pEvasSinkID);
482         if(nErr != PLAYER_ERROR_NONE)
483         {
484                 VideoLogInfo("[ERR] Error code : %x - Fail to set attribute ", nErr);
485                 return false;
486         }
487
488         return true;
489 }
490
491 bool MpPlayerMgrSetSoundPriority(void)
492 {
493         VideoLogInfo("");
494
495         if(!MpPlayerMgrIsActive())
496         {
497                 VideoLogInfo("[ERR]");
498                 return false;
499         }
500
501         int nErr = player_set_sound_type(pPlayerHandle, SOUND_TYPE_MEDIA);
502         if(nErr != PLAYER_ERROR_NONE)
503         {
504                 VideoLogInfo("[ERR] Error code : %x -  Fail to set attribute ", nErr);
505                 return false;
506         }
507
508         return true;
509 }
510
511 int MpPlayerMgrSetPlaySpeed(float nSpeedValue)
512 {
513         VideoLogInfo("");
514
515         if(!MpPlayerMgrIsActive())
516         {
517                 VideoLogInfo("[ERR]");
518                 return -1;
519         }
520         int nErr = player_set_playback_rate(pPlayerHandle, nSpeedValue);
521         if(nErr != PLAYER_ERROR_NONE)
522         {
523                 VideoLogInfo("[ERR] Error code : %x - Fail to get attribute ", nErr);
524                 return -1;
525         }
526
527         return 0;
528 }
529
530 int MpPlayerMgrGetVideoWidthResolution(void)
531 {
532         VideoLogInfo("");
533
534         if(!MpPlayerMgrIsActive())
535         {
536                 VideoLogInfo("[ERR]");
537                 return 0;
538         }
539
540         int nWidth = 0;
541         int nHeight = 0;
542         int nErr = player_get_video_size(pPlayerHandle, &nWidth, &nHeight);
543         if(nErr != PLAYER_ERROR_NONE)
544         {
545                 VideoLogInfo("[ERR] Error code : %x - Fail to get attribute ", nErr);
546                 return 0;
547         }
548
549         return nWidth;
550 }
551
552 int MpPlayerMgrGetVideoHeightResolution(void)
553 {
554         VideoLogInfo("");
555
556         if(!MpPlayerMgrIsActive())
557         {
558                 VideoLogInfo("[ERR]");
559                 return 0;
560         }
561
562         int nWidth = 0;
563         int nHeight = 0;
564         int nErr = player_get_video_size(pPlayerHandle, &nWidth, &nHeight);
565         if(nErr != PLAYER_ERROR_NONE)
566         {
567                 VideoLogInfo("[ERR] Error code : %x - Fail to get attribute ", nErr);
568                 return 0;
569         }
570
571         return nHeight;
572 }
573
574 bool MpPlayerMgrSetSubtitle(char *szSubtitlePath)
575 {
576         VideoLogInfo("%s", szSubtitlePath);
577
578         if(!MpPlayerMgrIsActive())
579         {
580                 VideoLogInfo("[ERR]");
581                 return false;
582         }
583
584         if(!szSubtitlePath)
585         {
586                 VideoLogInfo("[ERR] subtitle path is null.");
587                 return false;
588         }
589
590         int nErr = player_set_subtitle_path(pPlayerHandle, szSubtitlePath);
591         if(nErr != PLAYER_ERROR_NONE)
592         {
593                 VideoLogInfo("[ERR] Error code : %x - Fail to set attribute ", nErr);
594                 return false;
595         }
596
597         return true;
598 }
599
600 bool MpPlayerMgrSetDisplayMode(MpPlayerMgrDisplayMethod nMethodMode)
601 {
602         VideoLogInfo("");
603
604         if(!MpPlayerMgrIsActive())
605         {
606                 VideoLogInfo("[ERR]");
607                 return false;
608         }
609         int nRet = player_set_display_mode (pPlayerHandle , nMethodMode);
610         if(nRet != PLAYER_ERROR_NONE)
611         {
612                 VideoLogInfo("[ERR] Error code : %x - Fail to set attribute ", nRet);
613                 return false;
614         }
615         return true;
616 }
617
618 bool MpPlayerMgrSetRotate(MpVideoRotation nRotation)
619 {
620         VideoLogInfo("");
621
622         if(!MpPlayerMgrIsActive())
623         {
624                 VideoLogInfo("[ERR]");
625                 return false;
626         }
627
628         int nRotVal = PLAYER_DISPLAY_ROTATION_NONE;
629
630         if(nRotation == VIDEO_SCREEN_PORTRAIT) {
631                 nRotVal = PLAYER_DISPLAY_ROTATION_NONE;
632         }
633         else if(nRotation == VIDEO_SCREEN_PORTRAIT_UPSIDEDOWN) {
634                 nRotVal = PLAYER_DISPLAY_ROTATION_180;
635         }
636         else if(nRotation == VIDEO_SCREEN_LANDSCAPE) {
637                 nRotVal = PLAYER_DISPLAY_ROTATION_270;
638         }
639         else if(nRotation == VIDEO_SCREEN_LANDSCAPE_UPSIDEDOWN) {
640                 nRotVal = PLAYER_DISPLAY_ROTATION_90;
641         }
642
643         int nRet = player_set_x11_display_rotation (pPlayerHandle , nRotVal);
644         if(nRet != PLAYER_ERROR_NONE)
645         {
646                 VideoLogInfo("[ERR] Error code : %x - Fail to set attribute ", nRet);
647                 return false;
648         }
649         return true;
650 }
651
652 bool MpPlayerMgrSetUseragentForStreaming(const char *szUserAgent)
653 {
654         VideoLogInfo("!!!!!! NO EXIST FUNCTION FOR SETTING USER AGENT. !!!!!!");
655
656         return true;
657 }
658
659 bool MpPlayerMgrSetProxyAddressForStreaming(const char *szProxyAddress)
660 {
661         VideoLogInfo("!!!!!! NO EXIST FUNCTION FOR SETTING PROXY ADDRESS. !!!!!!");
662         return true;
663 }
664
665 bool MpPlayerMgrSetCookieForStreaming(const char *szCookie)
666 {
667         if(!MpPlayerMgrIsActive())
668         {
669                 VideoLogInfo("[ERR]");
670                 return false;
671         }
672
673         if(!szCookie)
674         {
675                 VideoLogInfo("No exist cookie.");
676                 return false;
677         }
678
679         VideoLogInfo("");
680
681         int nRet = player_set_streaming_cookie(pPlayerHandle , szCookie, strlen(szCookie));
682         if(nRet == PLAYER_ERROR_INVALID_PARAMETER)
683         {
684                 VideoLogInfo("PLAYER_ERROR_INVALID_PARAMETER");
685                 return false;
686         }
687
688         return true;
689 }
690
691 bool MpPlayerMgrStartCapture()
692 {
693         VideoLogInfo("");
694         return true;
695 }
696
697 bool MpPlayerMgrCaptureVideo(void *pCallbackFunc, void *pUserData)
698 {
699         if(!MpPlayerMgrIsActive())
700         {
701                 VideoLogInfo("");
702                 return false;
703         }
704
705         VideoLogInfo("");
706
707         int nRet = player_capture_video(pPlayerHandle, pCallbackFunc, pUserData);
708         if(nRet == PLAYER_ERROR_INVALID_PARAMETER)
709         {
710                 VideoLogInfo("PLAYER_ERROR_INVALID_PARAMETER");
711                 return false;
712         }
713
714         if(nRet == PLAYER_ERROR_INVALID_OPERATION)
715         {
716                 VideoLogInfo("PLAYER_ERROR_INVALID_OPERATION");
717                 return false;
718         }
719
720         if(nRet == PLAYER_ERROR_INVALID_STATE)
721         {
722                 VideoLogInfo("PLAYER_ERROR_INVALID_STATE");
723                 return false;
724         }
725
726         return true;
727 }
728
729 int MpPlayerMgrGetBufferingPosition(void)
730 {
731         int nStartPos = 0;
732         int nCurrentPos = 0;
733
734         if(player_get_streaming_download_progress(pPlayerHandle,&nStartPos, &nCurrentPos) != PLAYER_ERROR_NONE)
735         {
736                 VideoLogError("");
737         return 0;
738 }
739
740         return nCurrentPos;
741 }
742
743 bool MpPlayerMgrRegisteBufferingCallBack(void *pCallbackFunc, void *pUserData)
744 {
745         if(!MpPlayerMgrIsActive())
746         {
747                 VideoLogInfo("[ERR]");
748                 return false;
749         }
750
751         // !!! CHECK player_buffering_cb !!!
752         if(player_set_buffering_cb(pPlayerHandle, pCallbackFunc, pUserData) != PLAYER_ERROR_NONE)
753         {
754                 VideoLogInfo("");
755                 return false;
756         }
757
758         return true;
759 }
760
761 int MpPlayerMgrGetFileStreamType(void)
762 {
763         VideoLogInfo("");
764
765 // jdlee
766         return FILE_STREAM_TYPE_VIDEO;
767 }
768
769 bool MpPlayerMgrSetScaling(bool bScale)
770 {
771         if(!MpPlayerMgrIsActive())
772         {
773                 VideoLogInfo("[ERR]");
774                 return false;
775         }
776
777         VideoLogInfo("");
778
779         if(player_enable_evas_display_scaling(pPlayerHandle, bScale) != PLAYER_ERROR_NONE) {
780                 VideoLogInfo("[ERR]");
781                 return false;
782         }
783         return true;
784 }
785
786 player_state_e MpPlayerMgrGetPlayerState(void)
787 {
788         int ret = 0;
789         player_state_e player_state = PLAYER_STATE_NONE;
790         ret = player_get_state(pPlayerHandle, &player_state);
791         if (ret != PLAYER_ERROR_NONE) {
792                 player_state = PLAYER_STATE_NONE;
793         }
794         return player_state;
795 }
796
797 void MpPlayerMgrSetVolume(float volume)
798 {
799         VideoLogInfo("volume = %f", volume);
800
801         if(!MpPlayerMgrIsActive())
802         {
803                 VideoLogInfo("[ERR]");
804                 return;
805         }
806
807         if(player_set_volume(pPlayerHandle, volume, volume) != PLAYER_ERROR_NONE)
808         {
809                 VideoLogInfo("[ERR] Fail to set volume.");
810         }
811 }
812
813 float MpPlayerMgrGetVolume(void)
814 {
815         VideoLogInfo("");
816
817         if(!MpPlayerMgrIsActive())
818         {
819                 VideoLogInfo("[ERR]");
820                 return 0.0;
821         }
822
823         float volume_left = 0.0;
824         float volume_right = 0.0;
825
826         if(player_get_volume(pPlayerHandle, &volume_left, &volume_right) != PLAYER_ERROR_NONE)
827         {
828                 VideoLogInfo("[ERR] Fail to get volume.");
829                 return 0.0;
830         }
831
832         return volume_left;
833 }
834
835 int MpPlayerMgrGetClosedCaptionCount(void)
836 {
837         VideoLogInfo("");
838
839         if(!MpPlayerMgrIsActive())
840         {
841                 VideoLogInfo("[ERR]");
842                 return 0;
843         }
844         int nCount = 0;
845
846         if(player_get_track_count(pPlayerHandle, PLAYER_TRACK_TYPE_TEXT, &nCount) != PLAYER_ERROR_NONE)
847         {
848                 VideoLogError("[ERR] player_get_track_count.");
849                 return 0;
850         }
851
852         VideoLogError("== %d ===========================================", nCount);
853
854         return nCount;
855 }
856