libgpac
Documentation of the core library of GPAC
|
Typedefs | |
typedef struct _3gpp_text_sample | GF_TextSample |
typedef struct _generic_subtitle_sample | GF_GenericSubtitleSample |
Enumerations | |
enum | GF_TextDumpType { GF_TEXTDUMPTYPE_TTXT = 0 , GF_TEXTDUMPTYPE_TTXT_BOXES , GF_TEXTDUMPTYPE_SRT , GF_TEXTDUMPTYPE_SVG , GF_TEXTDUMPTYPE_TTXT_CHAP , GF_TEXTDUMPTYPE_OGG_CHAP , GF_TEXTDUMPTYPE_ZOOM_CHAP } |
enum | GF_TextFlagsMode { GF_ISOM_TEXT_FLAGS_OVERWRITE = 0 , GF_ISOM_TEXT_FLAGS_TOGGLE , GF_ISOM_TEXT_FLAGS_UNTOGGLE } |
Functions | |
GF_Err | gf_isom_text_set_streaming_mode (GF_ISOFile *isom_file, Bool do_convert) |
GF_Err | gf_isom_text_dump (GF_ISOFile *isom_file, u32 trackNumber, FILE *dump, GF_TextDumpType dump_type) |
GF_Err | gf_isom_text_get_encoded_tx3g (GF_ISOFile *isom_file, u32 trackNumber, u32 sampleDescriptionIndex, u32 sidx_offset, u8 **tx3g, u32 *tx3g_size) |
GF_Err | gf_isom_set_forced_text (GF_ISOFile *isom_file, u32 trackNumber, u32 sampleDescriptionIndex, u32 force_type) |
GF_TextSample * | gf_isom_new_text_sample () |
void | gf_isom_delete_text_sample (GF_TextSample *tx_samp) |
GF_GenericSubtitleSample * | gf_isom_new_generic_subtitle_sample () |
void | gf_isom_delete_generic_subtitle_sample (GF_GenericSubtitleSample *generic_subtitle_samp) |
GF_Err | gf_isom_new_webvtt_description (GF_ISOFile *isom_file, u32 trackNumber, const char *URLname, const char *URNname, u32 *outDescriptionIndex, const char *config) |
const char * | gf_isom_get_webvtt_config (GF_ISOFile *isom_file, u32 trackNumber, u32 sampleDescriptionIndex) |
GF_Err | gf_isom_stxt_get_description (GF_ISOFile *isom_file, u32 trackNumber, u32 sampleDescriptionIndex, const char **mime, const char **encoding, const char **config) |
GF_Err | gf_isom_new_stxt_description (GF_ISOFile *isom_file, u32 trackNumber, u32 type, const char *mime, const char *encoding, const char *config, u32 *outDescriptionIndex) |
GF_Err | gf_isom_xml_subtitle_get_description (GF_ISOFile *isom_file, u32 trackNumber, u32 sampleDescriptionIndex, const char **xmlnamespace, const char **xml_schema_loc, const char **mimes) |
GF_Err | gf_isom_new_xml_subtitle_description (GF_ISOFile *isom_file, u32 trackNumber, const char *xmlnamespace, const char *xml_schema_loc, const char *auxiliary_mimes, u32 *outDescriptionIndex) |
const char * | gf_isom_subtitle_get_mime (GF_ISOFile *isom_file, u32 trackNumber, u32 sampleDescriptionIndex) |
GF_Err | gf_isom_subtitle_set_mime (GF_ISOFile *isom_file, u32 trackNumber, u32 sampleDescriptionIndex, const char *full_mime) |
GF_Err | gf_isom_get_xml_metadata_description (GF_ISOFile *isom_file, u32 trackNumber, u32 sampleDescriptionIndex, const char **xmlnamespace, const char **schema_loc, const char **content_encoding) |
GF_Err | gf_isom_new_xml_metadata_description (GF_ISOFile *isom_file, u32 trackNumber, const char *xmlnamespace, const char *schema_loc, const char *content_encoding, u32 *outDescriptionIndex) |
GF_Err | gf_isom_text_set_display_flags (GF_ISOFile *isom_file, u32 trackNumber, u32 sampleDescriptionIndex, u32 flags, GF_TextFlagsMode op_type) |
GF_Err | gf_isom_get_text_description (GF_ISOFile *isom_file, u32 trackNumber, u32 sampleDescriptionIndex, GF_TextSampleDescriptor **out_desc) |
GF_Err | gf_isom_new_text_description (GF_ISOFile *isom_file, u32 trackNumber, GF_TextSampleDescriptor *desc, const char *URLname, const char *URNname, u32 *outDescriptionIndex) |
GF_Err | gf_isom_text_reset (GF_TextSample *tx_samp) |
GF_Err | gf_isom_text_reset_styles (GF_TextSample *tx_samp) |
GF_Err | gf_isom_text_add_text (GF_TextSample *tx_samp, char *text_data, u32 text_len) |
GF_Err | gf_isom_text_add_style (GF_TextSample *tx_samp, GF_StyleRecord *rec) |
GF_Err | gf_isom_text_add_highlight (GF_TextSample *tx_samp, u16 start_char, u16 end_char) |
GF_Err | gf_isom_text_set_highlight_color (GF_TextSample *tx_samp, u32 argb) |
GF_Err | gf_isom_text_add_karaoke (GF_TextSample *tx_samp, u32 start_time) |
GF_Err | gf_isom_text_set_karaoke_segment (GF_TextSample *tx_samp, u32 end_time, u16 start_char, u16 end_char) |
GF_Err | gf_isom_text_set_scroll_delay (GF_TextSample *tx_samp, u32 scroll_delay) |
GF_Err | gf_isom_text_add_hyperlink (GF_TextSample *tx_samp, char *URL, char *altString, u16 start_char, u16 end_char) |
GF_Err | gf_isom_text_set_box (GF_TextSample *tx_samp, s16 top, s16 left, s16 bottom, s16 right) |
GF_Err | gf_isom_text_add_blink (GF_TextSample *tx_samp, u16 start_char, u16 end_char) |
GF_Err | gf_isom_text_set_wrap (GF_TextSample *tx_samp, u8 wrap_flags) |
GF_Err | gf_isom_text_set_forced (GF_TextSample *tx_samp, Bool is_forced) |
GF_Err | gf_isom_text_sample_write_bs (const GF_TextSample *tx_samp, GF_BitStream *bs) |
GF_ISOSample * | gf_isom_text_to_sample (const GF_TextSample *tx_samp) |
u32 | gf_isom_text_sample_size (GF_TextSample *tx_samp) |
GF_GenericSubtitleSample * | gf_isom_new_xml_subtitle_sample () |
void | gf_isom_delete_xml_subtitle_sample (GF_GenericSubtitleSample *subt_samp) |
GF_Err | gf_isom_xml_subtitle_reset (GF_GenericSubtitleSample *subt_samp) |
GF_ISOSample * | gf_isom_xml_subtitle_to_sample (GF_GenericSubtitleSample *subt_samp) |
GF_Err | gf_isom_xml_subtitle_sample_add_text (GF_GenericSubtitleSample *subt_samp, char *text_data, u32 text_len) |
typedef struct _3gpp_text_sample GF_TextSample |
text sample formatting
typedef struct _generic_subtitle_sample GF_GenericSubtitleSample |
generic subtitle sample formatting
enum GF_TextDumpType |
text track export type
enum GF_TextFlagsMode |
text flags operation type
GF_Err gf_isom_text_set_streaming_mode | ( | GF_ISOFile * | isom_file, |
Bool | do_convert | ||
) |
sets streaming text reading mode (MPEG-4 text vs 3GPP)
isom_file | the target ISO file |
do_convert | is set, all text samples will be retrieved as TTUs and ESD will be emulated for text tracks |
GF_Err gf_isom_text_dump | ( | GF_ISOFile * | isom_file, |
u32 | trackNumber, | ||
FILE * | dump, | ||
GF_TextDumpType | dump_type | ||
) |
dumps a text track to a file
isom_file | the target ISO file |
trackNumber | the target track |
dump | the file object to write to (binary open mode) |
dump_type | the dump type mode |
GF_Err gf_isom_text_get_encoded_tx3g | ( | GF_ISOFile * | isom_file, |
u32 | trackNumber, | ||
u32 | sampleDescriptionIndex, | ||
u32 | sidx_offset, | ||
u8 ** | tx3g, | ||
u32 * | tx3g_size | ||
) |
gets encoded TX3G box (text sample description for 3GPP text streams) as needed by RTP or other standards:
isom_file | the target ISO file |
trackNumber | the target track |
sampleDescriptionIndex | the sample description index |
sidx_offset | if 0, the sidx will NOT be written before the encoded TX3G. If not 0, the sidx will be written before the encoded TX3G, with the given offset. Offset sshould be at least 128 for most common usage of TX3G (RTP, MPEG-4 timed text, etc) |
tx3g | set to a newly allocated buffer containing the encoded tx3g - to be freed by caller |
tx3g_size | set to the size of the encoded config |
GF_Err gf_isom_set_forced_text | ( | GF_ISOFile * | isom_file, |
u32 | trackNumber, | ||
u32 | sampleDescriptionIndex, | ||
u32 | force_type | ||
) |
sets TX3G flags for forced samples
isom_file | the target ISO file |
trackNumber | the target track |
sampleDescriptionIndex | the sample description index |
force_type | if 0, no forced subs are present. If 1, some forced subs are present; if 2, all samples are forced subs |
GF_TextSample* gf_isom_new_text_sample | ( | ) |
creates text sample handle
void gf_isom_delete_text_sample | ( | GF_TextSample * | tx_samp | ) |
destroys text sample handle
tx_samp | the target text sample |
GF_GenericSubtitleSample* gf_isom_new_generic_subtitle_sample | ( | ) |
creates generic subtitle sample handle
void gf_isom_delete_generic_subtitle_sample | ( | GF_GenericSubtitleSample * | generic_subtitle_samp | ) |
destroys generic subtitle sample handle
generic_subtitle_samp | the target generic subtitle sample |
GF_Err gf_isom_new_webvtt_description | ( | GF_ISOFile * | isom_file, |
u32 | trackNumber, | ||
const char * | URLname, | ||
const char * | URNname, | ||
u32 * | outDescriptionIndex, | ||
const char * | config | ||
) |
creates new WebVTT config
isom_file | the target ISO file |
trackNumber | the target track |
URLname | URL value of the data reference, NULL if no data reference (media in the file) |
URNname | URN value of the data reference, NULL if no data reference (media in the file) |
outDescriptionIndex | set to the index of the created sample description |
config | the WebVTT configuration string |
const char* gf_isom_get_webvtt_config | ( | GF_ISOFile * | isom_file, |
u32 | trackNumber, | ||
u32 | sampleDescriptionIndex | ||
) |
gets WebVTT config for a sample description
isom_file | the target ISO file |
trackNumber | the target track |
sampleDescriptionIndex | the target sample description index |
GF_Err gf_isom_stxt_get_description | ( | GF_ISOFile * | isom_file, |
u32 | trackNumber, | ||
u32 | sampleDescriptionIndex, | ||
const char ** | mime, | ||
const char ** | encoding, | ||
const char ** | config | ||
) |
gets simple streaming text config for a sample description
isom_file | the target ISO file |
trackNumber | the target track |
sampleDescriptionIndex | the target sample description index |
mime | set to the mime type (optional, can be NULL) |
encoding | set to the text encoding type (optional, can be NULL) |
config | set to the WebVTT configuration string (optional, can be NULL) |
GF_Err gf_isom_new_stxt_description | ( | GF_ISOFile * | isom_file, |
u32 | trackNumber, | ||
u32 | type, | ||
const char * | mime, | ||
const char * | encoding, | ||
const char * | config, | ||
u32 * | outDescriptionIndex | ||
) |
creates new simple streaming text config
isom_file | the target ISO file |
trackNumber | the target track |
type | the four character code of the simple text sample description (sbtt, stxt, mett) |
mime | the mime type |
encoding | the text encoding, if any |
config | the configuration string, if any |
outDescriptionIndex | set to the index of the created sample description |
GF_Err gf_isom_xml_subtitle_get_description | ( | GF_ISOFile * | isom_file, |
u32 | trackNumber, | ||
u32 | sampleDescriptionIndex, | ||
const char ** | xmlnamespace, | ||
const char ** | xml_schema_loc, | ||
const char ** | mimes | ||
) |
gets XML streaming text config for a sample description
isom_file | the target ISO file |
trackNumber | the target track |
sampleDescriptionIndex | the target sample description index |
xmlnamespace | set to the XML namespace (optional, can be NULL) |
xml_schema_loc | set to the XML schema location (optional, can be NULL) |
mimes | set to the associated mime(s) types (optional, can be NULL) |
GF_Err gf_isom_new_xml_subtitle_description | ( | GF_ISOFile * | isom_file, |
u32 | trackNumber, | ||
const char * | xmlnamespace, | ||
const char * | xml_schema_loc, | ||
const char * | auxiliary_mimes, | ||
u32 * | outDescriptionIndex | ||
) |
creates a new XML streaming text config
isom_file | the target ISO file |
trackNumber | the target track |
xmlnamespace | the XML namespace |
xml_schema_loc | the XML schema location (optional, can be NULL) |
auxiliary_mimes | the associated mime(s) types (optional, can be NULL) |
outDescriptionIndex | set to the index of the created sample description |
const char* gf_isom_subtitle_get_mime | ( | GF_ISOFile * | isom_file, |
u32 | trackNumber, | ||
u32 | sampleDescriptionIndex | ||
) |
gets MIME parameters (type/subtype + codecs and profiles) associated with a sample descritpion
isom_file | the target ISO file |
trackNumber | the target track |
sampleDescriptionIndex | the target sample description index |
GF_Err gf_isom_subtitle_set_mime | ( | GF_ISOFile * | isom_file, |
u32 | trackNumber, | ||
u32 | sampleDescriptionIndex, | ||
const char * | full_mime | ||
) |
gets MIME parameters associated with a sample descritpion
isom_file | the target ISO file |
trackNumber | the target track |
sampleDescriptionIndex | the target sample description index |
full_mime | MIME param (type/subtype + codecs and profiles) to set, if NULL removes MIME parameter info |
GF_Err gf_isom_get_xml_metadata_description | ( | GF_ISOFile * | isom_file, |
u32 | trackNumber, | ||
u32 | sampleDescriptionIndex, | ||
const char ** | xmlnamespace, | ||
const char ** | schema_loc, | ||
const char ** | content_encoding | ||
) |
gets XML metadata for a sample description
isom_file | the target ISO file |
trackNumber | the target track |
sampleDescriptionIndex | the target sample description index |
xmlnamespace | set to the XML namespace (optional, can be NULL) |
schema_loc | set to the XML schema location (optional, can be NULL) |
content_encoding | set to the content encoding string (optional, can be NULL) |
GF_Err gf_isom_new_xml_metadata_description | ( | GF_ISOFile * | isom_file, |
u32 | trackNumber, | ||
const char * | xmlnamespace, | ||
const char * | schema_loc, | ||
const char * | content_encoding, | ||
u32 * | outDescriptionIndex | ||
) |
creates a new timed metadata sample description for this track
isom_file | the target ISO file |
trackNumber | the target track |
xmlnamespace | the XML namespace |
schema_loc | the XML schema location (optional, can be NULL) |
content_encoding | the content encoding string (optional, can be NULL) |
outDescriptionIndex | set to the index of the created sample description |
GF_Err gf_isom_text_set_display_flags | ( | GF_ISOFile * | isom_file, |
u32 | trackNumber, | ||
u32 | sampleDescriptionIndex, | ||
u32 | flags, | ||
GF_TextFlagsMode | op_type | ||
) |
sets text display flags according to given mode.
isom_file | the target ISO file |
trackNumber | the target track |
sampleDescriptionIndex | the target sample description index. If 0, sets the flags for all text descriptions |
flags | the flag to set |
op_type | the flag toggle mode |
GF_Err gf_isom_get_text_description | ( | GF_ISOFile * | isom_file, |
u32 | trackNumber, | ||
u32 | sampleDescriptionIndex, | ||
GF_TextSampleDescriptor ** | out_desc | ||
) |
gets text description of a sample description
isom_file | the target ISO file |
trackNumber | the target track |
sampleDescriptionIndex | the target sample description index |
out_desc | set to a newly allocated text sample descriptor - shall be freeed by user |
GF_Err gf_isom_new_text_description | ( | GF_ISOFile * | isom_file, |
u32 | trackNumber, | ||
GF_TextSampleDescriptor * | desc, | ||
const char * | URLname, | ||
const char * | URNname, | ||
u32 * | outDescriptionIndex | ||
) |
creates a new TextSampleDescription in the file.
isom_file | the target ISO file |
trackNumber | the target track |
desc | the text sample description |
URLname | URL value of the data reference, NULL if no data reference (media in the file) |
URNname | URN value of the data reference, NULL if no data reference (media in the file) |
outDescriptionIndex | set to the index of the created sample description |
GF_Err gf_isom_text_reset | ( | GF_TextSample * | tx_samp | ) |
resets text sample content
tx_samp | the target text sample |
GF_Err gf_isom_text_reset_styles | ( | GF_TextSample * | tx_samp | ) |
resets text sample styles but keep text
tx_samp | the target text sample |
GF_Err gf_isom_text_add_text | ( | GF_TextSample * | tx_samp, |
char * | text_data, | ||
u32 | text_len | ||
) |
appends text to sample - text_len is the number of bytes to be written from text_data. This allows handling UTF8 and UTF16 strings in a transparent manner
tx_samp | the target text sample |
text_data | the text data to add |
text_len | the size of the data to add |
GF_Err gf_isom_text_add_style | ( | GF_TextSample * | tx_samp, |
GF_StyleRecord * | rec | ||
) |
appends style modifyer to sample
tx_samp | the target text sample |
rec | the style record to add |
GF_Err gf_isom_text_add_highlight | ( | GF_TextSample * | tx_samp, |
u16 | start_char, | ||
u16 | end_char | ||
) |
appends highlight modifier for the sample
tx_samp | the target text sample |
start_char | first char highlighted, |
end_char | first char not highlighted |
GF_Err gf_isom_text_set_highlight_color | ( | GF_TextSample * | tx_samp, |
u32 | argb | ||
) |
sets highlight color for the whole sample
tx_samp | the target text sample |
argb | color value |
GF_Err gf_isom_text_add_karaoke | ( | GF_TextSample * | tx_samp, |
u32 | start_time | ||
) |
appends a new karaoke sequence in the sample
tx_samp | the target text sample |
start_time | karaoke start time expressed in text stream timescale, but relative to the sample media time |
GF_Err gf_isom_text_set_karaoke_segment | ( | GF_TextSample * | tx_samp, |
u32 | end_time, | ||
u16 | start_char, | ||
u16 | end_char | ||
) |
appends a new segment in the current karaoke sequence - you must build sequences in order to be compliant
tx_samp | the target text sample |
end_time | segment end time expressed in text stream timescale, but relative to the sample media time |
start_char | first char highlighted, |
end_char | first char not highlighted |
GF_Err gf_isom_text_set_scroll_delay | ( | GF_TextSample * | tx_samp, |
u32 | scroll_delay | ||
) |
sets scroll delay for the whole sample (scrolling is enabled through GF_TextSampleDescriptor.DisplayFlags)
tx_samp | the target text sample |
scroll_delay | delay for scrolling expressed in text stream timescale |
GF_Err gf_isom_text_add_hyperlink | ( | GF_TextSample * | tx_samp, |
char * | URL, | ||
char * | altString, | ||
u16 | start_char, | ||
u16 | end_char | ||
) |
appends hyperlinking for the sample
tx_samp | the target text sample |
URL | UTF-8 url |
altString | UTF-8 hint (tooltip, ...) for end user |
start_char | first char hyperlinked, |
end_char | first char not hyperlinked |
sets current text box (display pos&size within the text track window) for the sample
tx_samp | the target text sample |
top | top coordinate of box |
left | left coordinate of box |
bottom | bottom coordinate of box |
right | right coordinate of box |
GF_Err gf_isom_text_add_blink | ( | GF_TextSample * | tx_samp, |
u16 | start_char, | ||
u16 | end_char | ||
) |
appends blinking for the sample
tx_samp | the target text sample |
start_char | first char blinking, |
end_char | first char not blinking |
GF_Err gf_isom_text_set_wrap | ( | GF_TextSample * | tx_samp, |
u8 | wrap_flags | ||
) |
sets wrap flag for the sample
tx_samp | the target text sample |
wrap_flags | text wrap flags - currently only 0 (no wrap) and 1 ("soft wrap") are allowed in 3GP |
GF_Err gf_isom_text_set_forced | ( | GF_TextSample * | tx_samp, |
Bool | is_forced | ||
) |
sets force for the sample
tx_samp | the target text sample |
is_forced | for ce sample if TRUE |
GF_Err gf_isom_text_sample_write_bs | ( | const GF_TextSample * | tx_samp, |
GF_BitStream * | bs | ||
) |
formats sample as a regular GF_ISOSample payload in a bitstream object.
tx_samp | the target text sample |
bs | thetarget bitstream |
GF_ISOSample* gf_isom_text_to_sample | ( | const GF_TextSample * | tx_samp | ) |
formats sample as a regular GF_ISOSample. The resulting sample will always be marked as random access
tx_samp | the target text sample |
u32 gf_isom_text_sample_size | ( | GF_TextSample * | tx_samp | ) |
gets the serialized size of the text sample
tx_samp | the target text sample |
GF_GenericSubtitleSample* gf_isom_new_xml_subtitle_sample | ( | ) |
creates a new XML subtitle sample
void gf_isom_delete_xml_subtitle_sample | ( | GF_GenericSubtitleSample * | subt_samp | ) |
deletes an XML subtitle sample
subt_samp | the target XML subtitle sample |
GF_Err gf_isom_xml_subtitle_reset | ( | GF_GenericSubtitleSample * | subt_samp | ) |
resets content of an XML subtitle sample
subt_samp | the target XML subtitle sample |
GF_ISOSample* gf_isom_xml_subtitle_to_sample | ( | GF_GenericSubtitleSample * | subt_samp | ) |
the corresponding serialized ISO sample
subt_samp | the target XML subtitle sample |
GF_Err gf_isom_xml_subtitle_sample_add_text | ( | GF_GenericSubtitleSample * | subt_samp, |
char * | text_data, | ||
u32 | text_len | ||
) |
appends text to an XML subtitle sample
subt_samp | the target XML subtitle sample |
text_data | the UTF-8 or UTF-16 data to add |
text_len | the size of the text to add in bytes |