Exemple #1
0
static void
gst_goo_encarmaac_init (GstGooEncArmAac* self, GstGooEncArmAacClass *klass)
{
	/* goo stuff */
	{
		self->factory = goo_ti_component_factory_get_instance ();
		self->component = goo_component_factory_get_component
			(self->factory, GOO_TI_ARMAAC_ENCODER);

		self->inport =
			goo_component_get_port (self->component, "input0");
		g_assert (self->inport != NULL);

		self->outport =
			goo_component_get_port (self->component, "output0");
		g_assert (self->outport != NULL);

		OMX_AUDIO_PARAM_AACPROFILETYPE* param = NULL;
		param = GOO_TI_ARMAACENC_GET_OUTPUT_PORT_PARAM (self->component);

		param->nBitRate = DEFAULT_BITRATE;
		param->eAACStreamFormat = DEFAULT_OUTPUTFORMAT;
		param->eAACProfile = DEFAULT_PROFILE;
		param->nChannels = DEFAULT_CHANNELS;
		param->eChannelMode = DEFAULT_CHANNELS_MODE;
		param->nSampleRate = DEFAULT_SAMPLERATE;
	}

	/* gst stuff */
	{
		self->sinkpad = gst_pad_new_from_static_template
			(&sink_template, "sink");
		gst_pad_set_setcaps_function
			(self->sinkpad,
			 GST_DEBUG_FUNCPTR (gst_goo_encarmaac_setcaps));
		gst_pad_set_event_function
			(self->sinkpad,
			 GST_DEBUG_FUNCPTR (gst_goo_encarmaac_event));
		gst_pad_set_chain_function
			(self->sinkpad,
			 GST_DEBUG_FUNCPTR (gst_goo_encarmaac_chain));
		gst_element_add_pad (GST_ELEMENT (self), self->sinkpad);

		self->srcpad = gst_pad_new_from_static_template
			(&src_template, "src");
		gst_pad_use_fixed_caps (self->srcpad);
		gst_element_add_pad (GST_ELEMENT (self), self->srcpad);
	}

	/* gobject stuff */
	g_object_set_data (G_OBJECT (self->component), "gst", self);
	g_object_set_data (G_OBJECT (self), "goo", self->component);

	self->bitratemode = GOO_TI_ARMAACENC_BR_CBR;
	self->adapter = gst_goo_adapter_new ();

	GST_DEBUG_OBJECT (self, "");

        return;
}
Exemple #2
0
static void
gst_goo_encpcm_init (GstGooEncPcm* self, GstGooEncPcmClass* klass)
{
	/* goo stuff */
	self->factory = goo_ti_component_factory_get_instance ();
	self->component =
		goo_component_factory_get_component (self->factory,
						     GOO_TI_PCM_ENCODER);

	self->inport = goo_component_get_port (self->component, "input0");
	g_assert (self->inport != NULL);

	self->outport = goo_component_get_port (self->component, "output0");
	g_assert (self->outport != NULL);

	/* gst stuff */
	self->sinkpad = gst_pad_new_from_static_template (&sink_template,
							  "sink");
	gst_pad_set_setcaps_function
		(self->sinkpad, GST_DEBUG_FUNCPTR (gst_goo_encpcm_setcaps));
	gst_pad_set_event_function
		(self->sinkpad, GST_DEBUG_FUNCPTR (gst_goo_encpcm_event));
	gst_pad_set_chain_function
		(self->sinkpad, GST_DEBUG_FUNCPTR (gst_goo_encpcm_chain));
	gst_element_add_pad (GST_ELEMENT (self), self->sinkpad);

	self->srcpad = gst_pad_new_from_static_template (&src_template,
							 "src");
	gst_pad_use_fixed_caps (self->srcpad);
	gst_element_add_pad (GST_ELEMENT (self), self->srcpad);

	/* gobject stuff */
	g_object_set_data (G_OBJECT (self->component), "gst", self);
	g_object_set_data (G_OBJECT (self), "goo", self->component);

	self->adapter = gst_goo_adapter_new ();

	/* Initializing the private structure */
	GstGooEncPcmPrivate* priv = GST_GOO_ENCPCM_GET_PRIVATE (self);
	priv->incount = 0;
	priv->outcount = 0;

	GST_DEBUG_OBJECT (self, "");

        return;
}
Exemple #3
0
static void
gst_goo_filter_init (GstGooFilter* self, GstGooFilterClass* klass)
{
	GST_DEBUG ("Enter");

	GstGooFilterPrivate* priv = GST_GOO_FILTER_GET_PRIVATE (self);
	priv->num_input_buffers = NUM_INPUT_BUFFERS_DEFAULT;
	priv->num_output_buffers = NUM_OUTPUT_BUFFERS_DEFAULT;
	priv->incount = 0;
	priv->outcount = 0;
	priv->process_mode = DEFAULT_PROCESS_MODE;

	self->factory = goo_ti_component_factory_get_instance ();

	/* GST */
	GstPadTemplate* pad_template;

	pad_template = gst_element_class_get_pad_template
	(GST_ELEMENT_CLASS (klass), "sink");
	g_return_if_fail (pad_template != NULL);

	self->sinkpad = gst_pad_new_from_template (pad_template, "sink");
	gst_pad_set_event_function (self->sinkpad,
			GST_DEBUG_FUNCPTR (gst_goo_filter_sink_event));
	gst_pad_set_chain_function (self->sinkpad,
			GST_DEBUG_FUNCPTR (gst_goo_filter_chain));

	gst_element_add_pad (GST_ELEMENT (self), self->sinkpad);

	pad_template = gst_element_class_get_pad_template
	(GST_ELEMENT_CLASS (klass), "src");
	g_return_if_fail (pad_template != NULL);

	self->srcpad = gst_pad_new_from_template (pad_template, "src");

	gst_element_add_pad (GST_ELEMENT (self), self->srcpad);

	self->adapter = gst_goo_adapter_new ();
#if 0
	self->dasfsrc_sem = gst_goo_sem_new (0);
#endif

	GST_DEBUG ("Exit");
	return;
}
Exemple #4
0
static void
gst_goo_encgsmhr_init (GstGooEncGsmHr* self, GstGooEncGsmHrClass* klass)
{
	/* goo stuff */
	self->factory = goo_ti_component_factory_get_instance ();
	self->component =
		goo_component_factory_get_component (self->factory,
						     GOO_TI_GSMHR_ENCODER);

	self->bDTX = DEFAULT_DTX;
	self->bHiPassFilter = DEFAULT_HIPASS_FILTER;

	self->inport = goo_component_get_port (self->component, "input0");
	g_assert (self->inport != NULL);

	self->outport = goo_component_get_port (self->component, "output0");
	g_assert (self->outport != NULL);

	/* gst stuff */
	self->sinkpad = gst_pad_new_from_static_template (&sink_template,
							  "sink");
	gst_pad_set_setcaps_function
		(self->sinkpad, GST_DEBUG_FUNCPTR (gst_goo_encgsmhr_setcaps));
	gst_pad_set_event_function
		(self->sinkpad, GST_DEBUG_FUNCPTR (gst_goo_encgsmhr_event));
	gst_pad_set_chain_function
		(self->sinkpad, GST_DEBUG_FUNCPTR (gst_goo_encgsmhr_chain));
	gst_element_add_pad (GST_ELEMENT (self), self->sinkpad);

	self->srcpad = gst_pad_new_from_static_template (&src_template,
							 "src");
	gst_pad_use_fixed_caps (self->srcpad);
	gst_element_add_pad (GST_ELEMENT (self), self->srcpad);

	/* gobject stuff */
	g_object_set_data (G_OBJECT (self->component), "gst", self);
	g_object_set_data (G_OBJECT (self), "goo", self->component);

	self->adapter = gst_goo_adapter_new ();

	GST_DEBUG_OBJECT (self, "");
	return;
}
Exemple #5
0
static void
gst_goo_encjpeg_init (GstGooEncJpeg* self, GstGooEncJpegClass* klass)
{
	GST_DEBUG ("");

	self->factory = goo_ti_component_factory_get_instance ();
	self->component = goo_component_factory_get_component(self->factory, GOO_TI_JPEG_ENCODER);

	/* param */
	{
		GOO_TI_JPEGENC_GET_PARAM (self->component)->nQFactor =
			QUALITY_DEFAULT;
	}

	/* inport */
	{
		self->inport = goo_component_get_port (self->component,
						       "input0");
		g_assert (self->inport != NULL);

		OMX_PARAM_PORTDEFINITIONTYPE* param;
		param = GOO_PORT_GET_DEFINITION (self->inport);
		param->format.image.nFrameWidth = WIDTH_DEFAULT;
		param->format.image.nFrameHeight = HEIGHT_DEFAULT;
		param->format.image.eColorFormat = COLOR_FORMAT_DEFAULT;

		g_object_set (self->inport,
			      "buffercount", NUM_INPUT_BUFFERS_DEFAULT, NULL);
	}

	/* outport */
	{
		self->outport = goo_component_get_port (self->component,
							"output0");
		g_assert (self->outport != NULL);

		OMX_PARAM_PORTDEFINITIONTYPE* param;
		param = GOO_PORT_GET_DEFINITION (self->outport);
		param->format.image.nFrameWidth = WIDTH_DEFAULT;
		param->format.image.nFrameHeight = HEIGHT_DEFAULT;
		param->format.image.eColorFormat = COLOR_FORMAT_DEFAULT;

		g_object_set (self->outport, "buffercount", NUM_INPUT_BUFFERS_DEFAULT, NULL);
	}

	GstGooEncJpegPrivate* priv = GST_GOO_ENCJPEG_GET_PRIVATE (self);
	priv->num_input_buffers = NUM_INPUT_BUFFERS_DEFAULT;
	priv->num_output_buffers = NUM_OUTPUT_BUFFERS_DEFAULT;
	priv->incount = 0;
	priv->outcount = 0;
	priv->quality = QUALITY_DEFAULT;
	priv->colorformat = COLOR_FORMAT_DEFAULT;
	priv->width = WIDTH_DEFAULT;
	priv->height = HEIGHT_DEFAULT;
	priv->omxbufsiz = 0;

	/* GST */
	GstPadTemplate* pad_template;

	pad_template = gst_element_class_get_pad_template
		(GST_ELEMENT_CLASS (klass), "sink");
	g_return_if_fail (pad_template != NULL);
	self->sinkpad = gst_pad_new_from_template (pad_template, "sink");
	gst_pad_set_chain_function
		(self->sinkpad, GST_DEBUG_FUNCPTR (gst_goo_encjpeg_chain));
	gst_pad_set_setcaps_function
		(self->sinkpad, GST_DEBUG_FUNCPTR (gst_goo_encjpeg_setcaps));
/*	gst_pad_set_bufferalloc_function
		(self->sinkpad, GST_DEBUG_FUNCPTR (gst_goo_encjpeg_buffer_alloc));   */
	gst_element_add_pad (GST_ELEMENT (self), self->sinkpad);

	pad_template = gst_element_class_get_pad_template
		(GST_ELEMENT_CLASS (klass), "src");
	g_return_if_fail (pad_template != NULL);
	self->srcpad = gst_pad_new_from_template (pad_template, "src");
	gst_element_add_pad (GST_ELEMENT (self), self->srcpad);

	self->adapter = gst_goo_adapter_new ();

	g_object_set_data (G_OBJECT (self->component), "gst", self);
	g_object_set_data (G_OBJECT (self), "goo", self->component);

	return;
}