fixed a (wn32 avi) codec issue when adding an Empty scene.

added ttc and otc to the list of font extensions.
This commit is contained in:
2003-05-11 15:44:23 +00:00
parent a204816f3f
commit fe05ca64f2
7 changed files with 33 additions and 23 deletions

View File

@@ -157,6 +157,11 @@ Scene *add_scene(char *name)
sce->r.freqplay= 60; sce->r.freqplay= 60;
sce->r.depth= 32; sce->r.depth= 32;
if (sce->r.avicodecdata) {
printf("this is not good\n");
}
// sce->r.imtype= R_TARGA;
sce->r.stereomode = 1; // no stereo sce->r.stereomode = 1; // no stereo
strcpy(sce->r.backbuf, "//backbuf"); strcpy(sce->r.backbuf, "//backbuf");

View File

@@ -40,7 +40,5 @@ void append_avi_codec(int frame);
void end_avi_codec(void); void end_avi_codec(void);
int get_avicodec_settings(void); int get_avicodec_settings(void);
extern int have_avicodec;
extern char avicdname[128];
#endif #endif

View File

@@ -77,6 +77,8 @@ typedef struct AviCodecData {
unsigned int dwFlags; /* flags... see below */ unsigned int dwFlags; /* flags... see below */
unsigned int dwInterleaveEvery; /* for non-video streams only */ unsigned int dwInterleaveEvery; /* for non-video streams only */
unsigned int pad; unsigned int pad;
char avicodecname[128];
} AviCodecData; } AviCodecData;
typedef struct RenderData { typedef struct RenderData {

View File

@@ -6600,10 +6600,10 @@ void renderbuts(void)
#endif /* WITH_QUICKTIME */ #endif /* WITH_QUICKTIME */
} else { } else {
#ifdef _WIN32 #ifdef _WIN32
if(!have_avicodec) if(G.scene->r.avicodecdata->avicodecname[0] == NULL)
uiDefBut(block, LABEL, 0, "Codec: not set.", 892,yofs+42,225,20, 0, 0, 0, 0, 0, ""); uiDefBut(block, LABEL, 0, "Codec: not set.", 892,yofs+42,225,20, 0, 0, 0, 0, 0, "");
else else
uiDefBut(block, LABEL, 0, avicdname, 892,yofs+42,225,20, 0, 0, 0, 0, 0, ""); uiDefBut(block, LABEL, 0, G.scene->r.avicodecdata->avicodecname, 892,yofs+42,225,20, 0, 0, 0, 0, 0, "");
#endif #endif
uiDefBut(block, BUT,B_SELECTCODEC, "Set codec", 892,yofs,112,20, 0, 0, 0, 0, 0, "Set codec settings for AVI"); uiDefBut(block, BUT,B_SELECTCODEC, "Set codec", 892,yofs,112,20, 0, 0, 0, 0, 0, "Set codec settings for AVI");
} }

View File

@@ -516,7 +516,9 @@ void test_flags_file(SpaceFile *sfile)
if(BLI_testextensie(file->relname, ".py")) { if(BLI_testextensie(file->relname, ".py")) {
file->flags |= PYSCRIPTFILE; file->flags |= PYSCRIPTFILE;
} else if( BLI_testextensie(file->relname, ".ttf") } else if( BLI_testextensie(file->relname, ".ttf")
|| BLI_testextensie(file->relname, ".ttc")
|| BLI_testextensie(file->relname, ".pfb") || BLI_testextensie(file->relname, ".pfb")
|| BLI_testextensie(file->relname, ".otf")
|| BLI_testextensie(file->relname, ".otc")) { || BLI_testextensie(file->relname, ".otc")) {
file->flags |= FTFONTFILE; file->flags |= FTFONTFILE;
} else if (G.have_quicktime){ } else if (G.have_quicktime){

View File

@@ -2111,7 +2111,6 @@ Scene *copy_scene(Scene *sce, int level)
scen->r.avicodecdata->lpFormat = MEM_dupallocN(scen->r.avicodecdata->lpFormat); scen->r.avicodecdata->lpFormat = MEM_dupallocN(scen->r.avicodecdata->lpFormat);
scen->r.avicodecdata->lpParms = MEM_dupallocN(scen->r.avicodecdata->lpParms); scen->r.avicodecdata->lpParms = MEM_dupallocN(scen->r.avicodecdata->lpParms);
} }
return scen; return scen;
@@ -2204,6 +2203,13 @@ void do_info_buttons(unsigned short event)
if(nr==1) { if(nr==1) {
sce= add_scene(G.scene->id.name+2); sce= add_scene(G.scene->id.name+2);
sce->r= G.scene->r; sce->r= G.scene->r;
#ifdef _WIN32
if (sce->r.avicodecdata) {
sce->r.avicodecdata = MEM_dupallocN(G.scene->r.avicodecdata);
sce->r.avicodecdata->lpFormat = MEM_dupallocN(G.scene->r.avicodecdata->lpFormat);
sce->r.avicodecdata->lpParms = MEM_dupallocN(G.scene->r.avicodecdata->lpParms);
}
#endif
} }
else sce= copy_scene(G.scene, nr-2); else sce= copy_scene(G.scene, nr-2);

View File

@@ -64,8 +64,6 @@
// the output video stream // the output video stream
AVICOMPRESSOPTIONS opts; AVICOMPRESSOPTIONS opts;
char avicdname[128];
int have_avicodec= 0;
static int sframe; static int sframe;
static PAVIFILE pfile = NULL; static PAVIFILE pfile = NULL;
@@ -510,6 +508,9 @@ static void init_bmi(BITMAPINFOHEADER *bmi)
static void opts_to_acd(AviCodecData *acd) static void opts_to_acd(AviCodecData *acd)
{ {
HIC hic;
ICINFO icinfo;
acd->fccType = opts.fccType; acd->fccType = opts.fccType;
acd->fccHandler = opts.fccHandler; acd->fccHandler = opts.fccHandler;
acd->dwKeyFrameEvery = opts.dwKeyFrameEvery; acd->dwKeyFrameEvery = opts.dwKeyFrameEvery;
@@ -529,6 +530,18 @@ static void opts_to_acd(AviCodecData *acd)
acd->lpParms = MEM_mallocN(opts.cbParms, "avi.lpParms"); acd->lpParms = MEM_mallocN(opts.cbParms, "avi.lpParms");
memcpy(acd->lpParms, opts.lpParms, opts.cbParms); memcpy(acd->lpParms, opts.lpParms, opts.cbParms);
} }
if ((hic=ICOpen(ICTYPE_VIDEO,acd->fccHandler,ICMODE_QUERY))!=NULL) {
icinfo.dwSize=sizeof(ICINFO);
if (ICGetInfo(hic,&icinfo,sizeof(ICINFO))) {
WideCharToMultiByte(CP_ACP,0,icinfo.szDescription,-1,acd->avicodecname,128,NULL,NULL);
} else
sprintf(acd->avicodecname, "undefined");
if (ICClose(hic)!=ICERR_OK)
;// return 0;
} else {
sprintf(acd->avicodecname, "Full Frames (Uncompressed)"); //heh, nasty
}
} }
@@ -769,8 +782,6 @@ int get_avicodec_settings(void)
AVICOMPRESSOPTIONS *aopts[1] = {&opts}; AVICOMPRESSOPTIONS *aopts[1] = {&opts};
AviCodecData *acd = G.scene->r.avicodecdata; AviCodecData *acd = G.scene->r.avicodecdata;
static PAVISTREAM psdummy; static PAVISTREAM psdummy;
HIC hic;
ICINFO icinfo;
acd_to_opts(G.scene->r.avicodecdata); acd_to_opts(G.scene->r.avicodecdata);
@@ -788,20 +799,6 @@ int get_avicodec_settings(void)
{ {
ret_val = 1; ret_val = 1;
} else { } else {
have_avicodec = 1;
if ((hic=ICOpen(ICTYPE_VIDEO,opts.fccHandler,ICMODE_QUERY))!=NULL) {
icinfo.dwSize=sizeof(ICINFO);
if (ICGetInfo(hic,&icinfo,sizeof(ICINFO))) {
WideCharToMultiByte(CP_ACP,0,icinfo.szDescription,-1,avicdname,128,NULL,NULL);
} else
sprintf(avicdname, "undefined");
if (ICClose(hic)!=ICERR_OK)
return 0;
} else {
sprintf(avicdname, "Full Frames (Uncompressed)"); //heh, nasty
}
if (acd) { if (acd) {
free_avicodecdata(acd); free_avicodecdata(acd);
} else { } else {