summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfred <fred@home.lan>2011-04-26 14:05:07 (GMT)
committer fred <fred@home.lan>2011-04-26 14:05:07 (GMT)
commit7e17a3f84d26984bad3de8fc0ce60bdb605177ab (patch)
treeb8f8ca7ae93b8f36ffed5cff51215e7a642dbec7
parentd51d9a38aff393ff5caac8793ed2c601a8134379 (diff)
Some cleaning in the V4L2CamLayer, and Res classes
- In Res::, removed the chgRes method. In V4L2CamLayer::open, replaced some std::cerr by error() function.
-rw-r--r--qt/.gitignore2
-rw-r--r--qt/QqWidget.cpp5
-rw-r--r--qt/TODO23
-rw-r--r--qt/qqcombores.cpp2
-rw-r--r--src/.gitignore1
-rw-r--r--src/include/v4l2_layer.h1
-rw-r--r--src/v4l2_layer.cpp48
7 files changed, 6 insertions, 76 deletions
diff --git a/qt/.gitignore b/qt/.gitignore
index 79bd332..f0be531 100644
--- a/qt/.gitignore
+++ b/qt/.gitignore
@@ -40,7 +40,7 @@ Qfreej.pro.user.1.3
moc_*
ui_qfreej.h
*.ods
-TODO.txt
+TODO
Video/*
*.avi
*.mp4
diff --git a/qt/QqWidget.cpp b/qt/QqWidget.cpp
index acc2b8d..efcb7a1 100644
--- a/qt/QqWidget.cpp
+++ b/qt/QqWidget.cpp
@@ -79,7 +79,7 @@ QqWidget::QqWidget(Context *freej, QqTabWidget* tabWidget, Qfreej* qfreej, QStri
}
else
{
- QMessageBox::information(this, "Layers", "Impossible to create TextLayer :" + fichier);
+ QMessageBox::information(this, "Layers", "Can't to create Layer :" + fichier);
return;
}
@@ -98,8 +98,7 @@ QqWidget::QqWidget(Context *freej, QqTabWidget* tabWidget, Qfreej* qfreej, QStri
blt->addLayer(qLayer);
layV->addWidget(blt);
- qDebug() << "++ type :" << qLayer->type;
- if (qLayer->type == 4) { //V4L2LAYER
+ if (qLayer->type == Layer::V4L2LAYER) { //V4L2LAYER
m_comboRes = new QqComboRes ((V4L2CamLayer *)qLayer, this);
layV->addWidget(m_comboRes);
}
diff --git a/qt/TODO b/qt/TODO
deleted file mode 100644
index 7548a33..0000000
--- a/qt/TODO
+++ /dev/null
@@ -1,23 +0,0 @@
-//move main window in accordance with the size
-//resize ViewPort in accordance to the biggest layer .... (not sure it is good thing)
-//be able to record all marked opened layers with the initial quality.
-//devide the fake size window by two .... not sure :)
-//insert STRING filters parameters
-//add an x:x ratio button, resizing to the closest width and lenght to obtain this ratio
-//create a console for messages comming from func() warning() notice() act(). see Logger class
-//see to integrate ogg skeleton config on the graphic interface
-//there is a delay between audio and video if you open a video before creating
-the QJackClient of the time you waited to open the QJackClient .... see if a fix possible or needed.
-//Jack server sample rate and buffer size is hard coded for the moment, provide a way to put it manualy
-//try to fix sound problem issue when opening several VideoLayer with audio
-//add the capability to keep the actual config in a file..... important :)
-//if resizing the wiewport when the layer is bigger, you just need to touch the layer size to display it correctly
-//see if possible to manage an audio layer
-//be able to change v4l2 resolution from the graphic interface and to disable it for some bad v4l2 devices
-//try to suppress the drift taken when applying an effect
-//needs to launch QJackClient before start streaming when you want audio.
-//needs to re-launch streaming when disconnect and reconnect the jack input port
-//have to supress the other mutex
-//[!] nanosleep returned an error, not performing delay! message on the second TextLayer
-//maybe fixed//there is around 1100 normal streaming with fps modified and 200 sec more without ... find why it stops
-//try to improve fullscreen mode.
diff --git a/qt/qqcombores.cpp b/qt/qqcombores.cpp
index 45082d1..45e33a6 100644
--- a/qt/qqcombores.cpp
+++ b/qt/qqcombores.cpp
@@ -16,11 +16,9 @@ QqComboRes::QqComboRes(V4L2CamLayer *lay, QqWidget *parent) :
QStringList res;
QString qx, qy, qres;
- qDebug() << "++ nb:" << m_res->getNb();
for (int i = 0; i < m_res->getNb(); i++){
qx.setNum (m_res->getX(i));
qy.setNum (m_res->getY(i));
- qDebug() << "++ x:" << m_res->getX(i) << " y:" << m_res->getY(i) << " i:" << i;
qres.clear();
qres = qx + "x" + qy;
res << qres;
diff --git a/src/.gitignore b/src/.gitignore
index 1b2ea36..c569576 100644
--- a/src/.gitignore
+++ b/src/.gitignore
@@ -1,2 +1,3 @@
Session.vim
.swp.*
+.*.kate-swp
diff --git a/src/include/v4l2_layer.h b/src/include/v4l2_layer.h
index 28c55bc..1f55ab5 100644
--- a/src/include/v4l2_layer.h
+++ b/src/include/v4l2_layer.h
@@ -36,7 +36,6 @@ public:
int getY(int);
void setsX(int);
int getCurIdx();
- void chgRes(int);
private:
int m_idx, m_curIdx, m_size, m_fd;
diff --git a/src/v4l2_layer.cpp b/src/v4l2_layer.cpp
index 5ef9966..b6548bc 100644
--- a/src/v4l2_layer.cpp
+++ b/src/v4l2_layer.cpp
@@ -60,23 +60,13 @@ bool Res::addRes(int x, int y, int type) {
if (m_idx < (m_size -1)) {
m_sizes[m_idx][0] = x;
m_sizes[m_idx][1] = y;
- std::cerr << "--" << m_sizes[m_idx][0] << "x" << y << std::endl;
+// notice( "%dx%d", x, y) ;
m_idx++;
return (true);
}
else
return (false);
}
-/* else {
- if (m_idx > 0) {
- m_sizes[m_idx][0] = x;
- m_sizes[m_idx][1] = y;
- m_idx--;
- return (true);
- }
- else
- return (false);
- }*/
}
int Res::getNb() {
@@ -112,40 +102,6 @@ int Res::getCurIdx() {
return (m_curIdx);
}
-void Res::chgRes(int line) {
- if (line < m_idx) {
- // first, turn off streaming
-/* if(-1 == ioctl(m_fd, VIDIOC_STREAMOFF, &buftype)) {
- error("VIDIOC_STREAMOFF: %s", errno);
- }
- */
-
- /* Cleanup. */
-/* for (unsigned int i = 0; i < reqbuf.count; i++)
- munmap (buffers[i].start, buffers[i].length);
- memset (&m_format, 0, sizeof (m_format));
- m_format.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
-
- if (-1 == ioctl (m_fd, VIDIOC_G_FMT, &m_format)) {
- perror ("VIDIOC_G_FMT");
- return;
- }*/
-// memset (&m_format, 0, sizeof (m_format));
-// m_format.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
-/* m_format.fmt.pix.width = m_sizes[line][0];
- m_format.fmt.pix.height = m_sizes[line][1];
- m_format.fmt.pix.pixelformat = V4L2_PIX_FMT_YUYV;
- m_format.fmt.pix.field = V4L2_FIELD_ANY;
- if(0 == ioctl(m_fd, VIDIOC_TRY_FMT, &m_format)) {
- std::cerr << "--- we should be able to setup the resolution :)" << std::endl;
- if(-1 == ioctl(m_fd, VIDIOC_S_FMT, &m_format)) {
- error("VIDIOC_G_FMT: %s", strerror(errno));
- return;
- }
- }*/
- }
-}
-
V4L2CamLayer::V4L2CamLayer()
:Layer() {
@@ -224,7 +180,7 @@ bool V4L2CamLayer::open(const char *devfile) {
fmtdesc.index = 0;
fmtdesc.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
while (0 == ioctl (fd, VIDIOC_ENUM_FMT, &fmtdesc)) {
- std::cerr << "----- format description :" << fmtdesc.description << std::endl;
+ notice ("format description :%s", fmtdesc.description);
if (!m_res)
m_res = new Res (ARRAY_RESOLUTION_SIZE);
for (int i=0; ;i++){