示例#1
0
	/* output */
	{
		GooIterator* iter =
			goo_component_iterate_output_ports (component);
		goo_iterator_nth (iter, 0);
		GooPort* port = GOO_PORT (goo_iterator_get_current (iter));
		g_assert (port != NULL);

		GOO_PORT_GET_DEFINITION (port)->nBufferSize =
			OUTPUT_BUFFERSIZE;
		GOO_PORT_GET_DEFINITION (port)->nBufferCountActual = OUTPUT_NUM_BUFFERS;
		GOO_PORT_GET_DEFINITION (port)->format.audio.eEncoding =
			OMX_AUDIO_CodingPCM;

		g_object_unref (iter);
		g_object_unref (port);
	}

	return;
}

#if 0 /* i think it is not necessary now */
static void
goo_ti_mp3dec_release_buffer (GooComponent* self,
			      OMX_BUFFERHEADERTYPE* buffer)
{
	g_assert (GOO_IS_COMPONENT (self));
	g_assert (buffer != NULL);
	g_assert (self->cur_state == OMX_StateExecuting ||
		  self->cur_state == OMX_StateIdle);

	GooPort* port = GOO_PORT (g_object_ref (buffer->pAppPrivate));

	if (goo_port_is_eos (port) || goo_port_is_tunneled (port))
	{
		g_object_unref (port);
		return;
	}

	if ((buffer->nFlags & OMX_BUFFERFLAG_EOS) == 0x1)
	{
		GOO_OBJECT_INFO (port, "eos found!");
		goo_port_set_eos (port);
	}

	/* We should always push the EOS buffer */
	GOO_OBJECT_NOTICE (self, "OMX_EmptyThisBuffer, 0x%x", buffer);

	if (self->cur_state != OMX_StateIdle)
	{
		GOO_OBJECT_LOCK (self);
		GOO_RUN (
			OMX_EmptyThisBuffer (self->handle, buffer)
			);
		GOO_OBJECT_UNLOCK (self);
	}
	else
	{
		g_print("INFORMATION (workaround): Implementing workaround "
			"for DR OMAPS00143083\n");
	}

	g_object_unref (port);

	GOO_OBJECT_DEBUG (self, "");

	return;
}
示例#2
0
static gboolean
goo_ti_clock_load (GooComponent* self)
{
    GOO_OBJECT_LOCK (self);
    RETURN_GOO_RUN (
        OMX_GetHandle (&self->handle, self->id, self,
                       &self->callbacks)
    );

    GOO_RUN (
        OMX_GetState (self->handle, &self->cur_state)
    );
    GOO_OBJECT_UNLOCK (self);

    GOO_OBJECT_DEBUG (self, "");

    return TRUE;
}
示例#3
0
static void
goo_ti_clock_set_state_loaded (GooComponent* self)
{
    GOO_OBJECT_INFO (self, "Sending loaded state command");

    self->next_state = OMX_StateLoaded;

    GOO_OBJECT_LOCK (self);
    GOO_RUN (
        OMX_SendCommand (self->handle,
                         OMX_CommandStateSet,
                         self->next_state,
                         NULL)
    );
    GOO_OBJECT_UNLOCK (self);

    goo_component_wait_for_next_state (self);

    GOO_OBJECT_DEBUG (self, "");

    return;
}