mirror of
https://github.com/game-stop/veejay.git
synced 2025-12-19 22:30:06 +01:00
bugfixes
git-svn-id: svn://code.dyne.org/veejay/trunk@815 eb8d1916-c9e9-0310-b8de-cf0c9472ead5
This commit is contained in:
@@ -248,12 +248,14 @@ int vj_avcodec_stop( void *encoder , int fmt)
|
|||||||
{
|
{
|
||||||
if(!encoder)
|
if(!encoder)
|
||||||
return 0;
|
return 0;
|
||||||
|
#ifdef SUPPORT_READ_DV2
|
||||||
if( fmt == CODEC_ID_DVVIDEO )
|
if( fmt == CODEC_ID_DVVIDEO )
|
||||||
{
|
{
|
||||||
vj_dv_free_encoder(encoder);
|
vj_dv_free_encoder(encoder);
|
||||||
encoder = NULL;
|
encoder = NULL;
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
if( fmt == 900 )
|
if( fmt == 900 )
|
||||||
{
|
{
|
||||||
return 1;
|
return 1;
|
||||||
@@ -268,6 +270,7 @@ void *vj_avcodec_start( editlist *el, int encoder )
|
|||||||
{
|
{
|
||||||
int codec_id = vj_avcodec_find_codec( encoder );
|
int codec_id = vj_avcodec_find_codec( encoder );
|
||||||
void *ee = NULL;
|
void *ee = NULL;
|
||||||
|
#ifdef SUPPORT_READ_DV2
|
||||||
if(codec_id == CODEC_ID_DVVIDEO )
|
if(codec_id == CODEC_ID_DVVIDEO )
|
||||||
{
|
{
|
||||||
if(!is_dv_resolution(el->video_width, el->video_height ))
|
if(!is_dv_resolution(el->video_width, el->video_height ))
|
||||||
@@ -281,7 +284,10 @@ void *vj_avcodec_start( editlist *el, int encoder )
|
|||||||
return ee;
|
return ee;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
if( codec_id == CODEC_ID_DVVIDEO )
|
||||||
|
return NULL;
|
||||||
|
#endif
|
||||||
ee = vj_avcodec_new_encoder( codec_id, el , encoder );
|
ee = vj_avcodec_new_encoder( codec_id, el , encoder );
|
||||||
if(!ee)
|
if(!ee)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -600,6 +600,7 @@ int vj_unicap_configure_device( void *ud, int pixel_format, int w, int h )
|
|||||||
{
|
{
|
||||||
unsigned int rgb24_fourcc = get_fourcc( "RGB3" );
|
unsigned int rgb24_fourcc = get_fourcc( "RGB3" );
|
||||||
unsigned int rgb_fourcc = get_fourcc( "RGB4" );
|
unsigned int rgb_fourcc = get_fourcc( "RGB4" );
|
||||||
|
unsigned int bgr24_fourcc = get_fourcc( "BGR3");
|
||||||
unicap_format_t rgb_spec, rgb_format;
|
unicap_format_t rgb_spec, rgb_format;
|
||||||
unicap_void_format( &rgb_spec);
|
unicap_void_format( &rgb_spec);
|
||||||
veejay_msg(2, "Capture device has no support for YUV");
|
veejay_msg(2, "Capture device has no support for YUV");
|
||||||
@@ -625,6 +626,11 @@ int vj_unicap_configure_device( void *ud, int pixel_format, int w, int h )
|
|||||||
rgb_format.size.width = w;
|
rgb_format.size.width = w;
|
||||||
rgb_format.size.height = h;
|
rgb_format.size.height = h;
|
||||||
break;
|
break;
|
||||||
|
} else if ( bgr24_fourcc == rgb_format.fourcc )
|
||||||
|
{
|
||||||
|
veejay_msg(0, "Capture device supports %s, software conversion BGR24 -> YUV enabled");
|
||||||
|
vut->rgb = 3;
|
||||||
|
rgb_format.size.width = w; rgb_format.size.height = h;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -953,7 +959,15 @@ int vj_unicap_grab_a_frame( void *vut )
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
VJFrame *srci = yuv_rgb_template( v->buf->data, v->width,v->height, (v->rgb==2 ? PIX_FMT_BGR24:PIX_FMT_RGBA32) );
|
int dst_fmt = 0;
|
||||||
|
switch(v->rgb)
|
||||||
|
{
|
||||||
|
case 1: PIX_FMT_RGBA32; break;
|
||||||
|
case 2: PIX_FMT_RGB24: break;
|
||||||
|
case 3: PIX_FMT_BGR24: break;
|
||||||
|
}
|
||||||
|
|
||||||
|
VJFrame *srci = yuv_rgb_template( v->buf->data, v->width,v->height, dst_fmt );
|
||||||
VJFrame *dsti = yuv_yuv_template( buffer[0],buffer[1],buffer[2], v->width,v->height, v->pixfmt );
|
VJFrame *dsti = yuv_yuv_template( buffer[0],buffer[1],buffer[2], v->width,v->height, v->pixfmt );
|
||||||
|
|
||||||
yuv_convert_any(srci,dsti, srci->format, dsti->format );
|
yuv_convert_any(srci,dsti, srci->format, dsti->format );
|
||||||
|
|||||||
@@ -427,6 +427,9 @@ int vj_event_bundle_update( vj_msg_bundle *bundle, int bundle_id )
|
|||||||
|
|
||||||
static void constrain_sample( veejay_t *v,int n, long lo, long hi )
|
static void constrain_sample( veejay_t *v,int n, long lo, long hi )
|
||||||
{
|
{
|
||||||
|
#ifdef STRICT_CHECKING
|
||||||
|
assert( v->font != NULL );
|
||||||
|
#endif
|
||||||
vj_font_set_constraints_and_dict(
|
vj_font_set_constraints_and_dict(
|
||||||
v->font,
|
v->font,
|
||||||
lo,
|
lo,
|
||||||
@@ -437,6 +440,9 @@ static void constrain_sample( veejay_t *v,int n, long lo, long hi )
|
|||||||
|
|
||||||
static void constrain_stream( veejay_t *v, int n, long hi )
|
static void constrain_stream( veejay_t *v, int n, long hi )
|
||||||
{
|
{
|
||||||
|
#ifdef STRICT_CHECKING
|
||||||
|
assert(v->font != NULL );
|
||||||
|
#endif
|
||||||
vj_font_set_constraints_and_dict(
|
vj_font_set_constraints_and_dict(
|
||||||
v->font,
|
v->font,
|
||||||
0,
|
0,
|
||||||
@@ -8440,6 +8446,12 @@ void vj_event_get_srt_list( void *ptr, const char format[], va_list ap )
|
|||||||
char *str = NULL;
|
char *str = NULL;
|
||||||
int len = 0;
|
int len = 0;
|
||||||
|
|
||||||
|
if(!v->font)
|
||||||
|
{
|
||||||
|
SEND_MSG(v, "000000" );
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
char **list = vj_font_get_sequences( v->font );
|
char **list = vj_font_get_sequences( v->font );
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
@@ -8483,6 +8495,12 @@ void vj_event_get_font_list( void *ptr, const char format[], va_list ap )
|
|||||||
char *str = NULL;
|
char *str = NULL;
|
||||||
int len = 0;
|
int len = 0;
|
||||||
|
|
||||||
|
if(!v->font)
|
||||||
|
{
|
||||||
|
SEND_MSG(v, "000000" );
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
char **list = vj_font_get_all_fonts( v->font );
|
char **list = vj_font_get_all_fonts( v->font );
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
@@ -8528,6 +8546,12 @@ void vj_event_get_srt_info( void *ptr, const char format[], va_list ap )
|
|||||||
char *str = NULL;
|
char *str = NULL;
|
||||||
P_A(args,str,format,ap);
|
P_A(args,str,format,ap);
|
||||||
|
|
||||||
|
if(!v->font)
|
||||||
|
{
|
||||||
|
SEND_MSG(v, "000000");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
char *sequence = vj_font_get_sequence( v->font,args[0] );
|
char *sequence = vj_font_get_sequence( v->font,args[0] );
|
||||||
|
|
||||||
if(!sequence)
|
if(!sequence)
|
||||||
@@ -8553,6 +8577,12 @@ void vj_event_save_srt( void *ptr, const char format[], va_list ap )
|
|||||||
|
|
||||||
P_A(args,file_name,format,ap);
|
P_A(args,file_name,format,ap);
|
||||||
|
|
||||||
|
if(!v->font)
|
||||||
|
{
|
||||||
|
veejay_msg(0, "No font renderer active");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if( vj_font_save_srt( v->font, file_name ) )
|
if( vj_font_save_srt( v->font, file_name ) )
|
||||||
veejay_msg(VEEJAY_MSG_INFO, "Saved SRT file '%s'", file_name );
|
veejay_msg(VEEJAY_MSG_INFO, "Saved SRT file '%s'", file_name );
|
||||||
else
|
else
|
||||||
@@ -8566,6 +8596,12 @@ void vj_event_load_srt( void *ptr, const char format[], va_list ap )
|
|||||||
|
|
||||||
P_A(args,file_name,format,ap);
|
P_A(args,file_name,format,ap);
|
||||||
|
|
||||||
|
if(!v->font)
|
||||||
|
{
|
||||||
|
veejay_msg(0, "No font renderer active");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if( vj_font_load_srt( v->font, file_name ) )
|
if( vj_font_load_srt( v->font, file_name ) )
|
||||||
veejay_msg(VEEJAY_MSG_INFO, "Loaded SRT file '%s'", file_name );
|
veejay_msg(VEEJAY_MSG_INFO, "Loaded SRT file '%s'", file_name );
|
||||||
else
|
else
|
||||||
@@ -8727,6 +8763,13 @@ void vj_event_upd_subtitle( void *ptr, const char format[], va_list ap )
|
|||||||
|
|
||||||
veejay_t *v = (veejay_t*)ptr;
|
veejay_t *v = (veejay_t*)ptr;
|
||||||
P_A(args,text,format,ap);
|
P_A(args,text,format,ap);
|
||||||
|
|
||||||
|
if(!v->font )
|
||||||
|
{
|
||||||
|
veejay_msg(0, "No font renderer active");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
void *dict = select_dict( v, v->uc->sample_id );
|
void *dict = select_dict( v, v->uc->sample_id );
|
||||||
if(!dict)
|
if(!dict)
|
||||||
{
|
{
|
||||||
@@ -8744,6 +8787,14 @@ void vj_event_del_subtitle( void *ptr, const char format[], va_list ap )
|
|||||||
int args[5];
|
int args[5];
|
||||||
veejay_t *v = (veejay_t*)ptr;
|
veejay_t *v = (veejay_t*)ptr;
|
||||||
P_A(args,NULL,format,ap);
|
P_A(args,NULL,format,ap);
|
||||||
|
|
||||||
|
if(!v->font)
|
||||||
|
{
|
||||||
|
veejay_msg(0, "No font renderer active");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void *dict = select_dict( v, v->uc->sample_id );
|
void *dict = select_dict( v, v->uc->sample_id );
|
||||||
if(!dict)
|
if(!dict)
|
||||||
{
|
{
|
||||||
@@ -8763,6 +8814,12 @@ void vj_event_font_set_position( void *ptr, const char format[], va_list ap )
|
|||||||
veejay_t *v = (veejay_t*)ptr;
|
veejay_t *v = (veejay_t*)ptr;
|
||||||
P_A(args,NULL,format,ap);
|
P_A(args,NULL,format,ap);
|
||||||
|
|
||||||
|
if(!v->font)
|
||||||
|
{
|
||||||
|
veejay_msg(0, "No font renderer active");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
void *dict = select_dict( v, v->uc->sample_id );
|
void *dict = select_dict( v, v->uc->sample_id );
|
||||||
if(!dict)
|
if(!dict)
|
||||||
{
|
{
|
||||||
@@ -8779,6 +8836,12 @@ void vj_event_font_set_color( void *ptr, const char format[], va_list ap )
|
|||||||
veejay_t *v = (veejay_t*)ptr;
|
veejay_t *v = (veejay_t*)ptr;
|
||||||
P_A(args,NULL,format,ap);
|
P_A(args,NULL,format,ap);
|
||||||
|
|
||||||
|
if(!v->font)
|
||||||
|
{
|
||||||
|
veejay_msg(0, "No font renderer active");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
void *dict = select_dict( v, v->uc->sample_id );
|
void *dict = select_dict( v, v->uc->sample_id );
|
||||||
if(!dict)
|
if(!dict)
|
||||||
{
|
{
|
||||||
@@ -8818,6 +8881,12 @@ void vj_event_font_set_size_and_font( void *ptr, const char format[], va_list ap
|
|||||||
veejay_t *v = (veejay_t*)ptr;
|
veejay_t *v = (veejay_t*)ptr;
|
||||||
P_A(args,NULL,format,ap);
|
P_A(args,NULL,format,ap);
|
||||||
|
|
||||||
|
if(!v->font)
|
||||||
|
{
|
||||||
|
veejay_msg(0, "No font renderer active");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
void *dict = select_dict( v, v->uc->sample_id );
|
void *dict = select_dict( v, v->uc->sample_id );
|
||||||
if(!dict)
|
if(!dict)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -978,15 +978,15 @@ char **vj_font_get_all_fonts( void *font )
|
|||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static int font_selector( const struct dirent *dir )
|
static int font_selector( const struct dirent *dir )
|
||||||
{
|
{
|
||||||
if(strstr(dir->d_name, ".ttf" )) return 1;
|
if(strstr(dir->d_name, ".ttf" )) return 1;
|
||||||
if(strstr(dir->d_name, ".TTF" )) return 1;
|
if(strstr(dir->d_name, ".TTF" )) return 1;
|
||||||
if(strstr(dir->d_name, ".pfa" )) return 1;
|
// if(strstr(dir->d_name, ".pfa" )) return 1;
|
||||||
if(strstr(dir->d_name, ".pcf.gz" )) return 1;
|
// if(strstr(dir->d_name, ".pcf.gz" )) return 1;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int dir_selector( const struct dirent *dir )
|
static int dir_selector( const struct dirent *dir )
|
||||||
{
|
{
|
||||||
return 1;
|
return 1;
|
||||||
|
|||||||
Reference in New Issue
Block a user