55 * @new_buffer: Called when a new buffer is available. |
55 * @new_buffer: Called when a new buffer is available. |
56 * This callback is called from the steaming thread. |
56 * This callback is called from the steaming thread. |
57 * The new buffer can be retrieved with |
57 * The new buffer can be retrieved with |
58 * gst_app_sink_pull_buffer() either from this callback |
58 * gst_app_sink_pull_buffer() either from this callback |
59 * or from any other thread. |
59 * or from any other thread. |
60 * @new_buffer_list: Called when a new bufferlist is available. |
|
61 * This callback is called from the steaming thread. |
|
62 * The new bufferlist can be retrieved with |
|
63 * gst_app_sink_pull_buffer_list() either from this callback |
|
64 * or from any other thread. |
|
65 * |
60 * |
66 * A set of callbacks that can be installed on the appsink with |
61 * A set of callbacks that can be installed on the appsink with |
67 * gst_app_sink_set_callbacks(). |
62 * gst_app_sink_set_callbacks(). |
68 * |
63 * |
69 * Since: 0.10.23 |
64 * Since: 0.10.23 |
70 */ |
65 */ |
71 typedef struct { |
66 typedef struct { |
72 void (*eos) (GstAppSink *sink, gpointer user_data); |
67 void (*eos) (GstAppSink *sink, gpointer user_data); |
73 GstFlowReturn (*new_preroll) (GstAppSink *sink, gpointer user_data); |
68 GstFlowReturn (*new_preroll) (GstAppSink *sink, gpointer user_data); |
74 GstFlowReturn (*new_buffer) (GstAppSink *sink, gpointer user_data); |
69 GstFlowReturn (*new_buffer) (GstAppSink *sink, gpointer user_data); |
75 GstFlowReturn (*new_buffer_list) (GstAppSink *sink, gpointer user_data); |
|
76 |
70 |
77 /*< private >*/ |
71 /*< private >*/ |
78 gpointer _gst_reserved[GST_PADDING - 1]; |
72 gpointer _gst_reserved[GST_PADDING]; |
79 } GstAppSinkCallbacks; |
73 } GstAppSinkCallbacks; |
80 |
74 |
81 struct _GstAppSink |
75 struct _GstAppSink |
82 { |
76 { |
83 GstBaseSink basesink; |
77 GstBaseSink basesink; |
97 void (*eos) (GstAppSink *sink); |
91 void (*eos) (GstAppSink *sink); |
98 void (*new_preroll) (GstAppSink *sink); |
92 void (*new_preroll) (GstAppSink *sink); |
99 void (*new_buffer) (GstAppSink *sink); |
93 void (*new_buffer) (GstAppSink *sink); |
100 |
94 |
101 /* actions */ |
95 /* actions */ |
102 GstBuffer * (*pull_preroll) (GstAppSink *sink); |
96 GstBuffer * (*pull_preroll) (GstAppSink *sink); |
103 GstBuffer * (*pull_buffer) (GstAppSink *sink); |
97 GstBuffer * (*pull_buffer) (GstAppSink *sink); |
104 |
|
105 /* ABI added */ |
|
106 GstBufferList * (*new_buffer_list) (GstAppSink *sink); |
|
107 GstBufferList * (*pull_buffer_list) (GstAppSink *sink); |
|
108 |
98 |
109 /*< private >*/ |
99 /*< private >*/ |
110 gpointer _gst_reserved[GST_PADDING - 2]; |
100 gpointer _gst_reserved[GST_PADDING]; |
111 }; |
101 }; |
112 |
102 |
113 IMPORT_C GType gst_app_sink_get_type(void); |
103 IMPORT_C GType gst_app_sink_get_type(void); |
114 |
104 |
115 IMPORT_C void gst_app_sink_set_caps (GstAppSink *appsink, const GstCaps *caps); |
105 IMPORT_C void gst_app_sink_set_caps (GstAppSink *appsink, const GstCaps *caps); |
126 IMPORT_C void gst_app_sink_set_drop (GstAppSink *appsink, gboolean drop); |
116 IMPORT_C void gst_app_sink_set_drop (GstAppSink *appsink, gboolean drop); |
127 IMPORT_C gboolean gst_app_sink_get_drop (GstAppSink *appsink); |
117 IMPORT_C gboolean gst_app_sink_get_drop (GstAppSink *appsink); |
128 |
118 |
129 IMPORT_C GstBuffer * gst_app_sink_pull_preroll (GstAppSink *appsink); |
119 IMPORT_C GstBuffer * gst_app_sink_pull_preroll (GstAppSink *appsink); |
130 IMPORT_C GstBuffer * gst_app_sink_pull_buffer (GstAppSink *appsink); |
120 IMPORT_C GstBuffer * gst_app_sink_pull_buffer (GstAppSink *appsink); |
131 IMPORT_C GstBufferList * gst_app_sink_pull_buffer_list (GstAppSink *appsink); |
|
132 |
121 |
133 IMPORT_C void gst_app_sink_set_callbacks (GstAppSink * appsink, |
122 IMPORT_C void gst_app_sink_set_callbacks (GstAppSink * appsink, |
134 GstAppSinkCallbacks *callbacks, |
123 GstAppSinkCallbacks *callbacks, |
135 gpointer user_data, |
124 gpointer user_data, |
136 GDestroyNotify notify); |
125 GDestroyNotify notify); |