- Timestamp:
- 12/03/17 19:11:47 (5 years ago)
- Location:
- titan
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
titan/libeplayer3/container/container_ffmpeg.c
r41345 r41347 211 211 /* ***************************** */ 212 212 213 //extern void dvbsub_ass_write(AVCodecContext *c, AVSubtitle *sub, int pid); 214 215 //SubtitleOut_t subOut; 216 //SubtitleOut_t *subOut = NULL; 217 213 //obi 218 214 uint32_t tmptrackId; 219 215 // uint8_t *tmpdata; … … 224 220 int64_t tmpduration; // duration in miliseconds 225 221 char *tmptype; 226 intenablesub = 0;222 int enablesub = 0; 227 223 228 224 void dvbsub_ass_write(Context_t *context, AVCodecContext *c, AVSubtitle *sub, int pid, AVPacket *packet) … … 379 375 avformat_free_context(subavfc); 380 376 381 ffmpeg_printf(1, "format=%s\n", format);382 ffmpeg_printf(1, "pid=%d\n", pid);377 ffmpeg_printf(1, "format=%s\n", format); 378 ffmpeg_printf(1, "pid=%d\n", pid); 383 379 384 380 if(pid != -1) … … 423 419 return ret; 424 420 } 425 421 //obi (end) 426 422 427 423 static void ffmpeg_silen_callback(void * avcl, int level, const char * fmt, va_list vl) … … 1378 1374 if (duration > 0) 1379 1375 { 1380 printf("[LIBEPLAYER3/FFMPEGThread] start\n");1376 // printf("[LIBEPLAYER3/FFMPEGThread] start\n"); 1381 1377 1382 1378 SubtitleOut_t subOut; … … 1386 1382 subOut.pts = pts; 1387 1383 subOut.durationMS = duration; 1388 1389 1390 1391 // 1392 1393 1394 1395 1396 1397 1398 printf("[LIBEPLAYER3/FFMPEGThread] set tmpdata=%s\n", tmpdata);1399 printf("[LIBEPLAYER3/FFMPEGThread] set tmppts=%lld\n", tmppts);1400 printf("[LIBEPLAYER3/FFMPEGThread] set tmpduration=%lld\n", tmpduration);1401 1384 //obi 1385 tmptrackId = pid; 1386 tmpdata = (uint8_t *)packet.data; 1387 // tmpdata = (uint8_t *)&packet.data; 1388 //tmplen; 1389 tmppts = pts; 1390 tmpduration = duration; 1391 tmpdata = ostrcat(subOut.data, NULL, 0, 0); 1392 1393 //*tmptype; 1394 // printf("[LIBEPLAYER3/FFMPEGThread] set tmpdata=%s\n", tmpdata); 1395 // printf("[LIBEPLAYER3/FFMPEGThread] set tmppts=%lld\n", tmppts); 1396 // printf("[LIBEPLAYER3/FFMPEGThread] set tmpduration=%lld\n", tmpduration); 1397 //obi (end) 1402 1398 1403 1399 if (context->output->subtitle->Write(context, &subOut) < 0) … … 1405 1401 ffmpeg_err("writing data to teletext fifo failed\n"); 1406 1402 } 1407 1408 char* tmpstr = NULL; 1409 tmpstr = ostrcat(tmpstr, "duration=", 1, 0); 1410 tmpstr = ostrcat(tmpstr, ollutoa(tmpduration), 1, 1); 1411 tmpstr = ostrcat(tmpstr, ";pts=", 1, 0);; 1412 tmpstr = ostrcat(tmpstr, ollutoa(tmppts), 1, 0);; 1413 tmpstr = ostrcat(tmpstr, ";trackid=", 1, 0);; 1414 tmpstr = ostrcat(tmpstr, oitoa(tmptrackId), 1, 0); 1415 tmpstr = ostrcat(tmpstr, ";subtext=", 1, 0);; 1416 tmpstr = ostrcat(tmpstr, tmpdata, 1, 0);; 1417 1418 free(subtext), subtext = NULL; 1419 subtext = ostrcat(subtext, tmpstr, 1, 0); 1420 free(tmpstr), tmpstr = NULL; 1421 1422 // tmpduration = 0; 1423 tmppts = 0; 1424 tmptrackId = 0; 1425 1426 1427 printf("[LIBEPLAYER3/FFMPEGThread] set subtext: %s\n", subtext); 1428 1403 //obi 1404 char* tmpstr = NULL; 1405 tmpstr = ostrcat(tmpstr, "duration=", 1, 0); 1406 tmpstr = ostrcat(tmpstr, ollutoa(tmpduration), 1, 1); 1407 tmpstr = ostrcat(tmpstr, ";pts=", 1, 0);; 1408 tmpstr = ostrcat(tmpstr, ollutoa(tmppts), 1, 0);; 1409 tmpstr = ostrcat(tmpstr, ";trackid=", 1, 0);; 1410 tmpstr = ostrcat(tmpstr, oitoa(tmptrackId), 1, 0); 1411 tmpstr = ostrcat(tmpstr, ";subtext=", 1, 0);; 1412 tmpstr = ostrcat(tmpstr, tmpdata, 1, 0);; 1413 1414 free(subtext), subtext = NULL; 1415 subtext = ostrcat(subtext, tmpstr, 1, 0); 1416 free(tmpstr), tmpstr = NULL; 1417 1418 // tmpduration = 0; 1419 tmppts = 0; 1420 tmptrackId = 0; 1421 1422 // printf("[LIBEPLAYER3/FFMPEGThread] set subtext: %s\n", subtext); 1423 //obi (end) 1429 1424 } 1430 1425 } … … 1987 1982 ffmpeg_printf(10, "check tslivemode\n"); 1988 1983 1989 // if (ostrstr(filename, ".m3u8") != NULL)1984 // if (ostrstr(filename, ".m3u8") != NULL) 1990 1985 if (usetslivemode == 1) 1991 1986 { … … 2178 2173 res = container_ffmpeg_update_tracks(context, playFilesNames->szFirstFile, 1); 2179 2174 2180 ffmpeg_printf(1, "aaaaaaaaaaaaa\n"); 2181 2182 ffmpeg_printf(1, "bbbbbbbbbbbbbbb\n");2175 //obi 2176 //ReadSubtitles(context, playFilesNames->szFirstFile); 2177 //obi (end) 2183 2178 return res; 2184 2179 } … … 3254 3249 int64_t sec = -5; 3255 3250 context->playback->Command(context, PLAYBACK_SEEK, (void*)&sec); 3256 enablesub = 1; 3251 //obi 3252 enablesub = 1; 3253 //obi (end) 3257 3254 return cERR_CONTAINER_FFMPEG_NO_ERROR; 3258 3255 } 3259 3256 3257 //obi 3260 3258 static int32_t container_ffmpeg_get_subtext(Context_t* context, char ** data) 3261 //static int32_t container_ffmpeg_get_subtext(Context_t* context, SubtitleOut_t input) 3262 //static int32_t container_ffmpeg_get_subtext(Context_t* context, void **data) 3263 //static int32_t container_ffmpeg_get_subtext(Context_t* context, SubtitleOut_t **data) 3264 //static int32_t container_ffmpeg_get_subtext(Context_t* context, SubtitleOut_t *data) 3265 //static int32_t container_ffmpeg_get_subtext(Context_t* context, SubtitleOut_t ** data) 3266 { 3267 3268 printf("[LIBEPLAYER3/container_ffmpeg_get_subtext] start\n"); 3269 3270 //if(tmpduration != 0 && subtext != NULL) 3271 if(enablesub == 1 && subtext != NULL) 3272 { 3273 printf("[LIBEPLAYER3/container_ffmpeg_get_subtext] set data\n"); 3274 /* 3275 char* tmpstr = NULL; 3276 tmpstr = ostrcat("duration=", NULL, 0, 0); 3277 tmpstr = ostrcat(tmpstr, ollutoa(tmpduration), 1, 1); 3278 tmpstr = ostrcat(tmpstr, ";pts=", 1, 0);; 3279 tmpstr = ostrcat(tmpstr, ollutoa(tmppts), 1, 0);; 3280 tmpstr = ostrcat(tmpstr, ";trackid=", 1, 0);; 3281 tmpstr = ostrcat(tmpstr, oitoa(tmptrackId), 1, 0); 3282 tmpstr = ostrcat(tmpstr, ";subtext=", 1, 0);; 3283 tmpstr = ostrcat(tmpstr, subtext, 1, 0);; 3284 *data = ostrcat(tmpstr, NULL, 0, 0); 3285 free(tmpstr), tmpstr = NULL; 3286 free(subtext), subtext = NULL; 3287 tmpduration = 0; 3288 tmppts = 0; 3289 tmptrackId = 0; 3290 */ 3259 { 3260 3261 // printf("[LIBEPLAYER3/container_ffmpeg_get_subtext] start\n"); 3262 3263 if(enablesub == 1 && subtext != NULL) 3264 { 3265 // printf("[LIBEPLAYER3/container_ffmpeg_get_subtext] set data\n"); 3266 3291 3267 *data = ostrcat(subtext, NULL, 0, 0); 3292 3268 free(subtext), subtext = NULL; 3293 3269 3294 } 3295 3296 3297 3298 //*data = ostrcat("duration=", olutoa(tmpduration), 0, 1); 3299 //*data = ostrcat(data, ";subtext=", 1, 0); 3300 //*data = ostrcat(data, "subtext", 1, 0); 3301 3302 //*data = ostrcat(subtext, NULL, 0, 0); 3303 3304 3305 3306 3307 /* 3308 SubtitleOut_t subOut; 3309 memset(&subOut, 0, sizeof(subOut)); 3310 subOut.trackId = tmptrackId; 3311 subOut.data = (uint8_t *)subtext; 3312 subOut.pts = tmppts; 3313 subOut.durationMS = tmpduration; 3314 printf("[LIBEPLAYER3/container_ffmpeg_get_subtext] start1\n"); 3315 memset(&data, 0, sizeof(data)); 3316 printf("[LIBEPLAYER3/container_ffmpeg_get_subtext] start1a\n"); 3317 3318 *data = subOut; 3319 3320 // 3321 3322 // SubtitleOut_t subOut; 3323 printf("[LIBEPLAYER3/container_ffmpeg_get_subtext] start2\n"); 3324 3325 memset(&data, 0, sizeof(data)); 3326 printf("[LIBEPLAYER3/container_ffmpeg_get_subtext] start3\n"); 3327 3328 printf("[LIBEPLAYER3/container_ffmpeg_get_subtext] tmptrackId=%d\n", tmptrackId); 3329 printf("[LIBEPLAYER3/container_ffmpeg_get_subtext] data.trackId=%d\n", data->trackId); 3330 data->trackId = tmptrackId; 3331 // subOut.data = (uint8_t *)packet.data; 3332 printf("[LIBEPLAYER3/container_ffmpeg_get_subtext] start3\n"); 3333 3334 data->data = (uint8_t *)subtext; 3335 printf("[LIBEPLAYER3/container_ffmpeg_get_subtext] start4\n"); 3336 3337 data->pts = tmppts; 3338 printf("[LIBEPLAYER3/container_ffmpeg_get_subtext] start5\n"); 3339 3340 data->durationMS = tmpduration; 3341 3342 printf("[LIBEPLAYER3/container_ffmpeg_get_subtext] check subtext=%s\n", subtext); 3343 printf("[LIBEPLAYER3/container_ffmpeg_get_subtext] check tmpdata=%s\n", tmpdata); 3344 printf("[LIBEPLAYER3/container_ffmpeg_get_subtext] check data->data=%s\n", data->data); 3345 3346 printf("[LIBEPLAYER3/container_ffmpeg_get_subtext] check tmppts=%lld\n", tmppts); 3347 printf("[LIBEPLAYER3/container_ffmpeg_get_subtext] check data->pts=%lld\n", data->pts); 3348 3349 printf("[LIBEPLAYER3/container_ffmpeg_get_subtext] check tmpduration=%lld\n", tmpduration); 3350 printf("[LIBEPLAYER3/container_ffmpeg_get_subtext] check data->durationMS=%lld\n", data->durationMS); 3351 */ 3352 printf("[LIBEPLAYER3/container_ffmpeg_get_subtext] end\n"); 3353 3354 /* 3355 SubtitleOut_t *out = NULL; 3356 out = (SubtitleOut_t*) data; 3357 3358 printf("##########################\n"); 3359 printf("void *data.data: %s\n", out->data); 3360 //printf("void *data.pts: %lld\n", &data->pts); 3361 //printf("void *data.duration: %lld\n", &data->durationMS); 3362 printf("##########################\n"); 3363 */ 3364 // *data = (char *)packet->data; 3365 // char* subtext = NULL; 3366 // *data = ostrcat(subtext, NULL, 0, 0); 3367 // SubtitleOut_t subOut = input; 3368 // subOut1 = subOut; 3369 // SubtitleOut_t *out = NULL; 3370 // SubtitleOut_t subOut = (SubtitleOut_t*) data; 3371 3372 // SubtitleOut_t *subOut = NULL; 3373 // *subOut; 3374 // SubtitleOut_t *subOut = (SubtitleOut_t*) data; 3375 // SubtitleOut_t *subOut = (SubtitleOut_t*) data; 3376 //SubtitleOut_t* 3377 3378 3379 //data = &subOut; 3380 3381 //printf("555 data: %s\n", (char*)data->data); 3382 3383 3384 // SubtitleOut_t *subOut; 3385 // subOut = (SubtitleOut_t*) data; 3386 3387 // SubtitleOutputDef_t* out = (SubtitleOutputDef_t*)argument; 3388 3389 // printf("333subOut.data: %s\n", subOut.data); 3390 /* 3391 3392 printf("##########################\n"); 3393 3394 printf("data: %s\n", tmpdata); 3395 printf("pts: %lld\n", tmppts); 3396 printf("duration: %lld\n", tmpduration); 3397 3398 printf("subtext1: %s\n", subtext); 3399 printf("subtext2: %d\n", subtext); 3400 printf("##########################\n"); 3401 printf("subOut.data: %s\n", *data->data); 3402 printf("subOut.pts: %lld\n", data.pts); 3403 printf("subOut.durationMS: %lld\n", data.durationMS); 3404 printf("##########################\n"); 3405 3406 3407 SubtitleOut_t subOut; 3408 memset(&subOut, 0, sizeof(subOut)); 3409 subOut.trackId = tmptrackId; 3410 // subOut.data = (uint8_t *)packet.data; 3411 subOut.data = (uint8_t *)subtext; 3412 3413 subOut.pts = tmppts; 3414 subOut.durationMS = tmpduration; 3415 3416 printf("subOut.data: %s\n", subOut.data); 3417 printf("subOut.pts: %lld\n", subOut.pts); 3418 printf("subOut.durationMS: %lld\n", subOut.durationMS); 3419 3420 3421 *data = (SubtitleOut_t*)&subOut; 3422 data = &subOut; 3423 3424 printf("data.durationMS: %lld\n", (void*)data->durationMS); 3425 3426 3427 //printf("data.data: %s\n", data->data); 3428 3429 printf("##########################\n"); 3430 3431 //printf("22subOut2.data: %s\n", subOut2.data); 3432 //printf("22ubOut2.data: %d\n", subOut2.data); 3433 */ 3270 } 3271 3272 3273 3274 3275 3276 3277 3278 // printf("[LIBEPLAYER3/container_ffmpeg_get_subtext] end\n"); 3279 3280 3434 3281 return cERR_CONTAINER_FFMPEG_NO_ERROR; 3435 3282 } 3283 //obi (end) 3436 3284 3437 3285 /* konfetti comment: I dont like the mechanism of overwriting … … 3510 3358 command != CONTAINER_GET_BUFFER_STATUS && 3511 3359 command != CONTAINER_STOP_BUFFER && 3512 3360 command != CONTAINER_GET_SUBTEXT && 3513 3361 command != CONTAINER_INIT && !avContextTab[0]) 3514 3362 { … … 3611 3459 case CONTAINER_GET_SUBTEXT: 3612 3460 { 3613 printf("[LIBEPLAYER3/Command] start\n");3614 3615 3461 ret = container_ffmpeg_get_subtext(context, (char **)argument); 3616 3462 3617 // ret = container_ffmpeg_get_subtext(context, (SubtitleOut_t **)argument); 3618 3619 // (SubtitleOut_t *)argument; 3620 // memset(&argument, 0, sizeof(argument)); 3621 3622 // ret = container_ffmpeg_get_subtext(context, SubtitleOut_t ** argument); 3623 3624 printf("[LIBEPLAYER3/Command] end\n"); 3625 // data = ostrcat(subtext, NULL, 0, 0); 3626 // (char **)argument = subtext; 3627 //argument = (void**)&subOut; 3628 3629 /* 3630 // SubtitleOutputDef_t* out = (SubtitleOutputDef_t*)argument; 3631 3632 //printf("333subOut.data: %s\n", subOut.dat 3633 3634 3635 // ret = container_ffmpeg_get_subtext(context, (SubtitleOut_t)argument); 3636 3637 SubtitleOut_t subOut; 3638 memset(&subOut, 0, sizeof(subOut)); 3639 subOut.trackId = tmptrackId; 3640 // subOut.data = (uint8_t *)packet.data; 3641 subOut.data = (uint8_t *)subtext; 3642 3643 subOut.pts = tmppts; 3644 subOut.durationMS = tmpduration; 3645 printf("##########################\n"); 3646 printf("subOut.data: %s\n", subOut.data); 3647 printf("subOut.pts: %lld\n", subOut.pts); 3648 printf("subOut.duration: %lld\n", subOut.durationMS); 3649 printf("##########################\n"); 3650 3651 ret = container_ffmpeg_get_subtext(context, (void*)&subOut); 3652 // *((SubtitleOut_t*)argument) = subOut; 3653 argument = (void*)&subOut; 3654 3655 3656 SubtitleOut_t argument; 3657 memset(&argument, 0, sizeof(argument)); 3658 argument.trackId = tmptrackId; 3659 // subOut.data = (uint8_t *)packet.data; 3660 argument.data = (uint8_t *)subtext; 3661 3662 argument.pts = tmppts; 3663 argument.durationMS = tmpduration; 3664 printf("##########################\n"); 3665 printf("argument.data: %s\n", argument.data); 3666 printf("argument.pts: %lld\n", argument.pts); 3667 printf("argument.duration: %lld\n", argument.durationMS); 3668 printf("##########################\n"); 3669 3670 ret = container_ffmpeg_get_subtext(context, (void**)&argument); 3671 // *((SubtitleOut_t*)argument) = subOut; 3672 //argument = (void**)&subOut; 3673 */ 3463 3674 3464 3675 3465 break; -
titan/libeplayer3/container/tools_ffmpeg.c
r40322 r41347 22 22 #define MINMALLOC 4096 23 23 #include <ctype.h> 24 25 char* ostrshrink(char* value) 26 { 27 int len = 0; 28 char* buf = NULL; 29 30 if(value == NULL) return NULL; 31 32 len = strlen(value); 33 if(len == 0) return value; 34 35 buf = malloc(len + 1); 36 if(buf == NULL) 37 return value; 38 39 memcpy(buf, value, len); 40 free(value); 41 buf[len] = '\0'; 42 43 return buf; 44 } 45 46 char* oitoa(int value) 47 { 48 char *buf = NULL; 49 50 buf = malloc(MINMALLOC); 51 if(buf == NULL) 52 { 53 err("no mem"); 54 return NULL; 55 } 56 57 sprintf(buf, "%d", value); 58 buf = ostrshrink(buf); 59 60 return buf; 61 } 62 63 char* olutoa(unsigned long value) 64 { 65 char *buf = NULL; 66 67 buf = malloc(MINMALLOC); 68 if(buf == NULL) 69 { 70 err("no mem"); 71 return NULL; 72 } 73 74 sprintf(buf, "%lu", value); 75 buf = ostrshrink(buf); 76 77 return buf; 78 } 79 80 char* ollutoa(uint64_t value) 81 { 82 char *buf = NULL; 83 84 buf = malloc(MINMALLOC); 85 if(buf == NULL) 86 { 87 err("no mem"); 88 return NULL; 89 } 90 91 sprintf(buf, "%llu", value); 92 buf = ostrshrink(buf); 93 94 return buf; 95 } 96 97 char* oitoa64(off64_t value) 98 { 99 char *buf = NULL; 100 101 buf = malloc(MINMALLOC); 102 if(buf == NULL) 103 { 104 err("no mem"); 105 return NULL; 106 } 107 108 sprintf(buf, "%lld", value); 109 buf = ostrshrink(buf); 110 111 return buf; 112 } 24 113 25 114 int file_exist(char* filename) -
titan/libeplayer3/include/container.h
r40322 r41347 24 24 CONTAINER_GET_BUFFER_SIZE, 25 25 CONTAINER_GET_BUFFER_STATUS, 26 CONTAINER_STOP_BUFFER 26 CONTAINER_STOP_BUFFER, 27 CONTAINER_GET_SUBTEXT 27 28 } ContainerCmd_t; 28 29 -
titan/libeplayer3/include/manager.h
r40322 r41347 28 28 char * Name; 29 29 char * Encoding; 30 char * File; 30 31 int32_t Id; 31 32 int32_t AVIdx; -
titan/titan/player.h
r41345 r41347 1268 1268 // if(ostrcmp(getconfig("av_ac3mode", NULL), "downmix") == 0) 1269 1269 #ifndef MIPSEL 1270 printf("status.downmix; %d\n", status.downmix); 1271 1272 1270 int tmpdownmix = 0; 1273 1271 char* downmix = readfiletomem(getconfig("ac3dev", NULL), 1); 1274 printf("ac3dev: %s\n",getconfig("ac3dev", NULL)); 1275 printf("downmix: %s\n",downmix); 1272 // printf("ac3dev: %s\n",getconfig("ac3dev", NULL)); 1273 debug(150, "ac3dev %s\n", getconfig("ac3dev", NULL)); 1274 1275 // printf("downmix: %s\n",downmix); 1276 debug(150, "downmix %s\n", downmix); 1277 1276 1278 if(ostrcmp(downmix, "passthrough") == 0) 1277 status.downmix = 0;1279 tmpdownmix = 0; 1278 1280 else 1279 status.downmix = 1; 1280 1281 printf("status.downmix: %d\n",status.downmix); 1282 sleep(5); 1283 if(status.downmix == 1) 1281 tmpdownmix = 1; 1282 1283 free(downmix), downmix == NULL; 1284 if(tmpdownmix != status.downmix) 1285 debug(150, "change downmix %d to %d\n", status.downmix, tmpdownmix); 1286 1287 1288 // printf("status.downmix: %d\n",status.downmix); 1289 debug(150, "status.downmix %d\n", status.downmix); 1290 1291 if(tmpdownmix == 1) 1284 1292 { 1293 debug(150, "enable dts downmix\n"); 1285 1294 dts_software_decoder_set(1); 1286 1295 stereo_software_decoder_set(1); … … 3671 3680 player->container->selectedContainer->Command(player, CONTAINER_GET_SUBTEXT, (void*)&tmpstr); 3672 3681 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); 3682 char* duration = oregex(".*duration=(.*);pts=.*", tmpstr); 3683 // printf("[TITAN/getsubtext] duration %s\n", duration); 3684 debug(150, "duration %s\n", duration); 3685 3686 if(duration != NULL) 3687 { 3688 // printf("[TITAN/getsubtext] duration %d\n", atoi(duration)); 3689 debug(150, "duration %d\n", atoi(duration)); 3690 duration_ms = atoi(duration); 3691 } 3692 3693 char* pts = oregex(".*;pts=(.*);trackid=.*", tmpstr); 3694 // printf("[TITAN/getsubtext] pts %s\n", pts); 3695 debug(150, "pts %s\n", pts); 3696 3697 if(pts != NULL) 3698 printf("[TITAN/getsubtext] pts %d\n", atoi(pts)); 3699 3700 char* trackid = oregex(".*;trackid=(.*);trackid=.*", tmpstr); 3701 // printf("[TITAN/getsubtext] trackid %s\n", trackid); 3702 debug(150, "trackid %s\n", trackid); 3703 3704 if(trackid != NULL) 3705 printf("[TITAN/getsubtext] trackid %d\n", atoi(trackid)); 3706 3707 subtext = oregex(".*;subtext=(.*).*", tmpstr); 3708 printf("[TITAN/getsubtext] subtext %s\n", subtext); 3697 3709 3698 3710 if(subtitlethread == NULL) … … 3700 3712 3701 3713 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 3714 return subtext; 3798 3715 }
Note: See TracChangeset
for help on using the changeset viewer.