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