Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • videolan/vlc
  • chouquette/vlc
  • bakiewicz.marek122/vlc
  • devnexen/vlc
  • rohanrajpal/vlc
  • blurrrb/vlc
  • gsoc/gsoc2019/darkapex/vlc
  • b1ue/vlc
  • fkuehne/vlc
  • magsoft/vlc
  • chub/vlc
  • cramiro9/vlc
  • robUx4/vlc
  • rom1v/vlc
  • akshayaky/vlc
  • tmk907/vlc
  • akymaster/vlc
  • govind.sharma/vlc
  • psilokos/vlc
  • xjbeta/vlc
  • jahan/vlc
  • 1480c1/vlc
  • amanchande/vlc
  • aaqib/vlc
  • rist/vlc
  • apol/vlc
  • mindfreeze/vlc
  • alexandre-janniaux/vlc
  • sandsmark/vlc
  • jagannatharjun/vlc
  • gsoc/gsoc2020/matiaslgonzalez/vlc
  • gsoc/gsoc2020/jagannatharjun/vlc
  • mstorsjo/vlc
  • gsoc/gsoc2020/vedenta/vlc
  • gsoc/gsoc2020/arnav-ishaan/vlc
  • gsoc/gsoc2020/andreduong/vlc
  • fuzun/vlc
  • gsoc/gsoc2020/vatsin/vlc
  • gsoc/gsoc2020/sagid/vlc
  • yaron/vlc
  • Phoenix/vlc
  • Garf/vlc
  • ePiratWorkarounds/vlc
  • tguillem/vlc
  • jnqnfe/vlc
  • mdc/vlc
  • Vedaa/vlc
  • rasa/vlc
  • quink/vlc
  • yealo/vlc
  • aleksey_ak/vlc
  • ePirat/vlc
  • ilya.yanok/vlc
  • asenat/vlc
  • m/vlc
  • bunjee/vlc
  • BLumia/vlc
  • sagudev/vlc
  • hamedmonji30/vlc
  • nullgemm/vlc
  • DivyamAhuja/vlc
  • thesamesam/vlc
  • dag7/vlc
  • snehil101/vlc
  • haasn/vlc
  • jbk/vlc
  • ValZapod/vlc
  • mfkl/vlc
  • WangChuan/vlc
  • core1024/vlc
  • GhostVaibhav/vlc
  • dfuhrmann/vlc
  • davide.prade/vlc
  • tmatth/vlc
  • Courmisch/vlc
  • zouya/vlc
  • hpi/vlc
  • EwoutH/vlc
  • aleung27/vlc
  • hengwu0/vlc
  • saladin/vlc
  • ashuio/vlc
  • richselwood/vlc
  • verma16Ayush/vlc
  • chemicalflash/vlc
  • PoignardAzur/vlc
  • huangjieNT/vlc
  • Blake-Haydon/vlc
  • AnuthaDev/vlc
  • gsoc/gsoc2021/mpd/vlc
  • nicolas_lequec/vlc
  • sambassaly/vlc
  • thresh/vlc
  • bonniegong/vlc
  • myaashish/vlc
  • stavros.vagionitis/vlc
  • ileoo/vlc
  • louis-santucci/vlc
  • cchristiansen/vlc
  • sabyasachi07/vlc
  • AbduAmeen/vlc
  • ashishb0410/vlc
  • urbanhusky/vlc
  • davidepietrasanta/vlc
  • riksleutelstad/vlc
  • jeremyVignelles/vlc
  • komh/vlc
  • iamjithinjohn/vlc
  • JohannesKauffmann/vlc2
  • kunglao/vlc
  • natzberg/vlc
  • jill/vlc
  • cwendling/vlc
  • adufou/vlc
  • ErwanAirone/vlc
  • HasinduDilshan10/vlc
  • vagrantc/vlc
  • rafiv/macos-bigsur-icon
  • Aymeriic/vlc
  • saranshg20/vlc
  • metzlove24/vlc
  • linkfanel/vlc
  • Ds886/vlc
  • metehan-arslan/vlc
  • Skantes/vlc
  • kgsandundananjaya96/vlc
  • mitchcapper/vlc
  • advaitgupta/vlc
  • StefanBruens/vlc
  • ratajs/vlc
  • T.M.F.B.3761/vlc
  • m222059/vlc
  • casemerrick/vlc
  • joshuaword2alt/vlc
  • sjwaddy/vlc
  • dima/vlc
  • Ybalrid/vlc
  • umxprime/vlc
  • eschmidt/vlc
  • vannieuwenhuysenmichelle/vlc
  • badcf00d/vlc
  • wesinator/vlc
  • louis/vlc
  • xqq/vlc
  • EmperorYP7/vlc
  • NicoLiam/vlc
  • loveleen/vlc
  • rofferom/vlc
  • rbultje/vlc
  • TheUnamed/vlc
  • pratiksharma341/vlc
  • Saurab17/vlc
  • purist.coder/vlc
  • Shuicheng/vlc
  • mdrrubel292/vlc
  • silverbleu00/vlc
  • metif12/vlc
  • asher-m/vlc
  • jeffk/vlc
  • Brandonbr1/vlc
  • beautyyuyanli/vlc
  • rego21/vlc
  • muyangren907/vlc
  • collectionbylawrencejason/vlc
  • evelez/vlc
  • GSMgeeth/vlc
  • Oneric/vlc
  • TJ5/vlc
  • XuanTung95/vlc
  • darrenjenny21/vlc
  • Trenly/vlc
  • RockyTDR/vlc
  • mjakubowski/vlc
  • caprica/vlc
  • ForteFrankie/vlc
  • seannamiller19/vlc
  • junlon2006/vlc
  • kiwiren6666/vlc
  • iuseiphonexs/vlc
  • fenngtun/vlc
  • Rajdutt999/vlc
  • typx/vlc
  • leon.vitanos/vlc
  • robertogarci0938/vlc
  • gsoc/gsoc2022/luc65r/vlc-mpd
  • skeller/vlc
  • MCJack123/vlc
  • luc65r/vlc-mpd
  • popov895/vlc
  • claucambra/vlc
  • brad/vlc
  • matthewmurua88/vlc
  • Tomas8874/vlc
  • philenotfound/vlc
  • makita-do3/vlc
  • LZXCorp/vlc
  • mar0x/vlc
  • senojetkennedy0102/vlc
  • shaneb243/vlc
  • ahmadbader/vlc
  • rajduttcse26/vlc-audio-filters
  • Juniorzito8415/vlc
  • achernyakov/vlc
  • lucasjetgroup/vlc
  • pupdoggy666/vlc
  • gmde9363/vlc
  • alexnwayne/vlc
  • bahareebrahimi781/vlc
  • hamad633666/vlc
  • umghof3112/vlc
  • joe0199771874/vlc
  • Octocats66666666/vlc
  • jjm_223/vlc
  • btech10110.19/vlc
  • sunnykfc028/vlc-audio-filters
  • loic/vlc
  • nguyenminhducmx1/vlc
  • JanekKrueger/vlc
  • bstubbington2/vlc
  • rcombs/vlc
  • Ordissimo/vlc
  • king7532/vlc
  • noobsauce101/vlc
  • schong0525/vlc
  • myQwil/vlc
  • apisbg91/vlc
  • geeboy0101017/vlc
  • kim.faughey/vlc
  • nurupo/vlc
  • yyusea/vlc
  • 0711235879.khco/vlc
  • ialo/vlc
  • iloveyeye2/vlc
  • gdtdftdqtd/vlc
  • leandroconsiglio/vlc
  • AndyHTML2012/vlc
  • ncz/vlc
  • lucenticus/vlc
  • knr1931/vlc
  • kjoonlee/vlc
  • chandrakant100/vlc-qt
  • johge42/vlc
  • polter/vlc
  • hexchain/vlc
  • Tushwrld/vlc
  • mztea928/vlc
  • jbelloncastro/vlc
  • alvinhochun/vlc
  • ghostpiratecrow/vlc
  • ujjwaltwitx/vlc
  • alexsonarin06/vlc
  • adrianbon76/vlc
  • altsod/vlc
  • damien.lucas44/vlc
  • dmytrivtaisa/vlc
  • utk202/vlc
  • aaxhrj/vlc
  • thomas.hermes/vlc
  • structurenewworldorder/vlc
  • slomo/vlc
  • wantlamy/vlc
  • musc.o3cminc/vlc
  • thebarshablog/vlc
  • kerrick/vlc
  • kratos142518/vlc
  • leogps/vlc
  • vacantron/vlc
  • luna_koly/vlc
  • Ratio2/vlc
  • anuoshemohammad/vlc
  • apsun/vlc
  • aaa1115910/vlc
  • alimotmoyo/vlc
  • Ambossmann/vlc
  • Sam-LearnsToCode/vlc
  • Chilledheart/vlc
  • Labnann/vlc
  • ktcoooot1/vlc
  • mohit-marathe/vlc
  • johnddx/vlc
  • manstabuk/vlc
  • Omar-ahmed314/vlc
  • vineethkm/vlc
  • 9Enemi86/vlc
  • radoslav.m.panteleev/vlc
  • ashishami2002/vlc
  • Corbax/vlc
  • firnasahmed/vlc
  • pelayarmalam4/vlc
  • c0ff330k/vlc
  • shikhindahikar/vlc
  • l342723951/vlc
  • christianschwandner/vlc
  • douniwan5788/vlc
  • 7damian7/vlc
  • ferdnyc/vlc
  • f.ales1/vlc
  • pandagby/vlc
  • BaaBaa/vlc
  • jewe37/vlc
  • w00drow/vlc
  • russelltg/vlc
  • ironicallygod/vlc
  • soumyaDghosh/vlc
  • linzihao1999/vlc
  • deyayush6/vlc
  • mibi88/vlc
  • newabdallah10/vlc
  • jhorbincolombia/vlc
  • rimvihaqueshupto/vlc
  • andrewkhon98/vlc
  • fab78/vlc
  • lapaz17/vlc
  • amanna13/vlc
  • mdakram28/vlc
  • 07jw1980/vlc
  • sohamgupta/vlc
  • Eson-Jia1/vlc
  • Sumou/vlc
  • vikram-kangotra/vlc
  • chalice191/vlc
  • olivercalder/vlc
  • aaasg4001/vlc
  • zipdox/vlc
  • kwizart/vlc
  • Dragon-S/vlc
  • jdemeule/vlc
  • gabriel_lt/vlc
  • locutusofborg/vlc
  • sammirata/vlc-librist
  • another/vlc
  • Benjamin_Loison/vlc
  • ahmedmoselhi/vlc
  • petergaal/vlc
  • huynhsontung/vlc
  • dariusmihut/vlc
  • tvermaashutosh/vlc
  • buti/vlc
  • Niram7777/vlc
  • rohan-here/vlc
  • balaji-sivasakthi/vlc
  • rlindner81/vlc
  • Kakadus/vlc
  • djain/vlc
  • ABBurmeister/vlc
  • craighuggins/vlc
  • orbea/vlc
  • maxos/vlc
  • aakarshmj/vlc
  • kblaschke/vlc
  • ankitm/vlc
  • advait-0/vlc
  • mohak2003/vlc
  • yselkowitz/vlc
  • AZM999/vlc-azm
  • andrey.turkin/vlc
  • Disha-Baghel/vlc
  • nowrep/vlc
  • Apeng/vlc
  • Choucroute_melba/vlc
  • autra/vlc
  • eclipseo/vlc
  • fhuber/vlc
  • olafhering/vlc
  • sdasda7777/vlc
  • 1div0/vlc
  • skosnits/vlc-extended-playlist-support
  • dnicolson/vlc
  • Timshel/vlc
  • octopols/vlc
  • MangalK/vlc
  • nima64/vlc
  • misawai/vlc
  • Alexander-Wilms/vlc
  • Maxime2/vlc-fork-for-visualizer
  • ww/vlc
  • jeske/vlc
  • sgross-emlix/vlc
  • morenonatural/vlc
  • freakingLovesVLC/vlc
  • borisgolovnev/vlc
  • mpromonet/vlc
  • diogo.simao-marques/vlc
  • masstock/vlc
  • pratikpatel8982/vlc
  • hugok79/vlc
  • longervision/vlc
  • abhiudaysurya/vlc
  • rishabhgarg/vlc
  • tumic/vlc
  • cart/vlc
  • shubham442/vlc
  • Aditya692005/vlc
  • sammirata/vlc4
  • syrykh/vlc
  • Vvorcun/macos-new-icon
  • AyaanshC/vlc
  • nasso/vlc
  • Quark/vlc
  • sebastinas/vlc
  • rhstone/vlc
  • talregev/vlc
  • Managor/vlc
403 results
Show changes
Commits on Source (19)
......@@ -147,6 +147,10 @@ VLC_API subpicture_region_t * subpicture_region_NewText( void );
* The chroma of the format must match the one of the picture.
* The dimensions of the format should not exceed the ones of the picture. This
* is not checked explicitly in the function.
*
* \param p_fmt format for the subpicture cropping/SAR (may be NULL)
*
* \note if p_fmt is NULL, the format of the picture will be used.
*/
VLC_API subpicture_region_t * subpicture_region_ForPicture( const video_format_t *p_fmt, picture_t *pic );
......
......@@ -95,7 +95,7 @@ static void TTML_ImageSpuUpdate(subpicture_t *p_spu,
for(ttml_image_updater_region_t *p_updtregion = p_sys->p_regions;
p_updtregion; p_updtregion = p_updtregion->p_next)
{
subpicture_region_t *r = subpicture_region_ForPicture(&p_updtregion->p_pic->format, p_updtregion->p_pic);
subpicture_region_t *r = subpicture_region_ForPicture(NULL, p_updtregion->p_pic);
if (unlikely(r == NULL))
return;
......
......@@ -181,7 +181,7 @@ static subpicture_t *Subpicture( decoder_t *p_dec,
static void EventHandler( vbi_event *ev, void *user_data );
static int OpaquePage( picture_t *p_src, const vbi_page *p_page,
const video_format_t *p_fmt, bool b_opaque, const int text_offset );
bool b_opaque, const int text_offset );
static int get_first_visible_row( vbi_char *p_text, int rows, int columns);
static int get_last_visible_row( vbi_char *p_text, int rows, int columns);
......@@ -502,7 +502,7 @@ static int Decode( decoder_t *p_dec, block_t *p_block )
memcpy( p_sys->nav_link, &p_page.nav_link, sizeof( p_sys->nav_link )) ;
vlc_mutex_unlock( &p_sys->lock );
OpaquePage( p_pic, &p_page, &p_region->fmt, b_opaque, i_first_row * p_page.columns );
OpaquePage( p_pic, &p_page, b_opaque, i_first_row * p_page.columns );
}
exit:
......@@ -641,16 +641,16 @@ static int get_last_visible_row( vbi_char *p_text, int rows, int columns)
}
static int OpaquePage( picture_t *p_src, const vbi_page *p_page,
const video_format_t *p_fmt, bool b_opaque, const int text_offset )
bool b_opaque, const int text_offset )
{
unsigned int x, y;
assert( p_fmt->i_chroma == VLC_CODEC_RGBA );
assert( p_src->format.i_chroma == VLC_CODEC_RGBA );
/* Kludge since zvbi doesn't provide an option to specify opacity. */
for( y = 0; y < p_fmt->i_height; y++ )
for( y = 0; y < p_src->format.i_height; y++ )
{
for( x = 0; x < p_fmt->i_width; x++ )
for( x = 0; x < p_src->format.i_width; x++ )
{
const vbi_opacity opacity = p_page->text[ text_offset + y/10 * p_page->columns + x/12 ].opacity;
const int background = p_page->text[ text_offset + y/10 * p_page->columns + x/12 ].background;
......
......@@ -353,27 +353,28 @@ static subpicture_t *Filter( filter_t *p_filter, vlc_tick_t date )
vlc_vector_foreach(p_overlay, &p_sys->overlays)
{
if (!p_overlay->b_active || p_overlay->format.i_chroma == 0)
if (!p_overlay->b_active || p_overlay->type == OVERLAY_UNSET)
continue;
subpicture_region_t *p_region;
if( p_overlay->format.i_chroma == 0 )
if( p_overlay->type == OVERLAY_IS_TEXT )
p_region = subpicture_region_NewText();
else
p_region = subpicture_region_ForPicture( &p_overlay->format, p_overlay->data.p_pic );
p_region = subpicture_region_ForPicture( NULL, p_overlay->data.p_pic );
if( unlikely(p_region == NULL) )
{
break;
}
msg_Dbg( p_filter, "Displaying overlay: %4.4s, %d, %d, %d",
(char*)&p_overlay->format.i_chroma, p_overlay->i_x, p_overlay->i_y,
p_overlay->type == OVERLAY_IS_TEXT ? "TEXT" : (char*)&p_overlay->data.p_pic->format.i_chroma,
p_overlay->i_x, p_overlay->i_y,
p_overlay->i_alpha );
if( p_overlay->format.i_chroma == 0 )
if( p_overlay->type == OVERLAY_IS_TEXT )
{
video_format_Copy( &p_region->fmt, &p_overlay->format );
video_format_Setup( &p_region->fmt, 0, 0, 0, 0, 0, 0, 1 );
p_region->p_text = text_segment_New( p_overlay->data.p_text );
p_region->p_text->style = text_style_Duplicate( p_overlay->p_fontstyle );
}
......
......@@ -133,7 +133,11 @@ typedef struct overlay_t
int i_alpha;
bool b_active;
video_format_t format;
enum {
OVERLAY_UNSET,
OVERLAY_IS_TEXT,
OVERLAY_IS_PICTURE,
} type;
text_style_t *p_fontstyle;
union {
picture_t *p_pic;
......
......@@ -54,8 +54,7 @@ overlay_t *OverlayCreate( void )
p_ovl->i_x = p_ovl->i_y = 0;
p_ovl->i_alpha = 0xFF;
p_ovl->b_active = false;
video_format_Setup( &p_ovl->format, 0, 0, 0,
0, 0, 1, 1 );
p_ovl->type = OVERLAY_UNSET;
p_ovl->p_fontstyle = text_style_Create( STYLE_NO_DEFAULTS );
p_ovl->data.p_text = NULL;
p_ovl->data.p_pic = NULL;
......@@ -480,8 +479,7 @@ static int exec_DataSharedMem( filter_t *p_filter,
return VLC_ENOMEM;
}
video_format_Setup( &p_ovl->format, 0,
0, 0, 0, 0, 0, 1 );
p_ovl->type = OVERLAY_IS_TEXT;
p_data = shmat( p_params->i_shmid, NULL, SHM_RDONLY );
if( p_data == NULL )
......@@ -509,7 +507,7 @@ static int exec_DataSharedMem( filter_t *p_filter,
if( p_ovl->data.p_pic == NULL )
return VLC_ENOMEM;
p_ovl->format = p_ovl->data.p_pic->format;
p_ovl->type = OVERLAY_IS_PICTURE;
for( size_t i_plane = 0; i_plane < (size_t)p_ovl->data.p_pic->i_planes;
++i_plane )
......
......@@ -319,7 +319,6 @@ static subpicture_t *FilterSub( filter_t *p_filter, vlc_tick_t date )
subpicture_t *p_spu;
subpicture_region_t *p_region;
video_format_t fmt;
picture_t *p_pic;
logo_t *p_logo;
......@@ -362,13 +361,7 @@ static subpicture_t *FilterSub( filter_t *p_filter, vlc_tick_t date )
goto exit;
/* Create new SPU region */
video_format_Copy(&fmt, &p_pic->format);
fmt.i_sar_num = fmt.i_sar_den = 1;
fmt.i_width = fmt.i_visible_width = p_pic->p[Y_PLANE].i_visible_pitch;
fmt.i_height = fmt.i_visible_height = p_pic->p[Y_PLANE].i_visible_lines;
fmt.i_x_offset = fmt.i_y_offset = 0;
p_region = subpicture_region_ForPicture( &fmt, p_pic );
video_format_Clean(&fmt);
p_region = subpicture_region_ForPicture( NULL, p_pic );
if( !p_region )
{
msg_Err( p_filter, "cannot allocate SPU region" );
......
......@@ -586,12 +586,11 @@ static subpicture_t *Filter( filter_t *p_filter, vlc_tick_t date )
i_row = ( i_real_index / p_sys->i_cols ) % p_sys->i_rows;
i_col = i_real_index % p_sys->i_cols ;
video_format_Init( &fmt_in, 0 );
video_format_Init( &fmt_out, 0 );
p_converted = vlc_picture_chain_PeekFront( &p_es->pictures );
if ( !p_sys->b_keep )
{
video_format_Init( &fmt_in, 0 );
video_format_Init( &fmt_out, 0 );
/* Convert the images */
fmt_in.i_chroma = p_converted->format.i_chroma;
fmt_in.i_height = p_converted->format.i_height;
......@@ -625,32 +624,22 @@ static subpicture_t *Filter( filter_t *p_filter, vlc_tick_t date )
p_converted = image_Convert( p_sys->p_image, p_converted,
&fmt_in, &fmt_out );
video_format_Clean( &fmt_in );
video_format_Clean( &fmt_out );
if( !p_converted )
{
msg_Warn( p_filter,
"image resizing and chroma conversion failed" );
video_format_Clean( &fmt_in );
video_format_Clean( &fmt_out );
continue;
}
}
else
{
fmt_in.i_width = fmt_out.i_width = p_converted->format.i_width;
fmt_in.i_height = fmt_out.i_height = p_converted->format.i_height;
fmt_in.i_chroma = fmt_out.i_chroma = p_converted->format.i_chroma;
fmt_out.i_visible_width = fmt_out.i_width;
fmt_out.i_visible_height = fmt_out.i_height;
}
p_region = subpicture_region_ForPicture( &fmt_out, p_converted );
p_region = subpicture_region_ForPicture( NULL, p_converted );
if( !p_sys->b_keep )
picture_Release( p_converted );
if( !p_region )
{
video_format_Clean( &fmt_in );
video_format_Clean( &fmt_out );
msg_Err( p_filter, "cannot allocate SPU region" );
subpicture_Delete( p_spu );
vlc_global_unlock( VLC_MOSAIC_MUTEX );
......@@ -670,7 +659,7 @@ static subpicture_t *Filter( filter_t *p_filter, vlc_tick_t date )
}
else
{
if( fmt_out.i_width > col_inner_width ||
if( p_converted->format.i_width > col_inner_width ||
p_sys->b_ar || p_sys->b_keep )
{
/* we don't have to center the video since it takes the
......@@ -685,10 +674,10 @@ static subpicture_t *Filter( filter_t *p_filter, vlc_tick_t date )
p_region->i_x = p_sys->i_xoffset
+ i_col * ( p_sys->i_width / p_sys->i_cols )
+ ( i_col * p_sys->i_borderw ) / p_sys->i_cols
+ ( col_inner_width - fmt_out.i_width ) / 2;
+ ( col_inner_width - p_converted->format.i_width ) / 2;
}
if( fmt_out.i_height > row_inner_height
if( p_converted->format.i_height > row_inner_height
|| p_sys->b_ar || p_sys->b_keep )
{
/* we don't have to center the video since it takes the
......@@ -703,16 +692,13 @@ static subpicture_t *Filter( filter_t *p_filter, vlc_tick_t date )
p_region->i_y = p_sys->i_yoffset
+ i_row * ( p_sys->i_height / p_sys->i_rows )
+ ( i_row * p_sys->i_borderh ) / p_sys->i_rows
+ ( row_inner_height - fmt_out.i_height ) / 2;
+ ( row_inner_height - p_converted->format.i_height ) / 2;
}
}
p_region->i_align = p_sys->i_align;
p_region->i_alpha = p_es->i_alpha;
vlc_spu_regions_push(&p_spu->regions, p_region);
video_format_Clean( &fmt_in );
video_format_Clean( &fmt_out );
}
vlc_global_unlock( VLC_MOSAIC_MUTEX );
......
......@@ -500,17 +500,8 @@ static subpicture_t *Filter( filter_t *p_filter, vlc_tick_t date )
{
/* Display the feed's image */
picture_t *p_pic = p_feed->p_pic;
video_format_t fmt_out;
video_format_Copy( &fmt_out, &p_pic->format );
fmt_out.i_sar_num = fmt_out.i_sar_den = 1;
fmt_out.i_width =
fmt_out.i_visible_width = p_pic->p[Y_PLANE].i_visible_pitch;
fmt_out.i_height =
fmt_out.i_visible_height = p_pic->p[Y_PLANE].i_visible_lines;
p_region = subpicture_region_ForPicture( &fmt_out, p_pic );
p_region = subpicture_region_ForPicture( NULL, p_pic );
if( !p_region )
{
msg_Err( p_filter, "cannot allocate SPU region" );
......@@ -522,9 +513,8 @@ static subpicture_t *Filter( filter_t *p_filter, vlc_tick_t date )
vlc_spu_regions_push( &p_spu->regions, p_region );
/* Offset text to display right next to the image */
region->i_x += fmt_out.i_visible_width;
region->i_x += p_pic->format.i_visible_width;
}
video_format_Clean(&fmt_out);
}
vlc_mutex_unlock( &p_sys->lock );
......
......@@ -385,7 +385,7 @@ static subpicture_region_t *RenderText( filter_t *p_filter,
if (p_picture == NULL)
return NULL;
subpicture_region_t *p_region_out = subpicture_region_ForPicture(&p_picture->format, p_picture);
subpicture_region_t *p_region_out = subpicture_region_ForPicture(NULL, p_picture);
picture_Release(p_picture);
if (unlikely(p_region_out == NULL))
return NULL;
......
......@@ -147,10 +147,7 @@ subpicture_t *subpicture_NewFromPicture( vlc_object_t *p_obj,
p_subpic->i_original_picture_width = fmt_out.i_visible_width;
p_subpic->i_original_picture_height = fmt_out.i_visible_height;
fmt_out.i_sar_num =
fmt_out.i_sar_den = 0;
subpicture_region_t *p_region = subpicture_region_ForPicture( &fmt_out, p_pip );
subpicture_region_t *p_region = subpicture_region_ForPicture( NULL, p_pip );
picture_Release( p_pip );
if (likely(p_region == NULL))
......@@ -159,6 +156,10 @@ subpicture_t *subpicture_NewFromPicture( vlc_object_t *p_obj,
return NULL;
}
p_region->fmt.i_sar_num =
p_region->fmt.i_sar_den = 0;
vlc_spu_regions_push( &p_subpic->regions, p_region );
return p_subpic;
}
......@@ -278,13 +279,17 @@ subpicture_region_t *subpicture_region_NewText( void )
subpicture_region_t *subpicture_region_ForPicture( const video_format_t *p_fmt, picture_t *pic )
{
if ( !video_format_IsSameChroma( p_fmt, &pic->format ) )
assert( !p_fmt || video_format_IsSameChroma( p_fmt, &pic->format ) );
if ( p_fmt && !video_format_IsSameChroma( p_fmt, &pic->format ) )
return NULL;
subpicture_region_t *p_region = subpicture_region_NewInternal( );
if( !p_region )
return NULL;
if (p_fmt == NULL)
p_fmt = &pic->format;
video_format_Copy( &p_region->fmt, p_fmt );
if ( p_fmt->i_chroma == VLC_CODEC_YUVP || p_fmt->i_chroma == VLC_CODEC_RGBP )
{
......
......@@ -84,7 +84,7 @@ spuregion_CreateFromPicture( vlc_object_t *p_this, video_format_t *p_fmt,
if(!p_pic)
return NULL;
subpicture_region_t *region = subpicture_region_ForPicture(p_fmt, p_pic);
subpicture_region_t *region = subpicture_region_ForPicture(NULL, p_pic);
picture_Release( p_pic );
return region;
......
......@@ -983,7 +983,7 @@ static subpicture_region_t *SpuRenderRegion(spu_t *spu,
bool convert_chroma = true;
for (int i = 0; chroma_list[i] && convert_chroma; i++) {
if (region_fmt.i_chroma == chroma_list[i])
if (region->fmt.i_chroma == chroma_list[i])
convert_chroma = false;
}
......@@ -1145,7 +1145,6 @@ static subpicture_region_t *SpuRenderRegion(spu_t *spu,
}
}
assert(video_format_IsSameChroma( &region_fmt, &region_picture->format ));
subpicture_region_t *dst = subpicture_region_ForPicture(&region_fmt, region_picture);
if (dst == NULL)
return NULL;
......
......@@ -178,7 +178,7 @@ static void test_opengl_offscreen(
subpicture->i_original_picture_width = 4;
subpicture->i_original_picture_height = 4;
subpicture_region_t *p_region = subpicture_region_ForPicture(&fmt, picture);
subpicture_region_t *p_region = subpicture_region_ForPicture(NULL, picture);
assert(p_region != NULL);
vlc_spu_regions_push( &subpicture->regions, p_region );
......