Changeset 41345 for titan/titan/player.h
- Timestamp:
- 12/03/17 18:10:53 (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
titan/titan/player.h
r40898 r41345 242 242 int subtitleflag = 0; 243 243 char *subtext = NULL; 244 #else 245 struct stimerthread* subtitlethread = NULL; 246 uint32_t buf_pos_ms = 0; 247 uint32_t duration_ms = 0; 248 int subtitleflag = 0; 249 char *subtext = NULL; 244 250 #endif 245 251 … … 906 912 907 913 #ifdef EPLAYER4 914 void playersubtitle_thread() 915 { 916 struct skin* framebuffer = getscreen("framebuffer"); 917 struct skin* subtitle = getscreen("gstsubtitle"); 918 char* bg = NULL; 919 int count = 0; 920 921 subtitle->bgcol = -1; 922 923 setnodeattr(subtitle, framebuffer, 0); 924 bg = savescreen(subtitle); 925 926 while(subtitlethread->aktion != STOP) 927 { 928 if(duration_ms != 0) 929 { 930 count = 0; 931 changetext(subtitle, subtext); 932 count = duration_ms / 100; 933 drawscreen(subtitle, 0, 0); 934 while(count > 0 && subtitlethread->aktion != STOP) 935 { 936 usleep(100000); 937 count = count - 1; 938 } 939 changetext(subtitle, " "); 940 drawscreen(subtitle, 0, 0); 941 duration_ms = 0; 942 } 943 else 944 usleep(100000); 945 } 946 free(subtext); subtext = NULL; 947 restorescreen(bg, subtitle); 948 blitfb(0); 949 subtitlethread = NULL; 950 } 951 #else 908 952 void playersubtitle_thread() 909 953 { … … 1224 1268 // if(ostrcmp(getconfig("av_ac3mode", NULL), "downmix") == 0) 1225 1269 #ifndef MIPSEL 1270 printf("status.downmix; %d\n", status.downmix); 1271 1272 1273 char* downmix = readfiletomem(getconfig("ac3dev", NULL), 1); 1274 printf("ac3dev: %s\n",getconfig("ac3dev", NULL)); 1275 printf("downmix: %s\n",downmix); 1276 if(ostrcmp(downmix, "passthrough") == 0) 1277 status.downmix = 0; 1278 else 1279 status.downmix = 1; 1280 1281 printf("status.downmix: %d\n",status.downmix); 1282 sleep(5); 1226 1283 if(status.downmix == 1) 1227 1284 { … … 3608 3665 #endif 3609 3666 3610 #endif 3667 char* getsubtext() 3668 { 3669 char* tmpstr = NULL; 3670 if(player && player->container && player->container->selectedContainer) 3671 player->container->selectedContainer->Command(player, CONTAINER_GET_SUBTEXT, (void*)&tmpstr); 3672 3673 3674 //duration = oregex(".*([0-9]{8,8}.*[0-9]{4,4}).*", subtext); 3675 //duration = oregex(".*duration=(.*);.*", subtext); 3676 3677 char* duration = oregex(".*duration=(.*);pts=.*", tmpstr); 3678 printf("[TITAN/getsubtext] duration %s\n", duration); 3679 if(duration != NULL) 3680 { 3681 printf("[TITAN/getsubtext] duration %d\n", atoi(duration)); 3682 duration_ms = atoi(duration); 3683 } 3684 3685 char* pts = oregex(".*;pts=(.*);trackid=.*", tmpstr); 3686 printf("[TITAN/getsubtext] pts %s\n", pts); 3687 if(pts != NULL) 3688 printf("[TITAN/getsubtext] pts %d\n", atoi(pts)); 3689 3690 char* trackid = oregex(".*;trackid=(.*);trackid=.*", tmpstr); 3691 printf("[TITAN/getsubtext] trackid %s\n", trackid); 3692 if(trackid != NULL) 3693 printf("[TITAN/getsubtext] trackid %d\n", atoi(trackid)); 3694 3695 subtext = oregex(".*;subtext=(.*).*", tmpstr); 3696 printf("[TITAN/getsubtext] subtext %s\n", subtext); 3697 3698 if(subtitlethread == NULL) 3699 subtitlethread = addtimer(&playersubtitle_thread, START, 10000, 1, NULL, NULL, NULL); 3700 3701 3702 /* 3703 duration= 3704 duration=", ollutoa(tmpduration), 0, 1); 3705 tmpstr = ostrcat(tmpstr, ";pts=", 1, 0);; 3706 tmpstr = ostrcat(tmpstr, ollutoa(tmppts), 1, 0);; 3707 tmpstr = ostrcat(tmpstr, ";trackid=", 1, 0);; 3708 tmpstr = ostrcat(tmpstr, ollutoa(tmptrackId), 1, 0); 3709 tmpstr = ostrcat(tmpstr, ";subtext=", 1, 0);; 3710 tmpstr = ostrcat(tmpstr, subtext, 1, 0); 3711 3712 running_pts = pos / 11111LL; 3713 decoder_ms = running_pts / 90; 3714 3715 if(subtitlethread == NULL) 3716 subtitlethread = addtimer(&playersubtitle_thread, START, 10000, 1, NULL, NULL, NULL); 3717 3718 */ 3719 /* 3720 SubtitleOut_t *data; 3721 printf("[TITAN/getsubtext start]\n"); 3722 if(player && player->container && player->container->selectedContainer) 3723 // player->container->selectedContainer->Command(player, CONTAINER_GET_SUBTEXT, (void*)&data); 3724 player->container->selectedContainer->Command(player, CONTAINER_GET_SUBTEXT, (void*)data); 3725 3726 if (data == NULL) 3727 return NULL; 3728 printf("[TITAN/getsubtext] 2\n"); 3729 3730 printf("data.data: %s\n", &data->data); 3731 3732 printf("data.data: %s\n", data->data); 3733 printf("data.pts: %lld\n", data->pts); 3734 printf("data.duration: %lld\n", data->durationMS); 3735 3736 SubtitleOut_t *data; 3737 printf("111111111111111\n"); 3738 3739 3740 if(player && player->container && player->container->selectedContainer) 3741 player->container->selectedContainer->Command(player, CONTAINER_GET_SUBTEXT, (void*)data); 3742 // player->container->selectedContainer->Command(player, CONTAINER_GET_SUBTEXT, (void*)data); 3743 3744 printf("222222222222222\n"); 3745 3746 if (data == NULL) 3747 return NULL; 3748 printf("-------------------------------------\n"); 3749 3750 printf("titan &data.data %s\n", (char*)&data->data); 3751 3752 SubtitleOut_t *out = NULL; 3753 printf("333333333333333\n"); 3754 3755 out = (SubtitleOut_t*) data; 3756 printf("444444444444444\n"); 3757 3758 printf("out.duration: %lld\n", out->durationMS); 3759 printf("555555555555555\n"); 3760 */ 3761 /* 3762 printf(out->pts); 3763 printf("444444444444444\n"); 3764 3765 printf(out->data); 3766 printf("444444444444444\n"); 3767 3768 3769 printf("out.pts: %u\n", out->pts); 3770 printf("out1.data: %u\n", out->data); 3771 printf("out2.data: %d\n", out->data); 3772 3773 3774 char *Encoding = NULL; 3775 printf("Encoding:%s Text:%s Len:%d\n", Encoding, (char*) out->data, out->len); 3776 printf("555555555555555\n"); 3777 printf("-------------------------------------\n"); 3778 3779 printf("data.pts: %lld\n", data->pts); 3780 printf("data.durationMS: %lld\n", data->durationMS); 3781 printf("data1: %lld\n", data->data); 3782 printf("data2: %d\n", data->data); 3783 printf("data3: %s\n", data->data); 3784 printf("data4: %s\n", (char*)data->data); 3785 printf("data5: %s\n", (char*)data->data); 3786 printf("-------------------------------------\n"); 3787 3788 */ 3789 /* 3790 struct skin* framebuffer = getscreen("framebuffer"); 3791 struct skin* subtitle = getscreen("gstsubtitle"); 3792 3793 // changetext(subtitle, (char*) data->data); 3794 changetext(subtitle, subtext); 3795 drawscreen(subtitle, 0, 0); 3796 */ 3797 return subtext; 3798 } 3799
Note: See TracChangeset
for help on using the changeset viewer.