All pastes #443560 Raw Edit

Something

public text v1 · immutable
·published 2007-04-16 21:29 UTC
rendered paste body
static GstFlowReturn
gst_gomx_audio_chain (GstBaseSink *bsink,
					  GstBuffer *buf)
{
	GstGOmxFilter *self;
	GOmxCore *gomx;
	GstFlowReturn ret = GST_FLOW_OK;
	GstBuffer *output_adapter;

	self = GST_GOMX_SINK (bsink);

	gomx = self->gomx;

	if (self->info->id == GST_ELEMENT_AAC_FILTER && 
		gomx->ports[0]->buffer_size > GST_BUFFER_SIZE (buf) )
	{
		GST_DEBUG_OBJECT(self, "AAC filter adapter process");

		gst_adapter_push (self->adapter, buf);
		
		GST_DEBUG_OBJECT(self, "adapter availabe data: %d", gst_adapter_available (self->adapter));

		while (gst_adapter_available (self->adapter)  >= 2000)
		{
	
			GST_DEBUG_OBJECT (self, "got enough info: %d", gst_adapter_available (self->adapter));
			g_omx_sem_down (self->input_ready);
			
			GST_DEBUG_OBJECT (self, "About to peek from adapter %p", self->adapter);
			output_adapter = gst_adapter_take_buffer (self->adapter, 2000);
			
			memcpy (gomx->omx_buffer->pBuffer, GST_BUFFER_DATA (output_adapter), GST_BUFFER_SIZE (output_adapter));
			gomx->omx_buffer->nFilledLen = GST_BUFFER_SIZE (output_adapter));
			g_omx_sem_up (self->input_filled);
			gst_buffer_unref (output_adapter);
			
			GST_DEBUG_OBJECT(self, " Sent data to openmax");

		}

		GST_DEBUG_OBJECT(self, "AAC sink adapter process exit");

	}

[...]