annotate loader/dshow/test.c @ 25868:c36c43253806

Fix compilation failure because bitfile was undefined: In file included from decoder.c:36: mp4.h:46: error: expected ')' before '*' token
author diego
date Mon, 28 Jan 2008 01:31:39 +0000
parents 3ba165446c8a
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
169
550ebe869cec Added C-C++ interface in DS_VideoDec.h
arpi_esp
parents:
diff changeset
1 #include <stdio.h>
550ebe869cec Added C-C++ interface in DS_VideoDec.h
arpi_esp
parents:
diff changeset
2 #include <stdlib.h>
25584
3ba165446c8a Fix warnings:
diego
parents: 25583
diff changeset
3 #include <string.h>
169
550ebe869cec Added C-C++ interface in DS_VideoDec.h
arpi_esp
parents:
diff changeset
4
25583
49c3148ef5c3 Add missing #includes to fix compilation:
diego
parents: 18878
diff changeset
5 #include "wine/mmreg.h"
49c3148ef5c3 Add missing #includes to fix compilation:
diego
parents: 18878
diff changeset
6 #include "wine/vfw.h"
49c3148ef5c3 Add missing #includes to fix compilation:
diego
parents: 18878
diff changeset
7
169
550ebe869cec Added C-C++ interface in DS_VideoDec.h
arpi_esp
parents:
diff changeset
8 #include "formats.h"
550ebe869cec Added C-C++ interface in DS_VideoDec.h
arpi_esp
parents:
diff changeset
9 #include "com.h"
550ebe869cec Added C-C++ interface in DS_VideoDec.h
arpi_esp
parents:
diff changeset
10
550ebe869cec Added C-C++ interface in DS_VideoDec.h
arpi_esp
parents:
diff changeset
11 #include "DS_VideoDec.h"
550ebe869cec Added C-C++ interface in DS_VideoDec.h
arpi_esp
parents:
diff changeset
12
550ebe869cec Added C-C++ interface in DS_VideoDec.h
arpi_esp
parents:
diff changeset
13 int main(int argc,char* argv[]){
550ebe869cec Added C-C++ interface in DS_VideoDec.h
arpi_esp
parents:
diff changeset
14 FILE *f;
550ebe869cec Added C-C++ interface in DS_VideoDec.h
arpi_esp
parents:
diff changeset
15 BITMAPINFOHEADER bih;
550ebe869cec Added C-C++ interface in DS_VideoDec.h
arpi_esp
parents:
diff changeset
16 int len;
550ebe869cec Added C-C++ interface in DS_VideoDec.h
arpi_esp
parents:
diff changeset
17 char *src;
550ebe869cec Added C-C++ interface in DS_VideoDec.h
arpi_esp
parents:
diff changeset
18 char *dst=0;
550ebe869cec Added C-C++ interface in DS_VideoDec.h
arpi_esp
parents:
diff changeset
19 GUID CLSID_DivxDecompressorCF={0x82CCd3E0, 0xF71A, 0x11D0,
550ebe869cec Added C-C++ interface in DS_VideoDec.h
arpi_esp
parents:
diff changeset
20 { 0x9f, 0xe5, 0x00, 0x60, 0x97, 0x78, 0xaa, 0xaa}};
550ebe869cec Added C-C++ interface in DS_VideoDec.h
arpi_esp
parents:
diff changeset
21
550ebe869cec Added C-C++ interface in DS_VideoDec.h
arpi_esp
parents:
diff changeset
22 f=fopen("test.divx","rb");
550ebe869cec Added C-C++ interface in DS_VideoDec.h
arpi_esp
parents:
diff changeset
23
550ebe869cec Added C-C++ interface in DS_VideoDec.h
arpi_esp
parents:
diff changeset
24 fread(&bih,sizeof(BITMAPINFOHEADER),1,f);
170
a4d3c83eeb52 small cosmetic to avoid gcc warnings
arpi_esp
parents: 169
diff changeset
25 printf("frame dim: %d x %d \n",(int)bih.biWidth,(int)bih.biHeight);
169
550ebe869cec Added C-C++ interface in DS_VideoDec.h
arpi_esp
parents:
diff changeset
26
18878
3bf0d70b4c7f rm unnecesary casts from void* - part 2
reynaldo
parents: 184
diff changeset
27 src=malloc(512000);
169
550ebe869cec Added C-C++ interface in DS_VideoDec.h
arpi_esp
parents:
diff changeset
28 len=fread(src,1,512000,f);
550ebe869cec Added C-C++ interface in DS_VideoDec.h
arpi_esp
parents:
diff changeset
29 printf("frame len = %d\n",len);
550ebe869cec Added C-C++ interface in DS_VideoDec.h
arpi_esp
parents:
diff changeset
30
550ebe869cec Added C-C++ interface in DS_VideoDec.h
arpi_esp
parents:
diff changeset
31 DS_VideoDecoder_Open("divx_c32.ax", &CLSID_DivxDecompressorCF, &bih, 0, &dst);
550ebe869cec Added C-C++ interface in DS_VideoDec.h
arpi_esp
parents:
diff changeset
32
550ebe869cec Added C-C++ interface in DS_VideoDec.h
arpi_esp
parents:
diff changeset
33 // DS_VideoDecoder_SetDestFmt(16,fccYUY2);
550ebe869cec Added C-C++ interface in DS_VideoDec.h
arpi_esp
parents:
diff changeset
34 DS_VideoDecoder_SetDestFmt(24,0);
550ebe869cec Added C-C++ interface in DS_VideoDec.h
arpi_esp
parents:
diff changeset
35
184
385a68be7494 fixed Quality setting
arpi_esp
parents: 170
diff changeset
36 printf("DivX setting result = %d\n", DS_SetAttr_DivX("Quality",4) );
385a68be7494 fixed Quality setting
arpi_esp
parents: 170
diff changeset
37
169
550ebe869cec Added C-C++ interface in DS_VideoDec.h
arpi_esp
parents:
diff changeset
38 DS_VideoDecoder_Start();
550ebe869cec Added C-C++ interface in DS_VideoDec.h
arpi_esp
parents:
diff changeset
39
550ebe869cec Added C-C++ interface in DS_VideoDec.h
arpi_esp
parents:
diff changeset
40 printf("DivX setting result = %d\n", DS_SetValue_DivX("Brightness",60) );
550ebe869cec Added C-C++ interface in DS_VideoDec.h
arpi_esp
parents:
diff changeset
41
550ebe869cec Added C-C++ interface in DS_VideoDec.h
arpi_esp
parents:
diff changeset
42 DS_VideoDecoder_DecodeFrame(src, len, 1, 1);
550ebe869cec Added C-C++ interface in DS_VideoDec.h
arpi_esp
parents:
diff changeset
43
550ebe869cec Added C-C++ interface in DS_VideoDec.h
arpi_esp
parents:
diff changeset
44 #if 0
550ebe869cec Added C-C++ interface in DS_VideoDec.h
arpi_esp
parents:
diff changeset
45 f2=fopen("test.yuy2","wb");
550ebe869cec Added C-C++ interface in DS_VideoDec.h
arpi_esp
parents:
diff changeset
46 fwrite(dst,bih.biWidth*bih.biHeight*2,1,f2);
550ebe869cec Added C-C++ interface in DS_VideoDec.h
arpi_esp
parents:
diff changeset
47 fclose(f2);
550ebe869cec Added C-C++ interface in DS_VideoDec.h
arpi_esp
parents:
diff changeset
48 #endif
550ebe869cec Added C-C++ interface in DS_VideoDec.h
arpi_esp
parents:
diff changeset
49
550ebe869cec Added C-C++ interface in DS_VideoDec.h
arpi_esp
parents:
diff changeset
50 { unsigned char raw_head[32];
550ebe869cec Added C-C++ interface in DS_VideoDec.h
arpi_esp
parents:
diff changeset
51 FILE *f=fopen("test.raw","wb");
550ebe869cec Added C-C++ interface in DS_VideoDec.h
arpi_esp
parents:
diff changeset
52
550ebe869cec Added C-C++ interface in DS_VideoDec.h
arpi_esp
parents:
diff changeset
53 strcpy((char*)raw_head,"mhwanh");
550ebe869cec Added C-C++ interface in DS_VideoDec.h
arpi_esp
parents:
diff changeset
54 raw_head[7]=4;
550ebe869cec Added C-C++ interface in DS_VideoDec.h
arpi_esp
parents:
diff changeset
55 raw_head[8]=bih.biWidth>>8;
550ebe869cec Added C-C++ interface in DS_VideoDec.h
arpi_esp
parents:
diff changeset
56 raw_head[9]=bih.biWidth&0xFF;
550ebe869cec Added C-C++ interface in DS_VideoDec.h
arpi_esp
parents:
diff changeset
57 raw_head[10]=bih.biHeight>>8;
550ebe869cec Added C-C++ interface in DS_VideoDec.h
arpi_esp
parents:
diff changeset
58 raw_head[11]=bih.biHeight&0xFF;
550ebe869cec Added C-C++ interface in DS_VideoDec.h
arpi_esp
parents:
diff changeset
59 raw_head[12]=raw_head[13]=0; // 24bit
550ebe869cec Added C-C++ interface in DS_VideoDec.h
arpi_esp
parents:
diff changeset
60 raw_head[14]=1;raw_head[15]=0x2C;
550ebe869cec Added C-C++ interface in DS_VideoDec.h
arpi_esp
parents:
diff changeset
61 raw_head[16]=1;raw_head[17]=0x2C;
550ebe869cec Added C-C++ interface in DS_VideoDec.h
arpi_esp
parents:
diff changeset
62 memset(raw_head+18,0,32-18);
550ebe869cec Added C-C++ interface in DS_VideoDec.h
arpi_esp
parents:
diff changeset
63 fwrite(raw_head,32,1,f);
550ebe869cec Added C-C++ interface in DS_VideoDec.h
arpi_esp
parents:
diff changeset
64
550ebe869cec Added C-C++ interface in DS_VideoDec.h
arpi_esp
parents:
diff changeset
65 fwrite(dst,bih.biWidth*bih.biHeight*3,1,f);
550ebe869cec Added C-C++ interface in DS_VideoDec.h
arpi_esp
parents:
diff changeset
66 fclose(f);
550ebe869cec Added C-C++ interface in DS_VideoDec.h
arpi_esp
parents:
diff changeset
67 }
550ebe869cec Added C-C++ interface in DS_VideoDec.h
arpi_esp
parents:
diff changeset
68
550ebe869cec Added C-C++ interface in DS_VideoDec.h
arpi_esp
parents:
diff changeset
69
550ebe869cec Added C-C++ interface in DS_VideoDec.h
arpi_esp
parents:
diff changeset
70 return 0;
550ebe869cec Added C-C++ interface in DS_VideoDec.h
arpi_esp
parents:
diff changeset
71 }