summaryrefslogtreecommitdiffstats
path: root/Python/pyhash.c
diff options
context:
space:
mode:
Diffstat (limited to 'Python/pyhash.c')
0 files changed, 0 insertions, 0 deletions
; return results; } diff --git a/src/plugins/bearer/icd/qnetworksession_impl.cpp b/src/plugins/bearer/icd/qnetworksession_impl.cpp index a9e93e0..e7c56a2 100644 --- a/src/plugins/bearer/icd/qnetworksession_impl.cpp +++ b/src/plugins/bearer/icd/qnetworksession_impl.cpp @@ -1080,14 +1080,14 @@ QString QNetworkSessionPrivateImpl::errorString() const QString errorStr; switch(q->error()) { case QNetworkSession::RoamingError: - errorStr = QObject::tr("Roaming error"); + errorStr = QNetworkSessionPrivateImpl::tr("Roaming error"); break; case QNetworkSession::SessionAbortedError: - errorStr = QObject::tr("Session aborted by user or system"); + errorStr = QNetworkSessionPrivateImpl::tr("Session aborted by user or system"); break; default: case QNetworkSession::UnknownSessionError: - errorStr = QObject::tr("Unidentified Error"); + errorStr = QNetworkSessionPrivateImpl::tr("Unidentified Error"); break; } return errorStr; -- cgit v0.12 From db4f71fc4c7b29a4a37545a52a71269886db0210 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Wed, 24 Feb 2010 15:44:32 +0100 Subject: tr()-Fixes in Assistant/QHelpLib code. Reviewed-by: Christian Kandeler --- tools/assistant/lib/qhelpsearchresultwidget.cpp | 2 +- tools/assistant/tools/assistant/bookmarkmanager.cpp | 2 +- tools/assistant/tools/assistant/cmdlineparser.cpp | 16 ++++++++-------- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/tools/assistant/lib/qhelpsearchresultwidget.cpp b/tools/assistant/lib/qhelpsearchresultwidget.cpp index 8e476d5..2f5489b 100644 --- a/tools/assistant/lib/qhelpsearchresultwidget.cpp +++ b/tools/assistant/lib/qhelpsearchresultwidget.cpp @@ -304,7 +304,7 @@ private: last = resultLastToShow > count ? count : resultLastToShow; } } - hitsLabel->setText(QHelpSearchResultWidget::tr("%1 - %2 of %3 Hits").arg(first).arg(last).arg(count)); + hitsLabel->setText(QHelpSearchResultWidget::tr("%1 - %2 of %n Hits", 0, count).arg(first).arg(last)); } private: diff --git a/tools/assistant/tools/assistant/bookmarkmanager.cpp b/tools/assistant/tools/assistant/bookmarkmanager.cpp index 70f562e..b9a1b0e 100644 --- a/tools/assistant/tools/assistant/bookmarkmanager.cpp +++ b/tools/assistant/tools/assistant/bookmarkmanager.cpp @@ -148,7 +148,7 @@ void BookmarkManager::takeBookmarksMenu(QMenu* menu) void BookmarkManager::addBookmark(const QString &title, const QString &url) { TRACE_OBJ - showBookmarkDialog(title.isEmpty() ? tr("Untiled") : title, + showBookmarkDialog(title.isEmpty() ? tr("Untitled") : title, url.isEmpty() ? QLatin1String("about:blank") : url); } diff --git a/tools/assistant/tools/assistant/cmdlineparser.cpp b/tools/assistant/tools/assistant/cmdlineparser.cpp index bbc0c37..b6c0beb 100644 --- a/tools/assistant/tools/assistant/cmdlineparser.cpp +++ b/tools/assistant/tools/assistant/cmdlineparser.cpp @@ -167,10 +167,10 @@ void CmdLineParser::handleCollectionFileOption() const QString &fileName = nextArg(); m_collectionFile = getFileName(fileName); if (m_collectionFile.isEmpty()) - m_error = tr("The collection file '%1' does not exist!"). + m_error = tr("The collection file '%1' does not exist."). arg(fileName); } else { - m_error = tr("Missing collection file!"); + m_error = tr("Missing collection file."); } } @@ -183,9 +183,9 @@ void CmdLineParser::handleShowUrlOption() if (url.isValid()) { m_url = url; } else - m_error = tr("Invalid URL '%1'!").arg(urlString); + m_error = tr("Invalid URL '%1'.").arg(urlString); } else { - m_error = tr("Missing URL!"); + m_error = tr("Missing URL."); } } @@ -223,7 +223,7 @@ void CmdLineParser::handleShowOrHideOrActivateOption(ShowState state) else m_error = tr("Unknown widget: %1").arg(widget); } else { - m_error = tr("Missing widget!"); + m_error = tr("Missing widget."); } } @@ -246,11 +246,11 @@ void CmdLineParser::handleRegisterOrUnregisterOption(RegisterState state) const QString &fileName = nextArg(); m_helpFile = getFileName(fileName); if (m_helpFile.isEmpty()) - m_error = tr("The Qt help file '%1' does not exist!").arg(fileName); + m_error = tr("The Qt help file '%1' does not exist.").arg(fileName); else m_register = state; } else { - m_error = tr("Missing help file!"); + m_error = tr("Missing help file."); } } @@ -260,7 +260,7 @@ void CmdLineParser::handleSetCurrentFilterOption() if (hasMoreArgs()) m_currentFilter = nextArg(); else - m_error = tr("Missing filter argument!"); + m_error = tr("Missing filter argument."); } QString CmdLineParser::getFileName(const QString &fileName) -- cgit v0.12 From 98c0ee7ac1137c874f8bb6a69b0a446b6c3e7d93 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Wed, 24 Feb 2010 15:45:27 +0100 Subject: Prepare German translations for 4.7 (except Quick). --- translations/assistant_de.ts | 494 ++++++++----------- translations/designer_de.ts | 58 ++- translations/linguist_de.ts | 50 +- translations/qt_de.ts | 1121 +++++++++++++++++++++++++++++++++++++++--- translations/qt_help_de.ts | 181 ++++--- 5 files changed, 1416 insertions(+), 488 deletions(-) diff --git a/translations/assistant_de.ts b/translations/assistant_de.ts index b020003..0a0d37f 100644 --- a/translations/assistant_de.ts +++ b/translations/assistant_de.ts @@ -4,7 +4,7 @@ AboutDialog - + &Close &Schließen @@ -12,7 +12,7 @@ AboutLabel - + Warning Achtung @@ -24,12 +24,79 @@ - + OK OK + Assistant + + + Error registering documentation file '%1': %2 + Beim Registrieren der Dokumentationsdatei '%1' trat ein Fehler auf: %2 + + + + Error: %1 + Fehler: %1 + + + + Could not register documentation file +%1 + +Reason: +%2 + Dokumentationsdatei %1 kann nicht registriert werden + +Grund: +%2 + + + + Documentation successfully registered. + Dokumentation erfolgreich registriert. + + + + Could not unregister documentation file +%1 + +Reason: +%2 + Registrierung der Dokumentationsdatei %1 kann nicht aufgehoben werden + +Grund: +%2 + + + + Documentation successfully unregistered. + Dokumentation erfolgreich entfernt. + + + + Error reading collection file '%1': %2. + Fehler beim Lesen der Katalogdatei '%1': %2 + + + + Error creating collection file '%1': %2. + Fehler beim Erstellen der Katalogdatei '%1': %2. + + + + Error reading collection file '%1': %2 + Fehler beim Lesen der Katalogdatei '%1': %2 + + + + Cannot load sqlite database driver! + Der Datenbanktreiber für SQLite kann nicht geladen werden. + + + BookmarkDialog @@ -52,39 +119,20 @@ Neuer Ordner - - - - - - Bookmarks - Lesezeichen - - - + + + - - - Delete Folder - Ordner löschen - - - - Rename Folder - Ordner umbenennen - BookmarkManager - - Bookmarks - Lesezeichen + + Untitled + Ohne Titel - + Remove Entfernen @@ -94,26 +142,22 @@ Wenn Sie diesen Ordner löschen, wird auch<br>dessen kompletter Inhalt gelöscht. Möchten Sie wirklich fortfahren? - - - New Folder - Neuer Ordner + + Manage Bookmarks... + Lesezeichen verwalten... - - - BookmarkWidget - - Filter: - Filter: + + Add Bookmark... + Lesezeichen hinzufügen ... - - Remove - Entfernen + + Ctrl+D + Ctrl+D - + Delete Folder Ordner löschen @@ -133,7 +177,7 @@ Lesezeichen in neuem Reiter öffnen - + Delete Bookmark Lesezeichen löschen @@ -142,16 +186,11 @@ Rename Bookmark Lesezeichen umbenennen - - - Add - Hinzufügen - CentralWidget - + Add new page Neue Seite hinzufügen @@ -161,18 +200,18 @@ Aktuelle Seite schließen - + Print Document Drucken - + unknown unbekannt - + Add New Page Neue Seite hinzufügen @@ -192,15 +231,78 @@ Lesezeichen für diese Seite hinzufügen ... - + Search Suchen + CmdLineParser + + + Unknown option: %1 + Unbekannte Option: %1 + + + + Unknown widget: %1 + Unbekanntes Widget-Objekt: %1 + + + + The collection file '%1' does not exist. + Die Katalogdatei '%1' existiert nicht. + + + + Missing collection file. + Fehlende Katalogdatei. + + + + Invalid URL '%1'. + Ungültige URL '%1'. + + + + Missing URL. + Fehlende URL. + + + + Missing widget. + Fehlendes Widget-Objekt. + + + + The Qt help file '%1' does not exist. + Die Hilfedatei '%1' existiert nicht. + + + + Missing help file. + Fehlende Hilfedatei. + + + + Missing filter argument. + Das Filter-Argument fehlt. + + + + Error + Fehler + + + + Notice + Hinweis + + + ContentWindow - + Open Link Link öffnen @@ -224,34 +326,6 @@ - FindWidget - - - Previous - Zurück - - - - Next - Weiter - - - - Case Sensitive - Groß-/Kleinschreibung beachten - - - - Whole words - Ganze Wörter - - - - <img src=":/trolltech/assistant/images/wrap.png">&nbsp;Search wrapped - <img src=":/trolltech/assistant/images/wrap.png">&nbsp;Seitenende - - - FontPanel @@ -282,52 +356,25 @@ HelpViewer - - Help - Hilfe - - - - OK - OK + + <title>about:blank</title> + <title>about:blank</title> - + <title>Error 404...</title><div align="center"><br><br><h1>The page could not be found</h1><br><h3>'%1'</h3></div> <title>Fehler 404 ...</title><div align="center"><br><br><h1>Die Seite kann nicht gefunden werden.</h1><br><h3>'%1'</h3></div> - - - Copy &Link Location - &Link-Adresse kopieren - - - - Open Link in New Tab Ctrl+LMB - Link in neuem Reiter öffnen - - - - Open Link in New Tab - Link in neuem Reiter öffnen - - - - Unable to launch external application. - - Fehler beim Starten der externen Anwendung. - - IndexWindow - + &Look for: Suchen &nach: - + Open Link Link öffnen @@ -341,29 +388,29 @@ InstallDialog - + Install Documentation Dokumentation installieren - + Downloading documentation info... Dokumentationsinformation herunterladen ... - + Download canceled. Herunterladen abgebrochen. - - + + Done. Fertig. - + The file %1 already exists. Do you want to overwrite it? Die Datei %1 existiert bereits. Möchten Sie sie überschreiben? @@ -378,14 +425,14 @@ Herunterladen der Datei %1 ... - + - + Download failed: %1. Herunterladen fehlgeschlagen: %1. - + Documentation info file is corrupt! Die Dokumentationsdatei ist beschädigt. @@ -400,7 +447,7 @@ Dokumentation %1 installieren ... - + Error while installing documentation: %1 Fehler bei der Installation von: @@ -440,20 +487,20 @@ MainWindow - - + + Index Index - - + + Contents Inhalt - - + + Bookmarks Lesezeichen @@ -463,20 +510,14 @@ Suchen - - - + + + Qt Assistant Qt Assistant - - - Unfiltered - Ohne Filter - - - + Page Set&up... S&eite einrichten ... @@ -506,7 +547,12 @@ &Beenden - + + CTRL+Q + CTRL+Q + + + &Copy selected Text Ausgewählten Text &kopieren @@ -616,12 +662,12 @@ Ctrl+Alt+Left - - Add Bookmark... - Lesezeichen hinzufügen ... + + Could not register file '%1': %2 + Die Datei '%1' konnte nicht registriert werden: %2 - + About... Über ... @@ -631,12 +677,12 @@ Navigationsleiste - + Toolbars Werkzeugleisten - + Filter Toolbar Filterleiste @@ -646,7 +692,7 @@ Filter: - + Address Toolbar Adressleiste @@ -656,27 +702,27 @@ Adresse: - + Could not find the associated content item. Der zugehörige Inhaltseintrag konnte nicht gefunden werden. - + About %1 Über %1 - + Updating search index Suchindex wird aufgebaut - + Looking for Qt Documentation... Suche nach Qt-Dokumentation ... - + &Window &Fenster @@ -696,12 +742,12 @@ Zoom - + &File &Datei - + &Edit &Bearbeiten @@ -721,41 +767,36 @@ ALT+Home - + &Bookmarks &Lesezeichen - + &Help &Hilfe - + ALT+O ALT+O - - - CTRL+D - CTRL+D - PreferencesDialog - - + + Add Documentation Dokumentation hinzufügen - + Qt Compressed Help Files (*.qch) Komprimierte Hilfedateien (*.qch) - + The specified file is not a valid Qt Help File! Die angegebene Datei ist keine Qt-Hilfedatei. @@ -765,7 +806,7 @@ Der Namespace %1 ist bereits registriert. - + Remove Documentation Dokumentation entfernen @@ -785,7 +826,7 @@ OK - + Use custom settings Benutzerdefinierte Einstellungen verwenden @@ -909,118 +950,9 @@ - QObject - - - The specified collection file does not exist! - Die angegebene Katalogdatei (collection file) kann nicht gefunden werden. - - - - Missing collection file! - Fehlende Katalogdatei. - - - - Invalid URL! - Ungültige URL. - - - - Missing URL! - Fehlende URL. - - - - - - Unknown widget: %1 - Unbekanntes Objekt: %1 - - - - - - Missing widget! - Fehlendes Objekt. - - - - - The specified Qt help file does not exist! - Die angegebene Hilfedatei kann nicht gefunden werden. - - - - - Missing help file! - Fehlende Hilfedatei. - - - - Missing filter argument! - Das Filter-Argument fehlt. - - - - Unknown option: %1 - Unbekannte Option: %1 - - - - - Qt Assistant - Qt Assistant - - - - Could not register documentation file -%1 - -Reason: -%2 - Dokumentationsdatei %1 kann nicht registriert werden - -Grund: -%2 - - - - Documentation successfully registered. - Dokumentation erfolgreich registriert. - - - - Could not unregister documentation file -%1 - -Reason: -%2 - Registrierung der Dokumentationsdatei %1 kann nicht aufgehoben werden - -Grund: -%2 - - - - Documentation successfully unregistered. - Dokumentation erfolgreich entfernt. - - - - Cannot load sqlite database driver! - Der Datenbanktreiber für SQLite kann nicht geladen werden. - - - - The specified collection file could not be read! - Die angegebene Katalogdatei (collection file) kann nicht gelesen werden. - - - RemoteControl - + Debugging Remote Control Debugging Remote Control @@ -1033,7 +965,7 @@ Grund: SearchWidget - + &Copy &Kopieren @@ -1056,7 +988,7 @@ Grund: TopicChooser - + Choose a topic for <b>%1</b>: Wählen Sie ein Thema für <b>%1</b>: diff --git a/translations/designer_de.ts b/translations/designer_de.ts index 8c1ba68..475a5d5 100644 --- a/translations/designer_de.ts +++ b/translations/designer_de.ts @@ -506,7 +506,7 @@ Werkzeugleiste löschen - + Set action text Text der Aktion setzen @@ -621,7 +621,7 @@ Skript ändern - + Changed '%1' of '%2' '%1' von '%2' geändert @@ -635,7 +635,7 @@ - + Reset '%1' of '%2' '%1' von '%2' zurücksetzen @@ -1109,7 +1109,7 @@ FormWindow - + Unexpected element <%1> Ungültiges Element <%1> @@ -1985,7 +1985,7 @@ Möchten Sie es noch einmal versuchen? QDesignerMenu - + Type Here Geben Sie Text ein @@ -2011,7 +2011,7 @@ Möchten Sie es noch einmal versuchen? - + Add separator Trenner hinzufügen @@ -2085,7 +2085,7 @@ Möchten Sie es noch einmal versuchen? QDesignerPropertySheet - + Dynamic Properties Dynamische Eigenschaften @@ -2456,7 +2456,7 @@ Container-Seiten sollten ausschließlich im XML der domXML()-Methode spezifizier QtBoolEdit - + True @@ -2472,7 +2472,7 @@ Container-Seiten sollten ausschließlich im XML der domXML()-Methode spezifizier QtBoolPropertyManager - + True Wahr @@ -2501,7 +2501,7 @@ Container-Seiten sollten ausschließlich im XML der domXML()-Methode spezifizier QtColorPropertyManager - + Red Rot @@ -2524,7 +2524,7 @@ Container-Seiten sollten ausschließlich im XML der domXML()-Methode spezifizier QtCursorDatabase - + Arrow Pfeil @@ -3080,7 +3080,7 @@ Container-Seiten sollten ausschließlich im XML der domXML()-Methode spezifizier QtKeySequenceEdit - + Clear Shortcut Tastenkürzel löschen @@ -3522,7 +3522,7 @@ Dies kann zum Beispiel eine Sprachkennung wie "_de" sein. QtResourceViewDialog - + Select Resource Ressource auswählen @@ -4034,7 +4034,7 @@ Möchten Sie sie überschreiben? qdesigner_internal::ActionModel - + Name Name @@ -4727,7 +4727,7 @@ Möchten Sie sie überschreiben? qdesigner_internal::FormWindow - + Edit contents Ändern @@ -4737,34 +4737,33 @@ Möchten Sie sie überschreiben? F2 - + Resize Größe ändern - - + Key Move Verschieben mittels Tastatur - + Paste error Fehler beim Einfügen - + Lay out Layout - + Drop widget Widget einfügen - + Paste %n action(s) Eine Aktion einfügen @@ -4772,12 +4771,17 @@ Möchten Sie sie überschreiben? - + Insert widget '%1' Widget '%1' einfügen + + + Key Resize + Größe ändern mittels Tastatur + - + Paste %n widget(s) Widget einfügen @@ -4800,17 +4804,17 @@ Möchten Sie sie überschreiben? Bitte lösen Sie das Layout des gewünschten Containers auf und wählen Sie ihn erneut aus, um die Widgets einzufügen. - + Select Ancestor Übergeordnetes Widget auswählen - + A QMainWindow-based form does not contain a central widget. Ein auf QMainWindow basierendes Formular enthält kein zentrales Widget. - + Raise widgets Widgets nach vorn bringen diff --git a/translations/linguist_de.ts b/translations/linguist_de.ts index 101aa5b..14095ba 100644 --- a/translations/linguist_de.ts +++ b/translations/linguist_de.ts @@ -4,7 +4,7 @@ AboutDialog - + Qt Linguist Qt Linguist @@ -286,7 +286,7 @@ Es wird mit einer einfachen Universalform gearbeitet. FormMultiWidget - + Alt+Delete translate, but don't change Alt+Delete @@ -317,7 +317,7 @@ Es wird mit einer einfachen Universalform gearbeitet. LRelease - + Dropped %n message(s) which had no ID. Es wurde ein Eintrag ohne Bezeichner gelöscht. @@ -862,11 +862,6 @@ Es wird mit einer einfachen Universalform gearbeitet. - Display information about the Qt toolkit by Trolltech. - Informationen über das Qt-Toolkit von Trolltech anzeigen. - - - &What's This? &Direkthilfe @@ -914,13 +909,13 @@ Es wird mit einer einfachen Universalform gearbeitet. Freigeben unter ... - + This is the application's main window. - + Source text Ursprungstext @@ -947,12 +942,12 @@ Es wird mit einer einfachen Universalform gearbeitet. Dieser Bereich zeigt die Kontexte an. - + Strings Zeichenketten - + Phrases and guesses Wörterbuch und Vorschläge @@ -973,7 +968,7 @@ Es wird mit einer einfachen Universalform gearbeitet. Geändert - + Loading... Lade ... @@ -1010,7 +1005,7 @@ Soll die erstgenannte Datei übersprungen werden? - + Related files (%1);; Verwandte Dateien (%1);; @@ -1390,7 +1385,7 @@ Alle Dateien (*) Möchten Sie das Wörterbuch '%1' speichern? - + All Alle @@ -1411,7 +1406,7 @@ Alle Dateien (*) - + Translation File &Settings... E&instellungen ... @@ -1495,6 +1490,11 @@ Alle Dateien (*) Length Variants Längenvarianten + + + Display information about the Qt toolkit by Nokia. + + MessageEditor @@ -1535,12 +1535,12 @@ Alle Dateien (*) Chinesisch - + This whole panel allows you to view and edit the translation of some source text. Dieser Bereich erlaubt die Darstellung und Änderung der Übersetzung eines Textes. - + Source text Ursprungstext @@ -1575,7 +1575,7 @@ Alle Dateien (*) Hier können Sie Hinweise für den eigenen Gebrauch eintragen. Diese haben keinen Einflusse auf die Übersetzung. - + %1 translation (%2) Übersetzung %1 (%2) @@ -1605,7 +1605,7 @@ Zeile: %2 MessageModel - + Completion status for %1 Bearbeitungsstand von %1 @@ -1628,7 +1628,7 @@ Zeile: %2 MsgEdit - + This is the right panel of the main window. @@ -1807,7 +1807,7 @@ Zeile: %2 Alle Dateien (*) - + @@ -1843,7 +1843,7 @@ Zeile: %2 XLIFF-Übersetzungsdateien - + Qt Linguist 'Phrase Book' Qt-Linguist-Wörterbuch @@ -1985,12 +1985,12 @@ Zeile: %2 TranslationSettingsDialog - + Any Country Land - + Settings for '%1' - Qt Linguist Einstellungen für '%1' - Qt Linguist diff --git a/translations/qt_de.ts b/translations/qt_de.ts index 6447451..f02a7bb 100644 --- a/translations/qt_de.ts +++ b/translations/qt_de.ts @@ -4,7 +4,7 @@ CloseButton - + Close Tab Schließen @@ -372,6 +372,7 @@ Bitte überprüfen Sie Ihre GStreamer-Installation und stellen Sie sicher, dass Decay time (ms) + DecayTime: Time over which reverberation is diminished. Abklingzeit (ms) @@ -548,7 +549,7 @@ Bitte überprüfen Sie Ihre GStreamer-Installation und stellen Sie sicher, dass Q3FileDialog - + Copy or Move a File Datei kopieren oder verschieben @@ -1212,7 +1213,7 @@ nach Diese Socket-Operation wird nicht unterstützt - + Socket operation timed out Das Zeitlimit für die Operation wurde überschritten @@ -1257,7 +1258,7 @@ nach QApplication - + QT_LAYOUT_DIRECTION Translate this string to the string 'LTR' in left-to-right languages or to 'RTL' in right-to-left languages (such as Hebrew and Arabic) to get proper widget layout. LTR @@ -1327,7 +1328,7 @@ nach QColorDialog - + Hu&e: Farb&ton: @@ -1367,7 +1368,7 @@ nach Farbauswahl - + &Basic colors Grundfar&ben @@ -1567,7 +1568,7 @@ nach - + OK OK @@ -1818,7 +1819,7 @@ nach QFileDialog - + All Files (*) Alle Dateien (*) @@ -1906,7 +1907,7 @@ nach Verzeichnisse - + All Files (*.*) Alle Dateien (*.*) @@ -2059,7 +2060,7 @@ Möchten Sie die Datei trotzdem löschen? QFileSystemModel - + %1 TB %1 TB @@ -2088,7 +2089,7 @@ Möchten Sie die Datei trotzdem löschen? %1 Byte - + Invalid filename Ungültiger Dateiname @@ -2125,7 +2126,7 @@ Möchten Sie die Datei trotzdem löschen? Änderungsdatum - + My Computer Mein Computer @@ -2558,17 +2559,30 @@ Möchten Sie die Datei trotzdem löschen? + QGstreamerPlayerSession + + + Unable to play %1 + %1 kann nicht abgespielt werden + + + QHostInfo Unknown error Unbekannter Fehler + + + No host name given + Es wurde kein Hostname angegeben + QHostInfoAgent - + @@ -2591,12 +2605,14 @@ Möchten Sie die Datei trotzdem löschen? Unbekannter Fehler + No host name given Es wurde kein Hostname angegeben - + + Invalid hostname Ungültiger Rechnername @@ -2919,7 +2935,7 @@ Möchten Sie die Datei trotzdem löschen? QIODevice - + Permission denied Zugriff verweigert @@ -3003,7 +3019,7 @@ Möchten Sie die Datei trotzdem löschen? Operation unmap fehlgeschlagen für '%1': %2 - + The plugin '%1' uses incompatible Qt library. (%2.%3.%4) [%5] Das Plugin '%1' verwendet eine inkompatible Qt-Bibliothek. (%2.%3.%4) [%5] @@ -3055,7 +3071,7 @@ Möchten Sie die Datei trotzdem löschen? QLineEdit - + Select All Alles auswählen @@ -3132,7 +3148,7 @@ Möchten Sie die Datei trotzdem löschen? - + %1: Invalid name %1: Ungültiger Name @@ -3163,7 +3179,7 @@ Möchten Sie die Datei trotzdem löschen? - + %1: Connection error %1: Verbindungsfehler @@ -3376,6 +3392,39 @@ Möchten Sie die Datei trotzdem löschen? + QMediaPlayer + + + The QMediaPlayer object does not have a valid service + Das QMediaPlayer-Objekt verfügt über keinen gültigen Dienst + + + + QMediaPlaylist + + + + Could not add items to read only playlist. + Es konnten keine Einträge zur Wiedergabeliste hinzugefügt werden, da sie schreibgeschützt ist. + + + + + Playlist format is not supported + Das Format der Wiedergabeliste ist nicht unterstützt + + + + The file could not be accessed. + Auf die Datei konnte nicht zugegriffen werden. + + + + Playlist format is not supported. + Das Format der Wiedergabeliste ist nicht unterstützt. + + + QMenu @@ -3470,7 +3519,7 @@ Möchten Sie die Datei trotzdem löschen? QNativeSocketEngine - + The remote host closed the connection Der entfernte Rechner hat die Verbindung geschlossen @@ -3609,12 +3658,35 @@ Möchten Sie die Datei trotzdem löschen? + QNetworkAccessDataBackend + + + Operation not supported on %1 + Diese Operation wird von %1 nicht unterstützt + + + + Invalid URI: %1 + Ungültiger URI: %1 + + + QNetworkAccessDebugPipeBackend Write error writing to %1: %2 Fehler beim Schreiben zu %1: %2 + + + Socket error on %1: %2 + Socket-Fehler bei %1: %2 + + + + Remote host closed the connection prematurely on %1 + Der entfernte Rechner hat die Verbindung zu %1 vorzeitig beendet + QNetworkAccessFileBackend @@ -3678,37 +3750,106 @@ Möchten Sie die Datei trotzdem löschen? QNetworkAccessHttpBackend - + No suitable proxy found Es konnte kein geeigneter Proxy-Server gefunden werden + QNetworkAccessManager + + + Network access is disabled. + Der Zugriff auf das Netzwerk ist nicht gestattet. + + + QNetworkReply - + Error downloading %1 - server replied: %2 Beim Herunterladen von %1 trat ein Fehler auf - Die Antwort des Servers ist: %2 - + Protocol "%1" is unknown Das Protokoll "%1" ist unbekannt + + + Temporary network failure. + Das Netzwerk ist zur Zeit ausgefallen. + QNetworkReplyImpl - + Operation canceled Operation abgebrochen + QNetworkSession + + + Invalid configuration. + Ungültige Konfiguration. + + + + QNetworkSessionPrivateImpl + + + + Unknown session error. + Unbekannter Fehler bei Netzwerkverbindung. + + + + + The session was aborted by the user or system. + Die Verbindung wurde vom Nutzer oder vom Betriebssystem unterbrochen. + + + + + The requested operation is not supported by the system. + Die angeforderte Operation wird vom System nicht unterstützt. + + + + + The specified configuration cannot be used. + Die angegebene Konfiguration kann nicht verwendet werden. + + + + + Roaming was aborted or is not possible. + Das Roaming wurde abgebrochen oder ist hier nicht möglich. + + + + Roaming error + Fehler beim Roaming + + + + Session aborted by user or system + Die Verbindung wurde vom Nutzer oder vom Betriebssystem unterbrochen + + + + Unidentified Error + Unbekannter Fehler + + + QOCIDriver - + Unable to logon Logon-Vorgang fehlgeschlagen @@ -3782,12 +3923,12 @@ Möchten Sie die Datei trotzdem löschen? QODBCDriver - + Unable to connect Es kann keine Verbindung aufgebaut werden - + Unable to disable autocommit 'autocommit' konnte nicht deaktiviert werden @@ -3807,7 +3948,7 @@ Möchten Sie die Datei trotzdem löschen? 'autocommit' konnte nicht aktiviert werden - + Unable to connect - Driver doesn't support all functionality required Es kann keine Verbindung aufgebaut werden weil der Treiber die benötigte Funktionalität nicht vollständig unterstützt @@ -3815,19 +3956,19 @@ Möchten Sie die Datei trotzdem löschen? QODBCResult - + QODBCResult::reset: Unable to set 'SQL_CURSOR_STATIC' as statement attribute. Please check your ODBC driver configuration QODBCResult::reset: 'SQL_CURSOR_STATIC' konnte nicht als Attribut des Befehls gesetzt werden. Bitte prüfen Sie die Konfiguration Ihres ODBC-Treibers - + Unable to execute statement Der Befehl konnte nicht ausgeführt werden - + Unable to fetch next Der nächste Datensatz konnte nicht abgeholt werden @@ -3837,19 +3978,19 @@ Möchten Sie die Datei trotzdem löschen? Der Befehl konnte nicht initialisiert werden - + Unable to bind variable Die Variable konnte nicht gebunden werden - - + + Unable to fetch last Der letzte Datensatz konnte nicht abgeholt werden - + Unable to fetch Es konnten keine Daten abgeholt werden @@ -3867,41 +4008,15 @@ Möchten Sie die Datei trotzdem löschen? QObject - - Invalid hostname - Ungültiger Rechnername - - - - Operation not supported on %1 - Diese Operation wird von %1 nicht unterstützt - - - - Invalid URI: %1 - Ungültiger URI: %1 - - - - Socket error on %1: %2 - Socket-Fehler bei %1: %2 - - - - Remote host closed the connection prematurely on %1 - Der entfernte Rechner hat die Verbindung zu %1 vorzeitig beendet - - - - - No host name given - Es wurde kein Hostname angegeben + + "%1" duplicates a previous role name and will be disabled. + "%1" ist bereits als Name einer Rolle vergeben und wird daher deaktiviert. QPPDOptionsModel - + Name Name @@ -4959,7 +5074,7 @@ Bitte wählen Sie einen anderen Dateinamen. QSQLiteDriver - + Error opening database Die Datenbankverbindung konnte nicht geöffnet werden @@ -4987,7 +5102,7 @@ Bitte wählen Sie einen anderen Dateinamen. QSQLiteResult - + Unable to fetch row @@ -5245,7 +5360,7 @@ Bitte wählen Sie einen anderen Dateinamen. QScriptDebuggerLocalsModel - + Name Name @@ -6428,7 +6543,7 @@ Bitte wählen Sie einen anderen Dateinamen. Umdrehen - + Ctrl Strg @@ -6462,7 +6577,7 @@ Bitte wählen Sie einen anderen Dateinamen. F%1 - + Home Page Startseite @@ -6596,7 +6711,7 @@ Bitte wählen Sie einen anderen Dateinamen. Abbrechen - + Exit Beenden @@ -6940,7 +7055,7 @@ Bitte wählen Sie einen anderen Dateinamen. QTextControl - + &Undo &Rückgängig @@ -7989,7 +8104,7 @@ Bitte wählen Sie einen anderen Dateinamen. QWidget - + * * @@ -8454,6 +8569,866 @@ Bitte wählen Sie einen anderen Dateinamen. + QmlAbstractAnimation + + + Cannot animate non-existent property "%1" + Die Eigenschaft '%1" existiert nicht und kann daher nicht animiert werden + + + + Cannot animate read-only property "%1" + Die Eigenschaft '%1" ist schreibgeschützt und kann daher nicht animiert werden + + + + QmlBehavior + + + Cannot change the animation assigned to a Behavior. + Die zu einem Behavior-Element gehörende Animation kann nicht geändert werden. + + + + QmlBinding + + + Binding loop detected for property "%1" + Bei der für die Eigenschaft "%1" angegebenen Bindung wurde eine Schleife festgestellt + + + + QmlCompiler + + + + + + Invalid property assignment: "%1" is a read-only property + Ungültige Zuweisung bei Eigenschaft: "%1" ist schreibgeschützt + + + + Invalid property assignment: unknown enumeration + Ungültige Zuweisung bei Eigenschaft: Ungültiger Aufzählungswert + + + + Invalid property assignment: string expected + Ungültige Zuweisung bei Eigenschaft: Es wird eine Zeichenkette erwartet + + + + Invalid property assignment: url expected + Ungültige Zuweisung bei Eigenschaft: Es wird eine URL erwartet + + + + Invalid property assignment: unsigned int expected + Ungültige Zuweisung bei Eigenschaft: Es wird eine vorzeichenloser Ganzzahlwert erwartet + + + + Invalid property assignment: int expected + Ungültige Zuweisung bei Eigenschaft: Es wird ein Ganzzahlwert erwartet + + + + Invalid property assignment: float expected + Ungültige Zuweisung bei Eigenschaft: Es wird eine Gleitkommazahl erwartet + + + + Invalid property assignment: double expected + Ungültige Zuweisung bei Eigenschaft: Es wird eine Gleitkommazahl (double) erwartet + + + + Invalid property assignment: color expected + Ungültige Zuweisung bei Eigenschaft: Es wird eine Farbspezifikation erwartet + + + + Invalid property assignment: date expected + Ungültige Zuweisung bei Eigenschaft: Es wird eine Datumsangabe erwartet + + + + Invalid property assignment: time expected + Ungültige Zuweisung bei Eigenschaft: Es wird eine Zeitangabe erwartet + + + + Invalid property assignment: datetime expected + Ungültige Zuweisung bei Eigenschaft: Es wird eine Datumsangabe erwartet + + + + Invalid property assignment: point expected + Ungültige Zuweisung bei Eigenschaft: Es wird eine Koordinatenangabe für einen Punkt erwartet + + + + Invalid property assignment: size expected + Ungültige Zuweisung bei Eigenschaft: Es wird eine Größenangabe erwartet + + + + Invalid property assignment: rect expected + Ungültige Zuweisung bei Eigenschaft: Es werden Parameter für ein Rechteck erwartet + + + + Invalid property assignment: boolean expected + Ungültige Zuweisung bei Eigenschaft: Es wird ein Boolescher Wert erwartet + + + + Invalid property assignment: 3D vector expected + Ungültige Zuweisung bei Eigenschaft: Es wird ein dreidimensionaler Vektor erwartet + + + + Invalid property assignment: unsupported type "%1" + Ungültige Zuweisung bei Eigenschaft: Der Typ "%1" ist nicht unterstützt + + + + + Invalid component specification + + + + + Invalid component id specification + + + + + + id is not unique + + + + + Invalid component body specification + + + + + Cannot create empty component specification + + + + + Invalid Script block. Specify either the source property or inline script + + + + + Invalid Script source value + + + + + Properties cannot be set on Script block + + + + + Invalid Script block + + + + + Incorrectly specified signal + + + + + Empty signal assignment + + + + + Empty property assignment + + + + + Attached properties cannot be used here + + + + + + Non-existent attached object + + + + + + Invalid attached object assignment + + + + + Cannot assign to non-existent default property + + + + + + Cannot assign to non-existent property "%1" + + + + + Invalid use of namespace + + + + + Not an attached property name + + + + + Invalid use of id property + + + + + "%1" is not a valid object id + + + + + id conflicts with type name + + + + + id conflicts with namespace prefix + + + + + Invalid value in grouped property + + + + + + Invalid grouped property access + + + + + Invalid property use + + + + + Property assignment expected + + + + + Single property assignment expected + + + + + Unexpected object assignment + + + + + Cannot assign object to list + + + + + Cannot assign primitives to lists + + + + + Can only assign one binding to lists + + + + + Cannot assign multiple values to a script property + + + + + Invalid property assignment: script expected + + + + + Cannot assign object to property + + + + + Duplicate default property + + + + + Duplicate property name + + + + + Duplicate signal name + + + + + Duplicate method name + + + + + Invalid property nesting + + + + + Cannot override FINAL property + + + + + Invalid property type + + + + + + No property alias location + + + + + + Invalid alias location + + + + + Invalid alias reference. An alias reference must be specified as <id> or <id>.<property> + + + + + Invalid alias reference. Unable to find id "%1" + + + + + QmlCompositeTypeManager + + + + Resource %1 unavailable + + + + + Import %1 unavailable + + + + + Namespace %1 cannot be used as a type + + + + + %1 is not a type + + + + + Type %1 unavailable + + + + + QmlEngine + + + executeSql called outside transaction() + + + + + Read-only Transaction + + + + + Version mismatch: expected %1, found %2 + + + + + SQL transaction failed + + + + + transaction: missing callback + + + + + + SQL: database version mismatch + + + + + QmlGraphicsAnchors + + + Possible anchor loop detected on fill. + + + + + Possible anchor loop detected on centerIn. + + + + + + + + Cannot anchor to an item that isn't a parent or sibling. + + + + + Possible anchor loop detected on vertical anchor. + + + + + Possible anchor loop detected on horizontal anchor. + + + + + Cannot specify left, right, and hcenter anchors. + + + + + + Cannot anchor to a null item. + + + + + Cannot anchor a horizontal edge to a vertical edge. + + + + + + Cannot anchor item to self. + + + + + Cannot specify top, bottom, and vcenter anchors. + + + + + Baseline anchor cannot be used in conjunction with top, bottom, or vcenter anchors. + + + + + Cannot anchor a vertical edge to a horizontal edge. + + + + + QmlGraphicsFlipable + + + front is a write-once property + + + + + back is a write-once property + + + + + QmlGraphicsTextInput + + + + Could not load cursor delegate + + + + + Could not instantiate cursor delegate + + + + + QmlGraphicsVisualDataModel + + + Delegate component must be Item type. + + + + + QmlInfo + + + + unknown location + + + + + QmlListModel + + + remove: index %1 out of range + + + + + insert: value is not an object + + + + + insert: index %1 out of range + + + + + move: out of range + + + + + append: value is not an object + + + + + get: index %1 out of range + + + + + set: value is not an object + + + + + + set: index %1 out of range + + + + + ListElement: cannot use default property + + + + + ListElement: cannot use reserved "id" property + + + + + ListElement: cannot use script for property value + + + + + ListModel: undefined property '%1' + + + + + QmlParentChange + + + Unable to preserve appearance under complex transform + + + + + + Unable to preserve appearance under non-uniform scale + + + + + Unable to preserve appearance under scale of 0 + + + + + QmlParser + + + Illegal character + + + + + Unclosed string at end of line + + + + + Illegal escape squence + + + + + Illegal unicode escape sequence + + + + + Unclosed comment at end of file + + + + + Illegal syntax for exponential number + + + + + Identifier cannot start with numeric literal + + + + + Unterminated regular expression literal + + + + + Invalid regular expression flag '%0' + + + + + + Syntax error + + + + + Unexpected token `%1' + + + + + + Expected token `%1' + + + + + Expected type name + + + + + Invalid use of Script block + + + + + Invalid import qualifier ID + + + + + Library import requires a version + + + + + Expected parameter type + + + + + Invalid property type modifier + + + + + Unexpected property type modifier + + + + + Expected property type + + + + + Readonly not yet supported + + + + + QmlJS declaration outside Script element + + + + + Variable declarations not allow in inline Script blocks + + + + + QmlPauseAnimation + + + Cannot set a duration of < 0 + + + + + QmlPropertyAnimation + + + Unmatched parenthesis in easing function "%1" + + + + + Easing function "%1" must start with "ease" + + + + + Unknown easing curve "%1" + + + + + + Improperly specified parameter in easing function "%1" + + + + + Unknown easing parameter "%1" + + + + + Cannot set a duration of < 0 + + + + + QmlPropertyChanges + + + Cannot assign to non-existent property "%1" + + + + + Cannot assign to read-only property "%1" + + + + + QmlVME + + + Unable to create object of type %1 + + + + + Cannot assign value %1 to property %2 + + + + + Cannot assign object type %1 with no default method + + + + + Cannot connect mismatched signal/slot %1 %vs. %2 + + + + + Cannot assign an object to signal property %1 + + + + + Cannot assign object to list + + + + + Cannot assign object to interface property + + + + + Unable to create attached object + + + + + Cannot set properties on %1 as it is null + + + + + QmlXmlListModelRole + + + An XmlRole query must not start with '/' + + + + + QmlXmlRoleList + + + An XmlListModel query must start with '/' or "//" + + + + QtXmlPatterns diff --git a/translations/qt_help_de.ts b/translations/qt_help_de.ts index f64e741..40d1158 100644 --- a/translations/qt_help_de.ts +++ b/translations/qt_help_de.ts @@ -63,7 +63,7 @@ Unbekannter Filter '%1'. - + Invalid documentation file '%1'! Ungültige Dokumentationsdatei '%1'. @@ -78,7 +78,7 @@ Die Datenbank '%1' kann nicht zur Optimierung geöffnet werden. - + Cannot create directory: %1 Das Verzeichnis kann nicht angelegt werden: %1 @@ -88,7 +88,7 @@ Die Katalogdatei kann nicht kopiert werden: %1 - + Cannot register filter %1! Der Filter kann nicht registriert werden: %1 @@ -120,23 +120,20 @@ QHelpEngineCore - - The specified namespace does not exist! - Der angegebene Namensraum existiert nicht. + + Cannot open documentation file %1: %2! + Die Dokumentationsdatei %1 kann nicht geöffnet werden: %2! - - - QHelpEngineCorePrivate - - Cannot open documentation file %1: %2! - Die Dokumentationsdatei %1 kann nicht geöffnet werden: %2. + + The specified namespace does not exist! + Der angegebene Namensraum existiert nicht. QHelpGenerator - + Invalid help data! Ungültige Hilfe-Daten. @@ -216,7 +213,7 @@ Die Datei %1 kann nicht geöffnet werden. Wird übersprungen. - + The filter %1 is already registered! Der Filter %1 ist bereits registriert. @@ -231,7 +228,7 @@ Indizes einfügen... - + Insert contents... Inhalt einfügen... @@ -245,122 +242,142 @@ Cannot register contents! Inhalt kann nicht registriert werden. + + + File '%1' does not exist. + Die Datei '%1' existiert nicht. + + + + File '%1' cannot be opened. + Die Datei '%1' kann nicht geöffnet werden. + + + + File '%1' contains an invalid link to file '%2' + Die Datei '%1' enthält einen ungültigen Verweis auf die Datei '%2' + + + + Invalid links in HTML files. + Es wurden ungültige Verweise in HTML-Dateien gefunden. + + + + QHelpProject + + + Unknown token. + Unbekanntes Token. + + + + Unknown token. Expected "QtHelpProject"! + Unbekanntes Token. "QtHelpProject" erwartet. + + + + Error in line %1: %2 + Fehler in Zeile %1: %2 + + + + A virtual folder must not contain a '/' character! + Ein virtuelles Verzeichnis darf kein '/'-Zeichen enthalten. + + + + A namespace must not contain a '/' character! + Ein Namensraum darf kein '/'-Zeichen enthalten. + + + + Missing namespace in QtHelpProject. + Fehlender Namensraum in QtHelpProject. + + + + Missing virtual folder in QtHelpProject + Fehlendes virtuelles Verzeichnis in QtHelpProject. + + + + Missing attribute in keyword at line %1. + Fehlendes Attribut in Schlagwort in Zeile %1. + + + + The input file %1 could not be opened! + Die Eingabe-Datei %1 kann nicht geöffnet werden. + QHelpSearchQueryWidget - + Search for: Suche nach: - + Previous search Vorige Suche - + Next search Nächste Suche - + Search Suche - + Advanced search Erweiterte Suche - + words <B>similar</B> to: Worte <B>ähnlich</B> zu: - + <B>without</B> the words: <B>ohne</B> die Wörter: - + with <B>exact phrase</B>: mit der <B>genauen Wortgruppe</B>: - + with <B>all</B> of the words: mit <B>allen</B> Wörtern: - + with <B>at least one</B> of the words: mit <B>irgendeinem</B> der Wörter: QHelpSearchResultWidget + + + %1 - %2 of %n Hits + + %1 - %2 - Ein Treffer + %1 - %2 von %n Treffern + + - + 0 - 0 of 0 Hits 0 - 0 von 0 Treffern - - QHelpSearchResultWidgetPrivate - - - %1 - %2 of %3 Hits - %1 - %2 von %3 Treffern - - - - QObject - - - Unknown token. - Unbekanntes Token. - - - - Unknown token. Expected "QtHelpProject"! - Unbekanntes Token. "QtHelpProject" erwartet. - - - - Error in line %1: %2 - Fehler in Zeile %1: %2 - - - - A virtual folder must not contain a '/' character! - Ein virtuelles Verzeichnis darf kein '/'-Zeichen enthalten. - - - - A namespace must not contain a '/' character! - Ein Namensraum darf kein '/'-Zeichen enthalten. - - - - Missing namespace in QtHelpProject. - Fehlender Namensraum in QtHelpProject. - - - - Missing virtual folder in QtHelpProject - Fehlendes virtuelles Verzeichnis in QtHelpProject. - - - - Missing attribute in keyword at line %1. - Fehlendes Attribut in Schlagwort in Zeile %1. - - - - The input file %1 could not be opened! - Die Eingabe-Datei %1 kann nicht geöffnet werden. - - -- cgit v0.12 From 3dd918dee854ca3a78e411ca92f73bb349505a4d Mon Sep 17 00:00:00 2001 From: ck Date: Wed, 24 Feb 2010 14:13:37 +0100 Subject: Assistant: Make ~AbstractHelpViewer() virtual. --- tools/assistant/tools/assistant/helpviewer.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/assistant/tools/assistant/helpviewer.h b/tools/assistant/tools/assistant/helpviewer.h index 0bfe904..9e8f5f4 100644 --- a/tools/assistant/tools/assistant/helpviewer.h +++ b/tools/assistant/tools/assistant/helpviewer.h @@ -53,7 +53,7 @@ class AbstractHelpViewer { public: AbstractHelpViewer(); - ~AbstractHelpViewer(); + virtual ~AbstractHelpViewer(); virtual QFont viewerFont() const = 0; virtual void setViewerFont(const QFont &font) = 0; -- cgit v0.12 From e5affc9e4a663fc9f690418619f7d7351d1ea7c9 Mon Sep 17 00:00:00 2001 From: ck Date: Wed, 24 Feb 2010 15:48:53 +0100 Subject: Fix compilation with namespace. --- src/plugins/bearer/generic/qgenericengine.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/plugins/bearer/generic/qgenericengine.cpp b/src/plugins/bearer/generic/qgenericengine.cpp index a95b14b..f654038 100644 --- a/src/plugins/bearer/generic/qgenericengine.cpp +++ b/src/plugins/bearer/generic/qgenericengine.cpp @@ -62,6 +62,7 @@ #include #endif +QT_BEGIN_NAMESPACE static QString qGetInterfaceType(const QString &interface) { -- cgit v0.12 From cab764871cc9379ca9757f41dca9e3ed9e9d34aa Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Wed, 24 Feb 2010 18:21:09 +0100 Subject: suppress pointer aliasing warnings the code as such is safe, as no aliasing can occur here. so it is just a matter of making the compiler shut up. Reviewed-by: Olivier Goffart --- src/corelib/tools/qlist.h | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/corelib/tools/qlist.h b/src/corelib/tools/qlist.h index 3a29e13..02d434e 100644 --- a/src/corelib/tools/qlist.h +++ b/src/corelib/tools/qlist.h @@ -525,7 +525,8 @@ Q_OUTOFLINE_TEMPLATE void QList::append(const T &t) PodNode cpy = *reinterpret_cast(&t); Node *n = reinterpret_cast(p.append()); QT_TRY { - node_construct(n, *reinterpret_cast(&cpy)); + void *ptr = &cpy; + node_construct(n, *reinterpret_cast(ptr)); } QT_CATCH(...) { --d->end; QT_RETHROW; @@ -559,7 +560,8 @@ inline void QList::prepend(const T &t) PodNode cpy = *reinterpret_cast(&t); Node *n = reinterpret_cast(p.prepend()); QT_TRY { - node_construct(n, *reinterpret_cast(&cpy)); + void *ptr = &cpy; + node_construct(n, *reinterpret_cast(ptr)); } QT_CATCH(...) { ++d->begin; QT_RETHROW; @@ -593,7 +595,8 @@ inline void QList::insert(int i, const T &t) PodNode cpy = *reinterpret_cast(&t); Node *n = reinterpret_cast(p.insert(i)); QT_TRY { - node_construct(n, *reinterpret_cast(&cpy)); + void *ptr = &cpy; + node_construct(n, *reinterpret_cast(ptr)); } QT_CATCH(...) { p.remove(i); QT_RETHROW; -- cgit v0.12 From e9f3edcb0a0223b90606108993999ad3cb37af9f Mon Sep 17 00:00:00 2001 From: Justin McPherson Date: Thu, 25 Feb 2010 10:07:05 +1000 Subject: QT7; Add support for setting cookies when loading a movie. Reviewed-by: Dmytro Poplavskiy --- .../qt7/mediaplayer/qt7playersession.mm | 31 +++++++++++++++++++--- 1 file changed, 27 insertions(+), 4 deletions(-) diff --git a/src/plugins/mediaservices/qt7/mediaplayer/qt7playersession.mm b/src/plugins/mediaservices/qt7/mediaplayer/qt7playersession.mm index 3f198b9..28e220c 100644 --- a/src/plugins/mediaservices/qt7/mediaplayer/qt7playersession.mm +++ b/src/plugins/mediaservices/qt7/mediaplayer/qt7playersession.mm @@ -48,10 +48,13 @@ #include "qt7playercontrol.h" #include "qt7videooutputcontrol.h" +#include #include #include +#include +#include #include #include @@ -365,17 +368,37 @@ void QT7PlayerSession::setMedia(const QMediaContent &content, QIODevice *stream) m_mediaStream = stream; m_mediaStatus = QMediaPlayer::NoMedia; - QUrl url; + QNetworkRequest request; if (!content.isNull()) - url = content.canonicalUrl(); + request = content.canonicalResource().request(); else return; -// qDebug() << "Open media" << url; + QVariant cookies = request.header(QNetworkRequest::CookieHeader); + if (cookies.isValid()) { + NSHTTPCookieStorage *store = [NSHTTPCookieStorage sharedHTTPCookieStorage]; + QList cookieList = cookies.value >(); + + foreach (const QNetworkCookie &requestCookie, cookieList) { + NSMutableDictionary *p = [NSMutableDictionary dictionaryWithObjectsAndKeys: + (NSString*)qString2CFStringRef(requestCookie.name()), NSHTTPCookieName, + (NSString*)qString2CFStringRef(requestCookie.value()), NSHTTPCookieValue, + (NSString*)qString2CFStringRef(requestCookie.domain()), NSHTTPCookieDomain, + (NSString*)qString2CFStringRef(requestCookie.path()), NSHTTPCookiePath, + nil + ]; + if (requestCookie.isSessionCookie()) + [p setObject:[NSString stringWithUTF8String:"TRUE"] forKey:NSHTTPCookieDiscard]; + else + [p setObject:[NSDate dateWithTimeIntervalSince1970:requestCookie.expirationDate().toTime_t()] forKey:NSHTTPCookieExpires]; + + [store setCookie:[NSHTTPCookie cookieWithProperties:p]]; + } + } NSError *err = 0; - NSString *urlString = (NSString *)qString2CFStringRef(url.toString()); + NSString *urlString = (NSString *)qString2CFStringRef(request.url().toString()); NSDictionary *attr = [NSDictionary dictionaryWithObjectsAndKeys: [NSURL URLWithString:urlString], QTMovieURLAttribute, -- cgit v0.12 From f2d89dee45e2f08e8e7613c18660c5c3e133c0ff Mon Sep 17 00:00:00 2001 From: Andrew den Exter Date: Thu, 25 Feb 2010 12:52:23 +1000 Subject: Remove all uses of __uuidof from the Direct Show media service. It's unnecessary and not supported on all compilers. Reviewed-by: Justin McPherson --- .../mediaplayer/directshowaudioendpointcontrol.cpp | 5 +- .../directshow/mediaplayer/directshowglobal.h | 10 ++-- .../directshow/mediaplayer/directshowioreader.cpp | 2 +- .../directshow/mediaplayer/directshowiosource.cpp | 4 +- .../mediaplayer/directshowmetadatacontrol.cpp | 2 +- .../mediaplayer/directshowplayercontrol.cpp | 2 +- .../mediaplayer/directshowplayerservice.cpp | 53 ++++++++++++---------- .../mediaplayer/directshowplayerservice.h | 1 - .../directshow/mediaplayer/videosurfacefilter.cpp | 4 +- .../mediaplayer/vmr9videowindowcontrol.cpp | 27 +++++++---- 10 files changed, 59 insertions(+), 51 deletions(-) diff --git a/src/plugins/mediaservices/directshow/mediaplayer/directshowaudioendpointcontrol.cpp b/src/plugins/mediaservices/directshow/mediaplayer/directshowaudioendpointcontrol.cpp index 570b44a..30c05ed 100644 --- a/src/plugins/mediaservices/directshow/mediaplayer/directshowaudioendpointcontrol.cpp +++ b/src/plugins/mediaservices/directshow/mediaplayer/directshowaudioendpointcontrol.cpp @@ -55,7 +55,7 @@ DirectShowAudioEndpointControl::DirectShowAudioEndpointControl( , m_deviceEnumerator(0) { if (CreateBindCtx(0, &m_bindContext) == S_OK) { - m_deviceEnumerator = com_new(CLSID_SystemDeviceEnum); + m_deviceEnumerator = com_new(CLSID_SystemDeviceEnum, IID_ICreateDevEnum); updateEndpoints(); @@ -96,6 +96,7 @@ QString DirectShowAudioEndpointControl::endpointDescription(const QString &name) propertyBag->Release(); } } + return description;; } @@ -120,7 +121,7 @@ void DirectShowAudioEndpointControl::setActiveEndpoint(const QString &name) if (moniker->BindToObject( m_bindContext, 0, - __uuidof(IBaseFilter), + IID_IBaseFilter, reinterpret_cast(&filter)) == S_OK) { m_service->setAudioOutput(filter); diff --git a/src/plugins/mediaservices/directshow/mediaplayer/directshowglobal.h b/src/plugins/mediaservices/directshow/mediaplayer/directshowglobal.h index 1c9fe54..7601672 100644 --- a/src/plugins/mediaservices/directshow/mediaplayer/directshowglobal.h +++ b/src/plugins/mediaservices/directshow/mediaplayer/directshowglobal.h @@ -44,28 +44,26 @@ #include - QT_BEGIN_HEADER QT_BEGIN_NAMESPACE -template T *com_cast(IUnknown *unknown) +template T *com_cast(IUnknown *unknown, const IID &iid) { T *iface = 0; - return unknown && unknown->QueryInterface( - __uuidof(T), reinterpret_cast(&iface)) == S_OK + return unknown && unknown->QueryInterface(iid, reinterpret_cast(&iface)) == S_OK ? iface : 0; } -template T *com_new(const IID &clsid) +template T *com_new(const IID &clsid, const IID &iid) { T *object = 0; return CoCreateInstance( clsid, NULL, CLSCTX_INPROC_SERVER, - __uuidof(T), + iid, reinterpret_cast(&object)) == S_OK ? object : 0; diff --git a/src/plugins/mediaservices/directshow/mediaplayer/directshowioreader.cpp b/src/plugins/mediaservices/directshow/mediaplayer/directshowioreader.cpp index 54446b8..7369099 100644 --- a/src/plugins/mediaservices/directshow/mediaplayer/directshowioreader.cpp +++ b/src/plugins/mediaservices/directshow/mediaplayer/directshowioreader.cpp @@ -143,7 +143,7 @@ HRESULT DirectShowIOReader::RequestAllocator( return S_OK; } else { - *ppActual = com_new(CLSID_MemoryAllocator); + *ppActual = com_new(CLSID_MemoryAllocator, IID_IMemAllocator); if (*ppActual) { if ((*ppActual)->SetProperties(pProps, &actualProperties) != S_OK) { diff --git a/src/plugins/mediaservices/directshow/mediaplayer/directshowiosource.cpp b/src/plugins/mediaservices/directshow/mediaplayer/directshowiosource.cpp index 1dca465..15bfea5 100644 --- a/src/plugins/mediaservices/directshow/mediaplayer/directshowiosource.cpp +++ b/src/plugins/mediaservices/directshow/mediaplayer/directshowiosource.cpp @@ -414,8 +414,8 @@ HRESULT DirectShowIOSource::tryConnect(IPin *pin, const AM_MEDIA_TYPE *type) } else if (!m_allocator) { hr = VFW_E_NO_TRANSPORT; - if (IMemInputPin *memPin = com_cast(pin)) { - if ((m_allocator = com_new(CLSID_MemoryAllocator))) { + if (IMemInputPin *memPin = com_cast(pin, IID_IMemInputPin)) { + if ((m_allocator = com_new(CLSID_MemoryAllocator, IID_IMemAllocator))) { ALLOCATOR_PROPERTIES properties; if (memPin->GetAllocatorRequirements(&properties) == S_OK || m_allocator->GetProperties(&properties) == S_OK) { diff --git a/src/plugins/mediaservices/directshow/mediaplayer/directshowmetadatacontrol.cpp b/src/plugins/mediaservices/directshow/mediaplayer/directshowmetadatacontrol.cpp index 7b2552f..a33041e 100644 --- a/src/plugins/mediaservices/directshow/mediaplayer/directshowmetadatacontrol.cpp +++ b/src/plugins/mediaservices/directshow/mediaplayer/directshowmetadatacontrol.cpp @@ -344,7 +344,7 @@ void DirectShowMetaDataControl::updateGraph(IFilterGraph2 *graph, IBaseFilter *s if (m_headerInfo) m_headerInfo->Release(); - m_headerInfo = com_cast(source); + m_headerInfo = com_cast(source, IID_IWMHeaderInfo); #endif // DirectShowMediaPlayerService holds a lock at this point so defer emitting signals to a later // time. diff --git a/src/plugins/mediaservices/directshow/mediaplayer/directshowplayercontrol.cpp b/src/plugins/mediaservices/directshow/mediaplayer/directshowplayercontrol.cpp index b024557..bb7bac3 100644 --- a/src/plugins/mediaservices/directshow/mediaplayer/directshowplayercontrol.cpp +++ b/src/plugins/mediaservices/directshow/mediaplayer/directshowplayercontrol.cpp @@ -371,7 +371,7 @@ void DirectShowPlayerControl::updateAudioOutput(IBaseFilter *filter) if (m_audio) m_audio->Release(); - m_audio = com_cast(filter); + m_audio = com_cast(filter, IID_IBasicAudio); } void DirectShowPlayerControl::updateError(QMediaPlayer::Error error, const QString &errorString) diff --git a/src/plugins/mediaservices/directshow/mediaplayer/directshowplayerservice.cpp b/src/plugins/mediaservices/directshow/mediaplayer/directshowplayerservice.cpp index 57f4bec..649f3fb 100644 --- a/src/plugins/mediaservices/directshow/mediaplayer/directshowplayerservice.cpp +++ b/src/plugins/mediaservices/directshow/mediaplayer/directshowplayerservice.cpp @@ -205,7 +205,7 @@ void DirectShowPlayerService::load(const QMediaContent &media, QIODevice *stream } else { m_graphStatus = Loading; - m_graph = com_new(CLSID_FilterGraph); + m_graph = com_new(CLSID_FilterGraph, IID_IFilterGraph2); if (stream) m_pendingTasks = SetStreamSource; @@ -233,13 +233,14 @@ void DirectShowPlayerService::doSetUrlSource(QMutexLocker *locker) #ifndef QT_NO_WMSDK if (url.scheme() == QLatin1String("http") || url.scheme() == QLatin1String("https")) { - if (IFileSourceFilter *fileSource = com_new(CLSID_WMAsfReader)) { + if (IFileSourceFilter *fileSource = com_new( + CLSID_WMAsfReader, IID_IFileSourceFilter)) { locker->unlock(); hr = fileSource->Load(url.toString().utf16(), 0); locker->relock(); if (SUCCEEDED(hr)) { - source = com_cast(fileSource); + source = com_cast(fileSource, IID_IBaseFilter); if (!SUCCEEDED(hr = m_graph->AddFilter(source, L"Source")) && source) { source->Release(); @@ -342,7 +343,7 @@ void DirectShowPlayerService::doRender(QMutexLocker *locker) { m_pendingTasks |= m_executedTasks & (Play | Pause); - if (IMediaControl *control = com_cast(m_graph)) { + if (IMediaControl *control = com_cast(m_graph, IID_IMediaControl)) { control->Stop(); control->Release(); } @@ -462,11 +463,11 @@ void DirectShowPlayerService::doRender(QMutexLocker *locker) void DirectShowPlayerService::doFinalizeLoad(QMutexLocker *locker) { if (m_graphStatus != Loaded) { - if (IMediaEvent *event = com_cast(m_graph)) { + if (IMediaEvent *event = com_cast(m_graph, IID_IMediaEvent)) { event->GetEventHandle(reinterpret_cast(&m_eventHandle)); event->Release(); } - if (IMediaSeeking *seeking = com_cast(m_graph)) { + if (IMediaSeeking *seeking = com_cast(m_graph, IID_IMediaSeeking)) { LONGLONG duration = 0; seeking->GetDuration(&duration); m_duration = duration / 10; @@ -496,7 +497,8 @@ void DirectShowPlayerService::releaseGraph() { if (m_graph) { if (m_executingTask != 0) { - if (IAMOpenProgress *progress = com_cast(m_graph)) { + if (IAMOpenProgress *progress = com_cast( + m_graph, IID_IAMOpenProgress)) { progress->AbortOperation(); progress->Release(); } @@ -515,7 +517,7 @@ void DirectShowPlayerService::doReleaseGraph(QMutexLocker *locker) { Q_UNUSED(locker); - if (IMediaControl *control = com_cast(m_graph)) { + if (IMediaControl *control = com_cast(m_graph, IID_IMediaControl)) { control->Stop(); control->Release(); } @@ -630,7 +632,7 @@ void DirectShowPlayerService::play() void DirectShowPlayerService::doPlay(QMutexLocker *locker) { - if (IMediaControl *control = com_cast(m_graph)) { + if (IMediaControl *control = com_cast(m_graph, IID_IMediaControl)) { locker->unlock(); HRESULT hr = control->Run(); locker->relock(); @@ -672,7 +674,7 @@ void DirectShowPlayerService::pause() void DirectShowPlayerService::doPause(QMutexLocker *locker) { - if (IMediaControl *control = com_cast(m_graph)) { + if (IMediaControl *control = com_cast(m_graph, IID_IMediaControl)) { locker->unlock(); HRESULT hr = control->Pause(); locker->relock(); @@ -680,7 +682,7 @@ void DirectShowPlayerService::doPause(QMutexLocker *locker) control->Release(); if (SUCCEEDED(hr)) { - if (IMediaSeeking *seeking = com_cast(m_graph)) { + if (IMediaSeeking *seeking = com_cast(m_graph, IID_IMediaSeeking)) { LONGLONG position = 0; seeking->GetCurrentPosition(&position); @@ -723,12 +725,12 @@ void DirectShowPlayerService::stop() void DirectShowPlayerService::doStop(QMutexLocker *locker) { if (m_executedTasks & (Play | Pause)) { - if (IMediaControl *control = com_cast(m_graph)) { + if (IMediaControl *control = com_cast(m_graph, IID_IMediaControl)) { control->Stop(); control->Release(); } - if (IMediaSeeking *seeking = com_cast(m_graph)) { + if (IMediaSeeking *seeking = com_cast(m_graph, IID_IMediaSeeking)) { LONGLONG position = 0; seeking->GetCurrentPosition(&position); @@ -763,7 +765,7 @@ void DirectShowPlayerService::setRate(qreal rate) void DirectShowPlayerService::doSetRate(QMutexLocker *locker) { - if (IMediaSeeking *seeking = com_cast(m_graph)) { + if (IMediaSeeking *seeking = com_cast(m_graph, IID_IMediaSeeking)) { // Cache current values as we can't query IMediaSeeking during a seek due to the // possibility of a deadlock when flushing the VideoSurfaceFilter. LONGLONG currentPosition = 0; @@ -801,7 +803,7 @@ qint64 DirectShowPlayerService::position() const if (m_graphStatus == Loaded) { if (m_executingTask == Seek || m_executingTask == SetRate) { return m_position; - } else if (IMediaSeeking *seeking = com_cast(m_graph)) { + } else if (IMediaSeeking *seeking = com_cast(m_graph, IID_IMediaSeeking)) { LONGLONG position = 0; seeking->GetCurrentPosition(&position); @@ -822,7 +824,7 @@ QMediaTimeRange DirectShowPlayerService::availablePlaybackRanges() const if (m_graphStatus == Loaded) { if (m_executingTask == Seek || m_executingTask == SetRate) { return m_playbackRange; - } else if (IMediaSeeking *seeking = com_cast(m_graph)) { + } else if (IMediaSeeking *seeking = com_cast(m_graph, IID_IMediaSeeking)) { LONGLONG minimum = 0; LONGLONG maximum = 0; @@ -850,7 +852,7 @@ void DirectShowPlayerService::seek(qint64 position) void DirectShowPlayerService::doSeek(QMutexLocker *locker) { - if (IMediaSeeking *seeking = com_cast(m_graph)) { + if (IMediaSeeking *seeking = com_cast(m_graph, IID_IMediaSeeking)) { LONGLONG seekPosition = LONGLONG(m_position) * 10; // Cache current values as we can't query IMediaSeeking during a seek due to the @@ -886,7 +888,8 @@ int DirectShowPlayerService::bufferStatus() const #ifndef QT_NO_WMSDK QMutexLocker locker(const_cast(&m_mutex)); - if (IWMReaderAdvanced2 *reader = com_cast(m_source)) { + if (IWMReaderAdvanced2 *reader = com_cast( + m_source, IID_IWMReaderAdvanced2)) { DWORD percentage = 0; reader->GetBufferProgress(&percentage, 0); @@ -949,7 +952,7 @@ void DirectShowPlayerService::doReleaseAudioOutput(QMutexLocker *locker) { m_pendingTasks |= m_executedTasks & (Play | Pause); - if (IMediaControl *control = com_cast(m_graph)) { + if (IMediaControl *control = com_cast(m_graph, IID_IMediaControl)) { control->Stop(); control->Release(); } @@ -960,7 +963,7 @@ void DirectShowPlayerService::doReleaseAudioOutput(QMutexLocker *locker) decoder->AddRef(); } - if (IFilterChain *chain = com_cast(m_graph)) { + if (IFilterChain *chain = com_cast(m_graph, IID_IFilterChain)) { chain->RemoveChain(decoder, m_audioOutput); chain->Release(); } else { @@ -1018,7 +1021,7 @@ void DirectShowPlayerService::doReleaseVideoOutput(QMutexLocker *locker) { m_pendingTasks |= m_executedTasks & (Play | Pause); - if (IMediaControl *control = com_cast(m_graph)) { + if (IMediaControl *control = com_cast(m_graph, IID_IMediaControl)) { control->Stop(); control->Release(); } @@ -1035,7 +1038,7 @@ void DirectShowPlayerService::doReleaseVideoOutput(QMutexLocker *locker) decoder->AddRef(); } - if (IFilterChain *chain = com_cast(m_graph)) { + if (IFilterChain *chain = com_cast(m_graph, IID_IFilterChain)) { chain->RemoveChain(decoder, m_videoOutput); chain->Release(); } else { @@ -1118,7 +1121,7 @@ void DirectShowPlayerService::videoOutputChanged() void DirectShowPlayerService::graphEvent(QMutexLocker *locker) { - if (IMediaEvent *event = com_cast(m_graph)) { + if (IMediaEvent *event = com_cast(m_graph, IID_IMediaEvent)) { long eventCode; LONG_PTR param1; LONG_PTR param2; @@ -1137,7 +1140,7 @@ void DirectShowPlayerService::graphEvent(QMutexLocker *locker) m_buffering = false; m_atEnd = true; - if (IMediaSeeking *seeking = com_cast(m_graph)) { + if (IMediaSeeking *seeking = com_cast(m_graph, IID_IMediaSeeking)) { LONGLONG position = 0; seeking->GetCurrentPosition(&position); @@ -1149,7 +1152,7 @@ void DirectShowPlayerService::graphEvent(QMutexLocker *locker) QCoreApplication::postEvent(this, new QEvent(QEvent::Type(EndOfMedia))); break; case EC_LENGTH_CHANGED: - if (IMediaSeeking *seeking = com_cast(m_graph)) { + if (IMediaSeeking *seeking = com_cast(m_graph, IID_IMediaSeeking)) { LONGLONG duration = 0; seeking->GetDuration(&duration); m_duration = duration / 10; diff --git a/src/plugins/mediaservices/directshow/mediaplayer/directshowplayerservice.h b/src/plugins/mediaservices/directshow/mediaplayer/directshowplayerservice.h index a5da9a4..23515d0 100644 --- a/src/plugins/mediaservices/directshow/mediaplayer/directshowplayerservice.h +++ b/src/plugins/mediaservices/directshow/mediaplayer/directshowplayerservice.h @@ -57,7 +57,6 @@ #include - QT_BEGIN_HEADER QT_BEGIN_NAMESPACE diff --git a/src/plugins/mediaservices/directshow/mediaplayer/videosurfacefilter.cpp b/src/plugins/mediaservices/directshow/mediaplayer/videosurfacefilter.cpp index 7b4aad5..94b6f24 100644 --- a/src/plugins/mediaservices/directshow/mediaplayer/videosurfacefilter.cpp +++ b/src/plugins/mediaservices/directshow/mediaplayer/videosurfacefilter.cpp @@ -446,7 +446,7 @@ HRESULT VideoSurfaceFilter::EndOfStream() QMutexLocker locker(&m_mutex); if (!m_sampleScheduler.scheduleEndOfStream()) { - if (IMediaEventSink *sink = com_cast(m_graph)) { + if (IMediaEventSink *sink = com_cast(m_graph, IID_IMediaEventSink)) { sink->Notify( EC_COMPLETE, S_OK, @@ -610,7 +610,7 @@ void VideoSurfaceFilter::sampleReady() sample->Release(); if (eos) { - if (IMediaEventSink *sink = com_cast(m_graph)) { + if (IMediaEventSink *sink = com_cast(m_graph, IID_IMediaEventSink)) { sink->Notify( EC_COMPLETE, S_OK, diff --git a/src/plugins/mediaservices/directshow/mediaplayer/vmr9videowindowcontrol.cpp b/src/plugins/mediaservices/directshow/mediaplayer/vmr9videowindowcontrol.cpp index a564e14..b1ddd98 100644 --- a/src/plugins/mediaservices/directshow/mediaplayer/vmr9videowindowcontrol.cpp +++ b/src/plugins/mediaservices/directshow/mediaplayer/vmr9videowindowcontrol.cpp @@ -48,7 +48,7 @@ QT_BEGIN_NAMESPACE Vmr9VideoWindowControl::Vmr9VideoWindowControl(QObject *parent) : QVideoWindowControl(parent) - , m_filter(com_new(CLSID_VideoMixingRenderer9)) + , m_filter(com_new(CLSID_VideoMixingRenderer9, IID_IBaseFilter)) , m_windowId(0) , m_dirtyValues(0) , m_brightness(0) @@ -57,7 +57,7 @@ Vmr9VideoWindowControl::Vmr9VideoWindowControl(QObject *parent) , m_saturation(0) , m_fullScreen(false) { - if (IVMRFilterConfig9 *config = com_cast(m_filter)) { + if (IVMRFilterConfig9 *config = com_cast(m_filter, IID_IVMRFilterConfig9)) { config->SetRenderingMode(VMR9Mode_Windowless); config->SetNumberOfStreams(1); config->Release(); @@ -81,7 +81,8 @@ void Vmr9VideoWindowControl::setWinId(WId id) { m_windowId = id; - if (IVMRWindowlessControl9 *control = com_cast(m_filter)) { + if (IVMRWindowlessControl9 *control = com_cast( + m_filter, IID_IVMRWindowlessControl9)) { control->SetVideoClippingWindow(m_windowId); control->Release(); } @@ -91,7 +92,8 @@ QRect Vmr9VideoWindowControl::displayRect() const { QRect rect; - if (IVMRWindowlessControl9 *control = com_cast(m_filter)) { + if (IVMRWindowlessControl9 *control = com_cast( + m_filter, IID_IVMRWindowlessControl9)) { RECT sourceRect; RECT displayRect; @@ -109,7 +111,8 @@ QRect Vmr9VideoWindowControl::displayRect() const void Vmr9VideoWindowControl::setDisplayRect(const QRect &rect) { - if (IVMRWindowlessControl9 *control = com_cast(m_filter)) { + if (IVMRWindowlessControl9 *control = com_cast( + m_filter, IID_IVMRWindowlessControl9)) { RECT sourceRect = { 0, 0, 0, 0 }; RECT displayRect = { rect.left(), rect.top(), rect.right(), rect.bottom() }; @@ -134,7 +137,8 @@ void Vmr9VideoWindowControl::repaint() if (QWidget *widget = QWidget::find(m_windowId)) { HDC dc = widget->getDC(); - if (IVMRWindowlessControl9 *control = com_cast(m_filter)) { + if (IVMRWindowlessControl9 *control = com_cast( + m_filter, IID_IVMRWindowlessControl9)) { control->RepaintVideo(m_windowId, dc); control->Release(); } @@ -146,7 +150,8 @@ QSize Vmr9VideoWindowControl::nativeSize() const { QSize size; - if (IVMRWindowlessControl9 *control = com_cast(m_filter)) { + if (IVMRWindowlessControl9 *control = com_cast( + m_filter, IID_IVMRWindowlessControl9)) { LONG width; LONG height; @@ -161,7 +166,8 @@ QVideoWidget::AspectRatioMode Vmr9VideoWindowControl::aspectRatioMode() const { QVideoWidget::AspectRatioMode mode = QVideoWidget::KeepAspectRatio; - if (IVMRWindowlessControl9 *control = com_cast(m_filter)) { + if (IVMRWindowlessControl9 *control = com_cast( + m_filter, IID_IVMRWindowlessControl9)) { DWORD arMode; if (control->GetAspectRatioMode(&arMode) == S_OK && arMode == VMR9ARMode_None) @@ -173,7 +179,8 @@ QVideoWidget::AspectRatioMode Vmr9VideoWindowControl::aspectRatioMode() const void Vmr9VideoWindowControl::setAspectRatioMode(QVideoWidget::AspectRatioMode mode) { - if (IVMRWindowlessControl9 *control = com_cast(m_filter)) { + if (IVMRWindowlessControl9 *control = com_cast( + m_filter, IID_IVMRWindowlessControl9)) { switch (mode) { case QVideoWidget::IgnoreAspectRatio: control->SetAspectRatioMode(VMR9ARMode_None); @@ -254,7 +261,7 @@ void Vmr9VideoWindowControl::setSaturation(int saturation) void Vmr9VideoWindowControl::setProcAmpValues() { - if (IVMRMixerControl9 *control = com_cast(m_filter)) { + if (IVMRMixerControl9 *control = com_cast(m_filter, IID_IVMRMixerControl9)) { VMR9ProcAmpControl procAmp; procAmp.dwSize = sizeof(VMR9ProcAmpControl); procAmp.dwFlags = m_dirtyValues; -- cgit v0.12 From 190ec169dd6f5455115e5164cfbacdad214de00a Mon Sep 17 00:00:00 2001 From: Dmytro Poplavskiy Date: Thu, 25 Feb 2010 12:52:29 +1000 Subject: Try to start media playback on all load state changes. QuickTime doesn't start movie playback as soon as it loaded, it's necessary to start manualy after suitable load state reached. Reviewed-by: Justin McPherson --- .../qt7/mediaplayer/qt7playersession.h | 6 +- .../qt7/mediaplayer/qt7playersession.mm | 64 ++++++++++++---------- 2 files changed, 40 insertions(+), 30 deletions(-) diff --git a/src/plugins/mediaservices/qt7/mediaplayer/qt7playersession.h b/src/plugins/mediaservices/qt7/mediaplayer/qt7playersession.h index 4742e2e..0ba3041 100644 --- a/src/plugins/mediaservices/qt7/mediaplayer/qt7playersession.h +++ b/src/plugins/mediaservices/qt7/mediaplayer/qt7playersession.h @@ -107,7 +107,7 @@ public slots: void setMuted(bool muted); void processEOS(); - void processStateChange(); + void processLoadStateChange(); void processVolumeChange(); void processNaturalSizeChange(); @@ -138,6 +138,10 @@ private: bool m_muted; int m_volume; qreal m_rate; + + qint64 m_duration; + bool m_videoAvailable; + bool m_audioAvailable; }; QT_END_NAMESPACE diff --git a/src/plugins/mediaservices/qt7/mediaplayer/qt7playersession.mm b/src/plugins/mediaservices/qt7/mediaplayer/qt7playersession.mm index 28e220c..2dd3fe8 100644 --- a/src/plugins/mediaservices/qt7/mediaplayer/qt7playersession.mm +++ b/src/plugins/mediaservices/qt7/mediaplayer/qt7playersession.mm @@ -68,7 +68,9 @@ - (QTMovieObserver *) initWithPlayerSession:(QT7PlayerSession*)session; - (void) setMovie:(QTMovie *)movie; - (void) processEOS:(NSNotification *)notification; -- (void) processStateChange:(NSNotification *)notification; +- (void) processLoadStateChange:(NSNotification *)notification; +- (void) processVolumeChange:(NSNotification *)notification; +- (void) processNaturalSizeChange :(NSNotification *)notification; @end @implementation QTMovieObserver @@ -101,7 +103,7 @@ object:m_movie]; [[NSNotificationCenter defaultCenter] addObserver:self - selector:@selector(processStateChange:) + selector:@selector(processLoadStateChange:) name:QTMovieLoadStateDidChangeNotification object:m_movie]; @@ -129,10 +131,10 @@ m_session->processEOS(); } -- (void) processStateChange:(NSNotification *)notification +- (void) processLoadStateChange:(NSNotification *)notification { Q_UNUSED(notification); - m_session->processStateChange(); + m_session->processLoadStateChange(); } - (void) processVolumeChange:(NSNotification *)notification @@ -167,6 +169,9 @@ QT7PlayerSession::QT7PlayerSession(QObject *parent) , m_muted(false) , m_volume(100) , m_rate(1.0) + , m_duration(0) + , m_videoAvailable(false) + , m_audioAvailable(false) { m_movieObserver = [[QTMovieObserver alloc] initWithPlayerSession:this]; } @@ -174,7 +179,7 @@ QT7PlayerSession::QT7PlayerSession(QObject *parent) QT7PlayerSession::~QT7PlayerSession() { [(QTMovieObserver*)m_movieObserver setMovie:nil]; - [(QTMovieObserver*)m_movieObserver release]; + [(QTMovieObserver*)m_movieObserver release]; } void *QT7PlayerSession::movie() const @@ -423,7 +428,7 @@ void QT7PlayerSession::setMedia(const QMediaContent &content, QIODevice *stream) m_videoOutput->setMovie(m_QTMovie); m_videoOutput->setEnabled(true); } - processStateChange(); + processLoadStateChange(); [(QTMovie*)m_QTMovie setMuted:m_muted]; setVolume(m_volume); @@ -455,8 +460,11 @@ void QT7PlayerSession::processEOS() emit mediaStatusChanged(m_mediaStatus); } -void QT7PlayerSession::processStateChange() +void QT7PlayerSession::processLoadStateChange() { + if (!m_QTMovie) + return; + signed long state = [[(QTMovie*)m_QTMovie attributeForKey:QTMovieLoadStateAttribute] longValue]; // qDebug() << "Moview load state changed:" << state; @@ -484,32 +492,30 @@ void QT7PlayerSession::processStateChange() if (state == kMovieLoadStateError) { newStatus = QMediaPlayer::InvalidMedia; - emit error(QMediaPlayer::FormatError, tr("Playback failed")); + emit error(QMediaPlayer::FormatError, tr("Failed to load media")); + emit stateChanged(m_state = QMediaPlayer::StoppedState); } - if (newStatus != m_mediaStatus) { - switch (newStatus) { - case QMediaPlayer::BufferedMedia: - case QMediaPlayer::BufferingMedia: - //delayed playback start is necessary for network sources - if (m_state == QMediaPlayer::PlayingState) { - QMetaObject::invokeMethod(this, "play", Qt::QueuedConnection); - } - //fall - case QMediaPlayer::LoadedMedia: - case QMediaPlayer::LoadingMedia: - emit durationChanged(duration()); - emit audioAvailableChanged(isAudioAvailable()); - emit videoAvailableChanged(isVideoAvailable()); - break; - case QMediaPlayer::InvalidMedia: - emit stateChanged(m_state = QMediaPlayer::StoppedState); - default: - break; - } + if (state >= kMovieLoadStatePlayable && + m_state == QMediaPlayer::PlayingState && + [(QTMovie*)m_QTMovie rate] == 0) { + QMetaObject::invokeMethod(this, "play", Qt::QueuedConnection); + } - emit mediaStatusChanged(m_mediaStatus = newStatus); + if (state >= kMovieLoadStateLoaded) { + qint64 currentDuration = duration(); + if (m_duration != currentDuration) + emit durationChanged(m_duration = currentDuration); + + if (m_audioAvailable != isAudioAvailable()) + emit audioAvailableChanged(m_audioAvailable = !m_audioAvailable); + + if (m_videoAvailable != isVideoAvailable()) + emit videoAvailableChanged(m_videoAvailable = !m_videoAvailable); } + + if (newStatus != m_mediaStatus) + emit mediaStatusChanged(m_mediaStatus = newStatus); } void QT7PlayerSession::processVolumeChange() -- cgit v0.12 From 44accdad194251062be74aeafac2cc9d856df479 Mon Sep 17 00:00:00 2001 From: Andrew den Exter Date: Thu, 25 Feb 2010 12:56:05 +1000 Subject: Test for the existance of the Windows Media SDK in configure. Some filters use interfaces from the windows media sdk instead of those from direct show. These interfaces aren't required for playback, but can provide better feedback about the current media than would otherwise be available. Reviewed-by: Justin McPherson --- .../mediaservices/directshow/mediaplayer/mediaplayer.pri | 2 +- tools/configure/configureapp.cpp | 11 ++++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/plugins/mediaservices/directshow/mediaplayer/mediaplayer.pri b/src/plugins/mediaservices/directshow/mediaplayer/mediaplayer.pri index a7adb38..99a1191 100644 --- a/src/plugins/mediaservices/directshow/mediaplayer/mediaplayer.pri +++ b/src/plugins/mediaservices/directshow/mediaplayer/mediaplayer.pri @@ -2,7 +2,7 @@ INCLUDEPATH += $$PWD DEFINES += QMEDIA_DIRECTSHOW_PLAYER -win32-g++: DEFINES += QT_NO_WMSDK +!contains(QT_CONFIG, wmsdk): DEFINES += QT_NO_WMSDK HEADERS += \ $$PWD/directshowaudioendpointcontrol.h \ diff --git a/tools/configure/configureapp.cpp b/tools/configure/configureapp.cpp index 172dcd4..cfc7e24 100644 --- a/tools/configure/configureapp.cpp +++ b/tools/configure/configureapp.cpp @@ -249,6 +249,7 @@ Configure::Configure( int& argc, char** argv ) dictionary[ "MULTIMEDIA" ] = "yes"; dictionary[ "AUDIO_BACKEND" ] = "auto"; dictionary[ "MEDIASERVICE"] = "auto"; + dictionary[ "WMSDK" ] = "auto"; dictionary[ "DIRECTSHOW" ] = "no"; dictionary[ "WEBKIT" ] = "auto"; dictionary[ "DECLARATIVE" ] = "auto"; @@ -1585,6 +1586,7 @@ bool Configure::displayHelp() "[-qtnamespace ] [-qtlibinfix ] [-no-phonon]\n" "[-phonon] [-no-phonon-backend] [-phonon-backend]\n" "[-no-multimedia] [-multimedia] [-no-audio-backend] [-audio-backend]\n" + "[-no-mediaservice] [-mediaservice]\n" "[-no-script] [-script] [-no-scripttools] [-scripttools]\n" "[-no-webkit] [-webkit] [-graphicssystem raster|opengl|openvg]\n\n", 0, 7); @@ -2069,6 +2071,8 @@ bool Configure::checkAvailability(const QString &part) if (!findFile("msdmo.lib")) cout << "msdmo.lib not found" << endl; if (!findFile("d3d9.h")) cout << "d3d9.h not found" << endl; } + } else if (part == "WMSDK") { + available = findFile("wmsdk.h"); } else if (part == "MULTIMEDIA" || part == "SCRIPT" || part == "SCRIPTTOOLS") { available = true; } else if (part == "WEBKIT") { @@ -2213,6 +2217,8 @@ void Configure::autoDetection() dictionary["AUDIO_BACKEND"] = checkAvailability("AUDIO_BACKEND") ? "yes" : "no"; if (dictionary["MEDIASERVICE"] == "auto") dictionary["MEDIASERVICE"] = checkAvailability("MEDIASERVICE") ? "yes" : "no"; + if (dictionary["WMSDK"] == "auto") + dictionary["WMSDK"] = checkAvailability("WMSDK") ? "yes" : "no"; // Qt/WinCE remote test application if (dictionary["CETEST"] == "auto") @@ -2603,8 +2609,11 @@ void Configure::generateOutputVars() qtConfig += "multimedia"; if (dictionary["AUDIO_BACKEND"] == "yes") qtConfig += "audio-backend"; - if (dictionary["MEDIASERVICE"] == "yes") + if (dictionary["MEDIASERVICE"] == "yes") { qtConfig += "mediaservice"; + if (dictionary["WMSDK"] == "yes") + qtConfig += "wmsdk"; + } } if (dictionary["WEBKIT"] == "yes") -- cgit v0.12 From 9a8a35d829ff62fa7ea213ff31f52f0dee00ec78 Mon Sep 17 00:00:00 2001 From: Dmytro Poplavskiy Date: Thu, 25 Feb 2010 12:56:25 +1000 Subject: Use the monitor color space for video output. Currently the main monitor color space is used. Colorspace correction is disabled by default for renderer video output, since video frames can on any output device, not only on the main monitor. Reviewed-by: Justin McPherson --- src/plugins/mediaservices/qt7/qt7movierenderer.mm | 21 ++++++++++++++++++++- .../mediaservices/qt7/qt7movievideowidget.mm | 17 ++++++++++++++--- 2 files changed, 34 insertions(+), 4 deletions(-) diff --git a/src/plugins/mediaservices/qt7/qt7movierenderer.mm b/src/plugins/mediaservices/qt7/qt7movierenderer.mm index 6b9fd21..1c1f5e4 100644 --- a/src/plugins/mediaservices/qt7/qt7movierenderer.mm +++ b/src/plugins/mediaservices/qt7/qt7movierenderer.mm @@ -58,6 +58,8 @@ QT_BEGIN_NAMESPACE +//#define USE_MAIN_MONITOR_COLOR_SPACE 1 + class CVGLTextureVideoBuffer : public QAbstractVideoBuffer { public: @@ -233,7 +235,24 @@ bool QT7MovieRenderer::createPixelBufferVisualContext() &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks); CFDictionarySetValue(visualContextOptions, kQTVisualContextPixelBufferAttributesKey, pixelBufferOptions); - CFDictionarySetValue(visualContextOptions, kQTVisualContextWorkingColorSpaceKey, CGColorSpaceCreateDeviceRGB()); + + CGColorSpaceRef colorSpace = NULL; + +#if USE_MAIN_MONITOR_COLOR_SPACE + CMProfileRef sysprof = NULL; + + // Get the Systems Profile for the main display + if (CMGetSystemProfile(&sysprof) == noErr) { + // Create a colorspace with the systems profile + colorSpace = CGColorSpaceCreateWithPlatformColorSpace(sysprof); + CMCloseProfile(sysprof); + } +#endif + + if (!colorSpace) + colorSpace = CGColorSpaceCreateDeviceRGB(); + + CFDictionarySetValue(visualContextOptions, kQTVisualContextOutputColorSpaceKey, colorSpace); OSStatus err = QTPixelBufferContextCreate(kCFAllocatorDefault, visualContextOptions, diff --git a/src/plugins/mediaservices/qt7/qt7movievideowidget.mm b/src/plugins/mediaservices/qt7/qt7movievideowidget.mm index 4043330..00ceffc 100644 --- a/src/plugins/mediaservices/qt7/qt7movievideowidget.mm +++ b/src/plugins/mediaservices/qt7/qt7movievideowidget.mm @@ -199,7 +199,6 @@ QT7MovieVideoWidget::QT7MovieVideoWidget(QObject *parent) } } - bool QT7MovieVideoWidget::createVisualContext() { #ifdef QUICKTIME_C_API_AVAILABLE @@ -210,8 +209,20 @@ bool QT7MovieVideoWidget::createVisualContext() NSOpenGLPixelFormat *nsglPixelFormat = [NSOpenGLView defaultPixelFormat]; CGLPixelFormatObj cglPixelFormat = static_cast([nsglPixelFormat CGLPixelFormatObj]); - CFTypeRef keys[] = { kQTVisualContextWorkingColorSpaceKey }; - CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB(); + CFTypeRef keys[] = { kQTVisualContextOutputColorSpaceKey }; + CGColorSpaceRef colorSpace = NULL; + CMProfileRef sysprof = NULL; + + // Get the Systems Profile for the main display + if (CMGetSystemProfile(&sysprof) == noErr) { + // Create a colorspace with the systems profile + colorSpace = CGColorSpaceCreateWithPlatformColorSpace(sysprof); + CMCloseProfile(sysprof); + } + + if (!colorSpace) + colorSpace = CGColorSpaceCreateDeviceRGB(); + CFDictionaryRef textureContextAttributes = CFDictionaryCreate(kCFAllocatorDefault, (const void **)keys, (const void **)&colorSpace, 1, -- cgit v0.12 From cccfbf4e2ad80c47b96e08765858c1cd4365a312 Mon Sep 17 00:00:00 2001 From: Justin McPherson Date: Thu, 25 Feb 2010 12:43:24 +1000 Subject: QMediaContent: Add a convenience method to retrieve the QNetworkRequest. Reviewed-by: Andrew den Exter --- src/multimedia/base/qmediacontent.cpp | 9 +++++++++ src/multimedia/base/qmediacontent.h | 1 + tests/auto/qmediacontent/tst_qmediacontent.cpp | 1 + 3 files changed, 11 insertions(+) diff --git a/src/multimedia/base/qmediacontent.cpp b/src/multimedia/base/qmediacontent.cpp index fd519c6..dd0c315 100644 --- a/src/multimedia/base/qmediacontent.cpp +++ b/src/multimedia/base/qmediacontent.cpp @@ -206,6 +206,15 @@ QUrl QMediaContent::canonicalUrl() const } /*! + Returns a QNetworkRequest that represents that canonical resource for this media content. +*/ + +QNetworkRequest QMediaContent::canonicalRequest() const +{ + return canonicalResource().request(); +} + +/*! Returns a QMediaResource that represents that canonical resource for this media content. */ diff --git a/src/multimedia/base/qmediacontent.h b/src/multimedia/base/qmediacontent.h index b6f3017..5a279c1 100644 --- a/src/multimedia/base/qmediacontent.h +++ b/src/multimedia/base/qmediacontent.h @@ -75,6 +75,7 @@ public: bool isNull() const; QUrl canonicalUrl() const; + QNetworkRequest canonicalRequest() const; QMediaResource canonicalResource() const; QMediaResourceList resources() const; diff --git a/tests/auto/qmediacontent/tst_qmediacontent.cpp b/tests/auto/qmediacontent/tst_qmediacontent.cpp index 8987241..a0a9bdb 100644 --- a/tests/auto/qmediacontent/tst_qmediacontent.cpp +++ b/tests/auto/qmediacontent/tst_qmediacontent.cpp @@ -85,6 +85,7 @@ void tst_QMediaContent::testRequestCtor() QMediaContent media(request); + QCOMPARE(media.canonicalRequest(), request); QCOMPARE(media.canonicalUrl(), QUrl("http://example.com/movie.mov")); QCOMPARE(media.canonicalResource().request(), request); QCOMPARE(media.canonicalResource().url(), QUrl("http://example.com/movie.mov")); -- cgit v0.12 From f4d15309c2c44bb2fdc18a8c89629c6f415f0b67 Mon Sep 17 00:00:00 2001 From: Dmytro Poplavskiy Date: Thu, 25 Feb 2010 14:03:39 +1000 Subject: Fixed QTMoview object leak. Reviewed-by: Justin McPherson --- src/plugins/mediaservices/qt7/mediaplayer/qt7playerservice.mm | 3 ++- src/plugins/mediaservices/qt7/mediaplayer/qt7playersession.mm | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/plugins/mediaservices/qt7/mediaplayer/qt7playerservice.mm b/src/plugins/mediaservices/qt7/mediaplayer/qt7playerservice.mm index faf75d1..205e862 100644 --- a/src/plugins/mediaservices/qt7/mediaplayer/qt7playerservice.mm +++ b/src/plugins/mediaservices/qt7/mediaplayer/qt7playerservice.mm @@ -62,7 +62,7 @@ QT_BEGIN_NAMESPACE QT7PlayerService::QT7PlayerService(QObject *parent): QMediaService(parent) { - m_session = new QT7PlayerSession; + m_session = new QT7PlayerSession(this); m_control = new QT7PlayerControl(this); m_control->setSession(m_session); @@ -102,6 +102,7 @@ QT7PlayerService::QT7PlayerService(QObject *parent): QT7PlayerService::~QT7PlayerService() { + m_session->setVideoOutput(0); } QMediaControl *QT7PlayerService::control(const char *name) const diff --git a/src/plugins/mediaservices/qt7/mediaplayer/qt7playersession.mm b/src/plugins/mediaservices/qt7/mediaplayer/qt7playersession.mm index 2dd3fe8..d83c0e3 100644 --- a/src/plugins/mediaservices/qt7/mediaplayer/qt7playersession.mm +++ b/src/plugins/mediaservices/qt7/mediaplayer/qt7playersession.mm @@ -179,7 +179,8 @@ QT7PlayerSession::QT7PlayerSession(QObject *parent) QT7PlayerSession::~QT7PlayerSession() { [(QTMovieObserver*)m_movieObserver setMovie:nil]; - [(QTMovieObserver*)m_movieObserver release]; + [(QTMovieObserver*)m_movieObserver release]; + [(QTMovie*)m_QTMovie release]; } void *QT7PlayerSession::movie() const -- cgit v0.12 From 77f722aca2c5243f07733dcb302035fb3c454f3a Mon Sep 17 00:00:00 2001 From: Justin McPherson Date: Thu, 25 Feb 2010 14:54:49 +1000 Subject: Qt namespace fixes. Reviewed-by: Dmytro Poplavskiy --- src/multimedia/qml/qsoundeffect_pulse_p.cpp | 5 +++++ src/multimedia/qml/qsoundeffect_qmedia_p.cpp | 4 ++++ .../gstreamer/mediaplayer/qgstreamermetadataprovider.cpp | 5 +++++ .../mediaservices/gstreamer/mediaplayer/qgstreamerplayercontrol.cpp | 5 +++++ .../mediaservices/gstreamer/mediaplayer/qgstreamerplayersession.cpp | 6 ++++++ src/plugins/mediaservices/gstreamer/qgstreamerbushelper.cpp | 3 +++ src/plugins/mediaservices/gstreamer/qgstreamermessage.cpp | 4 ++++ .../mediaservices/gstreamer/qgstreamervideoinputdevicecontrol.cpp | 6 ++++++ .../mediaservices/gstreamer/qgstreamervideooutputcontrol.cpp | 5 +++++ src/plugins/mediaservices/gstreamer/qgstreamervideooverlay.cpp | 5 +++++ src/plugins/mediaservices/gstreamer/qgstreamervideorenderer.cpp | 6 ++++++ .../mediaservices/gstreamer/qgstreamervideorendererinterface.cpp | 6 ++++++ .../mediaservices/gstreamer/qgstreamervideorendererinterface.h | 4 ++-- src/plugins/mediaservices/gstreamer/qgstreamervideowidget.cpp | 6 ++++++ src/plugins/mediaservices/gstreamer/qgstvideobuffer.cpp | 4 ++++ src/plugins/mediaservices/gstreamer/qgstxvimagebuffer.cpp | 6 ++++++ src/plugins/mediaservices/gstreamer/qgstxvimagebuffer.h | 6 +++--- src/plugins/mediaservices/gstreamer/qvideosurfacegstsink.cpp | 6 ++++++ src/plugins/mediaservices/gstreamer/qx11videosurface.cpp | 6 +++++- 19 files changed, 92 insertions(+), 6 deletions(-) diff --git a/src/multimedia/qml/qsoundeffect_pulse_p.cpp b/src/multimedia/qml/qsoundeffect_pulse_p.cpp index ec851aa..7e9a25c 100644 --- a/src/multimedia/qml/qsoundeffect_pulse_p.cpp +++ b/src/multimedia/qml/qsoundeffect_pulse_p.cpp @@ -72,6 +72,8 @@ // Less than ideal #define PA_SCACHE_ENTRY_SIZE_MAX (1024*1024*16) +QT_BEGIN_NAMESPACE + namespace { inline pa_sample_spec audioFormatToSampleSpec(const QAudioFormat &format) @@ -502,3 +504,6 @@ void QSoundEffectPrivate::play_callback(pa_context *c, int success, void *userda } } +QT_END_NAMESPACE + + diff --git a/src/multimedia/qml/qsoundeffect_qmedia_p.cpp b/src/multimedia/qml/qsoundeffect_qmedia_p.cpp index 886380a..48fb257 100644 --- a/src/multimedia/qml/qsoundeffect_qmedia_p.cpp +++ b/src/multimedia/qml/qsoundeffect_qmedia_p.cpp @@ -59,6 +59,8 @@ #include "qsoundeffect_qmedia_p.h" +QT_BEGIN_NAMESPACE + QSoundEffectPrivate::QSoundEffectPrivate(QObject* parent): QObject(parent), m_muted(false), @@ -161,3 +163,5 @@ void QSoundEffectPrivate::setMedia(const QMediaContent &media) m_player->setMedia(media.canonicalUrl()); } +QT_END_NAMESPACE + diff --git a/src/plugins/mediaservices/gstreamer/mediaplayer/qgstreamermetadataprovider.cpp b/src/plugins/mediaservices/gstreamer/mediaplayer/qgstreamermetadataprovider.cpp index 4d0ffe4..eff6ea4 100644 --- a/src/plugins/mediaservices/gstreamer/mediaplayer/qgstreamermetadataprovider.cpp +++ b/src/plugins/mediaservices/gstreamer/mediaplayer/qgstreamermetadataprovider.cpp @@ -45,6 +45,8 @@ #include +QT_BEGIN_NAMESPACE + struct QGstreamerMetaDataKeyLookup { QtMultimedia::MetaData key; @@ -202,3 +204,6 @@ void QGstreamerMetaDataProvider::updateTags() { emit metaDataChanged(); } + +QT_END_NAMESPACE + diff --git a/src/plugins/mediaservices/gstreamer/mediaplayer/qgstreamerplayercontrol.cpp b/src/plugins/mediaservices/gstreamer/mediaplayer/qgstreamerplayercontrol.cpp index d417266..2d7aaa8 100644 --- a/src/plugins/mediaservices/gstreamer/mediaplayer/qgstreamerplayercontrol.cpp +++ b/src/plugins/mediaservices/gstreamer/mediaplayer/qgstreamerplayercontrol.cpp @@ -54,6 +54,8 @@ #include #include +QT_BEGIN_NAMESPACE + QGstreamerPlayerControl::QGstreamerPlayerControl(QGstreamerPlayerSession *session, QObject *parent) : QMediaPlayerControl(parent) , m_session(session) @@ -341,3 +343,6 @@ void QGstreamerPlayerControl::closeFifo() m_bufferOffset = 0; } } + +QT_END_NAMESPACE + diff --git a/src/plugins/mediaservices/gstreamer/mediaplayer/qgstreamerplayersession.cpp b/src/plugins/mediaservices/gstreamer/mediaplayer/qgstreamerplayersession.cpp index 2e5d10f..600621e 100644 --- a/src/plugins/mediaservices/gstreamer/mediaplayer/qgstreamerplayersession.cpp +++ b/src/plugins/mediaservices/gstreamer/mediaplayer/qgstreamerplayersession.cpp @@ -51,6 +51,9 @@ //#define USE_PLAYBIN2 + +QT_BEGIN_NAMESPACE + QGstreamerPlayerSession::QGstreamerPlayerSession(QObject *parent) :QObject(parent), m_state(QMediaPlayer::StoppedState), @@ -710,3 +713,6 @@ void QGstreamerPlayerSession::getStreamsInfo() emit streamsChanged(); } + +QT_END_NAMESPACE + diff --git a/src/plugins/mediaservices/gstreamer/qgstreamerbushelper.cpp b/src/plugins/mediaservices/gstreamer/qgstreamerbushelper.cpp index 59ae5be..5049fa1 100644 --- a/src/plugins/mediaservices/gstreamer/qgstreamerbushelper.cpp +++ b/src/plugins/mediaservices/gstreamer/qgstreamerbushelper.cpp @@ -45,6 +45,7 @@ #include "qgstreamerbushelper.h" +QT_BEGIN_NAMESPACE #ifndef QT_NO_GLIB class QGstreamerBusHelperPrivate : public QObject @@ -200,4 +201,6 @@ void QGstreamerBusHelper::installSyncEventFilter(QGstreamerSyncEventFilter *filt d->filter = filter; } +QT_END_NAMESPACE + #include "qgstreamerbushelper.moc" diff --git a/src/plugins/mediaservices/gstreamer/qgstreamermessage.cpp b/src/plugins/mediaservices/gstreamer/qgstreamermessage.cpp index 0a689d9..d52aa75 100644 --- a/src/plugins/mediaservices/gstreamer/qgstreamermessage.cpp +++ b/src/plugins/mediaservices/gstreamer/qgstreamermessage.cpp @@ -44,6 +44,8 @@ #include "qgstreamermessage.h" +QT_BEGIN_NAMESPACE + static int wuchi = qRegisterMetaType(); @@ -91,3 +93,5 @@ QGstreamerMessage& QGstreamerMessage::operator=(QGstreamerMessage const& rhs) return *this; } + +QT_END_NAMESPACE diff --git a/src/plugins/mediaservices/gstreamer/qgstreamervideoinputdevicecontrol.cpp b/src/plugins/mediaservices/gstreamer/qgstreamervideoinputdevicecontrol.cpp index 94ae847..406cefe11 100644 --- a/src/plugins/mediaservices/gstreamer/qgstreamervideoinputdevicecontrol.cpp +++ b/src/plugins/mediaservices/gstreamer/qgstreamervideoinputdevicecontrol.cpp @@ -57,6 +57,9 @@ #include #include + +QT_BEGIN_NAMESPACE + QGstreamerVideoInputDeviceControl::QGstreamerVideoInputDeviceControl(QObject *parent) :QVideoDeviceControl(parent), m_selectedDevice(0) { @@ -155,3 +158,6 @@ void QGstreamerVideoInputDeviceControl::update() ::close(fd); } } + +QT_END_NAMESPACE + diff --git a/src/plugins/mediaservices/gstreamer/qgstreamervideooutputcontrol.cpp b/src/plugins/mediaservices/gstreamer/qgstreamervideooutputcontrol.cpp index decf524..f406bff 100644 --- a/src/plugins/mediaservices/gstreamer/qgstreamervideooutputcontrol.cpp +++ b/src/plugins/mediaservices/gstreamer/qgstreamervideooutputcontrol.cpp @@ -41,6 +41,8 @@ #include "qgstreamervideooutputcontrol.h" +QT_BEGIN_NAMESPACE + QGstreamerVideoOutputControl::QGstreamerVideoOutputControl(QObject *parent) : QVideoOutputControl(parent) , m_output(NoOutput) @@ -70,3 +72,6 @@ void QGstreamerVideoOutputControl::setOutput(Output output) if (m_output != output) emit outputChanged(m_output = output); } + +QT_END_NAMESPACE + diff --git a/src/plugins/mediaservices/gstreamer/qgstreamervideooverlay.cpp b/src/plugins/mediaservices/gstreamer/qgstreamervideooverlay.cpp index 6c6c802..846a24a 100644 --- a/src/plugins/mediaservices/gstreamer/qgstreamervideooverlay.cpp +++ b/src/plugins/mediaservices/gstreamer/qgstreamervideooverlay.cpp @@ -46,6 +46,8 @@ #include "qx11videosurface.h" +QT_BEGIN_NAMESPACE + QGstreamerVideoOverlay::QGstreamerVideoOverlay(QObject *parent) : QVideoWindowControl(parent) , m_surface(new QX11VideoSurface) @@ -208,3 +210,6 @@ void QGstreamerVideoOverlay::setScaledDisplayRect() break; }; } + +QT_END_NAMESPACE + diff --git a/src/plugins/mediaservices/gstreamer/qgstreamervideorenderer.cpp b/src/plugins/mediaservices/gstreamer/qgstreamervideorenderer.cpp index 25a53cf..1f03990 100644 --- a/src/plugins/mediaservices/gstreamer/qgstreamervideorenderer.cpp +++ b/src/plugins/mediaservices/gstreamer/qgstreamervideorenderer.cpp @@ -47,6 +47,9 @@ #include + +QT_BEGIN_NAMESPACE + QGstreamerVideoRenderer::QGstreamerVideoRenderer(QObject *parent) :QVideoRendererControl(parent),m_videoSink(0) { @@ -80,3 +83,6 @@ void QGstreamerVideoRenderer::setSurface(QAbstractVideoSurface *surface) m_surface = surface; } +QT_END_NAMESPACE + + diff --git a/src/plugins/mediaservices/gstreamer/qgstreamervideorendererinterface.cpp b/src/plugins/mediaservices/gstreamer/qgstreamervideorendererinterface.cpp index 0a1c20d..886a064 100644 --- a/src/plugins/mediaservices/gstreamer/qgstreamervideorendererinterface.cpp +++ b/src/plugins/mediaservices/gstreamer/qgstreamervideorendererinterface.cpp @@ -41,6 +41,12 @@ #include "qgstreamervideorendererinterface.h" + +QT_BEGIN_NAMESPACE + QGstreamerVideoRendererInterface::~QGstreamerVideoRendererInterface() { } + +QT_END_NAMESPACE + diff --git a/src/plugins/mediaservices/gstreamer/qgstreamervideorendererinterface.h b/src/plugins/mediaservices/gstreamer/qgstreamervideorendererinterface.h index 39deee8..c63a757 100644 --- a/src/plugins/mediaservices/gstreamer/qgstreamervideorendererinterface.h +++ b/src/plugins/mediaservices/gstreamer/qgstreamervideorendererinterface.h @@ -59,11 +59,11 @@ public: virtual void precessNewStream() {} }; -QT_END_NAMESPACE - #define QGstreamerVideoRendererInterface_iid "com.nokia.Qt.QGstreamerVideoRendererInterface/1.0" Q_DECLARE_INTERFACE(QGstreamerVideoRendererInterface, QGstreamerVideoRendererInterface_iid) +QT_END_NAMESPACE + QT_END_HEADER #endif diff --git a/src/plugins/mediaservices/gstreamer/qgstreamervideowidget.cpp b/src/plugins/mediaservices/gstreamer/qgstreamervideowidget.cpp index 1d8d43d..47fb451 100644 --- a/src/plugins/mediaservices/gstreamer/qgstreamervideowidget.cpp +++ b/src/plugins/mediaservices/gstreamer/qgstreamervideowidget.cpp @@ -51,6 +51,9 @@ #include #include + +QT_BEGIN_NAMESPACE + class QGstreamerVideoWidget : public QWidget { public: @@ -320,3 +323,6 @@ void QGstreamerVideoWidgetControl::setSaturation(int saturation) emit saturationChanged(saturation); } } + +QT_END_NAMESPACE + diff --git a/src/plugins/mediaservices/gstreamer/qgstvideobuffer.cpp b/src/plugins/mediaservices/gstreamer/qgstvideobuffer.cpp index 9519db6..76289bf 100644 --- a/src/plugins/mediaservices/gstreamer/qgstvideobuffer.cpp +++ b/src/plugins/mediaservices/gstreamer/qgstvideobuffer.cpp @@ -42,6 +42,8 @@ #include "qgstvideobuffer.h" +QT_BEGIN_NAMESPACE + QGstVideoBuffer::QGstVideoBuffer(GstBuffer *buffer, int bytesPerLine) : QAbstractVideoBuffer(NoHandle) , m_buffer(buffer) @@ -95,3 +97,5 @@ void QGstVideoBuffer::unmap() m_mode = NotMapped; } +QT_END_NAMESPACE + diff --git a/src/plugins/mediaservices/gstreamer/qgstxvimagebuffer.cpp b/src/plugins/mediaservices/gstreamer/qgstxvimagebuffer.cpp index 5b99817..b2e633d 100644 --- a/src/plugins/mediaservices/gstreamer/qgstxvimagebuffer.cpp +++ b/src/plugins/mediaservices/gstreamer/qgstxvimagebuffer.cpp @@ -47,6 +47,9 @@ #include "qgstxvimagebuffer.h" #include "qvideosurfacegstsink.h" + +QT_BEGIN_NAMESPACE + GstBufferClass *QGstXvImageBuffer::parent_class = NULL; GType QGstXvImageBuffer::get_type(void) @@ -274,3 +277,6 @@ void QGstXvImageBufferPool::destroyBuffer(QGstXvImageBuffer *xvBuffer) if (m_imagesToDestroy.size() == 1) QMetaObject::invokeMethod(this, "queuedDestroy", Qt::QueuedConnection); } + +QT_END_NAMESPACE + diff --git a/src/plugins/mediaservices/gstreamer/qgstxvimagebuffer.h b/src/plugins/mediaservices/gstreamer/qgstxvimagebuffer.h index beeb01f..30f77d1 100644 --- a/src/plugins/mediaservices/gstreamer/qgstxvimagebuffer.h +++ b/src/plugins/mediaservices/gstreamer/qgstxvimagebuffer.h @@ -56,14 +56,13 @@ #include #include - #include + QT_BEGIN_HEADER QT_BEGIN_NAMESPACE - class QGstXvImageBufferPool; struct QGstXvImageBuffer { @@ -82,7 +81,6 @@ struct QGstXvImageBuffer { const QAbstractVideoBuffer::HandleType XvHandleType = QAbstractVideoBuffer::HandleType(4); -Q_DECLARE_METATYPE(XvImage*) class QGstXvImageBufferPool : public QObject { @@ -125,6 +123,8 @@ private: QT_END_NAMESPACE +Q_DECLARE_METATYPE(::XvImage*) + QT_END_HEADER diff --git a/src/plugins/mediaservices/gstreamer/qvideosurfacegstsink.cpp b/src/plugins/mediaservices/gstreamer/qvideosurfacegstsink.cpp index 402a225..76d87ce 100644 --- a/src/plugins/mediaservices/gstreamer/qvideosurfacegstsink.cpp +++ b/src/plugins/mediaservices/gstreamer/qvideosurfacegstsink.cpp @@ -52,8 +52,11 @@ #include "qgstxvimagebuffer.h" + Q_DECLARE_METATYPE(QVideoSurfaceFormat) +QT_BEGIN_NAMESPACE + QVideoSurfaceGstDelegate::QVideoSurfaceGstDelegate(QAbstractVideoSurface *surface) : m_surface(surface) , m_renderReturn(GST_FLOW_ERROR) @@ -691,3 +694,6 @@ GstFlowReturn QVideoSurfaceGstSink::render(GstBaseSink *base, GstBuffer *buffer) return sink->delegate->render(buffer); } +QT_END_NAMESPACE + + diff --git a/src/plugins/mediaservices/gstreamer/qx11videosurface.cpp b/src/plugins/mediaservices/gstreamer/qx11videosurface.cpp index 6e282ff..cbd5a76 100644 --- a/src/plugins/mediaservices/gstreamer/qx11videosurface.cpp +++ b/src/plugins/mediaservices/gstreamer/qx11videosurface.cpp @@ -46,7 +46,9 @@ #include "qx11videosurface.h" -Q_DECLARE_METATYPE(XvImage*); +Q_DECLARE_METATYPE(::XvImage*); + +QT_BEGIN_NAMESPACE static QAbstractVideoBuffer::HandleType XvHandleType = QAbstractVideoBuffer::HandleType(4); @@ -507,3 +509,5 @@ void QX11VideoSurface::querySupportedFormats() XFree(attributes); } } + +QT_END_NAMESPACE -- cgit v0.12 From 40ee581661e07e522a2852b32a25337d13ca25f9 Mon Sep 17 00:00:00 2001 From: Justin McPherson Date: Thu, 25 Feb 2010 16:06:58 +1000 Subject: QT7; Fix warnings. Reviewed-by: Dmytro Poplavskiy --- .../qt7/mediaplayer/qt7playermetadata.mm | 74 +++++++++++++--------- 1 file changed, 43 insertions(+), 31 deletions(-) diff --git a/src/plugins/mediaservices/qt7/mediaplayer/qt7playermetadata.mm b/src/plugins/mediaservices/qt7/mediaplayer/qt7playermetadata.mm index a14981a..b046672 100644 --- a/src/plugins/mediaservices/qt7/mediaplayer/qt7playermetadata.mm +++ b/src/plugins/mediaservices/qt7/mediaplayer/qt7playermetadata.mm @@ -132,15 +132,19 @@ static OSStatus readMetaValue(QTMetaDataRef metaDataRef, QTMetaDataItem item, QT UInt32 propFlags; OSStatus err = QTMetaDataGetItemPropertyInfo(metaDataRef, item, propClass, id, &type, &propSize, &propFlags); - - *value = malloc(propSize); - - err = QTMetaDataGetItemProperty(metaDataRef, item, propClass, id, propSize, *value, size); - - if (type == 'code' || type == 'itsk' || type == 'itlk') { - // convert from native endian to big endian - OSTypePtr pType = (OSTypePtr)*value; - *pType = EndianU32_NtoB(*pType); + if (err == noErr) { + *value = malloc(propSize); + if (*value != 0) { + err = QTMetaDataGetItemProperty(metaDataRef, item, propClass, id, propSize, *value, size); + + if (err == noErr && (type == 'code' || type == 'itsk' || type == 'itlk')) { + // convert from native endian to big endian + OSTypePtr pType = (OSTypePtr)*value; + *pType = EndianU32_NtoB(*pType); + } + } + else + return -1; } return err; @@ -153,10 +157,14 @@ static UInt32 getMetaType(QTMetaDataRef metaDataRef, QTMetaDataItem item) OSStatus err = readMetaValue( metaDataRef, item, kPropertyClass_MetaDataItem, kQTMetaDataItemPropertyID_DataType, &value, &ignore); - UInt32 type = *((UInt32 *) value); - if (value) - free(value); - return type; + if (err == noErr) { + UInt32 type = *((UInt32 *) value); + if (value) + free(value); + return type; + } + + return 0; } static QString cFStringToQString(CFStringRef str) @@ -179,23 +187,26 @@ static QString getMetaValue(QTMetaDataRef metaDataRef, QTMetaDataItem item, SInt QTPropertyValuePtr value = 0; ByteCount size = 0; OSStatus err = readMetaValue(metaDataRef, item, kPropertyClass_MetaDataItem, id, &value, &size); - QString string; - UInt32 dataType = getMetaType(metaDataRef, item); - switch (dataType){ - case kQTMetaDataTypeUTF8: - case kQTMetaDataTypeMacEncodedText: - string = cFStringToQString(CFStringCreateWithBytes(0, (UInt8*)value, size, kCFStringEncodingUTF8, false)); - break; - case kQTMetaDataTypeUTF16BE: - string = cFStringToQString(CFStringCreateWithBytes(0, (UInt8*)value, size, kCFStringEncodingUTF16BE, false)); - break; - default: - break; + + if (err == noErr) { + UInt32 dataType = getMetaType(metaDataRef, item); + switch (dataType){ + case kQTMetaDataTypeUTF8: + case kQTMetaDataTypeMacEncodedText: + string = cFStringToQString(CFStringCreateWithBytes(0, (UInt8*)value, size, kCFStringEncodingUTF8, false)); + break; + case kQTMetaDataTypeUTF16BE: + string = cFStringToQString(CFStringCreateWithBytes(0, (UInt8*)value, size, kCFStringEncodingUTF16BE, false)); + break; + default: + break; + } + + if (value) + free(value); } - if (value) - free(value); return string; } @@ -234,10 +245,11 @@ void QT7PlayerMetaDataControl::updateTags() #ifdef QUICKTIME_C_API_AVAILABLE QTMetaDataRef metaDataRef; OSStatus err = QTCopyMovieMetaData([movie quickTimeMovie], &metaDataRef); - - readFormattedData(metaDataRef, kQTMetaDataStorageFormatUserData, metaMap); - readFormattedData(metaDataRef, kQTMetaDataStorageFormatQuickTime, metaMap); - readFormattedData(metaDataRef, kQTMetaDataStorageFormatiTunes, metaMap); + if (err == noErr) { + readFormattedData(metaDataRef, kQTMetaDataStorageFormatUserData, metaMap); + readFormattedData(metaDataRef, kQTMetaDataStorageFormatQuickTime, metaMap); + readFormattedData(metaDataRef, kQTMetaDataStorageFormatiTunes, metaMap); + } #else NSString *name = [movie attributeForKey:@"QTMovieDisplayNameAttribute"]; metaMap.insert(QLatin1String("nam"), QString::fromUtf8([name UTF8String])); -- cgit v0.12 From 4124bff7eb55ca2026bb89198950991a0804d0e6 Mon Sep 17 00:00:00 2001 From: Andrew den Exter Date: Thu, 25 Feb 2010 17:32:40 +1000 Subject: Make the Direct Show media service compile with mingw. There a number of interfaces and guid constants used by the media service that aren't defined by mingw. Define these locally. Reviewed-by: Justin McPherson --- .../mediaplayer/directshowaudioendpointcontrol.cpp | 6 +- .../directshow/mediaplayer/directshowglobal.h | 71 ++++++++++++++++++++++ .../directshow/mediaplayer/directshowiosource.cpp | 6 +- .../directshow/mediaplayer/directshowiosource.h | 2 +- .../directshow/mediaplayer/directshowmediatype.cpp | 34 ++++++----- .../mediaplayer/directshowmetadatacontrol.cpp | 2 +- .../mediaplayer/directshowmetadatacontrol.h | 3 +- .../mediaplayer/directshowplayerservice.cpp | 55 +++++++++++------ .../directshow/mediaplayer/videosurfacefilter.cpp | 14 ++++- .../directshow/mediaplayer/videosurfacefilter.h | 4 +- 10 files changed, 152 insertions(+), 45 deletions(-) diff --git a/src/plugins/mediaservices/directshow/mediaplayer/directshowaudioendpointcontrol.cpp b/src/plugins/mediaservices/directshow/mediaplayer/directshowaudioendpointcontrol.cpp index 30c05ed..5f72ca6 100644 --- a/src/plugins/mediaservices/directshow/mediaplayer/directshowaudioendpointcontrol.cpp +++ b/src/plugins/mediaservices/directshow/mediaplayer/directshowaudioendpointcontrol.cpp @@ -82,6 +82,7 @@ QList DirectShowAudioEndpointControl::availableEndpoints() const QString DirectShowAudioEndpointControl::endpointDescription(const QString &name) const { +#ifdef __IPropertyBag_INTERFACE_DEFINED__ QString description; if (IMoniker *moniker = m_devices.value(name, 0)) { @@ -97,7 +98,10 @@ QString DirectShowAudioEndpointControl::endpointDescription(const QString &name) } } - return description;; + return description; +#else + return name.section(QLatin1Char('\\'), -1); +#endif } QString DirectShowAudioEndpointControl::defaultEndpoint() const diff --git a/src/plugins/mediaservices/directshow/mediaplayer/directshowglobal.h b/src/plugins/mediaservices/directshow/mediaplayer/directshowglobal.h index 7601672..e43e2a7 100644 --- a/src/plugins/mediaservices/directshow/mediaplayer/directshowglobal.h +++ b/src/plugins/mediaservices/directshow/mediaplayer/directshowglobal.h @@ -42,6 +42,8 @@ #ifndef DIRECTSHOWGLOBAL_H #define DIRECTSHOWGLOBAL_H +#include + #include QT_BEGIN_HEADER @@ -73,4 +75,73 @@ QT_END_NAMESPACE QT_END_HEADER +#ifndef __IFilterGraph2_INTERFACE_DEFINED__ +#define __IFilterGraph2_INTERFACE_DEFINED__ +#define INTERFACE IFilterGraph2 +DECLARE_INTERFACE_(IFilterGraph2 ,IGraphBuilder) +{ + STDMETHOD(AddSourceFilterForMoniker)(THIS_ IMoniker *, IBindCtx *, LPCWSTR,IBaseFilter **) PURE; + STDMETHOD(ReconnectEx)(THIS_ IPin *, const AM_MEDIA_TYPE *) PURE; + STDMETHOD(RenderEx)(IPin *, DWORD, DWORD *) PURE; +}; +#undef INTERFACE +#endif + +#ifndef __IAMFilterMiscFlags_INTERFACE_DEFINED__ +#define __IAMFilterMiscFlags_INTERFACE_DEFINED__ +#define INTERFACE IAMFilterMiscFlags +DECLARE_INTERFACE_(IAMFilterMiscFlags ,IUnknown) +{ + STDMETHOD(QueryInterface)(THIS_ REFIID,PVOID*) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release)(THIS) PURE; + STDMETHOD_(ULONG,GetMiscFlags)(THIS) PURE; +}; +#undef INTERFACE +#endif + +#ifndef __IFileSourceFilter_INTERFACE_DEFINED__ +#define __IFileSourceFilter_INTERFACE_DEFINED__ +#define INTERFACE IFileSourceFilter +DECLARE_INTERFACE_(IFileSourceFilter ,IUnknown) +{ + STDMETHOD(QueryInterface)(THIS_ REFIID,PVOID*) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release)(THIS) PURE; + STDMETHOD(Load)(THIS_ LPCOLESTR, const AM_MEDIA_TYPE *) PURE; + STDMETHOD(GetCurFile)(THIS_ LPOLESTR *ppszFileName, AM_MEDIA_TYPE *) PURE; +}; +#undef INTERFACE +#endif + +#ifndef __IAMOpenProgress_INTERFACE_DEFINED__ +#define __IAMOpenProgress_INTERFACE_DEFINED__ +#define INTERFACE IAMOpenProgress +DECLARE_INTERFACE_(IAMOpenProgress ,IUnknown) +{ + STDMETHOD(QueryInterface)(THIS_ REFIID,PVOID*) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release)(THIS) PURE; + STDMETHOD(QueryProgress)(THIS_ LONGLONG *, LONGLONG *) PURE; + STDMETHOD(AbortOperation)(THIS) PURE; +}; +#undef INTERFACE +#endif + +#ifndef __IFilterChain_INTERFACE_DEFINED__ +#define __IFilterChain_INTERFACE_DEFINED__ +#define INTERFACE IFilterChain +DECLARE_INTERFACE_(IFilterChain ,IUnknown) +{ + STDMETHOD(QueryInterface)(THIS_ REFIID,PVOID*) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release)(THIS) PURE; + STDMETHOD(StartChain)(IBaseFilter *, IBaseFilter *) PURE; + STDMETHOD(PauseChain)(IBaseFilter *, IBaseFilter *) PURE; + STDMETHOD(StopChain)(IBaseFilter *, IBaseFilter *) PURE; + STDMETHOD(RemoveChain)(IBaseFilter *, IBaseFilter *) PURE; +}; +#undef INTERFACE +#endif + #endif diff --git a/src/plugins/mediaservices/directshow/mediaplayer/directshowiosource.cpp b/src/plugins/mediaservices/directshow/mediaplayer/directshowiosource.cpp index 15bfea5..7b66d56 100644 --- a/src/plugins/mediaservices/directshow/mediaplayer/directshowiosource.cpp +++ b/src/plugins/mediaservices/directshow/mediaplayer/directshowiosource.cpp @@ -121,6 +121,10 @@ void DirectShowIOSource::setAllocator(IMemAllocator *allocator) // IUnknown HRESULT DirectShowIOSource::QueryInterface(REFIID riid, void **ppvObject) { + // 2dd74950-a890-11d1-abe8-00a0c905f375 + static const GUID iid_IAmFilterMiscFlags = { + 0x2dd74950, 0xa890, 0x11d1, {0xab, 0xe8, 0x00, 0xa0, 0xc9, 0x05, 0xf3, 0x75}}; + if (!ppvObject) { return E_POINTER; } else if (riid == IID_IUnknown @@ -128,7 +132,7 @@ HRESULT DirectShowIOSource::QueryInterface(REFIID riid, void **ppvObject) || riid == IID_IMediaFilter || riid == IID_IBaseFilter) { *ppvObject = static_cast(this); - } else if (riid == IID_IAMFilterMiscFlags) { + } else if (riid == iid_IAmFilterMiscFlags) { *ppvObject = static_cast(this); } else if (riid == IID_IPin) { *ppvObject = static_cast(this); diff --git a/src/plugins/mediaservices/directshow/mediaplayer/directshowiosource.h b/src/plugins/mediaservices/directshow/mediaplayer/directshowiosource.h index b626473..3eb9a88 100644 --- a/src/plugins/mediaservices/directshow/mediaplayer/directshowiosource.h +++ b/src/plugins/mediaservices/directshow/mediaplayer/directshowiosource.h @@ -42,11 +42,11 @@ #ifndef DIRECTSHOWIOSOURCE_H #define DIRECTSHOWIOSOURCE_H +#include "directshowglobal.h" #include "directshowioreader.h" #include "directshowmediatype.h" #include "directshowmediatypelist.h" - QT_BEGIN_HEADER QT_BEGIN_NAMESPACE diff --git a/src/plugins/mediaservices/directshow/mediaplayer/directshowmediatype.cpp b/src/plugins/mediaservices/directshow/mediaplayer/directshowmediatype.cpp index f719b29..cf6d45b 100644 --- a/src/plugins/mediaservices/directshow/mediaplayer/directshowmediatype.cpp +++ b/src/plugins/mediaservices/directshow/mediaplayer/directshowmediatype.cpp @@ -54,20 +54,20 @@ namespace static const TypeLookup qt_typeLookup[] = { - { QVideoFrame::Format_RGB32, MEDIASUBTYPE_RGB32 }, - { QVideoFrame::Format_BGR24, MEDIASUBTYPE_RGB24 }, - { QVideoFrame::Format_RGB565, MEDIASUBTYPE_RGB565 }, - { QVideoFrame::Format_RGB555, MEDIASUBTYPE_RGB555 }, - { QVideoFrame::Format_AYUV444, MEDIASUBTYPE_AYUV }, - { QVideoFrame::Format_YUYV, MEDIASUBTYPE_YUY2 }, - { QVideoFrame::Format_UYVY, MEDIASUBTYPE_UYVY }, - { QVideoFrame::Format_IMC1, MEDIASUBTYPE_IMC1 }, - { QVideoFrame::Format_IMC2, MEDIASUBTYPE_IMC2 }, - { QVideoFrame::Format_IMC3, MEDIASUBTYPE_IMC3 }, - { QVideoFrame::Format_IMC4, MEDIASUBTYPE_IMC4 }, - { QVideoFrame::Format_YV12, MEDIASUBTYPE_YV12 }, - { QVideoFrame::Format_NV12, MEDIASUBTYPE_NV12 }, - { QVideoFrame::Format_YUV420P, MEDIASUBTYPE_IYUV } + { QVideoFrame::Format_RGB32, /*MEDIASUBTYPE_RGB32*/ {0xe436eb7e, 0x524f, 0x11ce, {0x9f, 0x53, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70}} }, + { QVideoFrame::Format_BGR24, /*MEDIASUBTYPE_RGB24*/ {0xe436eb7d, 0x524f, 0x11ce, {0x9f, 0x53, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70}} }, + { QVideoFrame::Format_RGB565, /*MEDIASUBTYPE_RGB565*/ {0xe436eb7b, 0x524f, 0x11ce, {0x9f, 0x53, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70}} }, + { QVideoFrame::Format_RGB555, /*MEDIASUBTYPE_RGB555*/ {0xe436eb7c, 0x524f, 0x11ce, {0x9f, 0x53, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70}} }, + { QVideoFrame::Format_AYUV444, /*MEDIASUBTYPE_AYUV*/ {0x56555941, 0x0000, 0x0010, {0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}} }, + { QVideoFrame::Format_YUYV, /*MEDIASUBTYPE_YUY2*/ {0x32595559, 0x0000, 0x0010, {0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}} }, + { QVideoFrame::Format_UYVY, /*MEDIASUBTYPE_UYVY*/ {0x59565955, 0x0000, 0x0010, {0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}} }, + { QVideoFrame::Format_IMC1, /*MEDIASUBTYPE_IMC1*/ {0x31434D49, 0x0000, 0x0010, {0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}} }, + { QVideoFrame::Format_IMC2, /*MEDIASUBTYPE_IMC2*/ {0x32434D49, 0x0000, 0x0010, {0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}} }, + { QVideoFrame::Format_IMC3, /*MEDIASUBTYPE_IMC3*/ {0x33434D49, 0x0000, 0x0010, {0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}} }, + { QVideoFrame::Format_IMC4, /*MEDIASUBTYPE_IMC4*/ {0x34434D49, 0x0000, 0x0010, {0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}} }, + { QVideoFrame::Format_YV12, /*MEDIASUBTYPE_YV12*/ {0x32315659, 0x0000, 0x0010, {0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}} }, + { QVideoFrame::Format_NV12, /*MEDIASUBTYPE_NV12*/ {0x3231564E, 0x0000, 0x0010, {0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}} }, + { QVideoFrame::Format_YUV420P, /*MEDIASUBTYPE_IYUV*/ {0x56555949, 0x0000, 0x0010, {0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}} } }; } @@ -102,12 +102,16 @@ void DirectShowMediaType::freeData(AM_MEDIA_TYPE *type) GUID DirectShowMediaType::convertPixelFormat(QVideoFrame::PixelFormat format) { + // MEDIASUBTYPE_None; + static const GUID none = { + 0xe436eb8e, 0x524f, 0x11ce, {0x9f, 0x53, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70} }; + const int count = sizeof(qt_typeLookup) / sizeof(TypeLookup); for (int i = 0; i < count; ++i) if (qt_typeLookup[i].pixelFormat == format) return qt_typeLookup[i].mediaType; - return MEDIASUBTYPE_None; + return none; } QVideoSurfaceFormat DirectShowMediaType::formatFromType(const AM_MEDIA_TYPE &type) diff --git a/src/plugins/mediaservices/directshow/mediaplayer/directshowmetadatacontrol.cpp b/src/plugins/mediaservices/directshow/mediaplayer/directshowmetadatacontrol.cpp index a33041e..89821c4 100644 --- a/src/plugins/mediaservices/directshow/mediaplayer/directshowmetadatacontrol.cpp +++ b/src/plugins/mediaservices/directshow/mediaplayer/directshowmetadatacontrol.cpp @@ -297,7 +297,7 @@ QVariant DirectShowMetaDataControl::metaData(QtMultimedia::MetaData key) const } if (string) { - value = QString::fromUtf16(string, ::SysStringLen(string)); + value = QString::fromUtf16(reinterpret_cast(string), ::SysStringLen(string)); ::SysFreeString(string); } diff --git a/src/plugins/mediaservices/directshow/mediaplayer/directshowmetadatacontrol.h b/src/plugins/mediaservices/directshow/mediaplayer/directshowmetadatacontrol.h index 966f9b8..9a81ba8 100644 --- a/src/plugins/mediaservices/directshow/mediaplayer/directshowmetadatacontrol.h +++ b/src/plugins/mediaservices/directshow/mediaplayer/directshowmetadatacontrol.h @@ -42,9 +42,10 @@ #ifndef DIRECTSHOWMETADATACONTROL_H #define DIRECTSHOWMETADATACONTROL_H +#include "directshowglobal.h" + #include -#include #include #ifndef QT_NO_WMSDK diff --git a/src/plugins/mediaservices/directshow/mediaplayer/directshowplayerservice.cpp b/src/plugins/mediaservices/directshow/mediaplayer/directshowplayerservice.cpp index 649f3fb..317fa5c 100644 --- a/src/plugins/mediaservices/directshow/mediaplayer/directshowplayerservice.cpp +++ b/src/plugins/mediaservices/directshow/mediaplayer/directshowplayerservice.cpp @@ -56,8 +56,6 @@ #include #include -#include - Q_GLOBAL_STATIC(DirectShowEventLoop, qt_directShowEventLoop) QT_BEGIN_NAMESPACE @@ -80,11 +78,11 @@ private: DirectShowPlayerService::DirectShowPlayerService(QObject *parent) : QMediaService(parent) , m_playerControl(0) - , m_audioEndpointControl(0) , m_metaDataControl(0) , m_videoOutputControl(0) , m_videoRendererControl(0) , m_videoWindowControl(0) + , m_audioEndpointControl(0) , m_taskThread(0) , m_loop(qt_directShowEventLoop()) , m_pendingTasks(0) @@ -203,9 +201,12 @@ void DirectShowPlayerService::load(const QMediaContent &media, QIODevice *stream m_graphStatus = InvalidMedia; m_error = QMediaPlayer::ResourceError; } else { + // {36b73882-c2c8-11cf-8b46-00805f6cef60} + static const GUID iid_IFilterGraph2 = { + 0x36b73882, 0xc2c8, 0x11cf, {0x8b, 0x46, 0x00, 0x80, 0x5f, 0x6c, 0xef, 0x60} }; m_graphStatus = Loading; - m_graph = com_new(CLSID_FilterGraph, IID_IFilterGraph2); + m_graph = com_new(CLSID_FilterGraph, iid_IFilterGraph2); if (stream) m_pendingTasks = SetStreamSource; @@ -231,12 +232,18 @@ void DirectShowPlayerService::doSetUrlSource(QMutexLocker *locker) HRESULT hr = E_FAIL; -#ifndef QT_NO_WMSDK if (url.scheme() == QLatin1String("http") || url.scheme() == QLatin1String("https")) { + static const GUID clsid_WMAsfReader = { + 0x187463a0, 0x5bb7, 0x11d3, {0xac, 0xbe, 0x00, 0x80, 0xc7, 0x5e, 0x24, 0x6e} }; + + // {56a868a6-0ad4-11ce-b03a-0020af0ba770} + static const GUID iid_IFileSourceFilter = { + 0x56a868a6, 0x0ad4, 0x11ce, {0xb0, 0x3a, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70} }; + if (IFileSourceFilter *fileSource = com_new( - CLSID_WMAsfReader, IID_IFileSourceFilter)) { + clsid_WMAsfReader, iid_IFileSourceFilter)) { locker->unlock(); - hr = fileSource->Load(url.toString().utf16(), 0); + hr = fileSource->Load(reinterpret_cast(url.toString().utf16()), 0); locker->relock(); if (SUCCEEDED(hr)) { @@ -260,13 +267,11 @@ void DirectShowPlayerService::doSetUrlSource(QMutexLocker *locker) } if (!SUCCEEDED(hr)) { -#endif locker->unlock(); - hr = m_graph->AddSourceFilter(url.toString().utf16(), L"Source", &source); + hr = m_graph->AddSourceFilter( + reinterpret_cast(url.toString().utf16()), L"Source", &source); locker->relock(); -#ifndef QT_NO_WMSDK } -#endif if (SUCCEEDED(hr)) { m_executedTasks = SetSource; @@ -300,7 +305,7 @@ void DirectShowPlayerService::doSetUrlSource(QMutexLocker *locker) default: m_error = QMediaPlayer::ResourceError; m_errorString = QString(); - qWarning("DirectShowPlayerService::doSetUrlSource: Unresolved error code %x", hr); + qWarning("DirectShowPlayerService::doSetUrlSource: Unresolved error code %x", uint(hr)); break; } @@ -394,7 +399,7 @@ void DirectShowPlayerService::doRender(QMutexLocker *locker) locker->unlock(); HRESULT hr; if (SUCCEEDED(hr = graph->RenderEx( - pin, AM_RENDEREX_RENDERTOEXISTINGRENDERERS, 0))) { + pin, /*AM_RENDEREX_RENDERTOEXISTINGRENDERERS*/ 1, 0))) { rendered = true; } else if (renderHr == S_OK || renderHr == VFW_E_NO_DECOMPRESSOR){ renderHr = hr; @@ -449,7 +454,7 @@ void DirectShowPlayerService::doRender(QMutexLocker *locker) m_error = QMediaPlayer::ResourceError; m_errorString = QString(); qWarning("DirectShowPlayerService::doRender: Unresolved error code %x", - renderHr); + uint(renderHr)); } } @@ -497,8 +502,12 @@ void DirectShowPlayerService::releaseGraph() { if (m_graph) { if (m_executingTask != 0) { + // {8E1C39A1-DE53-11cf-AA63-0080C744528D} + static const GUID iid_IAMOpenProgress = { + 0x8E1C39A1, 0xDE53, 0x11cf, {0xAA, 0x63, 0x00, 0x80, 0xC7, 0x44, 0x52, 0x8D} }; + if (IAMOpenProgress *progress = com_cast( - m_graph, IID_IAMOpenProgress)) { + m_graph, iid_IAMOpenProgress)) { progress->AbortOperation(); progress->Release(); } @@ -646,7 +655,7 @@ void DirectShowPlayerService::doPlay(QMutexLocker *locker) } else { m_error = QMediaPlayer::ResourceError; m_errorString = QString(); - qWarning("DirectShowPlayerService::doPlay: Unresolved error code %x", hr); + qWarning("DirectShowPlayerService::doPlay: Unresolved error code %x", uint(hr)); QCoreApplication::postEvent(this, new QEvent(QEvent::Type(Error))); } @@ -699,7 +708,7 @@ void DirectShowPlayerService::doPause(QMutexLocker *locker) } else { m_error = QMediaPlayer::ResourceError; m_errorString = QString(); - qWarning("DirectShowPlayerService::doPause: Unresolved error code %x", hr); + qWarning("DirectShowPlayerService::doPause: Unresolved error code %x", uint(hr)); QCoreApplication::postEvent(this, new QEvent(QEvent::Type(Error))); } @@ -963,7 +972,11 @@ void DirectShowPlayerService::doReleaseAudioOutput(QMutexLocker *locker) decoder->AddRef(); } - if (IFilterChain *chain = com_cast(m_graph, IID_IFilterChain)) { + // {DCFBDCF6-0DC2-45f5-9AB2-7C330EA09C29} + static const GUID iid_IFilterChain = { + 0xDCFBDCF6, 0x0DC2, 0x45f5, {0x9A, 0xB2, 0x7C, 0x33, 0x0E, 0xA0, 0x9C, 0x29} }; + + if (IFilterChain *chain = com_cast(m_graph, iid_IFilterChain)) { chain->RemoveChain(decoder, m_audioOutput); chain->Release(); } else { @@ -1038,7 +1051,11 @@ void DirectShowPlayerService::doReleaseVideoOutput(QMutexLocker *locker) decoder->AddRef(); } - if (IFilterChain *chain = com_cast(m_graph, IID_IFilterChain)) { + // {DCFBDCF6-0DC2-45f5-9AB2-7C330EA09C29} + static const GUID iid_IFilterChain = { + 0xDCFBDCF6, 0x0DC2, 0x45f5, {0x9A, 0xB2, 0x7C, 0x33, 0x0E, 0xA0, 0x9C, 0x29} }; + + if (IFilterChain *chain = com_cast(m_graph, iid_IFilterChain)) { chain->RemoveChain(decoder, m_videoOutput); chain->Release(); } else { diff --git a/src/plugins/mediaservices/directshow/mediaplayer/videosurfacefilter.cpp b/src/plugins/mediaservices/directshow/mediaplayer/videosurfacefilter.cpp index 94b6f24..a471c68 100644 --- a/src/plugins/mediaservices/directshow/mediaplayer/videosurfacefilter.cpp +++ b/src/plugins/mediaservices/directshow/mediaplayer/videosurfacefilter.cpp @@ -84,7 +84,11 @@ VideoSurfaceFilter::~VideoSurfaceFilter() } HRESULT VideoSurfaceFilter::QueryInterface(REFIID riid, void **ppvObject) -{ +{ + // 2dd74950-a890-11d1-abe8-00a0c905f375 + static const GUID iid_IAmFilterMiscFlags = { + 0x2dd74950, 0xa890, 0x11d1, {0xab, 0xe8, 0x00, 0xa0, 0xc9, 0x05, 0xf3, 0x75} }; + if (!ppvObject) { return E_POINTER; } else if (riid == IID_IUnknown @@ -92,7 +96,7 @@ HRESULT VideoSurfaceFilter::QueryInterface(REFIID riid, void **ppvObject) || riid == IID_IMediaFilter || riid == IID_IBaseFilter) { *ppvObject = static_cast(this); - } else if (riid == IID_IAMFilterMiscFlags) { + } else if (riid == iid_IAmFilterMiscFlags) { *ppvObject = static_cast(this); } else if (riid == IID_IPin) { *ppvObject = static_cast(this); @@ -570,6 +574,10 @@ void VideoSurfaceFilter::supportedFormatsChanged() { QMutexLocker locker(&m_mutex); + // MEDIASUBTYPE_None; + static const GUID none = { + 0xe436eb8e, 0x524f, 0x11ce, {0x9f, 0x53, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70} }; + QList formats = m_surface->supportedPixelFormats(); QVector mediaTypes; @@ -588,7 +596,7 @@ void VideoSurfaceFilter::supportedFormatsChanged() foreach (QVideoFrame::PixelFormat format, formats) { type.subtype = DirectShowMediaType::convertPixelFormat(format); - if (type.subtype != MEDIASUBTYPE_None) + if (type.subtype != none) mediaTypes.append(type); } diff --git a/src/plugins/mediaservices/directshow/mediaplayer/videosurfacefilter.h b/src/plugins/mediaservices/directshow/mediaplayer/videosurfacefilter.h index 8f3a101..0607fd3 100644 --- a/src/plugins/mediaservices/directshow/mediaplayer/videosurfacefilter.h +++ b/src/plugins/mediaservices/directshow/mediaplayer/videosurfacefilter.h @@ -41,6 +41,7 @@ #ifndef VIDEOSURFACEFILTER_H #define VIDEOSURFACEFILTER_H +#include "directshowglobal.h" #include "directshowmediatypelist.h" #include "directshowsamplescheduler.h" #include "directshowmediatype.h" @@ -52,9 +53,6 @@ #include #include -#include - - QT_BEGIN_HEADER QT_BEGIN_NAMESPACE -- cgit v0.12 From 8d98125460c223c5b9da017edd4a05dba8ba82af Mon Sep 17 00:00:00 2001 From: Andrew den Exter Date: Thu, 25 Feb 2010 17:34:52 +1000 Subject: Make the Direct Show media service compile with a Qt namespace. Move a QFile include outside the namespace. Reviewed-by: Justin McPherson --- src/plugins/mediaservices/directshow/mediaplayer/directshowiosource.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugins/mediaservices/directshow/mediaplayer/directshowiosource.h b/src/plugins/mediaservices/directshow/mediaplayer/directshowiosource.h index 3eb9a88..1d917df 100644 --- a/src/plugins/mediaservices/directshow/mediaplayer/directshowiosource.h +++ b/src/plugins/mediaservices/directshow/mediaplayer/directshowiosource.h @@ -47,12 +47,12 @@ #include "directshowmediatype.h" #include "directshowmediatypelist.h" +#include + QT_BEGIN_HEADER QT_BEGIN_NAMESPACE -#include - class DirectShowIOSource : public DirectShowMediaTypeList , public IBaseFilter -- cgit v0.12 From 7045ac94cd029fbcd3585e980f00fdf5a54750c3 Mon Sep 17 00:00:00 2001 From: Andrew den Exter Date: Thu, 25 Feb 2010 17:38:39 +1000 Subject: Rebuild configure.exe --- configure.exe | Bin 1221632 -> 1223168 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/configure.exe b/configure.exe index f937ea2..5d034f0 100755 Binary files a/configure.exe and b/configure.exe differ -- cgit v0.12 From f7d3ec31c417445c8bc35b722c1376cf20360642 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Thu, 25 Feb 2010 10:49:46 +0100 Subject: optimize appending of (empty) lists to (empty) lists if appending an empty lists, don't do anything. if appending to an empty list, just assign. this saves some needless detaches/reallocs. Reviewed-by: joao --- src/corelib/tools/qlist.h | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/src/corelib/tools/qlist.h b/src/corelib/tools/qlist.h index 02d434e..c6dd106 100644 --- a/src/corelib/tools/qlist.h +++ b/src/corelib/tools/qlist.h @@ -811,15 +811,22 @@ Q_OUTOFLINE_TEMPLATE typename QList::iterator QList::erase(typename QList< template Q_OUTOFLINE_TEMPLATE QList &QList::operator+=(const QList &l) { - Node *n = (d->ref != 1) - ? detach_helper_grow(INT_MAX, l.size()) - : reinterpret_cast(p.append2(l.p)); - QT_TRY{ - node_copy(n, reinterpret_cast(p.end()), reinterpret_cast(l.p.begin())); - } QT_CATCH(...) { - // restore the old end - d->end -= int(reinterpret_cast(p.end()) - n); - QT_RETHROW; + if (!l.isEmpty()) { + if (isEmpty()) { + *this = l; + } else { + Node *n = (d->ref != 1) + ? detach_helper_grow(INT_MAX, l.size()) + : reinterpret_cast(p.append2(l.p)); + QT_TRY { + node_copy(n, reinterpret_cast(p.end()), + reinterpret_cast(l.p.begin())); + } QT_CATCH(...) { + // restore the old end + d->end -= int(reinterpret_cast(p.end()) - n); + QT_RETHROW; + } + } } return *this; } -- cgit v0.12 From 63c002162bda57d0ec5faf108df63fd67ce7e089 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Tue, 23 Feb 2010 20:44:10 +0100 Subject: use QList::reserve() as appropriate --- src/corelib/tools/qhash.h | 3 +++ src/corelib/tools/qmap.h | 3 +++ 2 files changed, 6 insertions(+) diff --git a/src/corelib/tools/qhash.h b/src/corelib/tools/qhash.h index f1030ae..3374c80 100644 --- a/src/corelib/tools/qhash.h +++ b/src/corelib/tools/qhash.h @@ -625,6 +625,7 @@ template Q_OUTOFLINE_TEMPLATE QList QHash::uniqueKeys() const { QList res; + res.reserve(size()); // May be too much, but assume short lifetime const_iterator i = begin(); if (i != end()) { for (;;) { @@ -644,6 +645,7 @@ template Q_OUTOFLINE_TEMPLATE QList QHash::keys() const { QList res; + res.reserve(size()); const_iterator i = begin(); while (i != end()) { res.append(i.key()); @@ -688,6 +690,7 @@ template Q_OUTOFLINE_TEMPLATE QList QHash::values() const { QList res; + res.reserve(size()); const_iterator i = begin(); while (i != end()) { res.append(i.value()); diff --git a/src/corelib/tools/qmap.h b/src/corelib/tools/qmap.h index 2e21547..df0ae46 100644 --- a/src/corelib/tools/qmap.h +++ b/src/corelib/tools/qmap.h @@ -773,6 +773,7 @@ template Q_OUTOFLINE_TEMPLATE QList QMap::uniqueKeys() const { QList res; + res.reserve(size()); // May be too much, but assume short lifetime const_iterator i = begin(); if (i != end()) { for (;;) { @@ -792,6 +793,7 @@ template Q_OUTOFLINE_TEMPLATE QList QMap::keys() const { QList res; + res.reserve(size()); const_iterator i = begin(); while (i != end()) { res.append(i.key()); @@ -836,6 +838,7 @@ template Q_OUTOFLINE_TEMPLATE QList QMap::values() const { QList res; + res.reserve(size()); const_iterator i = begin(); while (i != end()) { res.append(i.value()); -- cgit v0.12 From 724fccdb1480e51df62ce7c810ec369608cc4803 Mon Sep 17 00:00:00 2001 From: aavit Date: Thu, 25 Feb 2010 15:09:40 +0100 Subject: Compile on WinCE --- src/3rdparty/libtiff/libtiff/tif_wince.c | 281 +++++++++++++++++++++++++++++++ src/plugins/imageformats/tiff/tiff.pro | 5 +- 2 files changed, 284 insertions(+), 2 deletions(-) create mode 100644 src/3rdparty/libtiff/libtiff/tif_wince.c diff --git a/src/3rdparty/libtiff/libtiff/tif_wince.c b/src/3rdparty/libtiff/libtiff/tif_wince.c new file mode 100644 index 0000000..4e283da --- /dev/null +++ b/src/3rdparty/libtiff/libtiff/tif_wince.c @@ -0,0 +1,281 @@ +/* $Id: tif_wince.c,v 1.1 2007-01-15 18:40:39 mloskot Exp $ */ + +/* + * Copyright (c) 1988-1997 Sam Leffler + * Copyright (c) 1991-1997 Silicon Graphics, Inc. + * + * Permission to use, copy, modify, distribute, and sell this software and + * its documentation for any purpose is hereby granted without fee, provided + * that (i) the above copyright notices and this permission notice appear in + * all copies of the software and related documentation, and (ii) the names of + * Sam Leffler and Silicon Graphics may not be used in any advertising or + * publicity relating to the software without the specific, prior written + * permission of Sam Leffler and Silicon Graphics. + * + * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, + * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY + * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. + * + * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR + * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, + * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, + * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF + * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE + * OF THIS SOFTWARE. + */ + +/* + * Windows CE-specific routines for TIFF Library. + * Adapted from tif_win32.c 01/10/2006 by Mateusz Loskot (mateusz@loskot.net) + */ + +#ifndef _WIN32_WCE +# error "Only Windows CE target is supported!" +#endif + +#include "tiffiop.h" +#include + +/* Turn off console support on Windows CE. */ +#undef TIF_PLATFORM_CONSOLE + + +/* + * Open a TIFF file for read/writing. + */ +TIFF* +TIFFOpen(const char* name, const char* mode) +{ + static const char module[] = "TIFFOpen"; + thandle_t fd; + int m; + DWORD dwMode; + TIFF* tif; + size_t nLen; + size_t nWideLen; + wchar_t* wchName; + + m = _TIFFgetMode(mode, module); + + switch(m) + { + case O_RDONLY: + dwMode = OPEN_EXISTING; + break; + case O_RDWR: + dwMode = OPEN_ALWAYS; + break; + case O_RDWR|O_CREAT: + dwMode = OPEN_ALWAYS; + break; + case O_RDWR|O_TRUNC: + dwMode = CREATE_ALWAYS; + break; + case O_RDWR|O_CREAT|O_TRUNC: + dwMode = CREATE_ALWAYS; + break; + default: + return ((TIFF*)0); + } + + /* On Windows CE, CreateFile is mapped to CreateFileW, + * but file path is passed as char-based string, + * so the path has to be converted to wchar_t. + */ + + nWideLen = 0; + wchName = NULL; + nLen = strlen(name) + 1; + + nWideLen = MultiByteToWideChar(CP_ACP, 0, name, nLen, NULL, 0); + wchName = (wchar_t*)malloc(sizeof(wchar_t) * nWideLen); + if (NULL == wchName) + { + TIFFErrorExt(0, module, "Memory allocation error!"); + return ((TIFF *)0); + } + memset(wchName, 0, sizeof(wchar_t) * nWideLen); + MultiByteToWideChar(CP_ACP, 0, name, nLen, wchName, nWideLen); + + fd = (thandle_t)CreateFile(wchName, + (m == O_RDONLY)?GENERIC_READ:(GENERIC_READ | GENERIC_WRITE), + FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, dwMode, + (m == O_RDONLY)?FILE_ATTRIBUTE_READONLY:FILE_ATTRIBUTE_NORMAL, + NULL); + + free(wchName); + + if (fd == INVALID_HANDLE_VALUE) { + TIFFErrorExt(0, module, "%s: Cannot open", name); + return ((TIFF *)0); + } + + /* TODO - mloskot: change to TIFFdOpenW and pass wchar path */ + + tif = TIFFFdOpen((int)fd, name, mode); + if(!tif) + CloseHandle(fd); + return tif; +} + +/* + * Open a TIFF file with a Unicode filename, for read/writing. + */ +TIFF* +TIFFOpenW(const wchar_t* name, const char* mode) +{ + static const char module[] = "TIFFOpenW"; + thandle_t fd; + int m; + DWORD dwMode; + int mbsize; + char *mbname; + TIFF *tif; + + m = _TIFFgetMode(mode, module); + + switch(m) { + case O_RDONLY: dwMode = OPEN_EXISTING; break; + case O_RDWR: dwMode = OPEN_ALWAYS; break; + case O_RDWR|O_CREAT: dwMode = OPEN_ALWAYS; break; + case O_RDWR|O_TRUNC: dwMode = CREATE_ALWAYS; break; + case O_RDWR|O_CREAT|O_TRUNC: dwMode = CREATE_ALWAYS; break; + default: return ((TIFF*)0); + } + + /* On Windows CE, CreateFile is mapped to CreateFileW, + * so no conversion of wchar_t to char is required. + */ + + fd = (thandle_t)CreateFile(name, + (m == O_RDONLY)?GENERIC_READ:(GENERIC_READ|GENERIC_WRITE), + FILE_SHARE_READ, NULL, dwMode, + (m == O_RDONLY)?FILE_ATTRIBUTE_READONLY:FILE_ATTRIBUTE_NORMAL, + NULL); + if (fd == INVALID_HANDLE_VALUE) { + TIFFErrorExt(0, module, "%S: Cannot open", name); + return ((TIFF *)0); + } + + mbname = NULL; + mbsize = WideCharToMultiByte(CP_ACP, 0, name, -1, NULL, 0, NULL, NULL); + if (mbsize > 0) { + mbname = (char *)_TIFFmalloc(mbsize); + if (!mbname) { + TIFFErrorExt(0, module, + "Can't allocate space for filename conversion buffer"); + return ((TIFF*)0); + } + + WideCharToMultiByte(CP_ACP, 0, name, -1, mbname, mbsize, + NULL, NULL); + } + + tif = TIFFFdOpen((int)fd, + (mbname != NULL) ? mbname : "", mode); + if(!tif) + CloseHandle(fd); + + _TIFFfree(mbname); + + return tif; +} + +static void +Win32WarningHandler(const char* module, const char* fmt, va_list ap) +{ + /* On Windows CE, MessageBox is mapped to wide-char based MessageBoxW. */ + + size_t nWideLen = 0; + LPTSTR szWideTitle = NULL; + LPTSTR szWideMsg = NULL; + + LPSTR szTitle; + LPSTR szTmp; + LPCSTR szTitleText = "%s Warning"; + LPCSTR szDefaultModule = "LIBTIFF"; + LPCSTR szTmpModule; + + szTmpModule = (module == NULL) ? szDefaultModule : module; + if ((szTitle = (LPSTR)LocalAlloc(LMEM_FIXED, + (strlen(szTmpModule) + strlen(szTitleText) + + strlen(fmt) + 128) * sizeof(char))) == NULL) + return; + + sprintf(szTitle, szTitleText, szTmpModule); + szTmp = szTitle + (strlen(szTitle) + 2) * sizeof(char); + vsprintf(szTmp, fmt, ap); + + /* Convert error message to Unicode. */ + + nWideLen = MultiByteToWideChar(CP_ACP, 0, szTitle, -1, NULL, 0); + szWideTitle = (wchar_t*)malloc(sizeof(wchar_t) * nWideLen); + MultiByteToWideChar(CP_ACP, 0, szTitle, -1, szWideTitle, nWideLen); + + nWideLen = MultiByteToWideChar(CP_ACP, 0, szTmp, -1, NULL, 0); + szWideMsg = (wchar_t*)malloc(sizeof(wchar_t) * nWideLen); + MultiByteToWideChar(CP_ACP, 0, szTmp, -1, szWideMsg, nWideLen); + + /* Display message */ + + MessageBox(GetFocus(), szWideMsg, szWideTitle, MB_OK | MB_ICONEXCLAMATION); + + /* Free resources */ + + LocalFree(szTitle); + free(szWideMsg); + free(szWideTitle); +} + +TIFFErrorHandler _TIFFwarningHandler = Win32WarningHandler; + +static void +Win32ErrorHandler(const char* module, const char* fmt, va_list ap) +{ + /* On Windows CE, MessageBox is mapped to wide-char based MessageBoxW. */ + + size_t nWideLen = 0; + LPTSTR szWideTitle = NULL; + LPTSTR szWideMsg = NULL; + + LPSTR szTitle; + LPSTR szTmp; + LPCSTR szTitleText = "%s Error"; + LPCSTR szDefaultModule = "LIBTIFF"; + LPCSTR szTmpModule; + + szTmpModule = (module == NULL) ? szDefaultModule : module; + if ((szTitle = (LPSTR)LocalAlloc(LMEM_FIXED, + (strlen(szTmpModule) + strlen(szTitleText) + + strlen(fmt) + 128) * sizeof(char))) == NULL) + return; + + sprintf(szTitle, szTitleText, szTmpModule); + szTmp = szTitle + (strlen(szTitle) + 2) * sizeof(char); + vsprintf(szTmp, fmt, ap); + + /* Convert error message to Unicode. */ + + nWideLen = MultiByteToWideChar(CP_ACP, 0, szTitle, -1, NULL, 0); + szWideTitle = (wchar_t*)malloc(sizeof(wchar_t) * nWideLen); + MultiByteToWideChar(CP_ACP, 0, szTitle, -1, szWideTitle, nWideLen); + + nWideLen = MultiByteToWideChar(CP_ACP, 0, szTmp, -1, NULL, 0); + szWideMsg = (wchar_t*)malloc(sizeof(wchar_t) * nWideLen); + MultiByteToWideChar(CP_ACP, 0, szTmp, -1, szWideMsg, nWideLen); + + /* Display message */ + + MessageBox(GetFocus(), szWideMsg, szWideTitle, MB_OK | MB_ICONEXCLAMATION); + + /* Free resources */ + + LocalFree(szTitle); + free(szWideMsg); + free(szWideTitle); +} + +TIFFErrorHandler _TIFFerrorHandler = Win32ErrorHandler; + + +/* vim: set ts=8 sts=8 sw=8 noet: */ diff --git a/src/plugins/imageformats/tiff/tiff.pro b/src/plugins/imageformats/tiff/tiff.pro index 312f99c..514fd69 100644 --- a/src/plugins/imageformats/tiff/tiff.pro +++ b/src/plugins/imageformats/tiff/tiff.pro @@ -47,14 +47,15 @@ contains(QT_CONFIG, system-tiff) { ../../../3rdparty/libtiff/libtiff/tif_warning.c \ ../../../3rdparty/libtiff/libtiff/tif_write.c \ ../../../3rdparty/libtiff/libtiff/tif_zip.c - win32 { + win32:!wince*: { SOURCES += ../../../3rdparty/libtiff/libtiff/tif_win32.c } unix: { SOURCES += ../../../3rdparty/libtiff/libtiff/tif_unix.c } wince*: { - SOURCES += ../../../corelib/kernel/qfunctions_wince.cpp + SOURCES += ../../../corelib/kernel/qfunctions_wince.cpp \ + ../../../3rdparty/libtiff/libtiff/tif_wince.c } symbian*: { SOURCES += ../../../3rdparty/libtiff/port/lfind.c -- cgit v0.12 From d7404e4ce890139c1447f892009c8a30f6dd6314 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Thu, 25 Feb 2010 20:47:19 +0100 Subject: fix ts-assistant target --- translations/translations.pri | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/translations/translations.pri b/translations/translations.pri index a8fb7ee..34da6b1 100644 --- a/translations/translations.pri +++ b/translations/translations.pri @@ -58,7 +58,7 @@ ts-linguist.depends = sub-tools ts-assistant.commands = (cd $$QT_SOURCE_TREE/src && $$LUPDATE \ ../tools/assistant/translations/translations.pro \ && $$LUPDATE \ - ../tools/assistant/translations/qt_help.pro)) + ../tools/assistant/translations/qt_help.pro) ts-assistant.depends = sub-tools ###### Qtconfig -- cgit v0.12 From 7944ac1fb6eb0ae3bbbfdf6780b52f7174174a93 Mon Sep 17 00:00:00 2001 From: Lorn Potter Date: Fri, 26 Feb 2010 15:22:02 +1000 Subject: check that wifi is powered on before trying to scan. also fix crash and remove useless warning messages. Alex --- src/plugins/bearer/corewlan/qcorewlanengine.mm | 122 ++++++++++++------------- 1 file changed, 59 insertions(+), 63 deletions(-) diff --git a/src/plugins/bearer/corewlan/qcorewlanengine.mm b/src/plugins/bearer/corewlan/qcorewlanengine.mm index a5384d1..9a28a33 100644 --- a/src/plugins/bearer/corewlan/qcorewlanengine.mm +++ b/src/plugins/bearer/corewlan/qcorewlanengine.mm @@ -154,9 +154,9 @@ void QCoreWlanEngine::connectToId(const QString &id) NSDictionary *parametersDict; NSArray* apArray; - CW8021XProfile *user8021XProfile; - NSError *err; - NSMutableDictionary *params; + CW8021XProfile *user8021XProfile; + NSError *err; + NSMutableDictionary *params; while ((wProfile = [enumerator nextObject])) { //CWWirelessProfile @@ -185,10 +185,8 @@ void QCoreWlanEngine::connectToId(const QString &id) bool result = [wifiInterface associateToNetwork: apNetwork parameters:[NSDictionary dictionaryWithDictionary:params] error:&err]; if(!result) { - qWarning() <<"ERROR"<< nsstringToQString([err localizedDescription ]); emit connectionError(id, ConnectError); } else { - [apNetwork release]; [autoreleasepool release]; return; } @@ -350,83 +348,81 @@ QStringList QCoreWlanEngine::scanForSsids(const QString &interfaceName) NSAutoreleasePool *autoreleasepool = [[NSAutoreleasePool alloc] init]; CWInterface *currentInterface = [CWInterface interfaceWithName:qstringToNSString(interfaceName)]; - NSError *err = nil; - NSDictionary *parametersDict = nil; - NSArray* apArray = [currentInterface scanForNetworksWithParameters:parametersDict error:&err]; + if([currentInterface power]) { + NSError *err = nil; + NSDictionary *parametersDict = nil; + NSArray* apArray = [currentInterface scanForNetworksWithParameters:parametersDict error:&err]; - CWNetwork *apNetwork; - if (!err) { - for(uint row=0; row < [apArray count]; row++ ) { - NSAutoreleasePool *looppool = [[NSAutoreleasePool alloc] init]; + CWNetwork *apNetwork; + if (!err) { + for(uint row=0; row < [apArray count]; row++ ) { + NSAutoreleasePool *looppool = [[NSAutoreleasePool alloc] init]; - apNetwork = [apArray objectAtIndex:row]; + apNetwork = [apArray objectAtIndex:row]; - const QString networkSsid = nsstringToQString([apNetwork ssid]); + const QString networkSsid = nsstringToQString([apNetwork ssid]); - const QString id = QString::number(qHash(QLatin1String("corewlan:") + networkSsid)); - found.append(id); + const QString id = QString::number(qHash(QLatin1String("corewlan:") + networkSsid)); + found.append(id); - QNetworkConfiguration::StateFlags state = QNetworkConfiguration::Undefined; + QNetworkConfiguration::StateFlags state = QNetworkConfiguration::Undefined; - if ([currentInterface.interfaceState intValue] == kCWInterfaceStateRunning) { - if (networkSsid == nsstringToQString([currentInterface ssid])) - state = QNetworkConfiguration::Active; - } else { - if (isKnownSsid(interfaceName, networkSsid)) - state = QNetworkConfiguration::Discovered; - else - state = QNetworkConfiguration::Defined; - } + if ([currentInterface.interfaceState intValue] == kCWInterfaceStateRunning) { + if (networkSsid == nsstringToQString([currentInterface ssid])) + state = QNetworkConfiguration::Active; + } else { + if (isKnownSsid(interfaceName, networkSsid)) + state = QNetworkConfiguration::Discovered; + else + state = QNetworkConfiguration::Defined; + } - if (accessPointConfigurations.contains(id)) { - QNetworkConfigurationPrivatePointer ptr = accessPointConfigurations.value(id); + if (accessPointConfigurations.contains(id)) { + QNetworkConfigurationPrivatePointer ptr = accessPointConfigurations.value(id); - bool changed = false; + bool changed = false; - if (!ptr->isValid) { - ptr->isValid = true; - changed = true; - } + if (!ptr->isValid) { + ptr->isValid = tru