On 2/23/22 03:09, Zebediah Figura (she/her) wrote:
On 2/22/22 16:48, Rémi Bernon wrote:
+NTSTATUS wg_transform_push_data(void *args) +{ + struct wg_transform_push_data_params *params = args; + struct wg_transform *transform = params->transform; + struct wg_sample *sample = params->sample; + GstFlowReturn ret; + GstBuffer *buffer; + + buffer = gst_buffer_new_and_alloc(sample->size); + if (!buffer) + return STATUS_NO_MEMORY; + + gst_buffer_fill(buffer, 0, sample->data, sample->size); + if ((ret = gst_pad_push(transform->my_src, buffer))) + return MF_E_NOTACCEPTING;
Does MF_E_NOTACCEPTING correspond to any failure GstFlowReturn, though? As far as I can tell GStreamer doesn't even have an equivalent; it just blocks in the chain function if applicable.
Yeah we could/should probably return an error instead here.
(Side note: I'd really prefer that we don't mix two different error code namespaces. Note that we're already returning STATUS_NO_MEMORY here when the PE side expects an HRESULT.)
I agree, I'm not sure how to do that though. Perhaps an output result parameter then, I really don't like returning non-NTSTATUS values when the return type is NTSTATUS. -- Rémi Bernon <rbernon(a)codeweavers.com>