Guest User

Untitled

a guest
Apr 24th, 2018
187
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.21 KB | None | 0 0
  1. /* GStreamer
  2. * Copyright (C) 2011 Collabora Ltd
  3. * @author: Olivier Crete <olivier.crete@collabora.com>
  4. *
  5. * This library is free software; you can redistribute it and/or
  6. * modify it under the terms of the GNU Library General Public
  7. * License as published by the Free Software Foundation; either
  8. * version 2 of the License, or (at your option) any later version.
  9. *
  10. * This library is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  13. * Library General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU Library General Public
  16. * License along with this library; if not, write to the
  17. * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  18. * Boston, MA 02111-1307, USA.
  19. */
  20.  
  21. #ifndef _GST_DYNAMIC_BIN_H_
  22. #define _GST_DYNAMIC_BIN_H_
  23.  
  24. #ifndef GST_USE_UNSTABLE_API
  25. #warning "GstDynamicBin is unstable API and may change in future."
  26. #warning "You can define GST_USE_UNSTABLE_API to avoid this warning."
  27. #endif
  28.  
  29. #include <gst/gst.h>
  30.  
  31. G_BEGIN_DECLS
  32.  
  33. #define GST_TYPE_DYNAMIC_BIN \
  34. (gst_dynamic_bin_get_type())
  35. #define GST_DYNAMIC_BIN(obj) \
  36. (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_DYNAMIC_BIN,GstDynamicBin))
  37. #define GST_DYNAMIC_BIN_CLASS(klass) \
  38. (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_DYNAMIC_BIN,GstDynamicBinClass))
  39. #define GST_DYNAMIC_BIN_GET_CLASS(obj) \
  40. (G_TYPE_INSTANCE_GET_CLASS((obj),GST_TYPE_DYNAMIC_BIN,GstDynamicBinClass))
  41. #define GST_IS_DYNAMIC_BIN(obj) \
  42. (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_DYNAMIC_BIN))
  43. #define GST_IS_DYNAMIC_BIN_CLASS(obj) \
  44. (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_DYNAMIC_BIN))
  45.  
  46. /**
  47. * GST_DYNAMIC_BIN_SINK_NAME:
  48. *
  49. * The name of the templates for the sink pad.
  50. */
  51. #define GST_DYNAMIC_BIN_SINK_NAME "sink"
  52. /**
  53. * GST_DYNAMIC_BIN_SRC_NAME:
  54. *
  55. * The name of the templates for the source pad.
  56. */
  57. #define GST_DYNAMIC_BIN_SRC_NAME "src"
  58.  
  59. /**
  60. * GST_DYNAMIC_BIN_SRC_PAD:
  61. * @obj: dynamic bin instance
  62. *
  63. * Gives the pointer to the source #GstPad object of the element.
  64. */
  65. #define GST_DYNAMIC_BIN_SRC_PAD(obj) (((GstDynamicBin *) (obj))->srcpad)
  66.  
  67. /**
  68. * GST_DYNAMIC_BIN_SINK_PAD:
  69. * @obj: dynamic bin instance
  70. *
  71. * Gives the pointer to the sink #GstPad object of the element.
  72. */
  73. #define GST_DYNAMIC_BIN_SINK_PAD(obj) (((GstDynamicBin *) (obj))->sinkpad)
  74.  
  75. typedef struct _GstDynamicBin GstDynamicBin;
  76. typedef struct _GstDynamicBinPrivate GstDynamicBinPrivate;
  77. typedef struct _GstDynamicBinClass GstDynamicBinClass;
  78.  
  79.  
  80. struct _GstDynamicBin
  81. {
  82. GstBin bin;
  83.  
  84. /*< private >*/
  85. GstPad *sinkpad;
  86. GstPad *srcpad;
  87.  
  88. GstDynamicBinPrivate *priv;
  89.  
  90. /* FIXME before moving to base */
  91. void *padding[GST_PADDING_LARGE];
  92. };
  93.  
  94. struct _GstDynamicBinClass
  95. {
  96. GstElementClass element_class;
  97.  
  98. /* FIXME before moving to base */
  99. void *padding[GST_PADDING_LARGE];
  100. };
  101.  
  102. GType gst_dynamic_bin_get_type (void);
  103.  
  104. typedef enum _GstDynamicBinResult {
  105. GST_DYNAMIC_BIN_SUCCESS = 0,
  106. GST_DYNAMIC_BIN_INVALID_ELEMENT,
  107. GST_DYNAMIC_BIN_MISSING_SIBLING,
  108. GST_DYNAMIC_BIN_LINKING_FAILED,
  109. GST_DYNAMIC_BIN_ADDING_FAILED
  110. } GstDynamicBinResult;
  111.  
  112. typedef void (*GstDynamicBinChangeCompleted) (GstDynamicBin *bin,
  113. GstElement *element, GstDynamicBinResult result,
  114. gpointer user_data);
  115.  
  116.  
  117. GstDynamicBin *gst_dynamic_bin_new (void);
  118.  
  119. void gst_dynamic_bin_add_last_async (GstDynamicBin * bin, GstElement * element,
  120. GstDynamicBinChangeCompleted completed, gpointer user_data);
  121. void gst_dynamic_bin_add_first_async (GstDynamicBin * bin, GstElement * element,
  122. GstDynamicBinChangeCompleted completed, gpointer user_data);
  123. void gst_dynamic_bin_add_before_async (GstDynamicBin * bin,
  124. GstElement * element, GstElement * sibling,
  125. GstDynamicBinChangeCompleted completed, gpointer user_data);
  126. void gst_dynamic_bin_add_after_async (GstDynamicBin * bin, GstElement * element,
  127. GstElement * sibling,
  128. GstDynamicBinChangeCompleted completed, gpointer user_data);
  129.  
  130. void gst_dynamic_bin_remove_async (GstDynamicBin * bin, GstElement * element,
  131. GstDynamicBinChangeCompleted completed, gpointer user_data);
  132.  
  133. G_END_DECLS
  134.  
  135. #endif
Add Comment
Please, Sign In to add comment