diff --git a/gstreamer/backend.cpp b/gstreamer/backend.cpp index c4a8844..5803862 100644 --- a/gstreamer/backend.cpp +++ b/gstreamer/backend.cpp @@ -122,8 +122,6 @@ Backend::~Backend() { if (GlobalSubtitles::self) delete GlobalSubtitles::self; - if (GlobalAudioChannels::self) - delete GlobalAudioChannels::self; delete m_effectManager; delete m_deviceManager; PulseSupport::shutdown(); @@ -324,9 +322,6 @@ QList Backend::objectDescriptionIndexes(ObjectDescriptionType type) const case Phonon::SubtitleType: list << GlobalSubtitles::instance()->globalIndexes(); break; - case Phonon::AudioChannelType: - list << GlobalAudioChannels::instance()->globalIndexes(); - break; default: break; } @@ -371,14 +366,6 @@ QHash Backend::objectDescriptionProperties(ObjectDescripti } break; - case Phonon::AudioChannelType: { - const AudioChannelDescription description = GlobalAudioChannels::instance()->fromIndex(index); - ret.insert("name", description.name()); - ret.insert("description", description.description()); - ret.insert("type", description.property("type")); - } - break; - default: break; } diff --git a/gstreamer/mediaobject.cpp b/gstreamer/mediaobject.cpp index 78b4d2b..07a5e9c 100644 --- a/gstreamer/mediaobject.cpp +++ b/gstreamer/mediaobject.cpp @@ -119,12 +119,12 @@ MediaObject::MediaObject(Backend *backend, QObject *parent) connect(m_pipeline, SIGNAL(textTagChanged(int)), this, SLOT(getSubtitleInfo(int))); - connect(m_pipeline, SIGNAL(audioTagChanged(int)), - this, SLOT(getAudioChannelInfo(int))); + connect(m_pipeline, SIGNAL(trackCountChanged(int)), this, SLOT(handleTrackCountChange(int))); connect(m_tickTimer, SIGNAL(timeout()), SLOT(emitTick())); + } MediaObject::~MediaObject() @@ -133,7 +133,6 @@ MediaObject::~MediaObject() delete m_pipeline; } GlobalSubtitles::instance()->unregister_(this); - GlobalAudioChannels::instance()->unregister_(this); } void MediaObject::saveState() @@ -395,35 +394,6 @@ void MediaObject::loadingComplete() link(); } -void MediaObject::getAudioChannelInfo(int stream) -{ - gint channelCount = 0; - g_object_get(G_OBJECT(m_pipeline->element()), "n-audio", &channelCount, NULL); - if (channelCount) - GlobalAudioChannels::instance()->add(this, -1, tr("Default"), ""); - for (gint i = 0; i < channelCount; ++i) { - GstTagList *tags = 0; - g_signal_emit_by_name (G_OBJECT(m_pipeline->element()), "get-audio-tags", - i, &tags); - if (tags) { - gchar *tagLangCode = 0; - gchar *tagCodecName = 0; - gst_tag_list_get_string (tags, GST_TAG_AUDIO_CODEC, &tagCodecName); - gst_tag_list_get_string (tags, GST_TAG_LANGUAGE_CODE, &tagLangCode); - QString name; - if (tagLangCode) - name = QLatin1String(tagLangCode); - else - name = tr("Unknown"); - if (tagCodecName) - name = QString("%1 [%2]").arg(name, QLatin1String(tagCodecName)); - GlobalAudioChannels::instance()->add(this, i, name); - g_free(tagLangCode); - g_free(tagCodecName); - } - } - emit availableAudioChannelsChanged(); -} void MediaObject::getSubtitleInfo(int stream) { @@ -607,7 +577,7 @@ void MediaObject::handleEndOfStream() bool MediaObject::hasInterface(Interface iface) const { return iface == AddonInterface::TitleInterface || iface == AddonInterface::NavigationInterface - || iface == AddonInterface::SubtitleInterface || iface == AddonInterface::AudioChannelInterface; + || iface == AddonInterface::SubtitleInterface; } QVariant MediaObject::interfaceCall(Interface iface, int command, const QList ¶ms) @@ -663,47 +633,12 @@ QVariant MediaObject::interfaceCall(Interface iface, int command, const QList()) { - error() << Q_FUNC_INFO << "arguments invalid"; - return QVariant(); - } - _iface_setCurrentAudioChannel(params.first().value()); - break; - } - break; } } return QVariant(); } #endif -QList MediaObject::_iface_availableAudioChannels() const -{ - return GlobalAudioChannels::instance()->listFor(this); -} - -AudioChannelDescription MediaObject::_iface_currentAudioChannel() const -{ - return m_currentAudioChannel; -} - -void MediaObject::_iface_setCurrentAudioChannel(const AudioChannelDescription &channel) -{ - const int localIndex = GlobalAudioChannels::instance()->localIdFor(this, channel.index()); - g_object_set(G_OBJECT(m_pipeline->element()), "current-audio", localIndex, NULL); - m_currentAudioChannel = channel; -} - QList MediaObject::_iface_availableMenus() const { return m_pipeline->availableMenus(); diff --git a/gstreamer/mediaobject.h b/gstreamer/mediaobject.h index 0198f31..acc0019 100644 --- a/gstreamer/mediaobject.h +++ b/gstreamer/mediaobject.h @@ -192,7 +192,6 @@ protected: private Q_SLOTS: void handleTrackCountChange(int tracks); void getSubtitleInfo(int stream); - void getAudioChannelInfo(int stream); void emitTick(); void beginPlay(); void autoDetectSubtitle(); @@ -222,10 +221,6 @@ private: void changeTitle(const QString &format, int title); void changeSubUri(const Mrl &mrl); - QList _iface_availableAudioChannels() const; - AudioChannelDescription _iface_currentAudioChannel() const; - void _iface_setCurrentAudioChannel(const AudioChannelDescription &channel); - bool m_resumeState; State m_oldState; quint64 m_oldPos; @@ -256,7 +251,6 @@ private: int m_availableTitles; int m_currentTitle; SubtitleDescription m_currentSubtitle; - AudioChannelDescription m_currentAudioChannel; int m_pendingTitle; // When we emit aboutToFinish(), libphonon calls setNextSource. To achieve gapless playback, diff --git a/gstreamer/pipeline.cpp b/gstreamer/pipeline.cpp index 4f281f7..8fbbe5b 100644 --- a/gstreamer/pipeline.cpp +++ b/gstreamer/pipeline.cpp @@ -51,7 +51,6 @@ Pipeline::Pipeline(QObject *parent) gst_object_ref_sink (m_pipeline); g_signal_connect(m_pipeline, "video-changed", G_CALLBACK(cb_videoChanged), this); g_signal_connect(m_pipeline, "text-tags-changed", G_CALLBACK(cb_textTagsChanged), this); - g_signal_connect(m_pipeline, "audio-tags-changed", G_CALLBACK(cb_audioTagsChanged), this); g_signal_connect(m_pipeline, "notify::source", G_CALLBACK(cb_setupSource), this); g_signal_connect(m_pipeline, "about-to-finish", G_CALLBACK(cb_aboutToFinish), this); @@ -399,12 +398,6 @@ void Pipeline::cb_textTagsChanged(GstElement *playbin, gint stream, gpointer dat emit that->textTagChanged(stream); } -void Pipeline::cb_audioTagsChanged(GstElement *playbin, gint stream, gpointer data) -{ - Pipeline *that = static_cast(data); - emit that->audioTagChanged(stream); -} - bool Pipeline::videoIsAvailable() const { gint videoCount; diff --git a/gstreamer/pipeline.h b/gstreamer/pipeline.h index 85df81c..4631342 100644 --- a/gstreamer/pipeline.h +++ b/gstreamer/pipeline.h @@ -70,7 +70,6 @@ class Pipeline : public QObject static void cb_videoChanged(GstElement *playbin, gpointer data); static void cb_textTagsChanged(GstElement *playbin, gint stream, gpointer data); - static void cb_audioTagsChanged(GstElement *playbin, gint stream, gpointer data); GstElement *audioPipe(); GstElement *videoPipe(); @@ -106,7 +105,6 @@ class Pipeline : public QObject void stateChanged(GstState oldState, GstState newState); void videoAvailabilityChanged(bool); void textTagChanged(int stream); - void audioTagChanged(int stream); void errorMessage(const QString &message, Phonon::ErrorType type); // Only emitted when metadata changes in the middle of a stream. void metaDataChanged(QMultiMap);