Hi,

The issue about having flexibility to select encoding pipelines for different target devices, use cases and derived concepts feels rising atm. This is probably one step to deal a part of it locally in application for camera stack - that doesn't provide such thing ?

I was thinking we could advance it in Qtm camerabin backend level. Instead the backend currently has statically named elements (including sources, codecs/filters and sinks), there could be a solution that allows pipeline configurations to be provided by external independent package. E.g. *-config packages made for reference hardware adaptations would suit for this.

I would propose to start such effort in Meego by adding rules like done in this patch and store them externally by using some expandable solution & common language. Do we have such ?

More commonly, whole multimedia should support configurable sets of elements and pipelines that are preferred (dealt by merit), shown as user options or in blacklist etc. So, just another ascii config file would just not live long. I'm used to this with MS DirectShow, but cannot see anything atm dealing with this in common around Qt/Qtm context.

Is there related plans with common multimedia and or ready-made and suitable APIs to just start working on it ?

BR,
-Teemu


On 04/07/2011 06:58 AM, Peter Zhu wrote:
Hi,
I have made the following changes to meego-app-camera in project Trunk. Please 
review and accept ASAP.

Thank You,
Peter Zhu

[This message was auto-generated]

---

Request #15856:

   submit:   Trunk:Testing/meego-app-camera(r2) ->  Trunk/meego-app-camera


Message:
     Move to Trunk

State:   new          2011-04-06T20:58:25 peter
Comment: None



changes files:
--------------
--- meego-app-camera.changes
+++ meego-app-camera.changes
@@ -0,0 +1,3 @@
+* Mon Apr 04 2011 Michael Leibowitz<[email protected]>  - 0.3.0
+- Unhardcode the video format from ogg+theora/vorbis (fix BMC#15244)
+

new:
----
   0001-First-implementation-of-flexible-codec-and-container.patch
   audiocodecs.patch

spec files:
-----------
--- meego-app-camera.spec
+++ meego-app-camera.spec
@@ -1,6 +1,6 @@
  #
  # Do NOT Edit the Auto-generated Part!
-# Generated by: spectacle version 0.21
+# Generated by: spectacle version 0.22
  #
  #>>  macros
  #<<  macros
@@ -14,6 +14,7 @@
  URL:        http://www.meego.com
  Source0:    %{name}-%{version}.tar.bz2
  Source100:  meego-app-camera.yaml
+Patch0:     0001-First-implementation-of-flexible-codec-and-container.patch
  Requires:   libqtcore4
  Requires:   libdeclarative-multimedia
  Requires:   meego-qml-launcher
@@ -43,6 +44,8 @@
  %prep
  %setup -q -n %{name}-%{version}

+# 0001-First-implementation-of-flexible-codec-and-container.patch
+%patch0 -p1
  #>>  setup
  #<<  setup


other changes:
--------------

++++++ 0001-First-implementation-of-flexible-codec-and-container.patch (new)
--- 0001-First-implementation-of-flexible-codec-and-container.patch
+++ 0001-First-implementation-of-flexible-codec-and-container.patch
+From ab697a67d97698d5e7a96880230e01caeb3a469f Mon Sep 17 00:00:00 2001
+From: Michael Leibowitz<[email protected]>
+Date: Fri, 1 Apr 2011 23:20:42 +0300
+Subject: [PATCH] First implementation of flexible codec and container 
selection for video output
+
+This change creates a set of preferred tuples for audio, video,
+container format and chooses amongst them.  If there no match found,
+it hardcodes it to ogg/theora, as that should always be available.
+
+Signed-off-by: Michael Leibowitz<[email protected]>
+---
+ plugin/viewfinder.cpp |   44 ++++++++++++++++++++++++++++++++++++++++----
+ plugin/viewfinder.h   |    3 ++-
+ 2 files changed, 42 insertions(+), 5 deletions(-)
+
+diff --git a/plugin/viewfinder.cpp b/plugin/viewfinder.cpp
+index 3bd059a..472474e 100644
+--- a/plugin/viewfinder.cpp
++++ b/plugin/viewfinder.cpp
+@@ -208,15 +208,51 @@ ViewFinder::setCamera (const QByteArray&cameraDevice)
+   foreach (QSize resolution, _mediaRecorder->supportedResolutions ()) {
+     qDebug ()<<  "Video resolution: "<<  resolution.width ()<<  "x"<<  
resolution.height ();
+   }
++
++  QList<QStringList>  preferredCodecCombos;
++  preferredCodecCombos<<  QString("audio/aac, video/h-264, mp4").split(", ");
++  preferredCodecCombos<<  QString("audio/vorbis, video/theora, ogg").split(", 
");
++
++  QStringList audioCodecs;
++  QStringList videoCodecs;
++  QStringList containers;
++
++  foreach (QString codec, _mediaRecorder->supportedAudioCodecs ()) {
++    qDebug ()<<  "Codec: "<<  codec;
++    audioCodecs<<  codec;
++  }
+   foreach (QString codec, _mediaRecorder->supportedVideoCodecs ()) {
+     qDebug ()<<  "Codec: "<<  codec;
++    videoCodecs<<  codec;
+   }
+   foreach (QString container, _mediaRecorder->supportedContainers ()) {
+     qDebug ()<<  "Container: "<<  container;
++    containers.append(container);
++  }
++  bool foundMatch = false;
++  foreach (QStringList codecCombo, preferredCodecCombos) {
++    qDebug()<<  "tuple: "<<  codecCombo;
++    qDebug()<<  "codecCombo[0]"<<  codecCombo[0];
++    if (audioCodecs.contains(codecCombo[0])&&
++      videoCodecs.contains(codecCombo[1])&&
++      containers.contains(codecCombo[2])) {
++
++      qDebug()<<  "preferred tuple found: "<<  codecCombo;
++      foundMatch = true;
++      audioSettings.setCodec(codecCombo[0]);
++      videoSettings.setCodec(codecCombo[1]);
++      _mediaRecorder->setEncodingSettings(audioSettings, videoSettings, 
codecCombo[2]);
++      _videoFilenameExtension = codecCombo[2];
++    }
+   }
+-
+-  _mediaRecorder->setEncodingSettings (audioSettings, videoSettings, "ogg");
+-
++  if (!foundMatch) {
++    qDebug()<<  "No codec combos found!  pretending that ogg works";
++    videoSettings.setCodec ("video/theora");
++    audioSettings.setCodec ("audio/vorbis");
++    _mediaRecorder->setEncodingSettings (audioSettings, videoSettings, "ogg");
++    _videoFilenameExtension = "ogg";
++  }
++
+   qDebug ()<<  "Selected container: "<<  _mediaRecorder->containerMimeType ();
+   connect (_mediaRecorder, SIGNAL (stateChanged (QMediaRecorder::State)),
+            this, SLOT (mediaRecorderStateChanged (QMediaRecorder::State)));
+@@ -536,7 +572,7 @@ ViewFinder::generateVideoFilename ()
+
+   // FIXME: What video format do we want to use?
+   noSpaces = now.toString ().replace (QChar (' '), QChar ('-'));
+-  return path.append (noSpaces).append (".ogg");
++  return path.append (noSpaces).append (".%1").arg(_videoFilenameExtension);
+ }
+
+ void
+diff --git a/plugin/viewfinder.h b/plugin/viewfinder.h
+index 800fc27..d337fac 100644
+--- a/plugin/viewfinder.h
++++ b/plugin/viewfinder.h
+@@ -131,7 +131,7 @@ class ViewFinder : public QDeclarativeItem
+
+   private:
+     static QString generateImageFilename ();
+-    static QString generateVideoFilename ();
++    QString generateVideoFilename ();
+     void completeImage (const QString&filename);
+     void setRecording (bool r) { _recording = r; emit recordingChanged (); }
+     void setDuration (qint64 d) { _duration = d; emit durationChanged (); }
+@@ -157,6 +157,7 @@ class ViewFinder : public QDeclarativeItem
+     QCameraImageCapture *_imageCapture;
+     QAudioCaptureSource *_audioSource;
+     QMediaRecorder *_mediaRecorder;
++    QString _videoFilenameExtension;
+
+     Settings *_settings;
+
+--
+1.7.2.2
+

++++++ audiocodecs.patch (new)
--- audiocodecs.patch
+++ audiocodecs.patch
+Index: meego-app-camera-0.3.0/plugin/viewfinder.cpp
+===================================================================
+--- meego-app-camera-0.3.0.orig/plugin/viewfinder.cpp
++++ meego-app-camera-0.3.0/plugin/viewfinder.cpp
+@@ -211,6 +211,9 @@ ViewFinder::setCamera (const QByteArray
+   foreach (QString codec, _mediaRecorder->supportedVideoCodecs ()) {
+     qDebug ()<<  "Codec: "<<  codec;
+   }
++  foreach (QString codec, _mediaRecorder->supportedAudioCodecs ()) {
++    qDebug ()<<  "Audio Codec: "<<  codec;
++  }
+   foreach (QString container, _mediaRecorder->supportedContainers ()) {
+     qDebug ()<<  "Container: "<<  container;
+   }

++++++ meego-app-camera.yaml
--- meego-app-camera.yaml
+++ meego-app-camera.yaml
@@ -7,6 +7,8 @@
  URL: http://www.meego.com
  Sources:
      - "%{name}-%{version}.tar.bz2"
+Patches:
+    - 0001-First-implementation-of-flexible-codec-and-container.patch
  Requires:
      - libqtcore4
      - libdeclarative-multimedia

_______________________________________________
MeeGo-commits mailing list
[email protected]
http://lists.meego.com/listinfo/meego-commits

_______________________________________________
MeeGo-packaging mailing list
[email protected]
http://lists.meego.com/listinfo/meego-packaging

Reply via email to