
Data Structures | |
| struct | spu_heap_entry_t |
| struct | spu_heap_t |
| struct | spu_private_t |
| struct | filter_owner_sys_t |
| struct | spu_scale_t |
| struct | spu_area_t |
| A few area functions helpers. More... | |
Defines | |
| #define | VOUT_MAX_SUBPICTURES (__MAX(VOUT_MAX_PICTURES, SPU_MAX_PREPARE_TIME/5000)) |
| #define | SCALE_UNIT (1000) |
| A few scale functions helpers. | |
Functions | |
| static void | SpuHeapInit (spu_heap_t *heap) |
| static int | SpuHeapPush (spu_heap_t *heap, subpicture_t *subpic) |
| static void | SpuHeapDeleteAt (spu_heap_t *heap, int index) |
| static int | SpuHeapDeleteSubpicture (spu_heap_t *heap, subpicture_t *subpic) |
| static void | SpuHeapClean (spu_heap_t *heap) |
| static void | FilterRelease (filter_t *filter) |
| static picture_t * | spu_new_video_buffer (filter_t *filter) |
| static void | spu_del_video_buffer (filter_t *filter, picture_t *picture) |
| static int | spu_get_attachments (filter_t *filter, input_attachment_t ***attachment_ptr, int *attachment_count) |
| static filter_t * | SpuRenderCreateAndLoadText (spu_t *spu) |
| static filter_t * | SpuRenderCreateAndLoadScale (vlc_object_t *object, vlc_fourcc_t src_chroma, vlc_fourcc_t dst_chroma, bool require_resize) |
| static void | SpuRenderText (spu_t *spu, bool *rerender_text, subpicture_region_t *region, const vlc_fourcc_t *chroma_list, mtime_t elapsed_time) |
| static spu_scale_t | spu_scale_create (int w, int h) |
| static spu_scale_t | spu_scale_unit (void) |
| static spu_scale_t | spu_scale_createq (int64_t wn, int64_t wd, int64_t hn, int64_t hd) |
| static int | spu_scale_w (int v, const spu_scale_t s) |
| static int | spu_scale_h (int v, const spu_scale_t s) |
| static int | spu_invscale_w (int v, const spu_scale_t s) |
| static int | spu_invscale_h (int v, const spu_scale_t s) |
| static spu_area_t | spu_area_create (int x, int y, int w, int h, spu_scale_t s) |
| static spu_area_t | spu_area_scaled (spu_area_t a) |
| static spu_area_t | spu_area_unscaled (spu_area_t a, spu_scale_t s) |
| static bool | spu_area_overlap (spu_area_t a, spu_area_t b) |
| static void | SpuAreaFixOverlap (spu_area_t *dst, const spu_area_t *sub_array, int sub_count, int align) |
| Avoid area overlapping. | |
| static void | SpuAreaFitInside (spu_area_t *area, const spu_area_t *boundary) |
| static void | SpuRegionPlace (int *x, int *y, const subpicture_t *subpic, const subpicture_region_t *region) |
| Place a region. | |
| static int | IntegerCmp (int64_t i0, int64_t i1) |
| This function compares two 64 bits integers. | |
| static int | SubpictureCmp (const void *s0, const void *s1) |
| This function compares 2 subpictures using the following properties (ordered by priority) 1. | |
| static void | SpuSelectSubpictures (spu_t *spu, unsigned int *subpicture_count, subpicture_t **subpicture_array, mtime_t render_subtitle_date, mtime_t render_osd_date, bool ignore_osd) |
| static void | SpuRenderRegion (spu_t *spu, subpicture_region_t **dst_ptr, spu_area_t *dst_area, subpicture_t *subpic, subpicture_region_t *region, const spu_scale_t scale_size, const vlc_fourcc_t *chroma_list, const video_format_t *fmt, const spu_area_t *subtitle_area, int subtitle_area_count, mtime_t render_date) |
| It will transform the provided region into another region suitable for rendering. | |
| static subpicture_t * | SpuRenderSubpictures (spu_t *spu, unsigned int i_subpicture, subpicture_t **pp_subpicture, const vlc_fourcc_t *chroma_list, const video_format_t *fmt_dst, const video_format_t *fmt_src, mtime_t render_subtitle_date, mtime_t render_osd_date) |
| This function renders all sub picture units in the list. | |
| static void | UpdateSPU (spu_t *spu, vlc_object_t *object) |
| static int | CropCallback (vlc_object_t *object, char const *var, vlc_value_t oldval, vlc_value_t newval, void *data) |
| static subpicture_t * | sub_new_buffer (filter_t *filter) |
| static void | sub_del_buffer (filter_t *filter, subpicture_t *subpic) |
| static int | SubSourceAllocationInit (filter_t *filter, void *data) |
| static void | SubSourceAllocationClean (filter_t *filter) |
| spu_t * | spu_Create (vlc_object_t *object) |
| Creates the subpicture unit. | |
| void | spu_Destroy (spu_t *spu) |
| Destroy the subpicture unit. | |
| void | spu_Attach (spu_t *spu, vlc_object_t *input, bool attach) |
| Attach/Detach the SPU from any input. | |
| int | spu_ProcessMouse (spu_t *spu, const vlc_mouse_t *mouse, const video_format_t *fmt) |
| Inform the SPU filters of mouse event. | |
| void | spu_PutSubpicture (spu_t *spu, subpicture_t *subpic) |
| Display a subpicture. | |
| subpicture_t * | spu_Render (spu_t *spu, const vlc_fourcc_t *chroma_list, const video_format_t *fmt_dst, const video_format_t *fmt_src, mtime_t render_subtitle_date, mtime_t render_osd_date, bool ignore_osd) |
| This function will return an unique subpicture containing the OSD and subtitles visibles at the requested date. | |
| void | spu_OffsetSubtitleDate (spu_t *spu, mtime_t duration) |
| This function will apply an offset on subtitle subpicture. | |
| int | spu_RegisterChannel (spu_t *spu) |
| It registers a new SPU channel. | |
| void | spu_ClearChannel (spu_t *spu, int channel) |
| It clears all subpictures associated to a SPU channel. | |
| void | spu_ChangeSources (spu_t *spu, const char *filters) |
| It changes the sub sources list. | |
| void | spu_ChangeFilters (spu_t *spu, const char *filters) |
| It changes the sub filters list. | |
| void | spu_ChangeMargin (spu_t *spu, int margin) |
| #define SCALE_UNIT (1000) |
A few scale functions helpers.
Referenced by spu_area_scaled(), spu_invscale_h(), spu_invscale_w(), spu_scale_createq(), spu_scale_unit(), and SpuRenderRegion().
| #define VOUT_MAX_SUBPICTURES (__MAX(VOUT_MAX_PICTURES, SPU_MAX_PREPARE_TIME/5000)) |
| static int CropCallback | ( | vlc_object_t * | object, | |
| char const * | var, | |||
| vlc_value_t | oldval, | |||
| vlc_value_t | newval, | |||
| void * | data | |||
| ) | [static] |
References UpdateSPU(), and VLC_UNUSED.
Referenced by spu_Attach().
| static void FilterRelease | ( | filter_t * | filter | ) | [static] |
References module_unneed, filter_t::p_module, filter_t::p_owner, and vlc_object_release.
Referenced by spu_Attach(), and spu_Destroy().
| static int IntegerCmp | ( | int64_t | i0, | |
| int64_t | i1 | |||
| ) | [static] |
This function compares two 64 bits integers.
It can be used by qsort.
Referenced by SubpictureCmp().
| static spu_area_t spu_area_create | ( | int | x, | |
| int | y, | |||
| int | w, | |||
| int | h, | |||
| spu_scale_t | s | |||
| ) | [static] |
References spu_area_t::x.
Referenced by SpuRenderRegion().
| static bool spu_area_overlap | ( | spu_area_t | a, | |
| spu_area_t | b | |||
| ) | [static] |
References __MAX, __MIN, spu_area_t::height, spu_area_scaled(), spu_area_t::width, spu_area_t::x, and spu_area_t::y.
Referenced by SpuAreaFixOverlap().
| static spu_area_t spu_area_scaled | ( | spu_area_t | a | ) | [static] |
References spu_scale_t::h, spu_area_t::height, spu_area_t::scale, SCALE_UNIT, spu_scale_h(), spu_scale_unit(), spu_scale_w(), spu_scale_t::w, spu_area_t::width, spu_area_t::x, and spu_area_t::y.
Referenced by spu_area_overlap(), spu_area_unscaled(), SpuAreaFitInside(), and SpuAreaFixOverlap().
| static spu_area_t spu_area_unscaled | ( | spu_area_t | a, | |
| spu_scale_t | s | |||
| ) | [static] |
References spu_scale_t::h, spu_area_t::height, spu_area_t::scale, spu_area_scaled(), spu_invscale_h(), spu_invscale_w(), spu_scale_t::w, spu_area_t::width, spu_area_t::x, and spu_area_t::y.
Referenced by SpuAreaFitInside(), SpuAreaFixOverlap(), and SpuRenderSubpictures().
| void spu_Attach | ( | spu_t * | spu, | |
| vlc_object_t * | input, | |||
| bool | attach | |||
| ) |
Attach/Detach the SPU from any input.
| p_this | the object in which to destroy the subpicture unit | |
| b_attach | to select attach or detach |
References CropCallback(), FilterRelease(), spu_private_t::input, spu_private_t::lock, spu_t::p, SpuRenderCreateAndLoadText(), spu_private_t::text, UpdateSPU(), var_AddCallback, var_Create, var_DelCallback, var_Destroy, vlc_mutex_lock(), vlc_mutex_unlock(), and VLC_VAR_BOOL.
Referenced by vout_Close(), vout_Request(), and VoutCreate().
| void spu_ChangeMargin | ( | spu_t * | spu, | |
| int | margin | |||
| ) |
References spu_private_t::lock, spu_private_t::margin, spu_t::p, vlc_mutex_lock(), and vlc_mutex_unlock().
Referenced by ThreadChangeSubMargin().
References picture_Release(), and VLC_UNUSED.
| static int spu_get_attachments | ( | filter_t * | filter, | |
| input_attachment_t *** | attachment_ptr, | |||
| int * | attachment_count | |||
| ) | [static] |
References spu_private_t::input, input_Control(), INPUT_GET_ATTACHMENTS, spu_t::p, filter_t::p_owner, and filter_owner_sys_t::spu.
| static int spu_invscale_h | ( | int | v, | |
| const spu_scale_t | s | |||
| ) | [static] |
References spu_scale_t::h, and SCALE_UNIT.
Referenced by spu_area_unscaled(), and SpuRenderRegion().
| static int spu_invscale_w | ( | int | v, | |
| const spu_scale_t | s | |||
| ) | [static] |
References SCALE_UNIT, and spu_scale_t::w.
Referenced by spu_area_unscaled().
References fmt, filter_t::fmt_out, picture_NewFromFormat(), es_format_t::video, and VLC_UNUSED.
This function will apply an offset on subtitle subpicture.
References subpicture_t::b_subtitle, spu_heap_t::entry, spu_private_t::heap, subpicture_t::i_start, subpicture_t::i_stop, spu_private_t::lock, spu_t::p, spu_heap_entry_t::subpicture, vlc_mutex_lock(), and vlc_mutex_unlock().
Referenced by ThreadChangePause().
| int spu_ProcessMouse | ( | spu_t * | spu, | |
| const vlc_mouse_t * | mouse, | |||
| const video_format_t * | fmt | |||
| ) |
Inform the SPU filters of mouse event.
References filter_chain_MouseEvent(), spu_t::p, spu_private_t::source_chain, spu_private_t::source_chain_lock, vlc_mutex_lock(), and vlc_mutex_unlock().
Referenced by vout_SendDisplayEventMouse().
| static spu_scale_t spu_scale_create | ( | int | w, | |
| int | h | |||
| ) | [static] |
References spu_scale_t::h, and spu_scale_t::w.
Referenced by spu_scale_createq(), and spu_scale_unit().
| static spu_scale_t spu_scale_createq | ( | int64_t | wn, | |
| int64_t | wd, | |||
| int64_t | hn, | |||
| int64_t | hd | |||
| ) | [static] |
References SCALE_UNIT, and spu_scale_create().
Referenced by SpuRenderSubpictures().
| static int spu_scale_h | ( | int | v, | |
| const spu_scale_t | s | |||
| ) | [static] |
References spu_scale_t::h.
Referenced by spu_area_scaled(), and SpuRenderRegion().
| static spu_scale_t spu_scale_unit | ( | void | ) | [static] |
References SCALE_UNIT, and spu_scale_create().
Referenced by spu_area_scaled(), and SpuRenderRegion().
| static int spu_scale_w | ( | int | v, | |
| const spu_scale_t | s | |||
| ) | [static] |
References spu_scale_t::w.
Referenced by spu_area_scaled(), and SpuRenderRegion().
| static void SpuAreaFitInside | ( | spu_area_t * | area, | |
| const spu_area_t * | boundary | |||
| ) | [static] |
References spu_area_t::height, spu_area_t::scale, spu_area_scaled(), spu_area_unscaled(), spu_area_t::width, spu_area_t::x, and spu_area_t::y.
Referenced by SpuRenderRegion().
| static void SpuAreaFixOverlap | ( | spu_area_t * | dst, | |
| const spu_area_t * | sub_array, | |||
| int | sub_count, | |||
| int | align | |||
| ) | [static] |
Avoid area overlapping.
References spu_area_t::height, spu_area_t::scale, spu_area_overlap(), spu_area_scaled(), spu_area_unscaled(), SUBPICTURE_ALIGN_BOTTOM, SUBPICTURE_ALIGN_TOP, and spu_area_t::y.
Referenced by SpuRenderRegion().
| static void SpuHeapClean | ( | spu_heap_t * | heap | ) | [static] |
References spu_heap_t::entry, spu_heap_entry_t::subpicture, and subpicture_Delete().
Referenced by spu_Destroy().
| static void SpuHeapDeleteAt | ( | spu_heap_t * | heap, | |
| int | index | |||
| ) | [static] |
References spu_heap_t::entry, spu_heap_entry_t::subpicture, and subpicture_Delete().
Referenced by SpuHeapDeleteSubpicture(), and SpuSelectSubpictures().
| static int SpuHeapDeleteSubpicture | ( | spu_heap_t * | heap, | |
| subpicture_t * | subpic | |||
| ) | [static] |
References spu_heap_t::entry, SpuHeapDeleteAt(), and spu_heap_entry_t::subpicture.
Referenced by SpuSelectSubpictures().
| static void SpuHeapInit | ( | spu_heap_t * | heap | ) | [static] |
References spu_heap_t::entry, spu_heap_entry_t::reject, and spu_heap_entry_t::subpicture.
Referenced by spu_Create().
| static int SpuHeapPush | ( | spu_heap_t * | heap, | |
| subpicture_t * | subpic | |||
| ) | [static] |
References spu_heap_t::entry, spu_heap_entry_t::reject, and spu_heap_entry_t::subpicture.
Referenced by spu_PutSubpicture().
| static void SpuRegionPlace | ( | int * | x, | |
| int * | y, | |||
| const subpicture_t * | subpic, | |||
| const subpicture_region_t * | region | |||
| ) | [static] |
Place a region.
References subpicture_t::b_absolute, subpicture_region_t::fmt, subpicture_region_t::i_align, video_format_t::i_height, subpicture_t::i_original_picture_height, subpicture_t::i_original_picture_width, video_format_t::i_width, subpicture_region_t::i_x, subpicture_region_t::i_y, SUBPICTURE_ALIGN_BOTTOM, SUBPICTURE_ALIGN_LEFT, SUBPICTURE_ALIGN_RIGHT, and SUBPICTURE_ALIGN_TOP.
Referenced by SpuRenderRegion().
| static filter_t* SpuRenderCreateAndLoadScale | ( | vlc_object_t * | object, | |
| vlc_fourcc_t | src_chroma, | |||
| vlc_fourcc_t | dst_chroma, | |||
| bool | require_resize | |||
| ) | [static] |
References es_format_Init(), filter_t::fmt_in, filter_t::fmt_out, video_format_t::i_chroma, video_format_t::i_height, video_format_t::i_width, module_need, filter_t::p_module, es_format_t::video, VIDEO_ES, and vlc_custom_create.
Referenced by spu_Create().
References es_format_Init(), filter_t::fmt_in, filter_t::fmt_out, video_format_t::i_height, video_format_t::i_visible_height, video_format_t::i_visible_width, video_format_t::i_width, module_need, filter_t::p_module, filter_t::p_owner, filter_t::pf_get_attachments, filter_owner_sys_t::spu, text, var_Create, es_format_t::video, VIDEO_ES, vlc_custom_create, VLC_VAR_BOOL, VLC_VAR_TIME, and xmalloc().
Referenced by spu_Attach(), and spu_Create().
| static void SpuRenderRegion | ( | spu_t * | spu, | |
| subpicture_region_t ** | dst_ptr, | |||
| spu_area_t * | dst_area, | |||
| subpicture_t * | subpic, | |||
| subpicture_region_t * | region, | |||
| const spu_scale_t | scale_size, | |||
| const vlc_fourcc_t * | chroma_list, | |||
| const video_format_t * | fmt, | |||
| const spu_area_t * | subtitle_area, | |||
| int | subtitle_area_count, | |||
| mtime_t | render_date | |||
| ) | [static] |
It will transform the provided region into another region suitable for rendering.
References __MAX, __MIN, subpicture_t::b_absolute, subpicture_t::b_fade, subpicture_t::b_subtitle, spu_private_t::crop, subpicture_region_private_t::fmt, subpicture_region_t::fmt, filter_t::fmt_in, filter_t::fmt_out, spu_private_t::force_crop, spu_private_t::force_palette, picture_t::format, spu_scale_t::h, spu_private_t::height, subpicture_region_t::i_align, subpicture_t::i_alpha, subpicture_region_t::i_alpha, video_format_t::i_chroma, es_format_t::i_codec, video_palette_t::i_entries, video_format_t::i_height, subpicture_t::i_start, subpicture_t::i_stop, video_format_t::i_visible_height, video_format_t::i_visible_width, video_format_t::i_width, subpicture_region_t::i_x, video_format_t::i_x_offset, subpicture_region_t::i_y, video_format_t::i_y_offset, spu_private_t::margin, msg_Err, msg_Warn, spu_t::p, filter_t::p_module, video_format_t::p_palette, subpicture_region_private_t::p_picture, subpicture_region_t::p_picture, subpicture_region_t::p_private, spu_private_t::palette, video_palette_t::palette, picture_Hold(), picture_Release(), spu_private_t::scale, spu_area_t::scale, SCALE_UNIT, spu_private_t::scale_yuvp, spu_area_create(), spu_invscale_h(), spu_scale_h(), spu_scale_unit(), spu_scale_w(), SpuAreaFitInside(), SpuAreaFixOverlap(), SpuRegionPlace(), SpuRenderText(), subpicture_region_New(), subpicture_region_private_Delete(), subpicture_region_private_New(), es_format_t::video, VLC_CODEC_TEXT, spu_scale_t::w, spu_private_t::width, spu_private_t::x, spu_area_t::x, spu_private_t::y, and spu_area_t::y.
Referenced by SpuRenderSubpictures().
| static subpicture_t* SpuRenderSubpictures | ( | spu_t * | spu, | |
| unsigned int | i_subpicture, | |||
| subpicture_t ** | pp_subpicture, | |||
| const vlc_fourcc_t * | chroma_list, | |||
| const video_format_t * | fmt_dst, | |||
| const video_format_t * | fmt_src, | |||
| mtime_t | render_subtitle_date, | |||
| mtime_t | render_osd_date | |||
| ) | [static] |
This function renders all sub picture units in the list.
References subpicture_t::b_absolute, subpicture_t::b_subtitle, count, subpicture_region_t::fmt, filter_t::fmt_out, spu_scale_t::h, spu_area_t::height, video_format_t::i_height, subpicture_t::i_original_picture_height, subpicture_t::i_original_picture_width, video_format_t::i_sar_den, video_format_t::i_sar_num, video_format_t::i_visible_height, video_format_t::i_visible_width, video_format_t::i_width, subpicture_region_t::i_x, subpicture_region_t::i_y, msg_Err, msg_Warn, spu_t::p, subpicture_region_t::p_next, subpicture_t::p_region, spu_area_unscaled(), spu_scale_createq(), SpuRenderRegion(), subpicture_New(), spu_private_t::text, es_format_t::video, vlc_ureduce(), spu_scale_t::w, spu_area_t::width, spu_area_t::x, and spu_area_t::y.
Referenced by spu_Render().
| static void SpuRenderText | ( | spu_t * | spu, | |
| bool * | rerender_text, | |||
| subpicture_region_t * | region, | |||
| const vlc_fourcc_t * | chroma_list, | |||
| mtime_t | elapsed_time | |||
| ) | [static] |
References subpicture_region_t::fmt, video_format_t::i_chroma, spu_t::p, filter_t::p_module, subpicture_region_t::psz_html, spu_private_t::text, text, var_GetBool, var_SetBool, var_SetTime, and VLC_CODEC_TEXT.
Referenced by SpuRenderRegion().
| static void SpuSelectSubpictures | ( | spu_t * | spu, | |
| unsigned int * | subpicture_count, | |||
| subpicture_t ** | subpicture_array, | |||
| mtime_t | render_subtitle_date, | |||
| mtime_t | render_osd_date, | |||
| bool | ignore_osd | |||
| ) | [static] |
References __MAX, subpicture_t::b_ephemer, subpicture_t::b_subtitle, spu_heap_t::entry, spu_private_t::heap, subpicture_t::i_channel, subpicture_t::i_order, subpicture_t::i_start, subpicture_t::i_stop, spu_private_t::last_sort_date, spu_t::p, spu_heap_entry_t::reject, SpuHeapDeleteAt(), SpuHeapDeleteSubpicture(), and spu_heap_entry_t::subpicture.
Referenced by spu_Render().
| static void sub_del_buffer | ( | filter_t * | filter, | |
| subpicture_t * | subpic | |||
| ) | [static] |
References subpicture_Delete(), and VLC_UNUSED.
| static subpicture_t* sub_new_buffer | ( | filter_t * | filter | ) | [static] |
References filter_owner_sys_t::channel, subpicture_t::i_channel, filter_t::p_owner, and subpicture_New().
| static int SubpictureCmp | ( | const void * | s0, | |
| const void * | s1 | |||
| ) | [static] |
This function compares 2 subpictures using the following properties (ordered by priority) 1.
absolute positionning 2. start time 3. creation order (per channel)
It can be used by qsort.
XXX spu_RenderSubpictures depends heavily on this order.
References subpicture_t::b_absolute, subpicture_t::i_channel, subpicture_t::i_order, subpicture_t::i_start, and IntegerCmp().
Referenced by spu_Render().
| static void SubSourceAllocationClean | ( | filter_t * | filter | ) | [static] |
References filter_owner_sys_t::channel, filter_t::p_owner, filter_owner_sys_t::spu, and spu_ClearChannel().
Referenced by spu_Create().
| static int SubSourceAllocationInit | ( | filter_t * | filter, | |
| void * | data | |||
| ) | [static] |
References filter_owner_sys_t::channel, filter_t::p_owner, filter_owner_sys_t::spu, and spu_RegisterChannel().
Referenced by spu_Create().
| static void UpdateSPU | ( | spu_t * | spu, | |
| vlc_object_t * | object | |||
| ) | [static] |
References vlc_value_t::b_bool, spu_private_t::crop, spu_private_t::force_crop, spu_private_t::force_palette, spu_private_t::height, spu_private_t::lock, msg_Dbg, spu_t::p, vlc_value_t::p_address, spu_private_t::palette, var_Get, var_GetInteger, vlc_mutex_lock(), vlc_mutex_unlock(), VLC_SUCCESS, spu_private_t::width, spu_private_t::x, and spu_private_t::y.
Referenced by CropCallback(), and spu_Attach().
1.7.1