comparison libmpcodecs/dec_video.c @ 7502:6a2b6f3d619c

best audio/video codec selection & init moved to libmpcodecs
author arpi
date Wed, 25 Sep 2002 23:45:34 +0000
parents a894e99c1e51
children c1cb94198e05
comparison
equal deleted inserted replaced
7501:20910550332f 7502:6a2b6f3d619c
202 return 1; 202 return 1;
203 } 203 }
204 return 0; 204 return 0;
205 } 205 }
206 206
207 int init_best_video_codec(sh_video_t *sh_video,char* video_codec,char* video_fm){
208 // Go through the codec.conf and find the best codec...
209 sh_video->inited=0;
210 codecs_reset_selection(0);
211 if(video_codec){
212 // forced codec by name:
213 mp_msg(MSGT_DECVIDEO,MSGL_INFO,MSGTR_ForcedVideoCodec,video_codec);
214 init_video(sh_video,video_codec,NULL,-1);
215 } else {
216 int status;
217 // try in stability order: UNTESTED, WORKING, BUGGY. never try CRASHING.
218 if(video_fm){
219 // try first the preferred codec family:
220 mp_msg(MSGT_DECVIDEO,MSGL_INFO,MSGTR_TryForceVideoFmtStr,video_fm);
221 for(status=CODECS_STATUS__MAX;status>=CODECS_STATUS__MIN;--status)
222 if(init_video(sh_video,NULL,video_fm,status)) break;
223 }
224 if(!sh_video->inited)
225 for(status=CODECS_STATUS__MAX;status>=CODECS_STATUS__MIN;--status)
226 if(init_video(sh_video,NULL,NULL,status)) break;
227 }
228
229 if(!sh_video->inited){
230 mp_msg(MSGT_DECVIDEO,MSGL_HINT, MSGTR_TryUpgradeCodecsConfOrRTFM,get_path("codecs.conf"));
231 mp_msg(MSGT_DECVIDEO,MSGL_ERR,MSGTR_CantFindVideoCodec,sh_video->format);
232 return 0; // failed
233 }
234
235 mp_msg(MSGT_DECVIDEO,MSGL_INFO,"%s video codec: [%s] vfm:%s (%s)\n",
236 video_codec?mp_gettext("Forcing"):mp_gettext("Detected"),sh_video->codec->name,sh_video->codec->drv,sh_video->codec->info);
237 return 1; // success
238 }
239
207 extern int vo_directrendering; 240 extern int vo_directrendering;
208 241
209 int decode_video(sh_video_t *sh_video,unsigned char *start,int in_size,int drop_frame){ 242 int decode_video(sh_video_t *sh_video,unsigned char *start,int in_size,int drop_frame){
210 vf_instance_t* vf; 243 vf_instance_t* vf;
211 mp_image_t *mpi=NULL; 244 mp_image_t *mpi=NULL;