OMX Camera with QT

Andrzej Sekowski as at macrix.pl
Fri Jun 14 06:21:47 PDT 2013


Hello 

                I have a problem with connection the OMX Camera many times
from two separate application. In one time only one application is
connected.  One is to record video  second to preview camera. The recording
video start new application and stop it, when stop recording. This
application is written in the C. The preview camera  is written in the qt
and qml.

If I start the preview camera and close it - hole application and the start
the recording it works. But it not work in other situations. Open preview
camera do not close pipeline then start recording - this works(for
recording), but when I back to preview - it show black screen. 

When I close pipeline after preview camera, start new instance of preview
camera too, close it and then start recording, stop recording and back to
the preview camera in the new instance - the same situation - black screen.

So connection to the camera works only when I start every time new instance.
When I only close pipeline it does not work. 

 

The another problem (which force starting every time new instance for
preview camera ) is when I try to connect to the OMX Camera(connection
that's mean  open pipeline and close) from preview more than 3 times. Next
try throw exception (the 4th one): 

"0:01:09.161913529 [333m 2786 [00m 0xad40a9c0 [31;01mERROR [00m [00m omx
gstomx_core.c:645:EventHandler:<omxcamera0> [00m unrecoverable error: The
hardware failed to respond as expected (0x80001009)

0:01:09.169485672 [333m 2786 [00m 0xad405200 [31;01mERROR [00m [00m omx
gstomx_core.c:645:EventHandler:<omxcamera2> [00m unrecoverable error: The
hardware failed to respond as expected (0x80001009)

0:01:09.170829117 [333m 2786 [00m 0xad405220 [31;01mERROR [00m [00m omx
gstomx_core.c:645:EventHandler:<omxcamera1> [00m unrecoverable error: The
hardware failed to respond as expected (0x80001009)

 

You can say that this is a problem with hardware - but why it works when I
restart application, not only pipeline.

 

To close pipeline I do:

Pipeline->sendEvent(QGst::EosEvent::create())

 

In the handle message method:

Pipeline->setState(QGst::StateNull);

Pipeline.clear();

 

 

The procedure  open pipeline source code:

QGst::PipelinePtr m_pipeline;

QGst::ElementPtr m_videoSink;

QGst::ElementPtr m_convert;

QGst::ElementPtr elementOmxCamera;

 

QSharedPointer<QDeclarativeView> viewer;

..

QGst::Ui::GraphicsVideoSurface *surface = new
QGst::Ui::GraphicsVideoSurface(&(*viewer) );

viewer->rootContext()->setContextProperty(QLatin1String("videoSurface1"),
surface);

m_videoSink = surface->videoSink();

 

elementOmxCamera =  QGst::ElementFactory::make("omx_camera");

elementOmxCamera->setProperty("device",1);

elementOmxCamera->setProperty("mode",1);

QGst::CapsPtr caps = QGst::Caps::createSimple("video/x-raw-yuv");

caps->setValue("width", 320);

caps->setValue("height",240);

caps->setValue("framerate", QGst::Fraction(20, 1));

 

m_pipeline->add(elementOmxCamera);

m_pipeline->add(m_videoSink);

m_convert = QGst::ElementFactory::make("colorspace");

m_pipeline->add(m_convert);

 

elementOmxCamera->link("src",m_convert, "sink", caps);

m_convert->link(m_videoSink);

m_pipeline->setState(QGst::StatePlaying);

 

QGst::BusPtr bus = m_pipeline->bus();

bus->addSignalWatch();

QGlib::connect(bus, "message", this,
&CameraSettingsController::onBusMessage);

 

 

 

Best regards

Andrzej Sekowski

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/gstreamer-openmax/attachments/20130614/a1227fc3/attachment.html>


More information about the gstreamer-openmax mailing list