Mercurial > mplayer.hg
comparison mencoder.c @ 3480:9943dbacb48e
vcodec_raw added
author | alex |
---|---|
date | Thu, 13 Dec 2001 17:50:19 +0000 |
parents | 6975a75a47fb |
children | 21fc87d76300 |
comparison
equal
deleted
inserted
replaced
3479:2704448de713 | 3480:9943dbacb48e |
---|---|
1 #define VCODEC_COPY 0 | 1 #define VCODEC_COPY 0 |
2 #define VCODEC_FRAMENO 1 | 2 #define VCODEC_FRAMENO 1 |
3 #define VCODEC_DIVX4 2 | 3 #define VCODEC_DIVX4 2 |
4 #define VCODEC_RAW 3 | |
4 | 5 |
5 #define ACODEC_COPY 0 | 6 #define ACODEC_COPY 0 |
6 #define ACODEC_PCM 1 | 7 #define ACODEC_PCM 1 |
7 #define ACODEC_VBRMP3 2 | 8 #define ACODEC_VBRMP3 2 |
8 | 9 |
523 } | 524 } |
524 printf("videocodec: framecopy (%dx%d %dbpp fourcc=%x)\n", | 525 printf("videocodec: framecopy (%dx%d %dbpp fourcc=%x)\n", |
525 mux_v->bih->biWidth, mux_v->bih->biHeight, | 526 mux_v->bih->biWidth, mux_v->bih->biHeight, |
526 mux_v->bih->biBitCount, mux_v->bih->biCompression); | 527 mux_v->bih->biBitCount, mux_v->bih->biCompression); |
527 break; | 528 break; |
529 case VCODEC_RAW: | |
530 printf("sh_video->bih: %x\n", sh_video->bih); | |
531 if (sh_video->bih) | |
532 mux_v->bih=sh_video->bih; | |
533 else | |
534 { | |
535 mux_v->bih=malloc(sizeof(BITMAPINFOHEADER)); | |
536 mux_v->bih->biSize=sizeof(BITMAPINFOHEADER); | |
537 mux_v->bih->biWidth=sh_video->disp_w; | |
538 mux_v->bih->biHeight=sh_video->disp_h; | |
539 mux_v->bih->biCompression=0; | |
540 mux_v->bih->biPlanes=1; | |
541 mux_v->bih->biBitCount=24; // FIXME!!! | |
542 mux_v->bih->biSizeImage=mux_v->bih->biWidth*mux_v->bih->biHeight*(mux_v->bih->biBitCount/8); | |
543 } | |
544 mux_v->bih->biCompression=0; | |
545 printf("videocodec: raw (%dx%d %dbpp fourcc=%x)\n", | |
546 mux_v->bih->biWidth, mux_v->bih->biHeight, | |
547 mux_v->bih->biBitCount, mux_v->bih->biCompression); | |
548 break; | |
528 case VCODEC_FRAMENO: | 549 case VCODEC_FRAMENO: |
529 mux_v->bih=malloc(sizeof(BITMAPINFOHEADER)); | 550 mux_v->bih=malloc(sizeof(BITMAPINFOHEADER)); |
530 mux_v->bih->biSize=sizeof(BITMAPINFOHEADER); | 551 mux_v->bih->biSize=sizeof(BITMAPINFOHEADER); |
531 mux_v->bih->biWidth=vo_w; | 552 mux_v->bih->biWidth=vo_w; |
532 mux_v->bih->biHeight=vo_h; | 553 mux_v->bih->biHeight=vo_h; |
576 mux_a->wf->nBlockAlign = mux_a->h.dwSampleSize; | 597 mux_a->wf->nBlockAlign = mux_a->h.dwSampleSize; |
577 mux_a->wf->wFormatTag = sh_audio->sample_format; | 598 mux_a->wf->wFormatTag = sh_audio->sample_format; |
578 mux_a->wf->nChannels = sh_audio->channels; | 599 mux_a->wf->nChannels = sh_audio->channels; |
579 mux_a->wf->nSamplesPerSec = sh_audio->samplerate; | 600 mux_a->wf->nSamplesPerSec = sh_audio->samplerate; |
580 mux_a->wf->nAvgBytesPerSec=mux_a->h.dwSampleSize*mux_a->wf->nSamplesPerSec; | 601 mux_a->wf->nAvgBytesPerSec=mux_a->h.dwSampleSize*mux_a->wf->nSamplesPerSec; |
581 mux_a->wf->wBitsPerSample = 16; | 602 mux_a->wf->wBitsPerSample = 16; // FIXME |
582 mux_a->wf->cbSize=0; // FIXME for l3codeca.acm | 603 mux_a->wf->cbSize=0; // FIXME for l3codeca.acm |
583 } | 604 } |
584 printf("audiocodec: framecopy (format=%x chans=%d rate=%d bits=%d)\n", | 605 printf("audiocodec: framecopy (format=%x chans=%d rate=%d bits=%d)\n", |
585 mux_a->wf->wFormatTag, mux_a->wf->nChannels, mux_a->wf->nSamplesPerSec, | 606 mux_a->wf->wFormatTag, mux_a->wf->nChannels, mux_a->wf->nSamplesPerSec, |
586 mux_a->wf->wBitsPerSample); | 607 mux_a->wf->wBitsPerSample); |
626 printf("Writing AVI header...\n"); | 647 printf("Writing AVI header...\n"); |
627 aviwrite_write_header(muxer,muxer_f); | 648 aviwrite_write_header(muxer,muxer_f); |
628 | 649 |
629 switch(mux_v->codec){ | 650 switch(mux_v->codec){ |
630 case VCODEC_COPY: | 651 case VCODEC_COPY: |
652 case VCODEC_RAW: | |
631 break; | 653 break; |
632 case VCODEC_FRAMENO: | 654 case VCODEC_FRAMENO: |
633 decoded_frameno=0; | 655 decoded_frameno=0; |
634 break; | 656 break; |
635 case VCODEC_DIVX4: | 657 case VCODEC_DIVX4: |
830 switch(mux_v->codec){ | 852 switch(mux_v->codec){ |
831 case VCODEC_COPY: | 853 case VCODEC_COPY: |
832 mux_v->buffer=start; | 854 mux_v->buffer=start; |
833 if(skip_flag<=0) aviwrite_write_chunk(muxer,mux_v,muxer_f,in_size,(sh_video->ds->flags&1)?0x10:0); | 855 if(skip_flag<=0) aviwrite_write_chunk(muxer,mux_v,muxer_f,in_size,(sh_video->ds->flags&1)?0x10:0); |
834 break; | 856 break; |
857 case VCODEC_RAW: | |
858 blit_frame=decode_video(&video_out,sh_video,start,in_size,0); | |
859 if(skip_flag>0) break; | |
860 if(!blit_frame){ | |
861 // empty. | |
862 aviwrite_write_chunk(muxer,mux_v,muxer_f,0,0); | |
863 break; | |
864 } | |
865 mux_v->buffer = vo_image_ptr; | |
866 aviwrite_write_chunk(muxer,mux_v,muxer_f,mux_v->buffer_size,0x10); | |
867 break; | |
835 case VCODEC_FRAMENO: | 868 case VCODEC_FRAMENO: |
836 mux_v->buffer=&decoded_frameno; // tricky | 869 mux_v->buffer=&decoded_frameno; // tricky |
837 if(skip_flag<=0) aviwrite_write_chunk(muxer,mux_v,muxer_f,sizeof(int),0x10); | 870 if(skip_flag<=0) aviwrite_write_chunk(muxer,mux_v,muxer_f,sizeof(int),0x10); |
838 break; | 871 break; |
839 case VCODEC_DIVX4: | 872 case VCODEC_DIVX4: |