gstpad.h 56 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446
  1. /* GStreamer
  2. * Copyright (C) 1999,2000 Erik Walthinsen <omega@cse.ogi.edu>
  3. * 2000 Wim Taymans <wim.taymans@chello.be>
  4. *
  5. * gstpad.h: Header for GstPad object
  6. *
  7. * This library is free software; you can redistribute it and/or
  8. * modify it under the terms of the GNU Library General Public
  9. * License as published by the Free Software Foundation; either
  10. * version 2 of the License, or (at your option) any later version.
  11. *
  12. * This library is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  15. * Library General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU Library General Public
  18. * License along with this library; if not, write to the
  19. * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
  20. * Boston, MA 02110-1301, USA.
  21. */
  22. #ifndef __GST_PAD_H__
  23. #define __GST_PAD_H__
  24. #include <gst/gstconfig.h>
  25. typedef struct _GstPad GstPad;
  26. typedef struct _GstPadPrivate GstPadPrivate;
  27. typedef struct _GstPadClass GstPadClass;
  28. typedef struct _GstPadProbeInfo GstPadProbeInfo;
  29. /**
  30. * GstPadDirection:
  31. * @GST_PAD_UNKNOWN: direction is unknown.
  32. * @GST_PAD_SRC: the pad is a source pad.
  33. * @GST_PAD_SINK: the pad is a sink pad.
  34. *
  35. * The direction of a pad.
  36. */
  37. typedef enum {
  38. GST_PAD_UNKNOWN,
  39. GST_PAD_SRC,
  40. GST_PAD_SINK
  41. } GstPadDirection;
  42. /**
  43. * GstPadMode:
  44. * @GST_PAD_MODE_NONE: Pad will not handle dataflow
  45. * @GST_PAD_MODE_PUSH: Pad handles dataflow in downstream push mode
  46. * @GST_PAD_MODE_PULL: Pad handles dataflow in upstream pull mode
  47. *
  48. * The status of a GstPad. After activating a pad, which usually happens when the
  49. * parent element goes from READY to PAUSED, the GstPadMode defines if the
  50. * pad operates in push or pull mode.
  51. */
  52. typedef enum {
  53. GST_PAD_MODE_NONE,
  54. GST_PAD_MODE_PUSH,
  55. GST_PAD_MODE_PULL
  56. } GstPadMode;
  57. #include <glib.h>
  58. const gchar * gst_pad_mode_get_name (GstPadMode mode);
  59. #include <gst/gstobject.h>
  60. #include <gst/gstbuffer.h>
  61. #include <gst/gstbufferlist.h>
  62. #include <gst/gstcaps.h>
  63. #include <gst/gstpadtemplate.h>
  64. #include <gst/gstevent.h>
  65. #include <gst/gstquery.h>
  66. #include <gst/gsttask.h>
  67. G_BEGIN_DECLS
  68. /*
  69. * Pad base class
  70. */
  71. #define GST_TYPE_PAD (gst_pad_get_type ())
  72. #define GST_IS_PAD(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_PAD))
  73. #define GST_IS_PAD_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_PAD))
  74. #define GST_PAD(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_PAD, GstPad))
  75. #define GST_PAD_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_PAD, GstPadClass))
  76. #define GST_PAD_CAST(obj) ((GstPad*)(obj))
  77. /**
  78. * GstPadLinkReturn:
  79. * @GST_PAD_LINK_OK : link succeeded
  80. * @GST_PAD_LINK_WRONG_HIERARCHY: pads have no common grandparent
  81. * @GST_PAD_LINK_WAS_LINKED : pad was already linked
  82. * @GST_PAD_LINK_WRONG_DIRECTION: pads have wrong direction
  83. * @GST_PAD_LINK_NOFORMAT : pads do not have common format
  84. * @GST_PAD_LINK_NOSCHED : pads cannot cooperate in scheduling
  85. * @GST_PAD_LINK_REFUSED : refused for some reason
  86. *
  87. * Result values from gst_pad_link and friends.
  88. */
  89. typedef enum {
  90. GST_PAD_LINK_OK = 0,
  91. GST_PAD_LINK_WRONG_HIERARCHY = -1,
  92. GST_PAD_LINK_WAS_LINKED = -2,
  93. GST_PAD_LINK_WRONG_DIRECTION = -3,
  94. GST_PAD_LINK_NOFORMAT = -4,
  95. GST_PAD_LINK_NOSCHED = -5,
  96. GST_PAD_LINK_REFUSED = -6
  97. } GstPadLinkReturn;
  98. /**
  99. * GST_PAD_LINK_FAILED:
  100. * @ret: the #GstPadLinkReturn value
  101. *
  102. * Macro to test if the given #GstPadLinkReturn value indicates a failed
  103. * link step.
  104. */
  105. #define GST_PAD_LINK_FAILED(ret) ((ret) < GST_PAD_LINK_OK)
  106. /**
  107. * GST_PAD_LINK_SUCCESSFUL:
  108. * @ret: the #GstPadLinkReturn value
  109. *
  110. * Macro to test if the given #GstPadLinkReturn value indicates a successful
  111. * link step.
  112. */
  113. #define GST_PAD_LINK_SUCCESSFUL(ret) ((ret) >= GST_PAD_LINK_OK)
  114. /**
  115. * GstFlowReturn:
  116. * @GST_FLOW_OK: Data passing was ok.
  117. * @GST_FLOW_NOT_LINKED: Pad is not linked.
  118. * @GST_FLOW_FLUSHING: Pad is flushing.
  119. * @GST_FLOW_EOS: Pad is EOS.
  120. * @GST_FLOW_NOT_NEGOTIATED: Pad is not negotiated.
  121. * @GST_FLOW_ERROR: Some (fatal) error occurred. Element generating
  122. * this error should post an error message with more
  123. * details.
  124. * @GST_FLOW_NOT_SUPPORTED: This operation is not supported.
  125. * @GST_FLOW_CUSTOM_SUCCESS: Elements can use values starting from
  126. * this (and higher) to define custom success
  127. * codes.
  128. * @GST_FLOW_CUSTOM_SUCCESS_1: Pre-defined custom success code (define your
  129. * custom success code to this to avoid compiler
  130. * warnings).
  131. * @GST_FLOW_CUSTOM_SUCCESS_2: Pre-defined custom success code.
  132. * @GST_FLOW_CUSTOM_ERROR: Elements can use values starting from
  133. * this (and lower) to define custom error codes.
  134. * @GST_FLOW_CUSTOM_ERROR_1: Pre-defined custom error code (define your
  135. * custom error code to this to avoid compiler
  136. * warnings).
  137. * @GST_FLOW_CUSTOM_ERROR_2: Pre-defined custom error code.
  138. *
  139. * The result of passing data to a pad.
  140. *
  141. * Note that the custom return values should not be exposed outside of the
  142. * element scope.
  143. */
  144. typedef enum {
  145. /* custom success starts here */
  146. GST_FLOW_CUSTOM_SUCCESS_2 = 102,
  147. GST_FLOW_CUSTOM_SUCCESS_1 = 101,
  148. GST_FLOW_CUSTOM_SUCCESS = 100,
  149. /* core predefined */
  150. GST_FLOW_OK = 0,
  151. /* expected failures */
  152. GST_FLOW_NOT_LINKED = -1,
  153. GST_FLOW_FLUSHING = -2,
  154. /* error cases */
  155. GST_FLOW_EOS = -3,
  156. GST_FLOW_NOT_NEGOTIATED = -4,
  157. GST_FLOW_ERROR = -5,
  158. GST_FLOW_NOT_SUPPORTED = -6,
  159. /* custom error starts here */
  160. GST_FLOW_CUSTOM_ERROR = -100,
  161. GST_FLOW_CUSTOM_ERROR_1 = -101,
  162. GST_FLOW_CUSTOM_ERROR_2 = -102
  163. } GstFlowReturn;
  164. const gchar* gst_flow_get_name (GstFlowReturn ret);
  165. GQuark gst_flow_to_quark (GstFlowReturn ret);
  166. const gchar* gst_pad_link_get_name (GstPadLinkReturn ret);
  167. /**
  168. * GstPadLinkCheck:
  169. * @GST_PAD_LINK_CHECK_NOTHING: Don't check hierarchy or caps compatibility.
  170. * @GST_PAD_LINK_CHECK_HIERARCHY: Check the pads have same parents/grandparents.
  171. * Could be omitted if it is already known that the two elements that own the
  172. * pads are in the same bin.
  173. * @GST_PAD_LINK_CHECK_TEMPLATE_CAPS: Check if the pads are compatible by using
  174. * their template caps. This is much faster than @GST_PAD_LINK_CHECK_CAPS, but
  175. * would be unsafe e.g. if one pad has %GST_CAPS_ANY.
  176. * @GST_PAD_LINK_CHECK_CAPS: Check if the pads are compatible by comparing the
  177. * caps returned by gst_pad_query_caps().
  178. * @GST_PAD_LINK_CHECK_DEFAULT: The default checks done when linking
  179. * pads (i.e. the ones used by gst_pad_link()).
  180. *
  181. * The amount of checking to be done when linking pads. @GST_PAD_LINK_CHECK_CAPS
  182. * and @GST_PAD_LINK_CHECK_TEMPLATE_CAPS are mutually exclusive. If both are
  183. * specified, expensive but safe @GST_PAD_LINK_CHECK_CAPS are performed.
  184. *
  185. * <warning><para>
  186. * Only disable some of the checks if you are 100% certain you know the link
  187. * will not fail because of hierarchy/caps compatibility failures. If uncertain,
  188. * use the default checks (%GST_PAD_LINK_CHECK_DEFAULT) or the regular methods
  189. * for linking the pads.
  190. * </para></warning>
  191. */
  192. typedef enum {
  193. GST_PAD_LINK_CHECK_NOTHING = 0,
  194. GST_PAD_LINK_CHECK_HIERARCHY = 1 << 0,
  195. GST_PAD_LINK_CHECK_TEMPLATE_CAPS = 1 << 1,
  196. GST_PAD_LINK_CHECK_CAPS = 1 << 2,
  197. GST_PAD_LINK_CHECK_DEFAULT = GST_PAD_LINK_CHECK_HIERARCHY | GST_PAD_LINK_CHECK_CAPS
  198. } GstPadLinkCheck;
  199. /* pad states */
  200. /**
  201. * GstPadActivateFunction:
  202. * @pad: a #GstPad
  203. * @parent: the parent of @pad
  204. *
  205. * This function is called when the pad is activated during the element
  206. * READY to PAUSED state change. By default this function will call the
  207. * activate function that puts the pad in push mode but elements can
  208. * override this function to activate the pad in pull mode if they wish.
  209. *
  210. * Returns: %TRUE if the pad could be activated.
  211. */
  212. typedef gboolean (*GstPadActivateFunction) (GstPad *pad, GstObject *parent);
  213. /**
  214. * GstPadActivateModeFunction:
  215. * @pad: a #GstPad
  216. * @parent: the parent of @pad
  217. * @mode: the requested activation mode of @pad
  218. * @active: activate or deactivate the pad.
  219. *
  220. * The prototype of the push and pull activate functions.
  221. *
  222. * Returns: %TRUE if the pad could be activated or deactivated.
  223. */
  224. typedef gboolean (*GstPadActivateModeFunction) (GstPad *pad, GstObject *parent,
  225. GstPadMode mode, gboolean active);
  226. /* data passing */
  227. /**
  228. * GstPadChainFunction:
  229. * @pad: the sink #GstPad that performed the chain.
  230. * @parent: (allow-none): the parent of @pad. If the #GST_PAD_FLAG_NEED_PARENT
  231. * flag is set, @parent is guaranteed to be not-%NULL and remain valid
  232. * during the execution of this function.
  233. * @buffer: (transfer full): the #GstBuffer that is chained, not %NULL.
  234. *
  235. * A function that will be called on sinkpads when chaining buffers.
  236. * The function typically processes the data contained in the buffer and
  237. * either consumes the data or passes it on to the internally linked pad(s).
  238. *
  239. * The implementer of this function receives a refcount to @buffer and should
  240. * gst_buffer_unref() when the buffer is no longer needed.
  241. *
  242. * When a chain function detects an error in the data stream, it must post an
  243. * error on the bus and return an appropriate #GstFlowReturn value.
  244. *
  245. * Returns: #GST_FLOW_OK for success
  246. */
  247. typedef GstFlowReturn (*GstPadChainFunction) (GstPad *pad, GstObject *parent,
  248. GstBuffer *buffer);
  249. /**
  250. * GstPadChainListFunction:
  251. * @pad: the sink #GstPad that performed the chain.
  252. * @parent: (allow-none): the parent of @pad. If the #GST_PAD_FLAG_NEED_PARENT
  253. * flag is set, @parent is guaranteed to be not-%NULL and remain valid
  254. * during the execution of this function.
  255. * @list: (transfer full): the #GstBufferList that is chained, not %NULL.
  256. *
  257. * A function that will be called on sinkpads when chaining buffer lists.
  258. * The function typically processes the data contained in the buffer list and
  259. * either consumes the data or passes it on to the internally linked pad(s).
  260. *
  261. * The implementer of this function receives a refcount to @list and
  262. * should gst_buffer_list_unref() when the list is no longer needed.
  263. *
  264. * When a chainlist function detects an error in the data stream, it must
  265. * post an error on the bus and return an appropriate #GstFlowReturn value.
  266. *
  267. * Returns: #GST_FLOW_OK for success
  268. */
  269. typedef GstFlowReturn (*GstPadChainListFunction) (GstPad *pad, GstObject *parent,
  270. GstBufferList *list);
  271. /**
  272. * GstPadGetRangeFunction:
  273. * @pad: the src #GstPad to perform the getrange on.
  274. * @parent: (allow-none): the parent of @pad. If the #GST_PAD_FLAG_NEED_PARENT
  275. * flag is set, @parent is guaranteed to be not-%NULL and remain valid
  276. * during the execution of this function.
  277. * @offset: the offset of the range
  278. * @length: the length of the range
  279. * @buffer: a memory location to hold the result buffer, cannot be %NULL.
  280. *
  281. * This function will be called on source pads when a peer element
  282. * request a buffer at the specified @offset and @length. If this function
  283. * returns #GST_FLOW_OK, the result buffer will be stored in @buffer. The
  284. * contents of @buffer is invalid for any other return value.
  285. *
  286. * This function is installed on a source pad with
  287. * gst_pad_set_getrange_function() and can only be called on source pads after
  288. * they are successfully activated with gst_pad_activate_mode() with the
  289. * #GST_PAD_MODE_PULL.
  290. *
  291. * @offset and @length are always given in byte units. @offset must normally be a value
  292. * between 0 and the length in bytes of the data available on @pad. The
  293. * length (duration in bytes) can be retrieved with a #GST_QUERY_DURATION or with a
  294. * #GST_QUERY_SEEKING.
  295. *
  296. * Any @offset larger or equal than the length will make the function return
  297. * #GST_FLOW_EOS, which corresponds to EOS. In this case @buffer does not
  298. * contain a valid buffer.
  299. *
  300. * The buffer size of @buffer will only be smaller than @length when @offset is
  301. * near the end of the stream. In all other cases, the size of @buffer must be
  302. * exactly the requested size.
  303. *
  304. * It is allowed to call this function with a 0 @length and valid @offset, in
  305. * which case @buffer will contain a 0-sized buffer and the function returns
  306. * #GST_FLOW_OK.
  307. *
  308. * When this function is called with a -1 @offset, the sequentially next buffer
  309. * of length @length in the stream is returned.
  310. *
  311. * When this function is called with a -1 @length, a buffer with a default
  312. * optimal length is returned in @buffer. The length might depend on the value
  313. * of @offset.
  314. *
  315. * Returns: #GST_FLOW_OK for success and a valid buffer in @buffer. Any other
  316. * return value leaves @buffer undefined.
  317. */
  318. typedef GstFlowReturn (*GstPadGetRangeFunction) (GstPad *pad, GstObject *parent,
  319. guint64 offset, guint length,
  320. GstBuffer **buffer);
  321. /**
  322. * GstPadEventFunction:
  323. * @pad: the #GstPad to handle the event.
  324. * @parent: (allow-none): the parent of @pad. If the #GST_PAD_FLAG_NEED_PARENT
  325. * flag is set, @parent is guaranteed to be not-%NULL and remain valid
  326. * during the execution of this function.
  327. * @event: (transfer full): the #GstEvent to handle.
  328. *
  329. * Function signature to handle an event for the pad.
  330. *
  331. * Returns: %TRUE if the pad could handle the event.
  332. */
  333. typedef gboolean (*GstPadEventFunction) (GstPad *pad, GstObject *parent,
  334. GstEvent *event);
  335. /**
  336. * GstPadEventFullFunction:
  337. * @pad: the #GstPad to handle the event.
  338. * @parent: (allow-none): the parent of @pad. If the #GST_PAD_FLAG_NEED_PARENT
  339. * flag is set, @parent is guaranteed to be not-%NULL and remain valid
  340. * during the execution of this function.
  341. * @event: (transfer full): the #GstEvent to handle.
  342. *
  343. * Function signature to handle an event for the pad.
  344. *
  345. * This variant is for specific elements that will take into account the
  346. * last downstream flow return (from a pad push), in which case they can
  347. * return it.
  348. *
  349. * Returns: %GST_FLOW_OK if the event was handled properly, or any other
  350. * #GstFlowReturn dependent on downstream state.
  351. *
  352. * Since: 1.8
  353. */
  354. typedef GstFlowReturn (*GstPadEventFullFunction) (GstPad *pad, GstObject *parent,
  355. GstEvent *event);
  356. /* internal links */
  357. /**
  358. * GstPadIterIntLinkFunction:
  359. * @pad: The #GstPad to query.
  360. * @parent: (allow-none): the parent of @pad. If the #GST_PAD_FLAG_NEED_PARENT
  361. * flag is set, @parent is guaranteed to be not-%NULL and remain valid
  362. * during the execution of this function.
  363. *
  364. * The signature of the internal pad link iterator function.
  365. *
  366. * Returns: a new #GstIterator that will iterate over all pads that are
  367. * linked to the given pad on the inside of the parent element.
  368. *
  369. * the caller must call gst_iterator_free() after usage.
  370. */
  371. typedef GstIterator* (*GstPadIterIntLinkFunction) (GstPad *pad, GstObject *parent);
  372. /* generic query function */
  373. /**
  374. * GstPadQueryFunction:
  375. * @pad: the #GstPad to query.
  376. * @parent: (allow-none): the parent of @pad. If the #GST_PAD_FLAG_NEED_PARENT
  377. * flag is set, @parent is guaranteed to be not-%NULL and remain valid
  378. * during the execution of this function.
  379. * @query: the #GstQuery object to execute
  380. *
  381. * The signature of the query function.
  382. *
  383. * Returns: %TRUE if the query could be performed.
  384. */
  385. typedef gboolean (*GstPadQueryFunction) (GstPad *pad, GstObject *parent,
  386. GstQuery *query);
  387. /* linking */
  388. /**
  389. * GstPadLinkFunction:
  390. * @pad: the #GstPad that is linked.
  391. * @parent: (allow-none): the parent of @pad. If the #GST_PAD_FLAG_NEED_PARENT
  392. * flag is set, @parent is guaranteed to be not-%NULL and remain valid
  393. * during the execution of this function.
  394. * @peer: the peer #GstPad of the link
  395. *
  396. * Function signature to handle a new link on the pad.
  397. *
  398. * Returns: the result of the link with the specified peer.
  399. */
  400. typedef GstPadLinkReturn (*GstPadLinkFunction) (GstPad *pad, GstObject *parent, GstPad *peer);
  401. /**
  402. * GstPadUnlinkFunction:
  403. * @pad: the #GstPad that is linked.
  404. * @parent: (allow-none): the parent of @pad. If the #GST_PAD_FLAG_NEED_PARENT
  405. * flag is set, @parent is guaranteed to be not-%NULL and remain valid
  406. * during the execution of this function.
  407. *
  408. * Function signature to handle a unlinking the pad prom its peer.
  409. */
  410. typedef void (*GstPadUnlinkFunction) (GstPad *pad, GstObject *parent);
  411. /* misc */
  412. /**
  413. * GstPadForwardFunction:
  414. * @pad: the #GstPad that is forwarded.
  415. * @user_data: the gpointer to optional user data.
  416. *
  417. * A forward function is called for all internally linked pads, see
  418. * gst_pad_forward().
  419. *
  420. * Returns: %TRUE if the dispatching procedure has to be stopped.
  421. */
  422. typedef gboolean (*GstPadForwardFunction) (GstPad *pad, gpointer user_data);
  423. /**
  424. * GstPadProbeType:
  425. * @GST_PAD_PROBE_TYPE_INVALID: invalid probe type
  426. * @GST_PAD_PROBE_TYPE_IDLE: probe idle pads and block while the callback is called
  427. * @GST_PAD_PROBE_TYPE_BLOCK: probe and block pads
  428. * @GST_PAD_PROBE_TYPE_BUFFER: probe buffers
  429. * @GST_PAD_PROBE_TYPE_BUFFER_LIST: probe buffer lists
  430. * @GST_PAD_PROBE_TYPE_EVENT_DOWNSTREAM: probe downstream events
  431. * @GST_PAD_PROBE_TYPE_EVENT_UPSTREAM: probe upstream events
  432. * @GST_PAD_PROBE_TYPE_EVENT_FLUSH: probe flush events. This probe has to be
  433. * explicitly enabled and is not included in the
  434. * @@GST_PAD_PROBE_TYPE_EVENT_DOWNSTREAM or
  435. * @@GST_PAD_PROBE_TYPE_EVENT_UPSTREAM probe types.
  436. * @GST_PAD_PROBE_TYPE_QUERY_DOWNSTREAM: probe downstream queries
  437. * @GST_PAD_PROBE_TYPE_QUERY_UPSTREAM: probe upstream queries
  438. * @GST_PAD_PROBE_TYPE_PUSH: probe push
  439. * @GST_PAD_PROBE_TYPE_PULL: probe pull
  440. * @GST_PAD_PROBE_TYPE_BLOCKING: probe and block at the next opportunity, at data flow or when idle
  441. * @GST_PAD_PROBE_TYPE_DATA_DOWNSTREAM: probe downstream data (buffers, buffer lists, and events)
  442. * @GST_PAD_PROBE_TYPE_DATA_UPSTREAM: probe upstream data (events)
  443. * @GST_PAD_PROBE_TYPE_DATA_BOTH: probe upstream and downstream data (buffers, buffer lists, and events)
  444. * @GST_PAD_PROBE_TYPE_BLOCK_DOWNSTREAM: probe and block downstream data (buffers, buffer lists, and events)
  445. * @GST_PAD_PROBE_TYPE_BLOCK_UPSTREAM: probe and block upstream data (events)
  446. * @GST_PAD_PROBE_TYPE_EVENT_BOTH: probe upstream and downstream events
  447. * @GST_PAD_PROBE_TYPE_QUERY_BOTH: probe upstream and downstream queries
  448. * @GST_PAD_PROBE_TYPE_ALL_BOTH: probe upstream events and queries and downstream buffers, buffer lists, events and queries
  449. * @GST_PAD_PROBE_TYPE_SCHEDULING: probe push and pull
  450. *
  451. * The different probing types that can occur. When either one of
  452. * @GST_PAD_PROBE_TYPE_IDLE or @GST_PAD_PROBE_TYPE_BLOCK is used, the probe will be a
  453. * blocking probe.
  454. */
  455. typedef enum
  456. {
  457. GST_PAD_PROBE_TYPE_INVALID = 0,
  458. /* flags to control blocking */
  459. GST_PAD_PROBE_TYPE_IDLE = (1 << 0),
  460. GST_PAD_PROBE_TYPE_BLOCK = (1 << 1),
  461. /* flags to select datatypes */
  462. GST_PAD_PROBE_TYPE_BUFFER = (1 << 4),
  463. GST_PAD_PROBE_TYPE_BUFFER_LIST = (1 << 5),
  464. GST_PAD_PROBE_TYPE_EVENT_DOWNSTREAM = (1 << 6),
  465. GST_PAD_PROBE_TYPE_EVENT_UPSTREAM = (1 << 7),
  466. GST_PAD_PROBE_TYPE_EVENT_FLUSH = (1 << 8),
  467. GST_PAD_PROBE_TYPE_QUERY_DOWNSTREAM = (1 << 9),
  468. GST_PAD_PROBE_TYPE_QUERY_UPSTREAM = (1 << 10),
  469. /* flags to select scheduling mode */
  470. GST_PAD_PROBE_TYPE_PUSH = (1 << 12),
  471. GST_PAD_PROBE_TYPE_PULL = (1 << 13),
  472. /* flag combinations */
  473. GST_PAD_PROBE_TYPE_BLOCKING = GST_PAD_PROBE_TYPE_IDLE | GST_PAD_PROBE_TYPE_BLOCK,
  474. GST_PAD_PROBE_TYPE_DATA_DOWNSTREAM = GST_PAD_PROBE_TYPE_BUFFER | GST_PAD_PROBE_TYPE_BUFFER_LIST | GST_PAD_PROBE_TYPE_EVENT_DOWNSTREAM,
  475. GST_PAD_PROBE_TYPE_DATA_UPSTREAM = GST_PAD_PROBE_TYPE_EVENT_UPSTREAM,
  476. GST_PAD_PROBE_TYPE_DATA_BOTH = GST_PAD_PROBE_TYPE_DATA_DOWNSTREAM | GST_PAD_PROBE_TYPE_DATA_UPSTREAM,
  477. GST_PAD_PROBE_TYPE_BLOCK_DOWNSTREAM = GST_PAD_PROBE_TYPE_BLOCK | GST_PAD_PROBE_TYPE_DATA_DOWNSTREAM,
  478. GST_PAD_PROBE_TYPE_BLOCK_UPSTREAM = GST_PAD_PROBE_TYPE_BLOCK | GST_PAD_PROBE_TYPE_DATA_UPSTREAM,
  479. GST_PAD_PROBE_TYPE_EVENT_BOTH = GST_PAD_PROBE_TYPE_EVENT_DOWNSTREAM | GST_PAD_PROBE_TYPE_EVENT_UPSTREAM,
  480. GST_PAD_PROBE_TYPE_QUERY_BOTH = GST_PAD_PROBE_TYPE_QUERY_DOWNSTREAM | GST_PAD_PROBE_TYPE_QUERY_UPSTREAM,
  481. GST_PAD_PROBE_TYPE_ALL_BOTH = GST_PAD_PROBE_TYPE_DATA_BOTH | GST_PAD_PROBE_TYPE_QUERY_BOTH,
  482. GST_PAD_PROBE_TYPE_SCHEDULING = GST_PAD_PROBE_TYPE_PUSH | GST_PAD_PROBE_TYPE_PULL
  483. } GstPadProbeType;
  484. /**
  485. * GstPadProbeReturn:
  486. * @GST_PAD_PROBE_OK: normal probe return value. This leaves the probe in
  487. * place, and defers decisions about dropping or passing data to other
  488. * probes, if any. If there are no other probes, the default behaviour
  489. * for the probe type applies (block for blocking probes, and pass for
  490. * non-blocking probes).
  491. * @GST_PAD_PROBE_DROP: drop data in data probes. For push mode this means that
  492. * the data item is not sent downstream. For pull mode, it means that
  493. * the data item is not passed upstream. In both cases, no more probes
  494. * are called and #GST_FLOW_OK or %TRUE is returned to the caller.
  495. * @GST_PAD_PROBE_REMOVE: remove this probe.
  496. * @GST_PAD_PROBE_PASS: pass the data item in the block probe and block on the
  497. * next item.
  498. * @GST_PAD_PROBE_HANDLED: Data has been handled in the probe and will not be
  499. * forwarded further. For events and buffers this is the same behaviour as
  500. * @GST_PAD_PROBE_DROP (except that in this case you need to unref the buffer
  501. * or event yourself). For queries it will also return %TRUE to the caller.
  502. * The probe can also modify the #GstFlowReturn value by using the
  503. * #GST_PAD_PROBE_INFO_FLOW_RETURN() accessor.
  504. * Note that the resulting query must contain valid entries.
  505. * Since: 1.6
  506. *
  507. * Different return values for the #GstPadProbeCallback.
  508. */
  509. typedef enum
  510. {
  511. GST_PAD_PROBE_DROP,
  512. GST_PAD_PROBE_OK,
  513. GST_PAD_PROBE_REMOVE,
  514. GST_PAD_PROBE_PASS,
  515. GST_PAD_PROBE_HANDLED
  516. } GstPadProbeReturn;
  517. /**
  518. * GstPadProbeInfo:
  519. * @type: the current probe type
  520. * @id: the id of the probe
  521. * @data: (allow-none): type specific data, check the @type field to know the
  522. * datatype. This field can be %NULL.
  523. * @offset: offset of pull probe, this field is valid when @type contains
  524. * #GST_PAD_PROBE_TYPE_PULL
  525. * @size: size of pull probe, this field is valid when @type contains
  526. * #GST_PAD_PROBE_TYPE_PULL
  527. *
  528. * Info passed in the #GstPadProbeCallback.
  529. */
  530. struct _GstPadProbeInfo
  531. {
  532. GstPadProbeType type;
  533. gulong id;
  534. gpointer data;
  535. guint64 offset;
  536. guint size;
  537. /*< private >*/
  538. union {
  539. gpointer _gst_reserved[GST_PADDING];
  540. struct {
  541. GstFlowReturn flow_ret;
  542. } abi;
  543. } ABI;
  544. };
  545. #define GST_PAD_PROBE_INFO_TYPE(d) ((d)->type)
  546. #define GST_PAD_PROBE_INFO_ID(d) ((d)->id)
  547. #define GST_PAD_PROBE_INFO_DATA(d) ((d)->data)
  548. #define GST_PAD_PROBE_INFO_FLOW_RETURN(d) ((d)->ABI.abi.flow_ret)
  549. #define GST_PAD_PROBE_INFO_BUFFER(d) GST_BUFFER_CAST(GST_PAD_PROBE_INFO_DATA(d))
  550. #define GST_PAD_PROBE_INFO_BUFFER_LIST(d) GST_BUFFER_LIST_CAST(GST_PAD_PROBE_INFO_DATA(d))
  551. #define GST_PAD_PROBE_INFO_EVENT(d) GST_EVENT_CAST(GST_PAD_PROBE_INFO_DATA(d))
  552. #define GST_PAD_PROBE_INFO_QUERY(d) GST_QUERY_CAST(GST_PAD_PROBE_INFO_DATA(d))
  553. #define GST_PAD_PROBE_INFO_OFFSET(d) ((d)->offset)
  554. #define GST_PAD_PROBE_INFO_SIZE(d) ((d)->size)
  555. GstEvent* gst_pad_probe_info_get_event (GstPadProbeInfo * info);
  556. GstQuery* gst_pad_probe_info_get_query (GstPadProbeInfo * info);
  557. GstBuffer* gst_pad_probe_info_get_buffer (GstPadProbeInfo * info);
  558. GstBufferList* gst_pad_probe_info_get_buffer_list (GstPadProbeInfo * info);
  559. /**
  560. * GstPadProbeCallback:
  561. * @pad: the #GstPad that is blocked
  562. * @info: #GstPadProbeInfo
  563. * @user_data: the gpointer to optional user data.
  564. *
  565. * Callback used by gst_pad_add_probe(). Gets called to notify about the current
  566. * blocking type.
  567. *
  568. * The callback is allowed to modify the data pointer in @info.
  569. *
  570. * Returns: a #GstPadProbeReturn
  571. */
  572. typedef GstPadProbeReturn (*GstPadProbeCallback) (GstPad *pad, GstPadProbeInfo *info,
  573. gpointer user_data);
  574. /**
  575. * GstPadStickyEventsForeachFunction:
  576. * @pad: the #GstPad.
  577. * @event: (allow-none): a sticky #GstEvent.
  578. * @user_data: the #gpointer to optional user data.
  579. *
  580. * Callback used by gst_pad_sticky_events_foreach().
  581. *
  582. * When this function returns %TRUE, the next event will be
  583. * returned. When %FALSE is returned, gst_pad_sticky_events_foreach() will return.
  584. *
  585. * When @event is set to %NULL, the item will be removed from the list of sticky events.
  586. * @event can be replaced by assigning a new reference to it.
  587. * This function is responsible for unreffing the old event when
  588. * removing or modifying.
  589. *
  590. * Returns: %TRUE if the iteration should continue
  591. */
  592. typedef gboolean (*GstPadStickyEventsForeachFunction) (GstPad *pad, GstEvent **event,
  593. gpointer user_data);
  594. /**
  595. * GstPadFlags:
  596. * @GST_PAD_FLAG_BLOCKED: is dataflow on a pad blocked
  597. * @GST_PAD_FLAG_FLUSHING: is pad flushing
  598. * @GST_PAD_FLAG_EOS: is pad in EOS state
  599. * @GST_PAD_FLAG_BLOCKING: is pad currently blocking on a buffer or event
  600. * @GST_PAD_FLAG_NEED_PARENT: ensure that there is a parent object before calling
  601. * into the pad callbacks.
  602. * @GST_PAD_FLAG_NEED_RECONFIGURE: the pad should be reconfigured/renegotiated.
  603. * The flag has to be unset manually after
  604. * reconfiguration happened.
  605. * @GST_PAD_FLAG_PENDING_EVENTS: the pad has pending events
  606. * @GST_PAD_FLAG_FIXED_CAPS: the pad is using fixed caps. This means that
  607. * once the caps are set on the pad, the default caps query function
  608. * will only return those caps.
  609. * @GST_PAD_FLAG_PROXY_CAPS: the default event and query handler will forward
  610. * all events and queries to the internally linked pads
  611. * instead of discarding them.
  612. * @GST_PAD_FLAG_PROXY_ALLOCATION: the default query handler will forward
  613. * allocation queries to the internally linked pads
  614. * instead of discarding them.
  615. * @GST_PAD_FLAG_PROXY_SCHEDULING: the default query handler will forward
  616. * scheduling queries to the internally linked pads
  617. * instead of discarding them.
  618. * @GST_PAD_FLAG_ACCEPT_INTERSECT: the default accept-caps handler will check
  619. * it the caps intersect the query-caps result instead
  620. * of checking for a subset. This is interesting for
  621. * parsers that can accept incompletely specified caps.
  622. * @GST_PAD_FLAG_ACCEPT_TEMPLATE: the default accept-caps handler will use
  623. * the template pad caps instead of query caps to
  624. * compare with the accept caps. Use this in combination
  625. * with %GST_PAD_FLAG_ACCEPT_INTERSECT. (Since 1.6)
  626. * @GST_PAD_FLAG_LAST: offset to define more flags
  627. *
  628. * Pad state flags
  629. */
  630. typedef enum {
  631. GST_PAD_FLAG_BLOCKED = (GST_OBJECT_FLAG_LAST << 0),
  632. GST_PAD_FLAG_FLUSHING = (GST_OBJECT_FLAG_LAST << 1),
  633. GST_PAD_FLAG_EOS = (GST_OBJECT_FLAG_LAST << 2),
  634. GST_PAD_FLAG_BLOCKING = (GST_OBJECT_FLAG_LAST << 3),
  635. GST_PAD_FLAG_NEED_PARENT = (GST_OBJECT_FLAG_LAST << 4),
  636. GST_PAD_FLAG_NEED_RECONFIGURE = (GST_OBJECT_FLAG_LAST << 5),
  637. GST_PAD_FLAG_PENDING_EVENTS = (GST_OBJECT_FLAG_LAST << 6),
  638. GST_PAD_FLAG_FIXED_CAPS = (GST_OBJECT_FLAG_LAST << 7),
  639. GST_PAD_FLAG_PROXY_CAPS = (GST_OBJECT_FLAG_LAST << 8),
  640. GST_PAD_FLAG_PROXY_ALLOCATION = (GST_OBJECT_FLAG_LAST << 9),
  641. GST_PAD_FLAG_PROXY_SCHEDULING = (GST_OBJECT_FLAG_LAST << 10),
  642. GST_PAD_FLAG_ACCEPT_INTERSECT = (GST_OBJECT_FLAG_LAST << 11),
  643. GST_PAD_FLAG_ACCEPT_TEMPLATE = (GST_OBJECT_FLAG_LAST << 12),
  644. /* padding */
  645. GST_PAD_FLAG_LAST = (GST_OBJECT_FLAG_LAST << 16)
  646. } GstPadFlags;
  647. /**
  648. * GstPad:
  649. * @element_private: private data owned by the parent element
  650. * @padtemplate: padtemplate for this pad
  651. * @direction: the direction of the pad, cannot change after creating
  652. * the pad.
  653. *
  654. * The #GstPad structure. Use the functions to update the variables.
  655. */
  656. struct _GstPad {
  657. GstObject object;
  658. /*< public >*/
  659. gpointer element_private;
  660. GstPadTemplate *padtemplate;
  661. GstPadDirection direction;
  662. /*< private >*/
  663. /* streaming rec_lock */
  664. GRecMutex stream_rec_lock;
  665. GstTask *task;
  666. /* block cond, mutex is from the object */
  667. GCond block_cond;
  668. GHookList probes;
  669. GstPadMode mode;
  670. GstPadActivateFunction activatefunc;
  671. gpointer activatedata;
  672. GDestroyNotify activatenotify;
  673. GstPadActivateModeFunction activatemodefunc;
  674. gpointer activatemodedata;
  675. GDestroyNotify activatemodenotify;
  676. /* pad link */
  677. GstPad *peer;
  678. GstPadLinkFunction linkfunc;
  679. gpointer linkdata;
  680. GDestroyNotify linknotify;
  681. GstPadUnlinkFunction unlinkfunc;
  682. gpointer unlinkdata;
  683. GDestroyNotify unlinknotify;
  684. /* data transport functions */
  685. GstPadChainFunction chainfunc;
  686. gpointer chaindata;
  687. GDestroyNotify chainnotify;
  688. GstPadChainListFunction chainlistfunc;
  689. gpointer chainlistdata;
  690. GDestroyNotify chainlistnotify;
  691. GstPadGetRangeFunction getrangefunc;
  692. gpointer getrangedata;
  693. GDestroyNotify getrangenotify;
  694. GstPadEventFunction eventfunc;
  695. gpointer eventdata;
  696. GDestroyNotify eventnotify;
  697. /* pad offset */
  698. gint64 offset;
  699. /* generic query method */
  700. GstPadQueryFunction queryfunc;
  701. gpointer querydata;
  702. GDestroyNotify querynotify;
  703. /* internal links */
  704. GstPadIterIntLinkFunction iterintlinkfunc;
  705. gpointer iterintlinkdata;
  706. GDestroyNotify iterintlinknotify;
  707. /* counts number of probes attached. */
  708. gint num_probes;
  709. gint num_blocked;
  710. GstPadPrivate *priv;
  711. union {
  712. gpointer _gst_reserved[GST_PADDING];
  713. struct {
  714. GstFlowReturn last_flowret;
  715. GstPadEventFullFunction eventfullfunc;
  716. } abi;
  717. } ABI;
  718. };
  719. struct _GstPadClass {
  720. GstObjectClass parent_class;
  721. /* signal callbacks */
  722. void (*linked) (GstPad *pad, GstPad *peer);
  723. void (*unlinked) (GstPad *pad, GstPad *peer);
  724. /*< private >*/
  725. gpointer _gst_reserved[GST_PADDING];
  726. };
  727. /***** helper macros *****/
  728. /* GstPad */
  729. /**
  730. * GST_PAD_NAME:
  731. * @pad: a #GstPad
  732. *
  733. * Get name of the given pad.
  734. * No locking is performed in this function, use gst_pad_get_name() instead.
  735. */
  736. #define GST_PAD_NAME(pad) (GST_OBJECT_NAME(pad))
  737. /**
  738. * GST_PAD_PARENT:
  739. * @pad: a #GstPad
  740. *
  741. * Get the @pad parent.
  742. * No locking is performed in this function, use gst_pad_get_parent() instead.
  743. */
  744. #define GST_PAD_PARENT(pad) (GST_ELEMENT_CAST(GST_OBJECT_PARENT(pad)))
  745. /**
  746. * GST_PAD_ELEMENT_PRIVATE:
  747. * @pad: a #GstPad
  748. *
  749. * Get the private data of @pad, which is usually some pad- or stream-specific
  750. * structure created by the element and set on the pad when creating it.
  751. * No locking is performed in this function.
  752. */
  753. #define GST_PAD_ELEMENT_PRIVATE(pad) (GST_PAD_CAST(pad)->element_private)
  754. /**
  755. * GST_PAD_PAD_TEMPLATE:
  756. * @pad: a #GstPad
  757. *
  758. * Get the @pad #GstPadTemplate. It describes the possible media types
  759. * a @pad or an element factory can handle.
  760. */
  761. #define GST_PAD_PAD_TEMPLATE(pad) (GST_PAD_CAST(pad)->padtemplate)
  762. /**
  763. * GST_PAD_DIRECTION:
  764. * @pad: a #GstPad
  765. *
  766. * Get the #GstPadDirection of the given @pad. Accessor macro, use
  767. * gst_pad_get_direction() instead.
  768. */
  769. #define GST_PAD_DIRECTION(pad) (GST_PAD_CAST(pad)->direction)
  770. /**
  771. * GST_PAD_TASK:
  772. * @pad: a #GstPad
  773. *
  774. * Get the #GstTask of @pad. Accessor macro used by GStreamer. Use the
  775. * gst_pad_start_task(), gst_pad_stop_task() and gst_pad_pause_task()
  776. * functions instead.
  777. */
  778. #define GST_PAD_TASK(pad) (GST_PAD_CAST(pad)->task)
  779. /**
  780. * GST_PAD_MODE:
  781. * @pad: a #GstPad
  782. *
  783. * Get the #GstPadMode of pad, which will be GST_PAD_MODE_NONE if the pad
  784. * has not been activated yet, and otherwise either GST_PAD_MODE_PUSH or
  785. * GST_PAD_MODE_PULL depending on which mode the pad was activated in.
  786. */
  787. #define GST_PAD_MODE(pad) (GST_PAD_CAST(pad)->mode)
  788. /**
  789. * GST_PAD_ACTIVATEFUNC:
  790. * @pad: a #GstPad
  791. *
  792. * Get the #GstPadActivateFunction from @pad.
  793. */
  794. #define GST_PAD_ACTIVATEFUNC(pad) (GST_PAD_CAST(pad)->activatefunc)
  795. /**
  796. * GST_PAD_ACTIVATEMODEFUNC:
  797. * @pad: a #GstPad
  798. *
  799. * Get the #GstPadActivateModeFunction from the given @pad.
  800. */
  801. #define GST_PAD_ACTIVATEMODEFUNC(pad) (GST_PAD_CAST(pad)->activatemodefunc)
  802. /**
  803. * GST_PAD_CHAINFUNC:
  804. * @pad: a #GstPad
  805. *
  806. * Get the #GstPadChainFunction from the given @pad.
  807. */
  808. #define GST_PAD_CHAINFUNC(pad) (GST_PAD_CAST(pad)->chainfunc)
  809. /**
  810. * GST_PAD_CHAINLISTFUNC:
  811. * @pad: a #GstPad
  812. *
  813. * Get the #GstPadChainListFunction from the given @pad.
  814. */
  815. #define GST_PAD_CHAINLISTFUNC(pad) (GST_PAD_CAST(pad)->chainlistfunc)
  816. /**
  817. * GST_PAD_GETRANGEFUNC:
  818. * @pad: a #GstPad
  819. *
  820. * Get the #GstPadGetRangeFunction from the given @pad.
  821. */
  822. #define GST_PAD_GETRANGEFUNC(pad) (GST_PAD_CAST(pad)->getrangefunc)
  823. /**
  824. * GST_PAD_EVENTFUNC:
  825. * @pad: a #GstPad
  826. *
  827. * Get the #GstPadEventFunction from the given @pad, which
  828. * is the function that handles events on the pad. You can
  829. * use this to set your own event handling function on a pad
  830. * after you create it. If your element derives from a base
  831. * class, use the base class's virtual functions instead.
  832. */
  833. #define GST_PAD_EVENTFUNC(pad) (GST_PAD_CAST(pad)->eventfunc)
  834. /**
  835. * GST_PAD_EVENTFULLFUNC:
  836. * @pad: a #GstPad
  837. *
  838. * Get the #GstPadEventFullFunction from the given @pad, which
  839. * is the function that handles events on the pad. You can
  840. * use this to set your own event handling function on a pad
  841. * after you create it. If your element derives from a base
  842. * class, use the base class's virtual functions instead.
  843. *
  844. * Since: 1.8
  845. */
  846. #define GST_PAD_EVENTFULLFUNC(pad) (GST_PAD_CAST(pad)->ABI.abi.eventfullfunc)
  847. /**
  848. * GST_PAD_QUERYFUNC:
  849. * @pad: a #GstPad
  850. *
  851. * Get the #GstPadQueryFunction from @pad, which is the function
  852. * that handles queries on the pad. You can use this to set your
  853. * own query handling function on a pad after you create it. If your
  854. * element derives from a base class, use the base class's virtual
  855. * functions instead.
  856. */
  857. #define GST_PAD_QUERYFUNC(pad) (GST_PAD_CAST(pad)->queryfunc)
  858. /**
  859. * GST_PAD_ITERINTLINKFUNC:
  860. * @pad: a #GstPad
  861. *
  862. * Get the #GstPadIterIntLinkFunction from the given @pad.
  863. */
  864. #define GST_PAD_ITERINTLINKFUNC(pad) (GST_PAD_CAST(pad)->iterintlinkfunc)
  865. /**
  866. * GST_PAD_PEER:
  867. * @pad: a #GstPad
  868. *
  869. * Return the pad's peer member. This member is a pointer to the linked @pad.
  870. * No locking is performed in this function, use gst_pad_get_peer() instead.
  871. */
  872. #define GST_PAD_PEER(pad) (GST_PAD_CAST(pad)->peer)
  873. /**
  874. * GST_PAD_LINKFUNC:
  875. * @pad: a #GstPad
  876. *
  877. * Get the #GstPadLinkFunction for the given @pad.
  878. */
  879. #define GST_PAD_LINKFUNC(pad) (GST_PAD_CAST(pad)->linkfunc)
  880. /**
  881. * GST_PAD_UNLINKFUNC:
  882. * @pad: a #GstPad
  883. *
  884. * Get the #GstPadUnlinkFunction from the given @pad.
  885. */
  886. #define GST_PAD_UNLINKFUNC(pad) (GST_PAD_CAST(pad)->unlinkfunc)
  887. /**
  888. * GST_PAD_IS_SRC:
  889. * @pad: a #GstPad
  890. *
  891. * Returns: %TRUE if the pad is a source pad (i.e. produces data).
  892. */
  893. #define GST_PAD_IS_SRC(pad) (GST_PAD_DIRECTION(pad) == GST_PAD_SRC)
  894. /**
  895. * GST_PAD_IS_SINK:
  896. * @pad: a #GstPad
  897. *
  898. * Returns: %TRUE if the pad is a sink pad (i.e. consumes data).
  899. */
  900. #define GST_PAD_IS_SINK(pad) (GST_PAD_DIRECTION(pad) == GST_PAD_SINK)
  901. /**
  902. * GST_PAD_IS_LINKED:
  903. * @pad: a #GstPad
  904. *
  905. * Returns: %TRUE if the pad is linked to another pad. Use gst_pad_is_linked()
  906. * instead.
  907. */
  908. #define GST_PAD_IS_LINKED(pad) (GST_PAD_PEER(pad) != NULL)
  909. /**
  910. * GST_PAD_IS_ACTIVE:
  911. * @pad: a #GstPad
  912. *
  913. * Returns: %TRUE if the pad has been activated.
  914. */
  915. #define GST_PAD_IS_ACTIVE(pad) (GST_PAD_MODE(pad) != GST_PAD_MODE_NONE)
  916. /**
  917. * GST_PAD_IS_BLOCKED:
  918. * @pad: a #GstPad
  919. *
  920. * Check if the dataflow on a @pad is blocked. Use gst_pad_is_blocked() instead.
  921. */
  922. #define GST_PAD_IS_BLOCKED(pad) (GST_OBJECT_FLAG_IS_SET (pad, GST_PAD_FLAG_BLOCKED))
  923. /**
  924. * GST_PAD_IS_BLOCKING:
  925. * @pad: a #GstPad
  926. *
  927. * Check if the @pad is currently blocking on a buffer or event. Use
  928. * gst_pad_is_blocking() instead.
  929. */
  930. #define GST_PAD_IS_BLOCKING(pad) (GST_OBJECT_FLAG_IS_SET (pad, GST_PAD_FLAG_BLOCKING))
  931. /**
  932. * GST_PAD_IS_FLUSHING:
  933. * @pad: a #GstPad
  934. *
  935. * Check if the given @pad is flushing.
  936. */
  937. #define GST_PAD_IS_FLUSHING(pad) (GST_OBJECT_FLAG_IS_SET (pad, GST_PAD_FLAG_FLUSHING))
  938. /**
  939. * GST_PAD_SET_FLUSHING:
  940. * @pad: a #GstPad
  941. *
  942. * Set the given @pad to flushing state, which means it will not accept any
  943. * more events, queries or buffers, and return GST_FLOW_FLUSHING if any buffers
  944. * are pushed on it. This usually happens when the pad is shut down or when
  945. * a flushing seek happens. This is used inside GStreamer when flush start/stop
  946. * events pass through pads, or when an element state is changed and pads are
  947. * activated or deactivated.
  948. */
  949. #define GST_PAD_SET_FLUSHING(pad) (GST_OBJECT_FLAG_SET (pad, GST_PAD_FLAG_FLUSHING))
  950. /**
  951. * GST_PAD_UNSET_FLUSHING:
  952. * @pad: a #GstPad
  953. *
  954. * Unset the flushing flag.
  955. */
  956. #define GST_PAD_UNSET_FLUSHING(pad) (GST_OBJECT_FLAG_UNSET (pad, GST_PAD_FLAG_FLUSHING))
  957. /**
  958. * GST_PAD_IS_EOS:
  959. * @pad: a #GstPad
  960. *
  961. * Check if the @pad is in EOS state.
  962. */
  963. #define GST_PAD_IS_EOS(pad) (GST_OBJECT_FLAG_IS_SET (pad, GST_PAD_FLAG_EOS))
  964. /**
  965. * GST_PAD_NEEDS_RECONFIGURE:
  966. * @pad: a #GstPad
  967. *
  968. * Check if the @pad should be reconfigured/renegotiated.
  969. * The flag has to be unset manually after reconfiguration happened.
  970. * Use gst_pad_needs_reconfigure() or gst_pad_check_reconfigure() instead.
  971. */
  972. #define GST_PAD_NEEDS_RECONFIGURE(pad) (GST_OBJECT_FLAG_IS_SET (pad, GST_PAD_FLAG_NEED_RECONFIGURE))
  973. /**
  974. * GST_PAD_HAS_PENDING_EVENTS:
  975. * @pad: a #GstPad
  976. *
  977. * Check if the given @pad has pending events. This is used internally by
  978. * GStreamer.
  979. */
  980. #define GST_PAD_HAS_PENDING_EVENTS(pad) (GST_OBJECT_FLAG_IS_SET (pad, GST_PAD_FLAG_PENDING_EVENTS))
  981. /**
  982. * GST_PAD_IS_FIXED_CAPS:
  983. * @pad: a #GstPad
  984. *
  985. * Check if the given @pad is using fixed caps, which means that
  986. * once the caps are set on the @pad, the caps query function will
  987. * only return those caps. See gst_pad_use_fixed_caps().
  988. */
  989. #define GST_PAD_IS_FIXED_CAPS(pad) (GST_OBJECT_FLAG_IS_SET (pad, GST_PAD_FLAG_FIXED_CAPS))
  990. /**
  991. * GST_PAD_NEEDS_PARENT:
  992. * @pad: a #GstPad
  993. *
  994. * Check if there is a parent object before calling into the @pad callbacks.
  995. * This is used internally by GStreamer.
  996. */
  997. #define GST_PAD_NEEDS_PARENT(pad) (GST_OBJECT_FLAG_IS_SET (pad, GST_PAD_FLAG_NEED_PARENT))
  998. /**
  999. * GST_PAD_IS_PROXY_CAPS:
  1000. * @pad: a #GstPad
  1001. *
  1002. * Check if the given @pad is set to proxy caps. This means that the default
  1003. * event and query handler will forward all events and queries to the
  1004. * internally linked @pads instead of discarding them.
  1005. */
  1006. #define GST_PAD_IS_PROXY_CAPS(pad) (GST_OBJECT_FLAG_IS_SET (pad, GST_PAD_FLAG_PROXY_CAPS))
  1007. /**
  1008. * GST_PAD_SET_PROXY_CAPS:
  1009. * @pad: a #GstPad
  1010. *
  1011. * Set @pad to proxy caps, so that all caps-related events and queries are
  1012. * proxied down- or upstream to the other side of the element automatically.
  1013. * Set this if the element always outputs data in the exact same format as it
  1014. * receives as input. This is just for convenience to avoid implementing some
  1015. * standard event and query handling code in an element.
  1016. */
  1017. #define GST_PAD_SET_PROXY_CAPS(pad) (GST_OBJECT_FLAG_SET (pad, GST_PAD_FLAG_PROXY_CAPS))
  1018. /**
  1019. * GST_PAD_UNSET_PROXY_CAPS:
  1020. * @pad: a #GstPad
  1021. *
  1022. * Unset proxy caps flag.
  1023. */
  1024. #define GST_PAD_UNSET_PROXY_CAPS(pad) (GST_OBJECT_FLAG_UNSET (pad, GST_PAD_FLAG_PROXY_CAPS))
  1025. /**
  1026. * GST_PAD_IS_PROXY_ALLOCATION:
  1027. * @pad: a #GstPad
  1028. *
  1029. * Check if the given @pad is set as proxy allocation which means
  1030. * that the default query handler will forward allocation queries to the
  1031. * internally linked @pads instead of discarding them.
  1032. */
  1033. #define GST_PAD_IS_PROXY_ALLOCATION(pad) (GST_OBJECT_FLAG_IS_SET (pad, GST_PAD_FLAG_PROXY_ALLOCATION))
  1034. /**
  1035. * GST_PAD_SET_PROXY_ALLOCATION:
  1036. * @pad: a #GstPad
  1037. *
  1038. * Set @pad to proxy allocation queries, which means that the default query
  1039. * handler will forward allocation queries to the internally linked @pads
  1040. * instead of discarding them.
  1041. * Set this if the element always outputs data in the exact same format as it
  1042. * receives as input. This is just for convenience to avoid implementing some
  1043. * standard query handling code in an element.
  1044. */
  1045. #define GST_PAD_SET_PROXY_ALLOCATION(pad) (GST_OBJECT_FLAG_SET (pad, GST_PAD_FLAG_PROXY_ALLOCATION))
  1046. /**
  1047. * GST_PAD_UNSET_PROXY_ALLOCATION:
  1048. * @pad: a #GstPad
  1049. *
  1050. * Unset proxy allocation flag.
  1051. */
  1052. #define GST_PAD_UNSET_PROXY_ALLOCATION(pad) (GST_OBJECT_FLAG_UNSET (pad, GST_PAD_FLAG_PROXY_ALLOCATION))
  1053. /**
  1054. * GST_PAD_IS_PROXY_SCHEDULING:
  1055. * @pad: a #GstPad
  1056. *
  1057. * Check if the given @pad is set to proxy scheduling queries, which means that
  1058. * the default query handler will forward scheduling queries to the internally
  1059. * linked @pads instead of discarding them.
  1060. */
  1061. #define GST_PAD_IS_PROXY_SCHEDULING(pad) (GST_OBJECT_FLAG_IS_SET (pad, GST_PAD_FLAG_PROXY_SCHEDULING))
  1062. /**
  1063. * GST_PAD_SET_PROXY_SCHEDULING:
  1064. * @pad: a #GstPad
  1065. *
  1066. * Set @pad to proxy scheduling queries, which means that the default query
  1067. * handler will forward scheduling queries to the internally linked @pads
  1068. * instead of discarding them. You will usually want to handle scheduling
  1069. * queries explicitly if your element supports multiple scheduling modes.
  1070. */
  1071. #define GST_PAD_SET_PROXY_SCHEDULING(pad) (GST_OBJECT_FLAG_SET (pad, GST_PAD_FLAG_PROXY_SCHEDULING))
  1072. /**
  1073. * GST_PAD_UNSET_PROXY_SCHEDULING:
  1074. * @pad: a #GstPad
  1075. *
  1076. * Unset proxy scheduling flag.
  1077. */
  1078. #define GST_PAD_UNSET_PROXY_SCHEDULING(pad) (GST_OBJECT_FLAG_UNSET (pad, GST_PAD_FLAG_PROXY_SCHEDULING))
  1079. /**
  1080. * GST_PAD_IS_ACCEPT_INTERSECT:
  1081. * @pad: a #GstPad
  1082. *
  1083. * Check if the pad's accept intersect flag is set. The default accept-caps
  1084. * handler will check if the caps intersect the query-caps result instead of
  1085. * checking for a subset. This is interesting for parser elements that can
  1086. * accept incompletely specified caps.
  1087. */
  1088. #define GST_PAD_IS_ACCEPT_INTERSECT(pad) (GST_OBJECT_FLAG_IS_SET (pad, GST_PAD_FLAG_ACCEPT_INTERSECT))
  1089. /**
  1090. * GST_PAD_SET_ACCEPT_INTERSECT:
  1091. * @pad: a #GstPad
  1092. *
  1093. * Set @pad to by default accept caps by intersecting the result instead of
  1094. * checking for a subset. This is interesting for parser elements that can
  1095. * accept incompletely specified caps.
  1096. */
  1097. #define GST_PAD_SET_ACCEPT_INTERSECT(pad) (GST_OBJECT_FLAG_SET (pad, GST_PAD_FLAG_ACCEPT_INTERSECT))
  1098. /**
  1099. * GST_PAD_UNSET_ACCEPT_INTERSECT:
  1100. * @pad: a #GstPad
  1101. *
  1102. * Unset accept intersect flag.
  1103. */
  1104. #define GST_PAD_UNSET_ACCEPT_INTERSECT(pad) (GST_OBJECT_FLAG_UNSET (pad, GST_PAD_FLAG_ACCEPT_INTERSECT))
  1105. /**
  1106. * GST_PAD_IS_ACCEPT_TEMPLATE:
  1107. * @pad: a #GstPad
  1108. *
  1109. * Check if the pad's accept caps operation will use the pad template caps.
  1110. * The default accept-caps will do a query caps to get the caps, which might
  1111. * be querying downstream causing unnecessary overhead. It is recommended to
  1112. * implement a proper accept-caps query handler or to use this flag to prevent
  1113. * recursive accept-caps handling.
  1114. *
  1115. * Since: 1.6
  1116. */
  1117. #define GST_PAD_IS_ACCEPT_TEMPLATE(pad) (GST_OBJECT_FLAG_IS_SET (pad, GST_PAD_FLAG_ACCEPT_TEMPLATE))
  1118. /**
  1119. * GST_PAD_SET_ACCEPT_TEMPLATE:
  1120. * @pad: a #GstPad
  1121. *
  1122. * Set @pad to by default use the pad template caps to compare with
  1123. * the accept caps instead of using a caps query result.
  1124. *
  1125. * Since: 1.6
  1126. */
  1127. #define GST_PAD_SET_ACCEPT_TEMPLATE(pad) (GST_OBJECT_FLAG_SET (pad, GST_PAD_FLAG_ACCEPT_TEMPLATE))
  1128. /**
  1129. * GST_PAD_UNSET_ACCEPT_TEMPLATE:
  1130. * @pad: a #GstPad
  1131. *
  1132. * Unset accept template flag.
  1133. *
  1134. * Since: 1.6
  1135. */
  1136. #define GST_PAD_UNSET_ACCEPT_TEMPLATE(pad) (GST_OBJECT_FLAG_UNSET (pad, GST_PAD_FLAG_ACCEPT_TEMPLATE))
  1137. /**
  1138. * GST_PAD_GET_STREAM_LOCK:
  1139. * @pad: a #GstPad
  1140. *
  1141. * Get the stream lock of @pad. The stream lock is protecting the
  1142. * resources used in the data processing functions of @pad. Accessor
  1143. * macro, use GST_PAD_STREAM_LOCK() and GST_PAD_STREAM_UNLOCK() instead
  1144. * to take/release the pad's stream lock.
  1145. */
  1146. #define GST_PAD_GET_STREAM_LOCK(pad) (&(GST_PAD_CAST(pad)->stream_rec_lock))
  1147. /**
  1148. * GST_PAD_STREAM_LOCK:
  1149. * @pad: a #GstPad
  1150. *
  1151. * Take the pad's stream lock. The stream lock is recursive and will be taken
  1152. * when buffers or serialized downstream events are pushed on a pad.
  1153. */
  1154. #define GST_PAD_STREAM_LOCK(pad) g_rec_mutex_lock(GST_PAD_GET_STREAM_LOCK(pad))
  1155. /**
  1156. * GST_PAD_STREAM_TRYLOCK:
  1157. * @pad: a #GstPad
  1158. *
  1159. * Try to take the pad's stream lock, and return %TRUE if the lock could be
  1160. * taken, and otherwise %FALSE.
  1161. */
  1162. #define GST_PAD_STREAM_TRYLOCK(pad) g_rec_mutex_trylock(GST_PAD_GET_STREAM_LOCK(pad))
  1163. /**
  1164. * GST_PAD_STREAM_UNLOCK:
  1165. * @pad: a #GstPad
  1166. *
  1167. * Release the pad's stream lock.
  1168. */
  1169. #define GST_PAD_STREAM_UNLOCK(pad) g_rec_mutex_unlock(GST_PAD_GET_STREAM_LOCK(pad))
  1170. /**
  1171. * GST_PAD_LAST_FLOW_RETURN:
  1172. * @pad: a #GstPad
  1173. *
  1174. * Gets the last flow return on this pad
  1175. *
  1176. * Since: 1.4
  1177. */
  1178. #define GST_PAD_LAST_FLOW_RETURN(pad) (GST_PAD_CAST(pad)->ABI.abi.last_flowret)
  1179. #define GST_PAD_BLOCK_GET_COND(pad) (&GST_PAD_CAST(pad)->block_cond)
  1180. #define GST_PAD_BLOCK_WAIT(pad) (g_cond_wait(GST_PAD_BLOCK_GET_COND (pad), GST_OBJECT_GET_LOCK (pad)))
  1181. #define GST_PAD_BLOCK_SIGNAL(pad) (g_cond_signal(GST_PAD_BLOCK_GET_COND (pad)))
  1182. #define GST_PAD_BLOCK_BROADCAST(pad) (g_cond_broadcast(GST_PAD_BLOCK_GET_COND (pad)))
  1183. GType gst_pad_get_type (void);
  1184. /* creating pads */
  1185. GstPad* gst_pad_new (const gchar *name, GstPadDirection direction);
  1186. GstPad* gst_pad_new_from_template (GstPadTemplate *templ, const gchar *name);
  1187. GstPad* gst_pad_new_from_static_template (GstStaticPadTemplate *templ, const gchar *name);
  1188. /**
  1189. * gst_pad_get_name:
  1190. * @pad: the pad to get the name from
  1191. *
  1192. * Get a copy of the name of the pad. g_free() after usage.
  1193. *
  1194. * MT safe.
  1195. */
  1196. #define gst_pad_get_name(pad) gst_object_get_name (GST_OBJECT_CAST (pad))
  1197. /**
  1198. * gst_pad_get_parent:
  1199. * @pad: the pad to get the parent of
  1200. *
  1201. * Get the parent of @pad. This function increases the refcount
  1202. * of the parent object so you should gst_object_unref() it after usage.
  1203. * Can return %NULL if the pad did not have a parent.
  1204. *
  1205. * MT safe.
  1206. *
  1207. * Returns: (nullable): the parent
  1208. */
  1209. #define gst_pad_get_parent(pad) gst_object_get_parent (GST_OBJECT_CAST (pad))
  1210. GstPadDirection gst_pad_get_direction (GstPad *pad);
  1211. gboolean gst_pad_set_active (GstPad *pad, gboolean active);
  1212. gboolean gst_pad_is_active (GstPad *pad);
  1213. gboolean gst_pad_activate_mode (GstPad *pad, GstPadMode mode,
  1214. gboolean active);
  1215. gulong gst_pad_add_probe (GstPad *pad,
  1216. GstPadProbeType mask,
  1217. GstPadProbeCallback callback,
  1218. gpointer user_data,
  1219. GDestroyNotify destroy_data);
  1220. void gst_pad_remove_probe (GstPad *pad, gulong id);
  1221. gboolean gst_pad_is_blocked (GstPad *pad);
  1222. gboolean gst_pad_is_blocking (GstPad *pad);
  1223. void gst_pad_mark_reconfigure (GstPad *pad);
  1224. gboolean gst_pad_needs_reconfigure (GstPad *pad);
  1225. gboolean gst_pad_check_reconfigure (GstPad *pad);
  1226. void gst_pad_set_element_private (GstPad *pad, gpointer priv);
  1227. gpointer gst_pad_get_element_private (GstPad *pad);
  1228. GstPadTemplate* gst_pad_get_pad_template (GstPad *pad);
  1229. GstFlowReturn gst_pad_store_sticky_event (GstPad *pad, GstEvent *event);
  1230. GstEvent* gst_pad_get_sticky_event (GstPad *pad, GstEventType event_type,
  1231. guint idx);
  1232. void gst_pad_sticky_events_foreach (GstPad *pad, GstPadStickyEventsForeachFunction foreach_func, gpointer user_data);
  1233. /* data passing setup functions */
  1234. void gst_pad_set_activate_function_full (GstPad *pad,
  1235. GstPadActivateFunction activate,
  1236. gpointer user_data,
  1237. GDestroyNotify notify);
  1238. void gst_pad_set_activatemode_function_full (GstPad *pad,
  1239. GstPadActivateModeFunction activatemode,
  1240. gpointer user_data,
  1241. GDestroyNotify notify);
  1242. /* data passing functions */
  1243. void gst_pad_set_chain_function_full (GstPad *pad,
  1244. GstPadChainFunction chain,
  1245. gpointer user_data,
  1246. GDestroyNotify notify);
  1247. void gst_pad_set_chain_list_function_full (GstPad *pad,
  1248. GstPadChainListFunction chainlist,
  1249. gpointer user_data,
  1250. GDestroyNotify notify);
  1251. void gst_pad_set_getrange_function_full (GstPad *pad,
  1252. GstPadGetRangeFunction get,
  1253. gpointer user_data,
  1254. GDestroyNotify notify);
  1255. void gst_pad_set_event_function_full (GstPad *pad,
  1256. GstPadEventFunction event,
  1257. gpointer user_data,
  1258. GDestroyNotify notify);
  1259. void gst_pad_set_event_full_function_full (GstPad *pad,
  1260. GstPadEventFullFunction event,
  1261. gpointer user_data,
  1262. GDestroyNotify notify);
  1263. #define gst_pad_set_activate_function(p,f) gst_pad_set_activate_function_full((p),(f),NULL,NULL)
  1264. #define gst_pad_set_activatemode_function(p,f) gst_pad_set_activatemode_function_full((p),(f),NULL,NULL)
  1265. #define gst_pad_set_chain_function(p,f) gst_pad_set_chain_function_full((p),(f),NULL,NULL)
  1266. #define gst_pad_set_chain_list_function(p,f) gst_pad_set_chain_list_function_full((p),(f),NULL,NULL)
  1267. #define gst_pad_set_getrange_function(p,f) gst_pad_set_getrange_function_full((p),(f),NULL,NULL)
  1268. #define gst_pad_set_event_function(p,f) gst_pad_set_event_function_full((p),(f),NULL,NULL)
  1269. #define gst_pad_set_event_full_function(p,f) gst_pad_set_event_full_function_full((p),(f),NULL,NULL)
  1270. /* pad links */
  1271. void gst_pad_set_link_function_full (GstPad *pad,
  1272. GstPadLinkFunction link,
  1273. gpointer user_data,
  1274. GDestroyNotify notify);
  1275. void gst_pad_set_unlink_function_full (GstPad *pad,
  1276. GstPadUnlinkFunction unlink,
  1277. gpointer user_data,
  1278. GDestroyNotify notify);
  1279. #define gst_pad_set_link_function(p,f) gst_pad_set_link_function_full((p),(f),NULL,NULL)
  1280. #define gst_pad_set_unlink_function(p,f) gst_pad_set_unlink_function_full((p),(f),NULL,NULL)
  1281. gboolean gst_pad_can_link (GstPad *srcpad, GstPad *sinkpad);
  1282. GstPadLinkReturn gst_pad_link (GstPad *srcpad, GstPad *sinkpad);
  1283. GstPadLinkReturn gst_pad_link_full (GstPad *srcpad, GstPad *sinkpad, GstPadLinkCheck flags);
  1284. gboolean gst_pad_unlink (GstPad *srcpad, GstPad *sinkpad);
  1285. gboolean gst_pad_is_linked (GstPad *pad);
  1286. GstPad* gst_pad_get_peer (GstPad *pad);
  1287. GstCaps* gst_pad_get_pad_template_caps (GstPad *pad);
  1288. /* capsnego function for linked/unlinked pads */
  1289. GstCaps * gst_pad_get_current_caps (GstPad * pad);
  1290. gboolean gst_pad_has_current_caps (GstPad * pad);
  1291. /* capsnego for linked pads */
  1292. GstCaps * gst_pad_get_allowed_caps (GstPad * pad);
  1293. /* pad offsets */
  1294. gint64 gst_pad_get_offset (GstPad *pad);
  1295. void gst_pad_set_offset (GstPad *pad, gint64 offset);
  1296. /* data passing functions to peer */
  1297. GstFlowReturn gst_pad_push (GstPad *pad, GstBuffer *buffer);
  1298. GstFlowReturn gst_pad_push_list (GstPad *pad, GstBufferList *list);
  1299. GstFlowReturn gst_pad_pull_range (GstPad *pad, guint64 offset, guint size,
  1300. GstBuffer **buffer);
  1301. gboolean gst_pad_push_event (GstPad *pad, GstEvent *event);
  1302. gboolean gst_pad_event_default (GstPad *pad, GstObject *parent,
  1303. GstEvent *event);
  1304. GstFlowReturn gst_pad_get_last_flow_return (GstPad *pad);
  1305. /* data passing functions on pad */
  1306. GstFlowReturn gst_pad_chain (GstPad *pad, GstBuffer *buffer);
  1307. GstFlowReturn gst_pad_chain_list (GstPad *pad, GstBufferList *list);
  1308. GstFlowReturn gst_pad_get_range (GstPad *pad, guint64 offset, guint size,
  1309. GstBuffer **buffer);
  1310. gboolean gst_pad_send_event (GstPad *pad, GstEvent *event);
  1311. /* pad tasks */
  1312. gboolean gst_pad_start_task (GstPad *pad, GstTaskFunction func,
  1313. gpointer user_data, GDestroyNotify notify);
  1314. gboolean gst_pad_pause_task (GstPad *pad);
  1315. gboolean gst_pad_stop_task (GstPad *pad);
  1316. /* internal links */
  1317. void gst_pad_set_iterate_internal_links_function_full (GstPad * pad,
  1318. GstPadIterIntLinkFunction iterintlink,
  1319. gpointer user_data,
  1320. GDestroyNotify notify);
  1321. GstIterator * gst_pad_iterate_internal_links (GstPad * pad);
  1322. GstIterator * gst_pad_iterate_internal_links_default (GstPad * pad, GstObject *parent);
  1323. #define gst_pad_set_iterate_internal_links_function(p,f) gst_pad_set_iterate_internal_links_function_full((p),(f),NULL,NULL)
  1324. /* generic query function */
  1325. gboolean gst_pad_query (GstPad *pad, GstQuery *query);
  1326. gboolean gst_pad_peer_query (GstPad *pad, GstQuery *query);
  1327. void gst_pad_set_query_function_full (GstPad *pad, GstPadQueryFunction query,
  1328. gpointer user_data,
  1329. GDestroyNotify notify);
  1330. gboolean gst_pad_query_default (GstPad *pad, GstObject *parent,
  1331. GstQuery *query);
  1332. #define gst_pad_set_query_function(p,f) gst_pad_set_query_function_full((p),(f),NULL,NULL)
  1333. /* misc helper functions */
  1334. gboolean gst_pad_forward (GstPad *pad, GstPadForwardFunction forward,
  1335. gpointer user_data);
  1336. #ifdef G_DEFINE_AUTOPTR_CLEANUP_FUNC
  1337. G_DEFINE_AUTOPTR_CLEANUP_FUNC(GstPad, gst_object_unref)
  1338. #endif
  1339. G_END_DECLS
  1340. #endif /* __GST_PAD_H__ */