comparison libmpcodecs/dec_video.c @ 7180:28677d779205

-afm/-vfm migration from ID (int) to NAME (string) - simplifies code and makes dlopen()'ing possible
author arpi
date Fri, 30 Aug 2002 21:44:20 +0000
parents eca7dbad0166
children 1eadce15446c
comparison
equal deleted inserted replaced
7179:a258b9b7669e 7180:28677d779205
132 return 0; 132 return 0;
133 } 133 }
134 134
135 void uninit_video(sh_video_t *sh_video){ 135 void uninit_video(sh_video_t *sh_video){
136 if(!sh_video->inited) return; 136 if(!sh_video->inited) return;
137 mp_msg(MSGT_DECVIDEO,MSGL_V,MSGTR_UninitVideo,sh_video->codec->driver); 137 mp_msg(MSGT_DECVIDEO,MSGL_V,MSGTR_UninitVideoStr,sh_video->codec->drv);
138 mpvdec->uninit(sh_video); 138 mpvdec->uninit(sh_video);
139 vf_uninit_filter_chain(sh_video->vfilter); 139 vf_uninit_filter_chain(sh_video->vfilter);
140 sh_video->inited=0; 140 sh_video->inited=0;
141 } 141 }
142 142
143 int init_video(sh_video_t *sh_video,char* codecname,int vfm,int status){ 143 int init_video(sh_video_t *sh_video,char* codecname,char* vfm,int status){
144 unsigned int orig_fourcc=sh_video->bih?sh_video->bih->biCompression:0; 144 unsigned int orig_fourcc=sh_video->bih?sh_video->bih->biCompression:0;
145 sh_video->codec=NULL; 145 sh_video->codec=NULL;
146 sh_video->vf_inited=0; 146 sh_video->vf_inited=0;
147 147
148 while(1){ 148 while(1){
153 sh_video->bih?((unsigned int*) &sh_video->bih->biCompression):NULL, 153 sh_video->bih?((unsigned int*) &sh_video->bih->biCompression):NULL,
154 sh_video->codec,0) )) break; 154 sh_video->codec,0) )) break;
155 // ok we found one codec 155 // ok we found one codec
156 if(sh_video->codec->flags&CODECS_FLAG_SELECTED) continue; // already tried & failed 156 if(sh_video->codec->flags&CODECS_FLAG_SELECTED) continue; // already tried & failed
157 if(codecname && strcmp(sh_video->codec->name,codecname)) continue; // -vc 157 if(codecname && strcmp(sh_video->codec->name,codecname)) continue; // -vc
158 if(vfm>=0 && sh_video->codec->driver!=vfm) continue; // vfm doesn't match 158 if(vfm && strcmp(sh_video->codec->drv,vfm)) continue; // vfm doesn't match
159 if(sh_video->codec->status<status) continue; // too unstable 159 if(sh_video->codec->status<status) continue; // too unstable
160 sh_video->codec->flags|=CODECS_FLAG_SELECTED; // tagging it 160 sh_video->codec->flags|=CODECS_FLAG_SELECTED; // tagging it
161 // ok, it matches all rules, let's find the driver! 161 // ok, it matches all rules, let's find the driver!
162 for (i=0; mpcodecs_vd_drivers[i] != NULL; i++) 162 for (i=0; mpcodecs_vd_drivers[i] != NULL; i++)
163 if(mpcodecs_vd_drivers[i]->info->id==sh_video->codec->driver) break; 163 // if(mpcodecs_vd_drivers[i]->info->id==sh_video->codec->driver) break;
164 if(!strcmp(mpcodecs_vd_drivers[i]->info->short_name,sh_video->codec->drv)) break;
164 mpvdec=mpcodecs_vd_drivers[i]; 165 mpvdec=mpcodecs_vd_drivers[i];
165 if(!mpvdec){ // driver not available (==compiled in) 166 if(!mpvdec){ // driver not available (==compiled in)
166 mp_msg(MSGT_DECVIDEO,MSGL_WARN,MSGTR_VideoCodecFamilyNotAvailable, 167 mp_msg(MSGT_DECVIDEO,MSGL_WARN,MSGTR_VideoCodecFamilyNotAvailableStr,
167 sh_video->codec->name, sh_video->codec->driver); 168 sh_video->codec->name, sh_video->codec->drv);
168 continue; 169 continue;
169 } 170 }
170 // it's available, let's try to init! 171 // it's available, let's try to init!
171 if(sh_video->codec->flags & CODECS_FLAG_ALIGN16){ 172 if(sh_video->codec->flags & CODECS_FLAG_ALIGN16){
172 // align width/height to n*16 173 // align width/height to n*16