[-]
[+]
|
Changed |
_service:tar_git:droid-camres.changes
|
|
[-]
[+]
|
Changed |
_service:tar_git:droid-camres.spec
^
|
|
[-]
[+]
|
Changed |
_service
^
|
@@ -6,7 +6,7 @@
<service name="tar_git">
<param name="url">https://github.com/mer-hybris/droid-camres.git</param>
<param name="branch">master</param>
- <param name="revision">c76fe334503ce994b9e0c04850304d13aa9a9eeb</param>
+ <param name="revision">19b8df9b35af8ab241292ab9b0a8084432e485dd</param>
<param name="token"/>
<param name="debian">N</param>
<param name="dumb">N</param>
|
[-]
[+]
|
Changed |
_service:tar_git:droid-camres-1.2.3.tar.bz2/src/camres.cpp
^
|
@@ -25,21 +25,21 @@
GstElement *elem = gst_element_factory_make("droidcamsrc", NULL);
if (!elem)
{
- fprintf(stderr, "Camres error: Failed to create an instance of droidcamsrc.\n");
+ qCritical("Camres error: Failed to create an instance of droidcamsrc.");
return res;
}
GParamSpec *spec = g_object_class_find_property(G_OBJECT_GET_CLASS(elem), "camera-device");
if (!spec)
{
- fprintf(stderr, "Camres error: Failed to get property camera-device\n");
+ qCritical("Camres error: Failed to get property camera-device");
gst_object_unref(elem);
return res;
}
if (!G_IS_PARAM_SPEC_ENUM(spec))
{
- fprintf(stderr, "Camres error: Property camera-device is not an enum.\n");
+ qCritical("Camres error: Property camera-device is not an enum.");
gst_object_unref(elem);
return res;
}
@@ -70,14 +70,14 @@
if (!cameraBin)
{
- fprintf(stderr, "Camres error: Failed to create camerabin.\n");
+ qCritical("Camres error: Failed to create camerabin.");
return res;
}
GstElement *videoSource = gst_element_factory_make("droidcamsrc", NULL);
if (!videoSource)
{
- fprintf(stderr, "Camres error: Failed to create videoSource.\n");
+ qCritical("Camres error: Failed to create videoSource.");
gst_object_unref(cameraBin);
return res;
}
@@ -89,7 +89,7 @@
if (!fakeviewfinder)
{
{
- fprintf(stderr, "Camres error: Failed to create fake viewfinder.\n");
+ qCritical("Camres error: Failed to create fake viewfinder.");
gst_object_unref(videoSource);
gst_object_unref(cameraBin);
return res;
@@ -103,7 +103,7 @@
if (!target)
{
- fprintf(stderr, "Camres error: Failed to load encoding target: %s\n", qPrintable(error->message));
+ qCritical("Camres error: Failed to load encoding target: %s", qPrintable(error->message));
g_error_free(error);
gst_object_unref(fakeviewfinder);
gst_object_unref(videoSource);
@@ -114,7 +114,7 @@
GstEncodingProfile *profile = gst_encoding_target_get_profile(target, "video-profile");
if (!profile)
{
- fprintf(stderr, "Camres error: Failed to load encoding profile.\n");
+ qCritical("Camres error: Failed to load encoding profile.");
gst_object_unref(fakeviewfinder);
gst_object_unref(videoSource);
gst_object_unref(cameraBin);
@@ -128,7 +128,7 @@
if (gst_element_set_state (GST_ELEMENT (cameraBin), GST_STATE_PLAYING) == GST_STATE_CHANGE_FAILURE)
{
- fprintf(stderr, "Camres error: Failed to start playback.\n");
+ qCritical("Camres error: Failed to start playback.");
gst_object_unref(fakeviewfinder);
gst_object_unref(videoSource);
gst_object_unref(cameraBin);
@@ -207,7 +207,7 @@
}
else
{
- fprintf(stderr, "Camres error: Unknown framerate type\n");
+ qWarning("Camres error: Unknown framerate type");
tmp = QString("%1x%2").arg(w).arg(h);
}
if (!res.contains(tmp))
@@ -244,7 +244,7 @@
float r = (width * 1.0) / height;
r = floor(r * 10) / 10.0;
- for (QMap<float, QString>::const_iterator iter = ratios.constBegin(); iter != ratios.constEnd(); iter++)
+ for (QMap<float, QString>::const_iterator iter = ratios.constBegin(); iter != ratios.constEnd(); ++iter)
{
if (qFuzzyCompare (r, iter.key()))
{
@@ -252,7 +252,7 @@
}
}
- fprintf(stderr, "Camres error: Could not find aspect ratio for %dx%d\n", width, height);
+ qWarning("Camres error: Could not find aspect ratio for %dx%d", width, height);
return QString("?:?");
}
@@ -286,7 +286,7 @@
}
}
- fprintf(stderr, "Camres error: Could not find viewfinder for %s\n", qPrintable(size));
+ qCritical("Camres error: Could not find viewfinder for %s", qPrintable(size));
return QString("?:?");
}
|
[-]
[+]
|
Changed |
_service:tar_git:droid-camres-1.2.3.tar.bz2/src/camres.h
^
|
@@ -14,9 +14,11 @@
QList<QPair<QString, int> > getCameras();
QList<QPair<QString, QStringList> > getResolutions(int cam, QStringList whichCaps);
- QStringList parse(GstCaps *caps);
static QString aspectRatioForResolution(const QString& size);
static QString findBestViewFinderForResolution(const QString& size, const QList<QPair<QString, QStringList> > &resolutions, const QRect &screenGeometry);
+
+private:
+ QStringList parse(GstCaps *caps);
};
|
[-]
[+]
|
Changed |
_service:tar_git:droid-camres-1.2.3.tar.bz2/src/main.cpp
^
|
@@ -15,7 +15,7 @@
int genCamhw = 0;
bool printUsage = true;
- fprintf(stderr, "Camres version %s\n", APP_VERSION);
+ qInfo("Camres version %s", APP_VERSION);
if (argc == 1)
printUsage = false;
@@ -59,9 +59,9 @@
if (printUsage)
{
- fprintf(stderr, "Usage: camres [OPTION]\n\n");
- fprintf(stderr, " -o [filename] Generate json for camera-settings-plugin\n");
- fprintf(stderr, " -w [filename] Generate dconf for jolla-camera-hw.txt\n");
+ qInfo("Usage: camres [OPTION]\n");
+ qInfo(" -o [filename] Generate json for camera-settings-plugin");
+ qInfo(" -w [filename] Generate dconf for jolla-camera-hw.txt");
return EXIT_FAILURE;
}
@@ -69,13 +69,13 @@
int i;
Camres cr;
- fprintf(stderr, "Searching cameras...\n");
+ qInfo("Searching cameras...");
QList<QPair<QString, int> > cameras = cr.getCameras();
if (cameras.isEmpty())
{
- fprintf(stderr, "Camres error: No cameras found.\n");
+ qFatal("Camres error: No cameras found.");
return EXIT_FAILURE;
}
@@ -88,15 +88,18 @@
for (i=0 ; i<cameras.size() ; i++)
{
- fprintf(stderr, "Searching resolutions for %s...\n", qPrintable(cameras.at(i).first));
- resolutions.append(cr.getResolutions(cameras.at(i).second, caps));
- }
+ qInfo("Searching resolutions for %s...", qPrintable(cameras.at(i).first));
+ QList<QPair<QString, QStringList> > res = cr.getResolutions(cameras.at(i).second, caps);
+ if (res.isEmpty())
+ return EXIT_FAILURE;
- fprintf(stderr, "\n");
+ resolutions.append(res);
+ }
OutputGen og;
- og.dump(cameras, resolutions);
+ if (jsonFilename.isEmpty() && camhwFilename.isEmpty())
+ og.dump(cameras, resolutions);
if (!jsonFilename.isEmpty())
og.makeJson(cameras, resolutions, app.primaryScreen()->availableGeometry(), jsonFilename);
|
[-]
[+]
|
Changed |
_service:tar_git:droid-camres-1.2.3.tar.bz2/src/outputgen.cpp
^
|
@@ -24,21 +24,21 @@
{
if (resolutions.at(i).isEmpty())
{
- fprintf(stderr, "Camres warning: No resolutions found for %s (%d):\n", qPrintable(cameras.at(i).first), cameras.at(i).second);
+ qCritical("Camres warning: No resolutions found for %s (%d):", qPrintable(cameras.at(i).first), cameras.at(i).second);
continue;
}
- printf("Resolutions for %s:\n", qPrintable(cameras.at(i).first));
+ qInfo("\nResolutions for %s:", qPrintable(cameras.at(i).first));
for (j=0 ; j<resolutions.at(i).size() ; j++)
{
- printf("%s resolutions:\n", qPrintable(resolutions.at(i).at(j).first.split("-").first()));
+ qInfo("%s resolutions:", qPrintable(resolutions.at(i).at(j).first.split("-").first()));
QStringList res = resolutions.at(i).at(j).second;
for (m=0 ; m<res.size() ; m++)
{
- printf("%s (%s)\n", qPrintable(res.at(m)), qPrintable(Camres::aspectRatioForResolution(res.at(m))));
+ qInfo("%s (%s)", qPrintable(res.at(m)), qPrintable(Camres::aspectRatioForResolution(res.at(m))));
}
}
}
@@ -57,13 +57,13 @@
if ( !file.open(QIODevice::ReadWrite | QIODevice::Truncate | QIODevice::Text))
{
- fprintf(stderr, "Camres error: Could not create output file.\n");
+ qCritical("Camres error: Could not create output file.");
return;
}
ts = new QTextStream(&file);
- fprintf(stderr, "Camres: Writing json to file %s\n", qPrintable(file.fileName()));
+ qInfo("Camres: Writing json to file %s", qPrintable(file.fileName()));
*ts << "{" << endl;
@@ -132,20 +132,20 @@
if ( !file.open(QIODevice::ReadWrite | QIODevice::Truncate | QIODevice::Text))
{
- fprintf(stderr, "Camres error: Could not create output file.\n");
+ qCritical("Camres error: Could not create output file.");
return;
}
ts = new QTextStream(&file);
- fprintf(stderr, "Camres: Writing dconf settings to file %s\n", qPrintable(file.fileName()));
+ qInfo("Camres: Writing dconf settings to file %s", qPrintable(file.fileName()));
QFile resfile("/usr/share/droid-camres/jolla-camera-hw-template.txt");
QStringList camhwTemplate;
if (!resfile.open(QIODevice::ReadOnly | QIODevice::Text))
{
- fprintf(stderr, "Camres error: failed to open template\n");
+ qCritical("Camres error: failed to open template");
return;
}
@@ -249,7 +249,7 @@
{
k.next();
if (k.value().isEmpty())
- fprintf(stderr, "Camres error: Not found suitable resolution for %s. Check output!\n", qPrintable(k.key()));
+ qCritical("Camres error: Not found suitable resolution for %s. Check output!", qPrintable(k.key()));
else
camhwTemplate.replaceInStrings(k.key(), k.value());
}
|