316
316
#warning "Calculate PTS from picture header!"
318
318
c = stream_read_char(demux->stream);
319
printf("packet 0x82(pos=%u) chunk=%x\n",
319
mp_msg(MSGT_DEMUX, MSGL_V, "packet 0x82(pos=%u) chunk=%x\n",
320
320
(int)stream_tell(demux->stream), c);
325
325
len=stream_read_char(demux->stream);
326
326
if(len>=0x80) len=0x80*(len-0x80)+stream_read_char(demux->stream);
327
printf("vivo extra header: %d bytes\n",len);
327
mp_msg(MSGT_DEMUX, MSGL_V, "vivo extra header: %d bytes\n",len);
328
328
#ifdef TEXTPARSE_ALL
466
466
/* picture header */
467
467
if (get_bits(&s->gb, 22) != 0x20){
468
printf("bad picture header\n");
468
mp_msg(MSGT_DEMUX, MSGL_FATAL, "bad picture header\n");
471
471
skip_bits(&s->gb, 8); /* picture timestamp */
473
473
if (get_bits1(&s->gb) != 1){
474
printf("bad marker\n");
474
mp_msg(MSGT_DEMUX, MSGL_FATAL, "bad marker\n");
475
475
return -1; /* marker */
477
477
if (get_bits1(&s->gb) != 0){
478
printf("bad h263 id\n");
478
mp_msg(MSGT_DEMUX, MSGL_FATAL, "bad h263 id\n");
479
479
return -1; /* h263 id */
481
481
skip_bits1(&s->gb); /* split screen off */
485
485
format = get_bits(&s->gb, 3);
487
487
if (format != 7) {
488
printf("h263_plus = 0 format = %d\n",format);
488
mp_msg(MSGT_DEMUX, MSGL_V, "h263_plus = 0 format = %d\n", format);
490
490
width = h263_format[format][0];
491
491
height = h263_format[format][1];
492
printf("%d x %d\n",width,height);
492
mp_msg(MSGT_DEMUX, MSGL_V, "%d x %d\n", width, height);
493
493
// if (!width) return -1;
495
printf("pict_type=%d\n",get_bits1(&s->gb));
496
printf("unrestricted_mv=%d\n",get_bits1(&s->gb));
495
mp_msg(MSGT_DEMUX, MSGL_V, "pict_type=%d\n", get_bits1(&s->gb));
496
mp_msg(MSGT_DEMUX, MSGL_V, "unrestricted_mv=%d\n", get_bits1(&s->gb));
498
printf("SAC: %d\n",get_bits1(&s->gb));
499
printf("advanced prediction mode: %d\n",get_bits1(&s->gb));
500
printf("PB frame: %d\n",get_bits1(&s->gb));
498
mp_msg(MSGT_DEMUX, MSGL_V, "SAC: %d\n", get_bits1(&s->gb));
499
mp_msg(MSGT_DEMUX, MSGL_V, "advanced prediction mode: %d\n", get_bits1(&s->gb));
500
mp_msg(MSGT_DEMUX, MSGL_V, "PB frame: %d\n", get_bits1(&s->gb));
502
502
if (get_bits1(&s->gb) != 0)
503
503
return -1; /* SAC: off */
506
506
if (get_bits1(&s->gb) != 0)
507
507
return -1; /* not PB frame */
509
printf("qscale=%d\n",get_bits(&s->gb, 5));
509
mp_msg(MSGT_DEMUX, MSGL_V, "qscale=%d\n", get_bits(&s->gb, 5));
510
510
skip_bits1(&s->gb); /* Continuous Presence Multipoint mode: off */
512
printf("h263_plus = 1\n");
512
mp_msg(MSGT_DEMUX, MSGL_V, "h263_plus = 1\n");
514
514
if (get_bits(&s->gb, 3) != 1){
515
printf("H.263v2 A error\n");
515
mp_msg(MSGT_DEMUX, MSGL_FATAL, "H.263v2 A error\n");
518
518
if (get_bits(&s->gb, 3) != 6){ /* custom source format */
519
printf("custom source format\n");
519
mp_msg(MSGT_DEMUX, MSGL_FATAL, "custom source format\n");
522
522
skip_bits(&s->gb, 12);
523
523
skip_bits(&s->gb, 3);
524
printf("pict_type=%d\n",get_bits(&s->gb, 3) + 1);
524
mp_msg(MSGT_DEMUX, MSGL_V, "pict_type=%d\n", get_bits(&s->gb, 3) + 1);
525
525
// if (s->pict_type != I_TYPE &&
526
526
// s->pict_type != P_TYPE)
530
530
width = (get_bits(&s->gb, 9) + 1) * 4;
531
531
skip_bits1(&s->gb);
532
532
height = get_bits(&s->gb, 9) * 4;
533
printf("%d x %d\n",width,height);
533
mp_msg(MSGT_DEMUX, MSGL_V, "%d x %d\n", width, height);
534
534
//if (height == 0)
536
printf("qscale=%d\n",get_bits(&s->gb, 5));
536
mp_msg(MSGT_DEMUX, MSGL_V, "qscale=%d\n", get_bits(&s->gb, 5));
627
627
/* disable seeking */
628
628
demuxer->seekable = 0;
630
mp_msg(MSGT_DEMUX,MSGL_STATUS,"VIVO Video stream %d size: display: %dx%d, codec: %ux%u\n",
630
mp_msg(MSGT_DEMUX,MSGL_V,"VIVO Video stream %d size: display: %dx%d, codec: %ux%u\n",
631
631
demuxer->video->id, sh->disp_w, sh->disp_h, sh->bih->biWidth,
632
632
sh->bih->biHeight);