gst_plugins_base/gst/subparse/gstsubparse.h
changeset 16 8e837d1bf446
parent 0 0e761a78d257
child 30 7e817e7e631c
equal deleted inserted replaced
15:4b0c6ed43234 16:8e837d1bf446
    20 
    20 
    21 #ifndef __GST_SUBPARSE_H__
    21 #ifndef __GST_SUBPARSE_H__
    22 #define __GST_SUBPARSE_H__
    22 #define __GST_SUBPARSE_H__
    23 
    23 
    24 #include <gst/gst.h>
    24 #include <gst/gst.h>
       
    25 #include <gst/base/gstadapter.h>
    25 
    26 
    26 GST_DEBUG_CATEGORY_EXTERN (sub_parse_debug);
    27 GST_DEBUG_CATEGORY_EXTERN (sub_parse_debug);
    27 #define GST_CAT_DEFAULT sub_parse_debug
    28 #define GST_CAT_DEFAULT sub_parse_debug
    28 
    29 
    29 G_BEGIN_DECLS
    30 G_BEGIN_DECLS
    58 typedef struct {
    59 typedef struct {
    59   int      state;
    60   int      state;
    60   GString *buf;
    61   GString *buf;
    61   guint64  start_time;
    62   guint64  start_time;
    62   guint64  duration;
    63   guint64  duration;
       
    64   guint64  max_duration; /* to clamp duration, 0 = no limit (used by tmplayer parser) */
    63   GstSegment *segment;
    65   GstSegment *segment;
    64   gpointer user_data;
    66   gpointer user_data;
    65   gdouble  fps;          /* used by microdvd parser */
    67   gdouble  fps;          /* used by microdvd parser */
    66 } ParserState;
    68 } ParserState;
    67 
    69 
    70 struct _GstSubParse {
    72 struct _GstSubParse {
    71   GstElement element;
    73   GstElement element;
    72 
    74 
    73   GstPad *sinkpad,*srcpad;
    75   GstPad *sinkpad,*srcpad;
    74 
    76 
       
    77   /* contains the input in the input encoding */
       
    78   GstAdapter *adapter;
       
    79   /* contains the UTF-8 decoded input */
    75   GString *textbuf;
    80   GString *textbuf;
    76 
    81 
    77   GstSubParseFormat parser_type;
    82   GstSubParseFormat parser_type;
    78   gboolean parser_detected;
    83   gboolean parser_detected;
       
    84   const gchar *subtitle_codec;
    79 
    85 
    80   Parser parse_line;
    86   Parser parse_line;
    81   ParserState state;
    87   ParserState state;
    82 
    88 
    83   /* seek */
    89   /* seek */
    89   GstSeekFlags  segment_flags;
    95   GstSeekFlags  segment_flags;
    90   gboolean      need_segment;
    96   gboolean      need_segment;
    91   
    97   
    92   gboolean flushing;
    98   gboolean flushing;
    93   gboolean valid_utf8;
    99   gboolean valid_utf8;
       
   100   gchar   *detected_encoding;
    94   gchar   *encoding;
   101   gchar   *encoding;
       
   102 
       
   103   gboolean first_buffer;
    95 };
   104 };
    96 
   105 
    97 struct _GstSubParseClass {
   106 struct _GstSubParseClass {
    98   GstElementClass parent_class;
   107   GstElementClass parent_class;
    99 };
   108 };