~ubuntu-dev/mplayer/ubuntu-feisty

« back to all changes in this revision

Viewing changes to libmpdemux/demux_viv.c

  • Committer: William Grant
  • Date: 2007-02-03 03:16:07 UTC
  • mto: This revision was merged to the branch mainline in revision 16.
  • Revision ID: william.grant@ubuntu.org.au-20070203031607-08gc2ompbz6spt9i
Update to 1.0rc1.

Show diffs side-by-side

added added

removed removed

Lines of Context:
316
316
#warning "Calculate PTS from picture header!"
317
317
      prefix = 1;
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);
321
321
  }
322
322
  switch(c&0xF0){
324
324
  {
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
329
329
{
330
330
      int pos;
465
465
 
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");
469
469
        return -1;
470
470
    }
471
471
    skip_bits(&s->gb, 8); /* picture timestamp */
472
472
 
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 */
476
476
    }
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 */
480
480
    }
481
481
    skip_bits1(&s->gb); /* split screen off */
485
485
    format = get_bits(&s->gb, 3);
486
486
 
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);
489
489
        /* H.263v1 */
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;
494
494
 
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));
497
497
#if 1
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));
501
501
#else
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 */
508
508
#endif
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 */
511
511
    } else {
512
 
        printf("h263_plus = 1\n");
 
512
        mp_msg(MSGT_DEMUX, MSGL_V, "h263_plus = 1\n");
513
513
        /* H.263v2 */
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");
516
516
            return -1;
517
517
        }
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");
520
520
            return -1;
521
521
        }
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)
527
527
//            return -1;
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)
535
535
        //    return -1;
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));
537
537
    }
538
538
 
539
539
    /* PEI */
627
627
                /* disable seeking */
628
628
                demuxer->seekable = 0;
629
629
 
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);
633
633
}
663
663
                {
664
664
                    mp_msg(MSGT_DEMUX, MSGL_ERR, "VIVO: Not support audio codec (%d)\n",
665
665
                        priv->audio_codec);
666
 
                    free_sh_audio(sh);
 
666
                    free_sh_audio(demuxer, 1);
667
667
                    goto nosound;
668
668
                }
669
669