Browse Source

subpicture: use helper functions for vlc_spu_regions

pull/162/head
Steve Lhomme 2 years ago
parent
commit
d6ffd5bc35
  1. 19
      modules/access/bluray.c
  2. 2
      modules/codec/arib/libaribcaption.c
  3. 2
      modules/codec/arib/substext.h
  4. 2
      modules/codec/avcodec/subtitle.c
  5. 2
      modules/codec/cvdsub.c
  6. 18
      modules/codec/dvbsub.c
  7. 6
      modules/codec/kate.c
  8. 4
      modules/codec/libass.c
  9. 2
      modules/codec/scte27.c
  10. 4
      modules/codec/spudec/parse.c
  11. 7
      modules/codec/substext.h
  12. 2
      modules/codec/substx3g.c
  13. 6
      modules/codec/subsusf.c
  14. 2
      modules/codec/svcdsub.c
  15. 2
      modules/codec/t140.c
  16. 2
      modules/codec/telx.c
  17. 2
      modules/codec/ttml/imageupdater.h
  18. 2
      modules/codec/webvtt/encvtt.c
  19. 4
      modules/codec/zvbi.c
  20. 2
      modules/hw/mmal/vout.c
  21. 2
      modules/spu/audiobargraph_v.c
  22. 2
      modules/spu/dynamicoverlay/dynamicoverlay.c
  23. 2
      modules/spu/logo.c
  24. 2
      modules/spu/marq.c
  25. 2
      modules/spu/mosaic.c
  26. 4
      modules/spu/rss.c
  27. 10
      modules/spu/subsdelay.c
  28. 6
      modules/video_output/android/display.c
  29. 6
      modules/video_output/apple/VLCSampleBufferDisplay.m
  30. 4
      modules/video_output/libplacebo/display.c
  31. 4
      modules/video_output/opengl/sub_renderer.c
  32. 4
      modules/video_output/win32/direct3d11.cpp
  33. 4
      modules/video_output/win32/direct3d9.c
  34. 2
      modules/video_output/xcb/render.c
  35. 8
      src/misc/subpicture.c
  36. 16
      src/video_output/video_epg.c
  37. 2
      src/video_output/video_text.c
  38. 2
      src/video_output/video_widgets.c
  39. 14
      src/video_output/vout_subpictures.c
  40. 2
      test/modules/video_output/opengl/sub_renderer.c
  41. 2
      test/src/input/decoder/input_decoder_scenarios.c

19
modules/access/bluray.c

@ -1675,17 +1675,17 @@ static void subpictureUpdaterUpdate(subpicture_t *p_subpic,
* We need to duplicate our regions (stored internally) to this subpic.
*/
subpicture_region_t *p_src;
if (vlc_list_is_empty(&p_overlay->regions)) {
if (vlc_spu_regions_is_empty(&p_overlay->regions)) {
updater_unlock_overlay(p_upd_sys);
return;
}
subpicture_region_t *p_dst;
vlc_list_foreach(p_src, &p_overlay->regions, node) {
vlc_spu_regions_foreach(p_src, &p_overlay->regions) {
p_dst = subpicture_region_Copy(p_src);
if (p_dst == NULL)
break;
vlc_list_append(&p_dst->node, &p_subpic->regions);
vlc_spu_regions_push(&p_subpic->regions, p_dst);
}
p_overlay->status = Displayed;
@ -1874,7 +1874,7 @@ static void blurayInitOverlay(demux_t *p_demux, int plane, uint16_t width, uint1
ov->width = width;
ov->height = height;
ov->b_on_vout = false;
vlc_list_init(&ov->regions);
vlc_spu_regions_init(&ov->regions);
vlc_mutex_init(&ov->lock);
@ -1901,7 +1901,7 @@ static void blurayDrawOverlay(demux_t *p_demux, const BD_OVERLAY* const eventov)
/* Find a region to update */
subpicture_region_t *p_reg;
vlc_list_foreach(p_reg, &ov->regions, node) {
vlc_spu_regions_foreach(p_reg, &ov->regions) {
if (p_reg->i_x == eventov->x &&
p_reg->i_y == eventov->y &&
p_reg->fmt.i_width == eventov->w &&
@ -1913,7 +1913,7 @@ static void blurayDrawOverlay(demux_t *p_demux, const BD_OVERLAY* const eventov)
if (!eventov->img) {
if (p_reg) {
/* drop region */
vlc_list_remove(&p_reg->node);
vlc_spu_regions_remove(&ov->regions, p_reg);
subpicture_region_Delete(p_reg);
}
vlc_mutex_unlock(&ov->lock);
@ -1931,7 +1931,7 @@ static void blurayDrawOverlay(demux_t *p_demux, const BD_OVERLAY* const eventov)
p_reg->i_x = eventov->x;
p_reg->i_y = eventov->y;
/* Append it to our list. */
vlc_list_append(&p_reg->node, &ov->regions);
vlc_spu_regions_push(&ov->regions, p_reg);
}
else
{
@ -2034,8 +2034,7 @@ static void blurayDrawArgbOverlay(demux_t *p_demux, const BD_ARGB_OVERLAY* const
#else
const vlc_fourcc_t rgbchroma = VLC_CODEC_BGRA;
#endif
subpicture_region_t *p_reg =
vlc_list_first_entry_or_null(&ov->regions, subpicture_region_t, node);
subpicture_region_t *p_reg = vlc_spu_regions_first_or_null(&ov->regions);
if (!p_reg)
{
video_format_t fmt;
@ -2049,7 +2048,7 @@ static void blurayDrawArgbOverlay(demux_t *p_demux, const BD_ARGB_OVERLAY* const
vlc_mutex_unlock(&ov->lock);
return;
}
vlc_list_append(&p_reg->node, &ov->regions);
vlc_spu_regions_push(&ov->regions, p_reg);
}
/* Find a region to update */

2
modules/codec/arib/libaribcaption.c

@ -201,7 +201,7 @@ static void SubpictureUpdate(subpicture_t *p_subpic,
CopyImageToRegion(region->p_picture, image);
vlc_list_append(&region->node, &p_subpic->regions);
vlc_spu_regions_push(&p_subpic->regions, region);
}
aribcc_render_result_cleanup(&p_spusys->render_result);

2
modules/codec/arib/substext.h

@ -82,7 +82,7 @@ static void SubpictureTextUpdate(subpicture_t *subpic,
{
return;
}
vlc_list_append(&r->node, &subpic->regions);
vlc_spu_regions_push(&subpic->regions, r);
r->fmt.i_sar_num = 1;
r->fmt.i_sar_den = 1;

2
modules/codec/avcodec/subtitle.c

@ -356,7 +356,7 @@ static subpicture_t *ConvertSubtitle(decoder_t *dec, AVSubtitle *ffsub, vlc_tick
break;
}
if (region) {
vlc_list_append(&region->node, &spu->regions);
vlc_spu_regions_push(&spu->regions, region);
}
}
avsubtitle_free(ffsub);

2
modules/codec/cvdsub.c

@ -545,7 +545,7 @@ static subpicture_t *DecodePacket( decoder_t *p_dec, block_t *p_data )
return NULL;
}
vlc_list_append(&p_region->node, &p_spu->regions);
vlc_spu_regions_push(&p_spu->regions, p_region);
p_region->i_x = p_sys->i_x_start;
p_region->i_x = p_region->i_x * 3 / 4; /* FIXME: use aspect ratio for x? */
p_region->i_y = p_sys->i_y_start;

18
modules/codec/dvbsub.c

@ -1604,7 +1604,7 @@ static subpicture_t *render( decoder_t *p_dec )
p_spu_region->i_x = i_base_x + p_regiondef->i_x;
p_spu_region->i_y = i_base_y + p_regiondef->i_y;
p_spu_region->i_align = p_sys->i_spu_position;
vlc_list_append(&p_spu_region->node, &p_spu->regions);
vlc_spu_regions_push(&p_spu->regions, p_spu_region);
p_src = p_region->p_pixbuf;
p_dst = p_spu_region->p_picture->Y_PIXELS;
@ -1644,7 +1644,7 @@ static subpicture_t *render( decoder_t *p_dec )
p_spu_region->i_x = i_base_x + p_regiondef->i_x + p_object_def->i_x;
p_spu_region->i_y = i_base_y + p_regiondef->i_y + p_object_def->i_y;
p_spu_region->i_align = p_sys->i_spu_position;
vlc_list_append(&p_spu_region->node, &p_spu->regions);
vlc_spu_regions_push(&p_spu->regions, p_spu_region);
}
}
@ -1734,7 +1734,7 @@ static void YuvaYuvp( subpicture_t *p_subpic )
{
subpicture_region_t *p_region = NULL;
vlc_list_foreach(p_region, &p_subpic->regions, node)
vlc_spu_regions_foreach(p_region, &p_subpic->regions)
{
video_format_t *p_fmt = &p_region->fmt;
int i = 0, j = 0, n = 0, p = 0;
@ -1933,12 +1933,12 @@ static block_t *Encode( encoder_t *p_enc, subpicture_t *p_subpic )
bs_t bits, *s = &bits;
block_t *p_block;
if( !p_subpic || !vlc_list_is_empty(&p_subpic->regions) ) return NULL;
if( !p_subpic || !vlc_spu_regions_is_empty(&p_subpic->regions) ) return NULL;
/* FIXME: this is a hack to convert VLC_CODEC_YUVA into
* VLC_CODEC_YUVP
*/
p_region = vlc_list_first_entry_or_null(&p_subpic->regions, subpicture_region_t, node);
p_region = vlc_spu_regions_first_or_null(&p_subpic->regions);
if( p_region->fmt.i_chroma == VLC_CODEC_YUVA )
{
YuvaYuvp( p_subpic );
@ -2051,7 +2051,7 @@ static void encode_page_composition( encoder_t *p_enc, bs_t *s,
i_regions = 0;
if (p_subpic)
vlc_list_foreach(p_region, &p_subpic->regions, node)
vlc_spu_regions_foreach(p_region, &p_subpic->regions)
{
if( i_regions >= p_sys->i_regions )
{
@ -2104,7 +2104,7 @@ static void encode_page_composition( encoder_t *p_enc, bs_t *s,
i_regions = 0;
if (p_subpic)
vlc_list_foreach(p_region, &p_subpic->regions, node)
vlc_spu_regions_foreach(p_region, &p_subpic->regions)
{
bs_write( s, 8, i_regions );
bs_write( s, 8, 0 ); /* Reserved */
@ -2170,7 +2170,7 @@ static void encode_region_composition( encoder_t *p_enc, bs_t *s,
unsigned int i_region;
i_region = 0;
vlc_list_foreach(p_region, &p_subpic->regions, node)
vlc_spu_regions_foreach(p_region, &p_subpic->regions)
{
int i_entries = 4, i_depth = 0x1, i_bg = 0;
bool b_text = subpicture_region_IsText( p_region );
@ -2246,7 +2246,7 @@ static void encode_object( encoder_t *p_enc, bs_t *s, subpicture_t *p_subpic )
int i_length_pos, i_update_pos, i_pixel_data_pos;
i_region = 0;
vlc_list_foreach(p_region, &p_subpic->regions, node)
vlc_spu_regions_foreach(p_region, &p_subpic->regions)
{
bs_write( s, 8, 0x0f ); /* Sync byte */
bs_write( s, 8, DVBSUB_ST_OBJECT_DATA ); /* Segment type */

6
modules/codec/kate.c

@ -899,7 +899,7 @@ static void TigerUpdateSubpicture( subpicture_t *p_subpic,
PROFILE_STOP( tiger_renderer_render );
PostprocessTigerImage( p_plane, fmt.i_width );
vlc_list_append( &p_r->node, &p_subpic->regions );
vlc_spu_regions_push( &p_subpic->regions, p_r );
p_sys->b_dirty = false;
PROFILE_STOP( TigerUpdateSubpicture );
@ -1187,9 +1187,9 @@ static subpicture_t *SetupSimpleKateSPU( decoder_t *p_dec, subpicture_t *p_spu,
/* if we have a bitmap, chain it before the text */
if (p_bitmap_region)
{
vlc_list_append(&p_bitmap_region->node, &p_spu->regions);
vlc_spu_regions_push(&p_spu->regions, p_bitmap_region);
}
vlc_list_append(&p_region->node, &p_spu->regions);
vlc_spu_regions_push(&p_spu->regions, p_region);
return p_spu;
}

4
modules/codec/libass.c

@ -454,7 +454,7 @@ static int SubpictureValidate( subpicture_t *p_subpic,
MS_FROM_VLC_TICK( i_stream_date ), &i_changed );
if( !i_changed && !b_fmt_src && !b_fmt_dst &&
(p_img != NULL) == (!vlc_list_is_empty(&p_subpic->regions)) )
(p_img != NULL) == (!vlc_spu_regions_is_empty(&p_subpic->regions)) )
{
vlc_mutex_unlock( &p_sys->lock );
return VLC_SUCCESS;
@ -522,7 +522,7 @@ static void SubpictureUpdate( subpicture_t *p_subpic,
RegionDraw( r, p_img );
/* */
vlc_list_append(&r->node, &p_subpic->regions);
vlc_spu_regions_push(&p_subpic->regions, r);
}
vlc_mutex_unlock( &p_sys->lock );

2
modules/codec/scte27.c

@ -391,7 +391,7 @@ static subpicture_t *DecodeSubtitleMessage(decoder_t *dec,
sub->b_ephemer = true;
sub->i_start = date;
sub->i_stop = date + display_duration * frame_duration;
vlc_list_append(&region->node, &sub->regions);
vlc_spu_regions_push(&sub->regions, region);
return sub;
} else {

4
modules/codec/spudec/parse.c

@ -254,7 +254,7 @@ static void OutputPicture( decoder_t *p_dec,
if( p_spu_data->p_pxctli && p_spu )
ParsePXCTLI( p_dec, p_spu_data,
vlc_list_first_entry_or_null(&p_spu->regions, subpicture_region_t, node) );
vlc_spu_regions_first_or_null(&p_spu->regions) );
pf_queue( p_dec, p_spu );
}
@ -868,7 +868,7 @@ static int Render( decoder_t *p_dec, subpicture_t *p_spu,
msg_Err( p_dec, "cannot allocate SPU region" );
return VLC_EGENERIC;
}
vlc_list_append(&p_region->node, &p_spu->regions);
vlc_spu_regions_push(&p_spu->regions, p_region);
p_region->i_x = p_spu_properties->i_x;
p_region->i_y = p_spu_properties->i_y + p_spu_data->i_y_top_offset;

7
modules/codec/substext.h

@ -110,11 +110,12 @@ static int SubpictureTextValidate(subpicture_t *subpic,
substext_updater_region_t *p_updtregion = &sys->region;
if (!(p_updtregion->flags & UPDT_REGION_FIXED_DONE) &&
subpic->b_absolute && !vlc_list_is_empty(&subpic->regions) &&
subpic->b_absolute && !vlc_spu_regions_is_empty(&subpic->regions) &&
subpic->i_original_picture_width > 0 &&
subpic->i_original_picture_height > 0)
{
subpicture_region_t *p_region = vlc_list_first_entry_or_null(&subpic->regions, subpicture_region_t, node);
subpicture_region_t *p_region =
vlc_spu_regions_first_or_null(&subpic->regions);
p_updtregion->flags |= UPDT_REGION_FIXED_DONE;
p_updtregion->origin.x = p_region->i_x;
p_updtregion->origin.y = p_region->i_y;
@ -171,7 +172,7 @@ static void SubpictureTextUpdate(subpicture_t *subpic,
subpicture_region_t *r = subpicture_region_NewText();
if (!r)
return;
vlc_list_append(&r->node, &subpic->regions);
vlc_spu_regions_push(&subpic->regions, r);
video_format_Copy( &r->fmt, &fmt );
r->p_text = text_segment_Copy( p_updtregion->p_segments );

2
modules/codec/substx3g.c

@ -703,7 +703,7 @@ static block_t * Encode( encoder_t *p_enc, subpicture_t *p_spu )
{
VLC_UNUSED(p_enc);
subpicture_region_t *p_region =
vlc_list_first_entry_or_null(&p_spu->regions, subpicture_region_t, node);
vlc_spu_regions_first_or_null(&p_spu->regions);
const text_segment_t *p_segments = p_region ? p_region->p_text : NULL;
size_t i_len = 0;
size_t i_styles = 0;

6
modules/codec/subsusf.c

@ -841,7 +841,7 @@ static void ParseUSFString( decoder_t *p_dec,
p_sys->i_align );
if( p_text_region )
{
vlc_list_append(&p_text_region->node, regions);
vlc_spu_regions_push(regions, p_text_region);
}
else free( psz_flat );
}
@ -891,7 +891,7 @@ static void ParseUSFString( decoder_t *p_dec,
if( p_image_region )
{
SetupPositions( p_image_region, psz_subtitle );
vlc_list_append(&p_image_region->node, regions);
vlc_spu_regions_push(regions, p_image_region);
}
}
else
@ -909,7 +909,7 @@ static void ParseUSFString( decoder_t *p_dec,
p_sys->i_align );
if( p_text_region )
{
vlc_list_append(&p_text_region->node, regions);
vlc_spu_regions_push(regions, p_text_region);
}
else free( psz_flat );
}

2
modules/codec/svcdsub.c

@ -496,7 +496,7 @@ static subpicture_t *DecodePacket( decoder_t *p_dec, block_t *p_data )
return NULL;
}
vlc_list_append(&p_region->node, &p_spu->regions);
vlc_spu_regions_push(&p_spu->regions, p_region);
p_region->i_x = p_sys->i_x_start;
p_region->i_y = p_sys->i_y_start;

2
modules/codec/t140.c

@ -83,7 +83,7 @@ static block_t *Encode( encoder_t *p_enc, subpicture_t *p_spu )
if( p_spu == NULL )
return NULL;
p_region = vlc_list_first_entry_or_null(&p_spu->regions, subpicture_region_t, node);
p_region = vlc_spu_regions_first_or_null(&p_spu->regions);
if( ( p_region == NULL )
|| (!subpicture_region_IsText( p_region ))
|| ( p_region->p_text == NULL )

2
modules/codec/telx.c

@ -735,7 +735,7 @@ static int Decode( decoder_t *p_dec, block_t *p_block )
msg_Err( p_dec, "cannot allocate SPU region" );
goto error;
}
vlc_list_append( &p_region->node, &p_spu->regions );
vlc_spu_regions_push( &p_spu->regions, p_region );
/* Normal text subs, easy markup */
p_region->i_align = SUBPICTURE_ALIGN_BOTTOM | p_sys->i_align;

2
modules/codec/ttml/imageupdater.h

@ -116,7 +116,7 @@ static void TTML_ImageSpuUpdate(subpicture_t *p_spu,
else
r->i_y = p_updtregion->origin.y;
vlc_list_append(&r->node, &p_spu->regions);
vlc_spu_regions_push(&p_spu->regions, r);
}
}

2
modules/codec/webvtt/encvtt.c

@ -85,7 +85,7 @@ static block_t *Encode( encoder_t *p_enc, subpicture_t *p_spu )
return NULL;
subpicture_region_t *p_region;
vlc_list_foreach(p_region, &p_spu->regions, node)
vlc_spu_regions_foreach(p_region, &p_spu->regions)
{
if(!subpicture_region_IsText( p_region )||
p_region->p_text == NULL ||

4
modules/codec/zvbi.c

@ -479,7 +479,7 @@ static int Decode( decoder_t *p_dec, block_t *p_block )
else
{
subpicture_region_t *p_region =
vlc_list_first_entry_or_null(&p_spu->regions, subpicture_region_t, node);
vlc_spu_regions_first_or_null(&p_spu->regions);
picture_t *p_pic = p_region->p_picture;
/* ZVBI is stupid enough to assume pitch == width */
@ -558,7 +558,7 @@ static subpicture_t *Subpicture( decoder_t *p_dec,
subpicture_Delete( p_spu );
return NULL;
}
vlc_list_append(&p_region->node, &p_spu->regions);
vlc_spu_regions_push(&p_spu->regions, p_region);
p_spu->i_start = i_pts;
p_spu->i_stop = b_text ? i_pts + VLC_TICK_FROM_SEC(10): 0;

2
modules/hw/mmal/vout.c

@ -758,7 +758,7 @@ static int attach_subpics(vout_display_t * const vd, vout_display_sys_t * const
for (subpicture_t * spic = subpicture; spic != NULL; spic = spic->p_next)
{
subpicture_region_t *sreg;
vlc_list_foreach(sreg, &spic->regions, node) {
vlc_spu_regions_foreach(sreg, &spic->regions) {
picture_t *const src = sreg->p_picture;
// At this point I think the subtitles are being placed in the

2
modules/spu/audiobargraph_v.c

@ -399,7 +399,7 @@ static subpicture_t *FilterSub(filter_t *p_filter, vlc_tick_t date)
p_region->i_x = p_sys->i_pos_x > 0 ? p_sys->i_pos_x : 0;
p_region->i_y = p_sys->i_pos_y > 0 ? p_sys->i_pos_y : 0;
vlc_list_append(&p_region->node, &p_spu->regions);
vlc_spu_regions_push(&p_spu->regions, p_region);
p_spu->i_alpha = p_BarGraph->i_alpha ;

2
modules/spu/dynamicoverlay/dynamicoverlay.c

@ -381,7 +381,7 @@ static subpicture_t *Filter( filter_t *p_filter, vlc_tick_t date )
p_region->i_y = p_overlay->i_y;
p_region->i_align = SUBPICTURE_ALIGN_LEFT | SUBPICTURE_ALIGN_TOP;
p_region->i_alpha = p_overlay->i_alpha;
vlc_list_append( &p_region->node, &p_spu->regions );
vlc_spu_regions_push( &p_spu->regions, p_region );
}
p_sys->b_updated = false;

2
modules/spu/logo.c

@ -392,7 +392,7 @@ static subpicture_t *FilterSub( filter_t *p_filter, vlc_tick_t date )
p_region->i_x = p_sys->i_pos_x > 0 ? p_sys->i_pos_x : 0;
p_region->i_y = p_sys->i_pos_y > 0 ? p_sys->i_pos_y : 0;
vlc_list_append( &p_region->node, &p_spu->regions );
vlc_spu_regions_push( &p_spu->regions, p_region );
p_spu->i_alpha = ( p_logo->i_alpha != -1 ?
p_logo->i_alpha : p_list->i_alpha );

2
modules/spu/marq.c

@ -291,7 +291,7 @@ static subpicture_t *Filter( filter_t *p_filter, vlc_tick_t date )
p_spu = NULL;
goto out;
}
vlc_list_append( &p_region->node, &p_spu->regions );
vlc_spu_regions_push( &p_spu->regions, p_region );
p_region->fmt.i_sar_den = p_region->fmt.i_sar_num = 1;
p_sys->last_time = date;

2
modules/spu/mosaic.c

@ -709,7 +709,7 @@ static subpicture_t *Filter( filter_t *p_filter, vlc_tick_t date )
p_region->i_align = p_sys->i_align;
p_region->i_alpha = p_es->i_alpha;
vlc_list_append(&p_region->node, &p_spu->regions);
vlc_spu_regions_push(&p_spu->regions, p_region);
video_format_Clean( &fmt_in );
video_format_Clean( &fmt_out );

4
modules/spu/rss.c

@ -409,7 +409,7 @@ static subpicture_t *Filter( filter_t *p_filter, vlc_tick_t date )
vlc_mutex_unlock( &p_sys->lock );
return NULL;
}
vlc_list_append( &region->node, &p_spu->regions );
vlc_spu_regions_push( &p_spu->regions, region );
/* Generate the string that will be displayed. This string is supposed to
be p_sys->i_length characters long. */
@ -519,7 +519,7 @@ static subpicture_t *Filter( filter_t *p_filter, vlc_tick_t date )
{
p_region->i_x = region->i_x;
p_region->i_y = region->i_y;
vlc_list_append( &p_region->node, &p_spu->regions );
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;

10
modules/spu/subsdelay.c

@ -941,7 +941,7 @@ static int SubpicValidateWrapper( subpicture_t *p_subpic, bool has_src_changed,
p_entry->b_last_region_saved = false;
subpicture_region_t *p_region =
vlc_list_first_entry_or_null(&p_subpic->regions, subpicture_region_t, node);
vlc_spu_regions_first_or_null(&p_subpic->regions);
if( p_region )
{
/* save copy */
@ -1045,7 +1045,7 @@ static void SubpicLocalUpdate( subpicture_t* p_subpic, vlc_tick_t i_ts )
SubsdelayHeapLock( p_heap );
subpicture_region_t *p_region =
vlc_list_first_entry_or_null(&p_subpic->regions, subpicture_region_t, node);
vlc_spu_regions_first_or_null(&p_subpic->regions);
if( p_entry->b_check_empty && p_region )
{
if( SubsdelayIsTextEmpty( p_region ) )
@ -1112,7 +1112,7 @@ static void SubpicLocalUpdate( subpicture_t* p_subpic, vlc_tick_t i_ts )
static bool SubpicIsEmpty( subpicture_t* p_subpic )
{
subpicture_region_t *p_region =
vlc_list_first_entry_or_null(&p_subpic->regions, subpicture_region_t, node);
vlc_spu_regions_first_or_null(&p_subpic->regions);
return p_region != NULL && SubsdelayIsTextEmpty( p_region );
}
@ -1152,7 +1152,7 @@ static subpicture_t *SubpicClone( subpicture_t *p_source, subpicture_updater_t *
*****************************************************************************/
static void SubpicDestroyClone( subpicture_t *p_subpic )
{
vlc_list_init(&p_subpic->regions); /* don't destroy region */
vlc_spu_regions_init(&p_subpic->regions); /* don't destroy region */
subpicture_Delete( p_subpic );
}
@ -1179,7 +1179,7 @@ static vlc_tick_t SubsdelayEstimateDelay( filter_t *p_filter, subsdelay_heap_ent
if( p_entry->p_subpic )
{
subpicture_region_t *p_region =
vlc_list_first_entry_or_null( &p_entry->p_subpic->regions, subpicture_region_t, node );
vlc_spu_regions_first_or_null( &p_entry->p_subpic->regions );
if( p_region && ( p_region->p_text ) )
{
//FIXME: We only use a single segment here

6
modules/video_output/android/display.c

@ -132,7 +132,7 @@ static bool subpicture_NeedDraw(vout_display_t *vd, subpicture_t *subpicture)
subpicture_region_t *r;
size_t count = 0;
vlc_list_foreach(r, &subpicture->regions, node)
vlc_spu_regions_foreach(r, &subpicture->regions)
count++;
if (subpicture->i_order != sub->last_order)
@ -147,7 +147,7 @@ static bool subpicture_NeedDraw(vout_display_t *vd, subpicture_t *subpicture)
if (count == sub->regions.size)
{
size_t i = 0;
vlc_list_foreach(r, &subpicture->regions, node)
vlc_spu_regions_foreach(r, &subpicture->regions)
{
struct sub_region *cmp = &sub->regions.data[i++];
if (cmp->x != r->i_x || cmp->y != r->i_y
@ -177,7 +177,7 @@ end:
sub->regions.size = 0;
vlc_list_foreach(r, &subpicture->regions, node)
vlc_spu_regions_foreach(r, &subpicture->regions)
{
struct sub_region reg = {
.x = r->i_x,

6
modules/video_output/apple/VLCSampleBufferDisplay.m

@ -433,7 +433,7 @@ static void UpdateSubpictureRegions(vout_display_t *vd,
NSMutableArray *regions = [NSMutableArray new];
CGColorSpaceRef space = CGColorSpaceCreateDeviceRGB();
subpicture_region_t *r;
vlc_list_foreach(r, &subpicture->regions, node) {
vlc_spu_regions_foreach(r, &subpicture->regions) {
CFIndex length = r->fmt.i_height * r->p_picture->p->i_pitch;
const size_t pixels_offset =
r->fmt.i_y_offset * r->p_picture->p->i_pitch +
@ -481,7 +481,7 @@ static bool IsSubpictureDrawNeeded(vout_display_t *vd, subpicture_t *subpicture)
size_t count = 0;
subpicture_region_t *r;
vlc_list_foreach(r, &subpicture->regions, node)
vlc_spu_regions_foreach(r, &subpicture->regions)
count++;
if (!sys.subpicture || subpicture->i_order != sys.subpicture.order)
@ -499,7 +499,7 @@ static bool IsSubpictureDrawNeeded(vout_display_t *vd, subpicture_t *subpicture)
if (count == sys.subpicture.regions.count)
{
size_t i = 0;
vlc_list_foreach(r, &subpicture->regions, node)
vlc_spu_regions_foreach(r, &subpicture->regions)
{
VLCSampleBufferSubpictureRegion *region =
sys.subpicture.regions[i++];

4
modules/video_output/libplacebo/display.c

@ -366,7 +366,7 @@ static void PictureRender(vout_display_t *vd, picture_t *pic,
if (subpicture) {
int num_regions = 0;
subpicture_region_t *r;
vlc_list_foreach(r, &subpicture->regions, node)
vlc_spu_regions_foreach(r, &subpicture->regions)
num_regions++;
// Grow the overlays array if needed
@ -388,7 +388,7 @@ static void PictureRender(vout_display_t *vd, picture_t *pic,
// Upload all of the regions
int i = 0;
vlc_list_foreach(r, &subpicture->regions, node) {
vlc_spu_regions_foreach(r, &subpicture->regions) {
assert(r->p_picture->i_planes == 1);
struct pl_plane_data subdata[4];
if (!vlc_placebo_PlaneData(r->p_picture, subdata, NULL))

4
modules/video_output/opengl/sub_renderer.c

@ -232,7 +232,7 @@ vlc_gl_sub_renderer_Prepare(struct vlc_gl_sub_renderer *sr, subpicture_t *subpic
if (subpicture) {
int count = 0;
subpicture_region_t *r;
vlc_list_foreach(r, &subpicture->regions, node)
vlc_spu_regions_foreach(r, &subpicture->regions)
count++;
gl_region_t *regions = calloc(count, sizeof(*regions));
@ -243,7 +243,7 @@ vlc_gl_sub_renderer_Prepare(struct vlc_gl_sub_renderer *sr, subpicture_t *subpic
sr->regions = regions;
int i = 0;
vlc_list_foreach(r, &subpicture->regions, node) {
vlc_spu_regions_foreach(r, &subpicture->regions) {
gl_region_t *glr = &sr->regions[i];
glr->width = r->fmt.i_visible_width;

4
modules/video_output/win32/direct3d11.cpp

@ -1284,7 +1284,7 @@ static int Direct3D11MapSubpicture(vout_display_t *vd, int *subpicture_region_co
int count = 0;
subpicture_region_t *r;
vlc_list_foreach(r, &subpicture->regions, node)
vlc_spu_regions_foreach(r, &subpicture->regions)
count++;
*region = static_cast<picture_t**>(calloc(count, sizeof(picture_t *)));
@ -1293,7 +1293,7 @@ static int Direct3D11MapSubpicture(vout_display_t *vd, int *subpicture_region_co
*subpicture_region_count = count;
int i = 0;
vlc_list_foreach(r, &subpicture->regions, node) {
vlc_spu_regions_foreach(r, &subpicture->regions) {
if (!r->fmt.i_visible_width || !r->fmt.i_visible_height)
{
i++;

4
modules/video_output/win32/direct3d9.c

@ -874,7 +874,7 @@ static void Direct3D9ImportSubpicture(vout_display_t *vd,
size_t count = 0;
subpicture_region_t *r;
vlc_list_foreach(r, &subpicture->regions, node)
vlc_spu_regions_foreach(r, &subpicture->regions)
count++;
*count_ptr = count;
@ -885,7 +885,7 @@ static void Direct3D9ImportSubpicture(vout_display_t *vd,
}
int i = 0;
vlc_list_foreach(r, &subpicture->regions, node) {
vlc_spu_regions_foreach(r, &subpicture->regions) {
d3d_region_t *d3dr = &(*region)[i];
HRESULT hr;

2
modules/video_output/xcb/render.c

@ -236,7 +236,7 @@ static void Prepare(vout_display_t *vd, picture_t *pic, subpicture_t *subpic,
if (subpic != NULL)
{
subpicture_region_t *r;
vlc_list_foreach(r, &subpic->regions, node)
vlc_spu_regions_foreach(r, &subpic->regions)
RenderRegion(vd, subpic, r);
}

8
src/misc/subpicture.c

@ -51,7 +51,7 @@ subpicture_t *subpicture_New( const subpicture_updater_t *p_upd )
p_subpic->b_fade = false;
p_subpic->b_subtitle = false;
p_subpic->i_alpha = 0xFF;
vlc_list_init(&p_subpic->regions);
vlc_spu_regions_init(&p_subpic->regions);
if( p_upd )
{
@ -316,9 +316,9 @@ void subpicture_region_Delete( subpicture_region_t *p_region )
void vlc_spu_regions_Clear( vlc_spu_regions *regions )
{
subpicture_region_t *p_head;
vlc_list_foreach(p_head, regions, node)
vlc_spu_regions_foreach(p_head, regions)
{
vlc_list_remove( &p_head->node );
vlc_spu_regions_remove( regions, p_head );
subpicture_region_Delete( p_head );
}
}
@ -333,7 +333,7 @@ unsigned picture_BlendSubpicture(picture_t *dst,
assert(src && !src->b_fade && src->b_absolute);
subpicture_region_t *r;
vlc_list_foreach(r, &src->regions, node) {
vlc_spu_regions_foreach(r, &src->regions) {
assert(r->p_picture && r->i_align == 0);
if (filter_ConfigureBlend(blend, dst->format.i_width,
dst->format.i_height, &r->fmt)

16
src/video_output/video_epg.c

@ -328,7 +328,7 @@ static void vout_FillRightPanel(epg_spu_updater_sys_t *p_sys,
height * EPGOSD_TEXTSIZE_NAME,
0x00ffffff);
if(last)
vlc_list_append(&last->node, regions);
vlc_spu_regions_push(regions, last);
const vlc_epg_event_t *p_current = p_sys->epg->p_current;
vlc_epg_event_t *p_next = NULL;
@ -355,7 +355,7 @@ static void vout_FillRightPanel(epg_spu_updater_sys_t *p_sys,
{
/* region rendering limits */
vout_OSDRegionConstrain(last, width, 0);
vlc_list_append(&last->node, regions);
vlc_spu_regions_push(regions, last);
}
}
@ -370,7 +370,7 @@ static void vout_FillRightPanel(epg_spu_updater_sys_t *p_sys,
{
/* region rendering limits */
vout_OSDRegionConstrain(last, width, 0);
vlc_list_append(&last->node, regions);
vlc_spu_regions_push(regions, last);
}
}
@ -387,7 +387,7 @@ static void vout_FillRightPanel(epg_spu_updater_sys_t *p_sys,
height * OSDEPG_ROWS(1),
f_progress);
if (last)
vlc_list_append(&last->node, regions);
vlc_spu_regions_push(regions, last);
/* Format the hours */
if(p_sys->time)
@ -404,7 +404,7 @@ static void vout_FillRightPanel(epg_spu_updater_sys_t *p_sys,
if(last)
{
last->i_align = SUBPICTURE_ALIGN_TOP|SUBPICTURE_ALIGN_RIGHT;
vlc_list_append(&last->node, regions);
vlc_spu_regions_push(regions, last);
}
}
}
@ -426,7 +426,7 @@ static void vout_BuildOSDEpg(epg_spu_updater_sys_t *p_sys,
visible_height * OSDEPG_HEIGHT,
ARGB_BGCOLOR);
if(last)
vlc_list_append(&last->node, regions);
vlc_spu_regions_push(regions, last);
struct
{
@ -467,7 +467,7 @@ static void vout_BuildOSDEpg(epg_spu_updater_sys_t *p_sys,
logo.h,
0xFF000000 | RGB_COLOR1);
if(last)
vlc_list_append(&last->node, regions);
vlc_spu_regions_push(regions, last);
int logo_padding = visible_height * (OSDEPG_LOGO_SIZE * OSDEPG_PADDING);
last = vout_OSDImage( p_sys->obj,
@ -477,7 +477,7 @@ static void vout_BuildOSDEpg(epg_spu_updater_sys_t *p_sys,
logo.h - 2 * logo_padding,
p_sys->art );
if(last)
vlc_list_append(&last->node, regions);
vlc_spu_regions_push(regions, last);
/* shrink */
panel.x += logo.w + i_padding;

2
src/video_output/video_text.c

@ -69,7 +69,7 @@ static void OSDTextUpdate(subpicture_t *subpic,
subpicture_region_t *r = subpicture_region_NewText();
if (!r)
return;
vlc_list_append(&r->node, &subpic->regions);
vlc_spu_regions_push(&subpic->regions, r);
r->fmt.i_sar_num = 1;
r->fmt.i_sar_den = 1;

2
src/video_output/video_widgets.c

@ -290,7 +290,7 @@ static void OSDWidgetUpdate(subpicture_t *subpic,
else
p_region = OSDIcon(sys->type, &fmt);
if (p_region)
vlc_list_append(&p_region->node, &subpic->regions);
vlc_spu_regions_push(&subpic->regions, p_region);
}
static void OSDWidgetDestroy(subpicture_t *subpic)

14
src/video_output/vout_subpictures.c

@ -1151,7 +1151,7 @@ static subpicture_t *SpuRenderSubpictures(spu_t *spu,
size_t count = 0;
subpicture_region_t *p_head;
vlc_list_foreach(p_head, &subpic->regions, node)
vlc_spu_regions_foreach(p_head, &subpic->regions)
count++;
if (subpic->b_subtitle)
@ -1185,7 +1185,7 @@ static subpicture_t *SpuRenderSubpictures(spu_t *spu,
subpicture_t *subpic = entry->subpic;
subpicture_region_t *region;
if (vlc_list_is_empty(&subpic->regions))
if (vlc_spu_regions_is_empty(&subpic->regions))
continue;
if (subpic->i_original_picture_width == 0 ||
@ -1209,7 +1209,7 @@ static subpicture_t *SpuRenderSubpictures(spu_t *spu,
* We always transform non absolute subtitle into absolute one on the
* first rendering to allow good subtitle overlap support.
*/
vlc_list_foreach(region, &subpic->regions, node) {
vlc_spu_regions_foreach(region, &subpic->regions) {
spu_area_t area;
/* Compute region scale AR */
@ -1277,7 +1277,7 @@ static subpicture_t *SpuRenderSubpictures(spu_t *spu,
}
}
vlc_list_append(&output_last_ptr->node, &output->regions);
vlc_spu_regions_push(&output->regions, output_last_ptr);
}
if (subpic->b_subtitle) {
@ -1290,7 +1290,7 @@ static subpicture_t *SpuRenderSubpictures(spu_t *spu,
subtitle_area[subtitle_area_count++] = area;
}
}
if (subpic->b_subtitle && vlc_list_is_empty(&subpic->regions))
if (subpic->b_subtitle && vlc_spu_regions_is_empty(&subpic->regions))
subpic->b_absolute = true;
}
@ -1523,7 +1523,7 @@ static void spu_PrerenderText(spu_t *spu, subpicture_t *p_subpic,
const unsigned i_original_picture_height = p_subpic->i_original_picture_height;
subpicture_region_t *region;
vlc_list_foreach(region, &p_subpic->regions, node)
vlc_spu_regions_foreach(region, &p_subpic->regions)
{
if(!subpicture_region_IsText( region ))
continue;
@ -1885,7 +1885,7 @@ void spu_PutSubpicture(spu_t *spu, subpicture_t *subpic)
/* p_private is for spu only and cannot be non NULL here */
subpicture_region_t *r;
vlc_list_foreach(r, &subpic->regions, node)
vlc_spu_regions_foreach(r, &subpic->regions)
assert(r->p_private == NULL);
/* */

2
test/modules/video_output/opengl/sub_renderer.c

@ -180,7 +180,7 @@ static void test_opengl_offscreen(
subpicture_region_t *p_region = subpicture_region_ForPicture(&fmt, picture);
assert(p_region != NULL);
vlc_list_append( &p_region->node, &subpicture->regions );
vlc_spu_regions_push( &subpicture->regions, p_region );
ret = vlc_gl_sub_renderer_Prepare(sr, subpicture);
assert(ret == VLC_SUCCESS);

2
test/src/input/decoder/input_decoder_scenarios.c

@ -484,7 +484,7 @@ static int cc_decoder_decode_common(decoder_t *dec, vlc_frame_t *in,
subpicture_region_t *p_region = subpicture_region_NewText();;
assert(p_region != NULL);
vlc_list_append( &p_region->node, &subpic->regions );
vlc_spu_regions_push( &subpic->regions, p_region );
p_region->p_text = text_segment_New(text);
assert(p_region->p_text != NULL);

Loading…
Cancel
Save