Собрал QT с поддержкой phonon, phonon-backend, gstreamer, при попытке проиграть файл получаю:
WARNING: Phonon needs QCoreApplication::applicationName to be set to export audio output names through the DBUS interface
"Warning: You do not seem to have the package gstreamer0.10-plugins-good installed.
Some video features have been disabled."
(phonon_ex:1849): GStreamer-CRITICAL **: gst_element_set_state: assertion 'GST_IS_ELEMENT (element)' failed
(phonon_ex:1849): GStreamer-CRITICAL **: gst_object_unref: assertion 'object != NULL' failed
(phonon_ex:1849): GStreamer-CRITICAL **: gst_object_ref: assertion 'object != NULL' failed
(phonon_ex:1849): GStreamer-CRITICAL **: gst_object_sink: assertion 'GST_IS_OBJECT (object)' failed
(phonon_ex:1849): GLib-GObject-CRITICAL **: g_object_set: assertion 'G_IS_OBJECT (object)' failed
(phonon_ex:1849): GStreamer-CRITICAL **: gst_object_ref: assertion 'object != NULL' failed
(phonon_ex:1849): GStreamer-CRITICAL **: gst_object_sink: assertion 'GST_IS_OBJECT (object)' failed
(phonon_ex:1849): GStreamer-CRITICAL **: gst_object_ref: assertion 'object != NULL' failed
(phonon_ex:1849): GStreamer-CRITICAL **: gst_object_sink: assertion 'GST_IS_OBJECT (object)' failed
(phonon_ex:1849): GLib-GObject-CRITICAL **: g_object_set: assertion 'G_IS_OBJECT (object)' failed
(phonon_ex:1849): GStreamer-CRITICAL **: gst_object_ref: assertion 'object != NULL' failed
(phonon_ex:1849): GStreamer-CRITICAL **: gst_object_sink: assertion 'GST_IS_OBJECT (object)' failed
** (phonon_ex:1849): WARNING **: can't find typefind element, decodebin will not work
(phonon_ex:1849): GLib-GObject-CRITICAL **: g_object_set: assertion 'G_IS_OBJECT (object)' failed
(phonon_ex:1849): GStreamer-CRITICAL **: gst_bin_add: assertion 'GST_IS_ELEMENT (element)' failed
(phonon_ex:1849): GStreamer-CRITICAL **: gst_element_get_pad: assertion 'GST_IS_ELEMENT (element)' failed
(phonon_ex:1849): GStreamer-CRITICAL **: gst_ghost_pad_new: assertion 'GST_IS_PAD (target)' failed
(phonon_ex:1849): GStreamer-CRITICAL **: gst_element_add_pad: assertion 'GST_IS_PAD (pad)' failed
(phonon_ex:1849): GStreamer-CRITICAL **: gst_object_unref: assertion 'object != NULL' failed
(phonon_ex:1849): GLib-GObject-CRITICAL **: g_object_set: assertion 'G_IS_OBJECT (object)' failed
(phonon_ex:1849): GStreamer-CRITICAL **: gst_bin_add: assertion 'GST_IS_ELEMENT (element)' failed
(phonon_ex:1849): GStreamer-CRITICAL **: gst_element_get_pad: assertion 'GST_IS_ELEMENT (element)' failed
(phonon_ex:1849): GStreamer-CRITICAL **: gst_ghost_pad_new: assertion 'GST_IS_PAD (target)' failed
(phonon_ex:1849): GStreamer-CRITICAL **: gst_element_add_pad: assertion 'GST_IS_PAD (pad)' failed
(phonon_ex:1849): GStreamer-CRITICAL **: gst_object_unref: assertion 'object != NULL' failed
WARNING: Phonon::createPath: Cannot connect Phonon::MediaObject ( no objectName ) to Phonon::AudioOutput ( no objectName ).
код:
QFile file(QString(static_cast<const char*>(argv[1])));
if(file.exists()) {
Phonon::MediaObject mediaObject;
Phonon::AudioOutput audioOutput;
mediaObject.setCurrentSource(Phonon::MediaSource(file.fileName()));
Phonon::createPath(&mediaObject, &audioOutput);
mediaObject.play();
} else {
qDebug()<<"file not exist";
}