GNOME Bugzilla – Bug 339520
[subparse] add "encoding" property
Last modified: 2006-05-17 17:55:05 UTC
Currently, subparse plugin use GST_SUBTITLE_ENCODING value for subtitle text charset decoding. But, I think it is not end-user friendly. End-user might want to select charset from some combobox or similar UI. so, I suggest that add encoding property in plugin.
Created attachment 64171 [details] [review] add encoding property patch
Well, I don't really see how a property is more *end-user* friendly, since end-users don't set properties on elements anyway, the application does that (and normally the subparse element is autoplugged by decodebin or playbin anyway, so even the application has a hard time doing this). Nevertheless, let's add it, since this is the way we do stuff, and also that way it shows up in gst-inspect and in the docs. Committed with some changes: - the first property must have an enum value > 0, that's why there's usually an unused PROP_0 enum at the beginning of the properties enums list - the property should be G_PARAM_READWRITE, not just G_PARAM_WRITABLE (and you implement both as well, ie. there is a getter function) - used subparse->encoding rather than subparse->default_encoding, since it's not really the default, but a fallback in case the text is not UTF-8 (also, it's shorter). 2006-05-17 Tim-Philipp Müller <tim at centricular dot net> Patch by: Young-Ho Cha <ganadist chollian net> * gst/subparse/gstsubparse.c: (gst_sub_parse_dispose), (gst_sub_parse_class_init), (gst_sub_parse_init), (gst_sub_parse_set_property), (gst_sub_parse_get_property), (convert_encoding): * gst/subparse/gstsubparse.h: Add 'encoding' property (#341681). * gst/subparse/samiparse.c: (characters_sami): Output is pango markup, so we need to escape text between tags (#342143).