gstreamer_core/gst/gstquery.h
changeset 8 4a7fac7dd34a
parent 0 0e761a78d257
child 30 7e817e7e631c
equal deleted inserted replaced
7:71e347f905f2 8:4a7fac7dd34a
    44  * @GST_QUERY_RATE: current rate of the stream
    44  * @GST_QUERY_RATE: current rate of the stream
    45  * @GST_QUERY_SEEKING: seeking capabilities
    45  * @GST_QUERY_SEEKING: seeking capabilities
    46  * @GST_QUERY_SEGMENT: segment start/stop positions
    46  * @GST_QUERY_SEGMENT: segment start/stop positions
    47  * @GST_QUERY_CONVERT: convert values between formats
    47  * @GST_QUERY_CONVERT: convert values between formats
    48  * @GST_QUERY_FORMATS: query supported formats for convert
    48  * @GST_QUERY_FORMATS: query supported formats for convert
       
    49  * @GST_QUERY_BUFFERING: query available media for efficient seeking. Since
       
    50  * 0.10.20.
       
    51  * @GST_QUERY_CUSTOM: a custom application or element defined query. Since
       
    52  * 0.10.22.
       
    53  * @GST_QUERY_URI: query the URI of the source or sink. Since 0.10.22.
    49  *
    54  *
    50  * Standard predefined Query types
    55  * Standard predefined Query types
    51  */
    56  */
    52 /* NOTE: don't forget to update the table in gstquery.c when changing
    57 /* NOTE: don't forget to update the table in gstquery.c when changing
    53  * this enum */
    58  * this enum */
    59   GST_QUERY_JITTER, 	/* not in draft-query, necessary? */
    64   GST_QUERY_JITTER, 	/* not in draft-query, necessary? */
    60   GST_QUERY_RATE,
    65   GST_QUERY_RATE,
    61   GST_QUERY_SEEKING,
    66   GST_QUERY_SEEKING,
    62   GST_QUERY_SEGMENT,
    67   GST_QUERY_SEGMENT,
    63   GST_QUERY_CONVERT,
    68   GST_QUERY_CONVERT,
    64   GST_QUERY_FORMATS
    69   GST_QUERY_FORMATS,
       
    70   GST_QUERY_BUFFERING,
       
    71   GST_QUERY_CUSTOM,
       
    72   GST_QUERY_URI
    65 } GstQueryType;
    73 } GstQueryType;
       
    74 
       
    75 /**
       
    76  * GstBufferingMode:
       
    77  * @GST_BUFFERING_STREAM: a small amount of data is buffered
       
    78  * @GST_BUFFERING_DOWNLOAD: the stream is being downloaded
       
    79  * @GST_BUFFERING_TIMESHIFT: the stream is being downloaded in a ringbuffer
       
    80  * @GST_BUFFERING_LIVE: the stream is a live stream
       
    81  *
       
    82  * The different types of buffering methods.
       
    83  */
       
    84 typedef enum {
       
    85   GST_BUFFERING_STREAM,
       
    86   GST_BUFFERING_DOWNLOAD,
       
    87   GST_BUFFERING_TIMESHIFT,
       
    88   GST_BUFFERING_LIVE
       
    89 } GstBufferingMode;
    66 
    90 
    67 typedef struct _GstQueryTypeDefinition GstQueryTypeDefinition;
    91 typedef struct _GstQueryTypeDefinition GstQueryTypeDefinition;
    68 typedef struct _GstQuery GstQuery;
    92 typedef struct _GstQuery GstQuery;
    69 typedef struct _GstQueryClass GstQueryClass;
    93 typedef struct _GstQueryClass GstQueryClass;
    70 
    94 
    88 #define GST_TYPE_QUERY				(gst_query_get_type())
   112 #define GST_TYPE_QUERY				(gst_query_get_type())
    89 #define GST_IS_QUERY(obj)                      (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_QUERY))
   113 #define GST_IS_QUERY(obj)                      (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_QUERY))
    90 #define GST_IS_QUERY_CLASS(klass)              (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_QUERY))
   114 #define GST_IS_QUERY_CLASS(klass)              (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_QUERY))
    91 #define GST_QUERY_GET_CLASS(obj)               (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_QUERY, GstQueryClass))
   115 #define GST_QUERY_GET_CLASS(obj)               (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_QUERY, GstQueryClass))
    92 #define GST_QUERY(obj)                         (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_QUERY, GstQuery))
   116 #define GST_QUERY(obj)                         (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_QUERY, GstQuery))
       
   117 #define GST_QUERY_CAST(obj)                    ((GstQuery*)(obj)) /* only since 0.10.23 */
    93 #define GST_QUERY_CLASS(klass)                 (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_QUERY, GstQueryClass))
   118 #define GST_QUERY_CLASS(klass)                 (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_QUERY, GstQueryClass))
       
   119 
    94 
   120 
    95 /**
   121 /**
    96  * GST_QUERY_TYPE:
   122  * GST_QUERY_TYPE:
    97  * @query: the query to query
   123  * @query: the query to query
    98  *
   124  *
   126   /*< public > *//* with COW */
   152   /*< public > *//* with COW */
   127   GstQueryType type;
   153   GstQueryType type;
   128 
   154 
   129   GstStructure *structure;
   155   GstStructure *structure;
   130 
   156 
   131   /*< private > */
   157   /*< private >*/
   132   gpointer _gst_reserved;
   158   gpointer _gst_reserved;
   133 };
   159 };
   134 
   160 
   135 struct _GstQueryClass {
   161 struct _GstQueryClass {
   136   GstMiniObjectClass mini_object_class;
   162   GstMiniObjectClass mini_object_class;
   137 
   163 
   138   /*< private > */
   164   /*< private >*/
   139   gpointer _gst_reserved[GST_PADDING];
   165   gpointer _gst_reserved[GST_PADDING];
   140 };
   166 };
   141 #ifdef __SYMBIAN32__
   167 #ifdef __SYMBIAN32__
   142 IMPORT_C
   168 IMPORT_C
   143 #endif
   169 #endif
   195 /**
   221 /**
   196  * gst_query_ref:
   222  * gst_query_ref:
   197  * @q: a #GstQuery to increase the refcount of.
   223  * @q: a #GstQuery to increase the refcount of.
   198  *
   224  *
   199  * Increases the refcount of the given query by one.
   225  * Increases the refcount of the given query by one.
   200  */
   226  *
   201 #define         gst_query_ref(q)		GST_QUERY (gst_mini_object_ref (GST_MINI_OBJECT (q)))
   227  * Returns: @q
       
   228  */
       
   229 #ifdef _FOOL_GTK_DOC_
       
   230 G_INLINE_FUNC GstQuery * gst_query_ref (GstQuery * q);
       
   231 #endif
       
   232 
       
   233 static inline GstQuery *
       
   234 gst_query_ref (GstQuery * q)
       
   235 {
       
   236   return GST_QUERY (gst_mini_object_ref (GST_MINI_OBJECT_CAST (q)));
       
   237 }
       
   238 
   202 /**
   239 /**
   203  * gst_query_unref:
   240  * gst_query_unref:
   204  * @q: a #GstQuery to decrease the refcount of.
   241  * @q: a #GstQuery to decrease the refcount of.
   205  *
   242  *
   206  * Decreases the refcount of the query. If the refcount reaches 0, the query
   243  * Decreases the refcount of the query. If the refcount reaches 0, the query
   207  * will be freed.
   244  * will be freed.
   208  */
   245  */
   209 #define         gst_query_unref(q)		gst_mini_object_unref (GST_MINI_OBJECT (q))
   246 #ifdef _FOOL_GTK_DOC_
       
   247 G_INLINE_FUNC void gst_query_unref (GstQuery * q);
       
   248 #endif
       
   249 
       
   250 static inline void
       
   251 gst_query_unref (GstQuery * q)
       
   252 {
       
   253   gst_mini_object_unref (GST_MINI_OBJECT_CAST (q));
       
   254 }
   210 
   255 
   211 /* copy query */
   256 /* copy query */
   212 /**
   257 /**
   213  * gst_query_copy:
   258  * gst_query_copy:
   214  * @q: a #GstQuery to copy.
   259  * @q: a #GstQuery to copy.
   215  *
   260  *
   216  * Copies the given query using the copy function of the parent #GstData
   261  * Copies the given query using the copy function of the parent #GstData
   217  * structure.
   262  * structure.
   218  */
   263  *
   219 #define         gst_query_copy(q)		GST_QUERY (gst_mini_object_copy (GST_MINI_OBJECT (q)))
   264  * Returns: a new copy of @q.
       
   265  */
       
   266 #ifdef _FOOL_GTK_DOC_
       
   267 G_INLINE_FUNC GstQuery * gst_query_copy (const GstQuery * q);
       
   268 #endif
       
   269 
       
   270 static inline GstQuery *
       
   271 gst_query_copy (const GstQuery * q)
       
   272 {
       
   273   return GST_QUERY (gst_mini_object_copy (GST_MINI_OBJECT_CAST (q)));
       
   274 }
       
   275 
   220 /**
   276 /**
   221  * gst_query_make_writable:
   277  * gst_query_make_writable:
   222  * @q: a #GstQuery to make writable
   278  * @q: a #GstQuery to make writable
   223  *
   279  *
   224  * Makes a writable query from the given query.
   280  * Makes a writable query from the given query.
   375 IMPORT_C
   431 IMPORT_C
   376 #endif
   432 #endif
   377 
   433 
   378 void            gst_query_parse_formats_nth     (GstQuery *query, guint nth, GstFormat *format);
   434 void            gst_query_parse_formats_nth     (GstQuery *query, guint nth, GstFormat *format);
   379 
   435 
       
   436 /* buffering query */
       
   437 #ifdef __SYMBIAN32__
       
   438 IMPORT_C
       
   439 #endif
       
   440 
       
   441 GstQuery*       gst_query_new_buffering           (GstFormat format);
       
   442 #ifdef __SYMBIAN32__
       
   443 IMPORT_C
       
   444 #endif
       
   445 
       
   446 void            gst_query_set_buffering_percent   (GstQuery *query, gboolean busy, gint percent);
       
   447 #ifdef __SYMBIAN32__
       
   448 IMPORT_C
       
   449 #endif
       
   450 
       
   451 void            gst_query_parse_buffering_percent (GstQuery *query, gboolean *busy, gint *percent);
       
   452 #ifdef __SYMBIAN32__
       
   453 IMPORT_C
       
   454 #endif
       
   455 
       
   456 
       
   457 void            gst_query_set_buffering_stats     (GstQuery *query, GstBufferingMode mode,
       
   458                                                    gint avg_in, gint avg_out, 
       
   459 						   gint64 buffering_left);
       
   460 #ifdef __SYMBIAN32__
       
   461 IMPORT_C
       
   462 #endif
       
   463  
       
   464 void            gst_query_parse_buffering_stats    (GstQuery *query, GstBufferingMode *mode,
       
   465                                                    gint *avg_in, gint *avg_out, 
       
   466 						   gint64 *buffering_left);
       
   467 #ifdef __SYMBIAN32__
       
   468 IMPORT_C
       
   469 #endif
       
   470  
       
   471 
       
   472 void            gst_query_set_buffering_range     (GstQuery *query, GstFormat format,
       
   473                                                    gint64 start, gint64 stop,
       
   474 						   gint64 estimated_total);
       
   475 #ifdef __SYMBIAN32__
       
   476 IMPORT_C
       
   477 #endif
       
   478 
       
   479 void            gst_query_parse_buffering_range   (GstQuery *query, GstFormat *format,
       
   480                                                    gint64 *start, gint64 *stop,
       
   481 						   gint64 *estimated_total);
       
   482 /* URI query */
       
   483 #ifdef __SYMBIAN32__
       
   484 IMPORT_C
       
   485 #endif
       
   486 
       
   487 GstQuery *      gst_query_new_uri                 (void);
       
   488 #ifdef __SYMBIAN32__
       
   489 IMPORT_C
       
   490 #endif
       
   491 
       
   492 void            gst_query_parse_uri               (GstQuery *query, gchar **uri);
       
   493 #ifdef __SYMBIAN32__
       
   494 IMPORT_C
       
   495 #endif
       
   496 
       
   497 void            gst_query_set_uri                 (GstQuery *query, const gchar *uri);
       
   498 
   380 G_END_DECLS
   499 G_END_DECLS
   381 
   500 
   382 #endif /* __GST_QUERY_H__ */
   501 #endif /* __GST_QUERY_H__ */
   383 
   502