ttmlrender: put all functions in gst_ttml_render namespace
https://bugzilla.gnome.org/show_bug.cgi?id=780402
This commit is contained in:
parent
b8f37d1074
commit
96e07de31d
@ -1166,7 +1166,7 @@ typedef struct
|
|||||||
} TextRange;
|
} TextRange;
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_text_range_free (TextRange * range)
|
gst_ttml_render_text_range_free (TextRange * range)
|
||||||
{
|
{
|
||||||
g_slice_free (TextRange, range);
|
g_slice_free (TextRange, range);
|
||||||
}
|
}
|
||||||
@ -1241,7 +1241,7 @@ typedef struct
|
|||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_unified_element_free (UnifiedElement * unified_element)
|
gst_ttml_render_unified_element_free (UnifiedElement * unified_element)
|
||||||
{
|
{
|
||||||
g_free (unified_element->text);
|
g_free (unified_element->text);
|
||||||
g_slice_free (UnifiedElement, unified_element);
|
g_slice_free (UnifiedElement, unified_element);
|
||||||
@ -1255,7 +1255,7 @@ typedef struct
|
|||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_unified_block_free (UnifiedBlock * unified_block)
|
gst_ttml_render_unified_block_free (UnifiedBlock * unified_block)
|
||||||
{
|
{
|
||||||
g_ptr_array_unref (unified_block->unified_elements);
|
g_ptr_array_unref (unified_block->unified_elements);
|
||||||
g_slice_free (UnifiedBlock, unified_block);
|
g_slice_free (UnifiedBlock, unified_block);
|
||||||
@ -1263,7 +1263,7 @@ _unified_block_free (UnifiedBlock * unified_block)
|
|||||||
|
|
||||||
|
|
||||||
static UnifiedElement *
|
static UnifiedElement *
|
||||||
_unified_block_get_element (UnifiedBlock * block, guint index)
|
gst_ttml_render_unified_block_get_element (UnifiedBlock * block, guint index)
|
||||||
{
|
{
|
||||||
if (index >= block->unified_elements->len)
|
if (index >= block->unified_elements->len)
|
||||||
return NULL;
|
return NULL;
|
||||||
@ -1276,8 +1276,8 @@ static void
|
|||||||
gst_ttml_render_handle_whitespace (UnifiedBlock * block)
|
gst_ttml_render_handle_whitespace (UnifiedBlock * block)
|
||||||
{
|
{
|
||||||
UnifiedElement *last = NULL;
|
UnifiedElement *last = NULL;
|
||||||
UnifiedElement *cur = _unified_block_get_element (block, 0);
|
UnifiedElement *cur = gst_ttml_render_unified_block_get_element (block, 0);
|
||||||
UnifiedElement *next = _unified_block_get_element (block, 1);
|
UnifiedElement *next = gst_ttml_render_unified_block_get_element (block, 1);
|
||||||
guint i;
|
guint i;
|
||||||
|
|
||||||
for (i = 2; cur; ++i) {
|
for (i = 2; cur; ++i) {
|
||||||
@ -1303,7 +1303,7 @@ gst_ttml_render_handle_whitespace (UnifiedBlock * block)
|
|||||||
}
|
}
|
||||||
last = cur;
|
last = cur;
|
||||||
cur = next;
|
cur = next;
|
||||||
next = _unified_block_get_element (block, i);
|
next = gst_ttml_render_unified_block_get_element (block, i);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1313,8 +1313,8 @@ gst_ttml_render_unify_block (const GstSubtitleBlock * block, GstBuffer * buf)
|
|||||||
{
|
{
|
||||||
guint i;
|
guint i;
|
||||||
UnifiedBlock *ret = g_slice_new0 (UnifiedBlock);
|
UnifiedBlock *ret = g_slice_new0 (UnifiedBlock);
|
||||||
ret->unified_elements =
|
ret->unified_elements = g_ptr_array_new_with_free_func ((GDestroyNotify)
|
||||||
g_ptr_array_new_with_free_func ((GDestroyNotify) _unified_element_free);
|
gst_ttml_render_unified_element_free);
|
||||||
|
|
||||||
for (i = 0; i < gst_subtitle_block_get_element_count (block); ++i) {
|
for (i = 0; i < gst_subtitle_block_get_element_count (block); ++i) {
|
||||||
UnifiedElement *ue = g_slice_new0 (UnifiedElement);
|
UnifiedElement *ue = g_slice_new0 (UnifiedElement);
|
||||||
@ -1350,7 +1350,7 @@ gst_ttml_render_generate_marked_up_string (GstTtmlRender * render,
|
|||||||
for (i = 0; i < element_count; ++i) {
|
for (i = 0; i < element_count; ++i) {
|
||||||
TextRange *range = g_slice_new0 (TextRange);
|
TextRange *range = g_slice_new0 (TextRange);
|
||||||
UnifiedElement *unified_element =
|
UnifiedElement *unified_element =
|
||||||
_unified_block_get_element (unified_block, i);
|
gst_ttml_render_unified_block_get_element (unified_block, i);
|
||||||
|
|
||||||
escaped_text = g_markup_escape_text (unified_element->text, -1);
|
escaped_text = g_markup_escape_text (unified_element->text, -1);
|
||||||
GST_CAT_DEBUG (ttmlrender_debug, "Escaped text is: \"%s\"", escaped_text);
|
GST_CAT_DEBUG (ttmlrender_debug, "Escaped text is: \"%s\"", escaped_text);
|
||||||
@ -1403,7 +1403,7 @@ gst_ttml_render_generate_marked_up_string (GstTtmlRender * render,
|
|||||||
g_free (font_size);
|
g_free (font_size);
|
||||||
}
|
}
|
||||||
|
|
||||||
_unified_block_free (unified_block);
|
gst_ttml_render_unified_block_free (unified_block);
|
||||||
return joined_text;
|
return joined_text;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1955,8 +1955,8 @@ gst_ttml_render_render_text_block (GstTtmlRender * render,
|
|||||||
const GstSubtitleBlock * block, GstBuffer * text_buf, guint width,
|
const GstSubtitleBlock * block, GstBuffer * text_buf, guint width,
|
||||||
gboolean overflow)
|
gboolean overflow)
|
||||||
{
|
{
|
||||||
GPtrArray *char_ranges =
|
GPtrArray *char_ranges = g_ptr_array_new_with_free_func ((GDestroyNotify)
|
||||||
g_ptr_array_new_with_free_func ((GDestroyNotify) _text_range_free);
|
gst_ttml_render_text_range_free);
|
||||||
gchar *marked_up_string;
|
gchar *marked_up_string;
|
||||||
PangoAlignment alignment;
|
PangoAlignment alignment;
|
||||||
guint max_font_size;
|
guint max_font_size;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user