Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. Building qt module from source doesn't apply changes
Forum Updated to NodeBB v4.3 + New Features

Building qt module from source doesn't apply changes

Scheduled Pinned Locked Moved Unsolved Installation and Deployment
19 Posts 4 Posters 2.7k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • W Offline
    W Offline
    Wiru
    wrote on last edited by
    #1

    Hello I'm having some trouble applying changes to a qt module and seeing the changes in the build.
    The module in question is qtmultimedia, I did the same before in Qt 5.10 and the same steps worked just fine, but now it simply doesn't do anything.

    What I do is go to qtmultimedia/src/plugins/avfoundation/mediaplayer/avfmediaplayersession.mm
    And do some changes, for example I add NSLog(@"something"); to the function
    - (void) setURL:(NSURL *)url, which later on should print out the log when I set a source for MediaPlayer component.

    The way I build the module:

    1. just in case I do a "git add/commit" the change in qtmultimedia
    2. run ~user/Qt/5.11.3/ios/bin/qmake ../qtmultimedia as I want it to replace my current qtmultimedia of Qt 5.11.3 (I run the command from an empty buildqtm folder so all the config files are created there)
    3. make

    And once this is done I build my project with Qt 5.11.3, however none of the changes or logs is visible once I run the application.

    Do I miss some steps, or is there any other reason my changes aren't visible, ( the exact same procedure did work before with Qt 5.10)?

    aha_1980A 1 Reply Last reply
    0
    • W Wiru

      Hello I'm having some trouble applying changes to a qt module and seeing the changes in the build.
      The module in question is qtmultimedia, I did the same before in Qt 5.10 and the same steps worked just fine, but now it simply doesn't do anything.

      What I do is go to qtmultimedia/src/plugins/avfoundation/mediaplayer/avfmediaplayersession.mm
      And do some changes, for example I add NSLog(@"something"); to the function
      - (void) setURL:(NSURL *)url, which later on should print out the log when I set a source for MediaPlayer component.

      The way I build the module:

      1. just in case I do a "git add/commit" the change in qtmultimedia
      2. run ~user/Qt/5.11.3/ios/bin/qmake ../qtmultimedia as I want it to replace my current qtmultimedia of Qt 5.11.3 (I run the command from an empty buildqtm folder so all the config files are created there)
      3. make

      And once this is done I build my project with Qt 5.11.3, however none of the changes or logs is visible once I run the application.

      Do I miss some steps, or is there any other reason my changes aren't visible, ( the exact same procedure did work before with Qt 5.10)?

      aha_1980A Offline
      aha_1980A Offline
      aha_1980
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi @Wiru,

      you didn't mention how you installed Qt. Is this just a normal installation or did you build Qt from source?

      I think you miss step 4. make install, which copies the generated libraries, plugins and header files the the place where your final app picks them up on compiling.

      Qt has to stay free or it will die.

      1 Reply Last reply
      0
      • W Offline
        W Offline
        Wiru
        wrote on last edited by Wiru
        #3

        Sorry about that. The QT 5.11.3 was freshly installed today with the installer, tho I do also have a whole custom build from source for ios build Qt 5.11.1 but I'm not using qmake from that one.

        I didn't use make install as I didn't use it before when it worked and it also says not to run make install once the ~user/Qt/5.11.3/ios/bin/qmake ../qtmultimedia is done.

        I can try with install next week as I don't have a mac at home.
        Mostly I'm just confused how it doesn't apply any changes anymore as it did before.

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          Hi,

          Might be a silly question, but do you really want to do that for the iOS platform or are you targeting macOS ?

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          1
          • W Offline
            W Offline
            Wiru
            wrote on last edited by
            #5

            @SGaist
            I'm targeting the iOS platform

            1 Reply Last reply
            0
            • SGaistS Offline
              SGaistS Offline
              SGaist
              Lifetime Qt Champion
              wrote on last edited by
              #6

              Did you double check that the make install command does everything as expected ?

              Interested in AI ? www.idiap.ch
              Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

              1 Reply Last reply
              0
              • W Offline
                W Offline
                Wiru
                wrote on last edited by
                #7

                I didn't run the make install as it says not to after the config, and I know for sure I didn't do it before either. But I'll try make and then make install on Monday and see if it works then.

                1 Reply Last reply
                0
                • W Offline
                  W Offline
                  Wiru
                  wrote on last edited by
                  #8

                  Even with make install no luck.

                  This is what I get as output for ~user/Qt/5.11.3/ios/bin/qmake ../qtmultimedia and why I didn't use make install before. Not sure anymore what could be the problem.

                  Info: creating stash file /Users/user/QTProjects/buildqtm/.qmake.stash
                  Info: creating cache file /Users/user/QTProjects/buildqtm/.qmake.cache
                  
                  Running configuration tests...
                  Checking for ALSA... no
                  Checking for AVFoundation... yes
                  Checking for Vivante GPU... no
                  Checking for GStreamer 1.0... no
                  Checking for GStreamer 0.10... no
                  Checking for Video for Linux... no
                  Checking for OpenAL... yes
                  Checking for PulseAudio >= 0.9.10... no
                  Checking for libresourceqt5... no
                  Done running configuration tests.
                  
                  Configure summary:
                  
                  Qt Multimedia:
                    ALSA ................................... no
                    GStreamer 1.0 .......................... no
                    GStreamer 0.10 ......................... no
                    Video for Linux ........................ no
                    OpenAL ................................. yes
                    PulseAudio ............................. no
                    Resource Policy (libresourceqt5) ....... no
                    AVFoundation ........................... yes
                    Windows Audio Services ................. no
                    DirectShow ............................. no
                    Windows Media Foundation ............... no
                  
                  Qt is now configured for building. Just run 'make'.
                  Once everything is built, Qt is installed.
                  You should NOT run 'make install'.
                  Note that this build cannot be deployed to other machines or devices.
                  
                  Prior to reconfiguration, make sure you remove any leftovers from
                  the previous build.
                  

                  I could paste the makefile it creates if that would be of use?

                  aha_1980A 1 Reply Last reply
                  0
                  • W Wiru

                    Even with make install no luck.

                    This is what I get as output for ~user/Qt/5.11.3/ios/bin/qmake ../qtmultimedia and why I didn't use make install before. Not sure anymore what could be the problem.

                    Info: creating stash file /Users/user/QTProjects/buildqtm/.qmake.stash
                    Info: creating cache file /Users/user/QTProjects/buildqtm/.qmake.cache
                    
                    Running configuration tests...
                    Checking for ALSA... no
                    Checking for AVFoundation... yes
                    Checking for Vivante GPU... no
                    Checking for GStreamer 1.0... no
                    Checking for GStreamer 0.10... no
                    Checking for Video for Linux... no
                    Checking for OpenAL... yes
                    Checking for PulseAudio >= 0.9.10... no
                    Checking for libresourceqt5... no
                    Done running configuration tests.
                    
                    Configure summary:
                    
                    Qt Multimedia:
                      ALSA ................................... no
                      GStreamer 1.0 .......................... no
                      GStreamer 0.10 ......................... no
                      Video for Linux ........................ no
                      OpenAL ................................. yes
                      PulseAudio ............................. no
                      Resource Policy (libresourceqt5) ....... no
                      AVFoundation ........................... yes
                      Windows Audio Services ................. no
                      DirectShow ............................. no
                      Windows Media Foundation ............... no
                    
                    Qt is now configured for building. Just run 'make'.
                    Once everything is built, Qt is installed.
                    You should NOT run 'make install'.
                    Note that this build cannot be deployed to other machines or devices.
                    
                    Prior to reconfiguration, make sure you remove any leftovers from
                    the previous build.
                    

                    I could paste the makefile it creates if that would be of use?

                    aha_1980A Offline
                    aha_1980A Offline
                    aha_1980
                    Lifetime Qt Champion
                    wrote on last edited by
                    #9

                    @Wiru so what does make install do?

                    The only reason for not installing is a developer build of Qt, AFAIK.

                    Qt has to stay free or it will die.

                    1 Reply Last reply
                    2
                    • W Offline
                      W Offline
                      Wiru
                      wrote on last edited by Wiru
                      #10

                      In short it does nothing, here is a piece of the output:

                      /Users/user/Qt/5.11.3/ios/bin/qmake -install qinstall /Users/user/QTProjects/buildqtm/lib/cmake/Qt5Multimedia/Qt5Multimedia_AVFMediaPlayerServicePlugin.cmake /Users/user/Qt/5.11.3/ios/lib/cmake/Qt5Multimedia/Qt5Multimedia_AVFMediaPlayerServicePlugin.cmake
                      cd camera/ && ( test -e Makefile || /Users/user/Qt/5.11.3/ios/bin/qmake -o Makefile /Users/user/QTProjects/qtmultimedia/src/plugins/avfoundation/camera/camera.pro ) && /Applications/Xcode.app/Contents/Developer/usr/bin/make -f Makefile install
                      /Applications/Xcode.app/Contents/Developer/usr/bin/make -f Makefile.Debug install
                      /Users/user/Qt/5.11.3/ios/bin/qmake -install qinstall /Users/user/QTProjects/buildqtm/mkspecs/modules-inst/qt_plugin_qavfcamera.pri /Users/user/Qt/5.11.3/ios/mkspecs/modules/qt_plugin_qavfcamera.pri
                      /Users/user/Qt/5.11.3/ios/bin/qmake -install qinstall ../../../../plugins/mediaservice/libqavfcamera_debug.a /Users/user/Qt/5.11.3/ios/plugins/mediaservice/libqavfcamera_debug.a
                      /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib -s /Users/user/Qt/5.11.3/ios/plugins/mediaservice/libqavfcamera_debug.a
                      sed -e 's,/Users/user/QTProjects/buildqtm/lib,$$[QT_INSTALL_LIBS],g' ../../../../plugins/mediaservice/libqavfcamera_debug.prl > /Users/user/Qt/5.11.3/ios/plugins/mediaservice/libqavfcamera_debug.prl
                      /Users/user/Qt/5.11.3/ios/bin/qmake -install qinstall /Users/user/QTProjects/buildqtm/lib/cmake/Qt5Multimedia/Qt5Multimedia_AVFServicePlugin.cmake /Users/user/Qt/5.11.3/ios/lib/cmake/Qt5Multimedia/Qt5Multimedia_AVFServicePlugin.cmake
                      /Applications/Xcode.app/Contents/Developer/usr/bin/make -f Makefile.Release install
                      /Users/user/Qt/5.11.3/ios/bin/qmake -install qinstall /Users/user/QTProjects/buildqtm/mkspecs/modules-inst/qt_plugin_qavfcamera.pri /Users/user/Qt/5.11.3/ios/mkspecs/modules/qt_plugin_qavfcamera.pri
                      /Users/user/Qt/5.11.3/ios/bin/qmake -install qinstall ../../../../plugins/mediaservice/libqavfcamera.a /Users/user/Qt/5.11.3/ios/plugins/mediaservice/libqavfcamera.a
                      /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib -s /Users/user/Qt/5.11.3/ios/plugins/mediaservice/libqavfcamera.a
                      sed -e 's,/Users/user/QTProjects/buildqtm/lib,$$[QT_INSTALL_LIBS],g' ../../../../plugins/mediaservice/libqavfcamera.prl > /Users/user/Qt/5.11.3/ios/plugins/mediaservice/libqavfcamera.prl
                      /Users/user/Qt/5.11.3/ios/bin/qmake -install qinstall /Users/user/QTProjects/buildqtm/lib/cmake/Qt5Multimedia/Qt5Multimedia_AVFServicePlugin.cmake /Users/user/Qt/5.11.3/ios/lib/cmake/Qt5Multimedia/Qt5Multimedia_AVFServicePlugin.cmake
                      

                      but even after that nothing visible changed in the app build.
                      Almost like it uses a cashed version or something and no matter what I build doesn't apply. Even tried to delete half of the code to break the module, as that would for sure be a noticeable change, but no luck.
                      I tried to run it on simulator and device.

                      1 Reply Last reply
                      0
                      • SGaistS Offline
                        SGaistS Offline
                        SGaist
                        Lifetime Qt Champion
                        wrote on last edited by
                        #11

                        Then a silly question, did you do a full rebuild (as in delete the build folder) of your application after calling make install ?

                        Interested in AI ? www.idiap.ch
                        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                        W 1 Reply Last reply
                        1
                        • SGaistS SGaist

                          Then a silly question, did you do a full rebuild (as in delete the build folder) of your application after calling make install ?

                          W Offline
                          W Offline
                          Wiru
                          wrote on last edited by Wiru
                          #12

                          @SGaist Yes, I delete it every time.
                          Right now I'm building the whole q5 from source, that at least should apply changes, but it takes way longer than building just one module.

                          EDIT: I'm starting to think that xcode is messing with me, what I said before that it worked with Qt 5.10 it was also the older version of xcode, that's the only other thing that might mess up the compile, but still doesn't make much sense.

                          1 Reply Last reply
                          0
                          • SGaistS Offline
                            SGaistS Offline
                            SGaist
                            Lifetime Qt Champion
                            wrote on last edited by
                            #13

                            Just in case, you don't need to build the whole of Qt, you can either skip all unneeded modules or build only qtbase and then the modules you need.

                            Interested in AI ? www.idiap.ch
                            Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                            1 Reply Last reply
                            1
                            • W Offline
                              W Offline
                              Wiru
                              wrote on last edited by
                              #14

                              Is there a way to see if the specific part I added is present in the build?
                              Even after building whole qt nothing changed.

                              This is the git commit I added to qtmultimedia, and as far as I know that's the part of code responsible for playback of iOS multimedia component?

                              Based on that it shouldn't even start playing anything.

                              diff --git a/src/plugins/avfoundation/mediaplayer/avfmediaplayersession.mm b/src/plugins/avfoundation/mediaplayer/avfmediaplayersession.mm
                              index 06fb71ef..80033d45 100644
                              --- a/src/plugins/avfoundation/mediaplayer/avfmediaplayersession.mm
                              +++ b/src/plugins/avfoundation/mediaplayer/avfmediaplayersession.mm
                              @@ -111,34 +111,37 @@ - (AVFMediaPlayerSessionObserver *) initWithMediaPlayerSession:(AVFMediaPlayerSe
                              
                               - (void) setURL:(NSURL *)url
                               {
                              -    if (m_URL != url)
                              -    {
                              -        [m_URL release];
                              -        m_URL = [url copy];
                              -
                              -        //Create an asset for inspection of a resource referenced by a given URL.
                              -        //Load the values for the asset keys "tracks", "playable".
                              -
                              -        // use __block to avoid maintaining strong references on variables captured by the
                              -        // following block callback
                              -        __block AVURLAsset *asset = [[AVURLAsset URLAssetWithURL:m_URL options:nil] retain];
                              -        __block NSArray *requestedKeys = [[NSArray arrayWithObjects:AVF_TRACKS_KEY, AVF_PLAYABLE_KEY, nil] retain];
                              -
                              -        __block AVFMediaPlayerSessionObserver *blockSelf = self;
                              -        QPointer<AVFMediaPlayerSession> session(m_session);
                              -
                              -        // Tells the asset to load the values of any of the specified keys that are not already loaded.
                              -        [asset loadValuesAsynchronouslyForKeys:requestedKeys completionHandler:
                              -         ^{
                              -             dispatch_async( dispatch_get_main_queue(),
                              -                           ^{
                              -                                if (session)
                              -                                    [blockSelf prepareToPlayAsset:asset withKeys:requestedKeys];
                              -                                 [asset release];
                              -                                 [requestedKeys release];
                              -                            });
                              -         }];
                              -    }
                              +//    if (m_URL != url)
                              +//    {
                              +//        [m_URL release];
                              +//        m_URL = [url copy];
                              +
                              +//qInfo() << "#################################";
                              +
                              +        NSLog(@"#################################  %@", url);
                              +//        //Create an asset for inspection of a resource referenced by a given URL.
                              +//        //Load the values for the asset keys "tracks", "playable".
                              +
                              +//        // use __block to avoid maintaining strong references on variables captured by the
                              +//        // following block callback
                              +//        __block AVURLAsset *asset = [[AVURLAsset URLAssetWithURL:m_URL options:nil] retain];
                              +//        __block NSArray *requestedKeys = [[NSArray arrayWithObjects:AVF_TRACKS_KEY, AVF_PLAYABLE_KEY, nil] retain];
                              +
                              +//        __block AVFMediaPlayerSessionObserver *blockSelf = self;
                              +//        QPointer<AVFMediaPlayerSession> session(m_session);
                              +
                              +//        // Tells the asset to load the values of any of the specified keys that are not already loaded.
                              +//        [asset loadValuesAsynchronouslyForKeys:requestedKeys completionHandler:
                              +//         ^{
                              +//             dispatch_async( dispatch_get_main_queue(),
                              +//                           ^{
                              +//                                if (session)
                              +//                                    [blockSelf prepareToPlayAsset:asset withKeys:requestedKeys];
                              +//                                 [asset release];
                              +//                                 [requestedKeys release];
                              +//                            });
                              +//         }];
                              +//    }
                               }
                              
                               - (void) unloadMedia
                              @@ -216,7 +219,10 @@ - (void) prepareToPlayAsset:(AVURLAsset *)asset
                                   }
                              
                                   //Create a new instance of AVPlayerItem from the now successfully loaded AVAsset.
                              -    m_playerItem = [AVPlayerItem playerItemWithAsset:asset];
                              +   //m_playerItem = [AVPlayerItem playerItemWithAsset:asset];
                              +
                              +    m_playerItem = [AVPlayerItem playerItemWithAsset:asset
                              +                           automaticallyLoadedAssetKeys:requestedKeys];
                              
                                   //Observe the player item "status" key to determine when it is ready to play.
                                   [m_playerItem addObserver:self
                              @@ -427,6 +433,7 @@ - (void) dealloc
                                   , m_seekable(false)
                               {
                                   m_observer = [[AVFMediaPlayerSessionObserver alloc] initWithMediaPlayerSession:this];
                              +NSLog(@"#################################");
                               }
                              
                               AVFMediaPlayerSession::~AVFMediaPlayerSession()
                              @@ -494,45 +501,46 @@ - (void) dealloc
                                   qDebug() << Q_FUNC_INFO << content.canonicalUrl();
                               #endif
                              
                              -    [(AVFMediaPlayerSessionObserver*)m_observer unloadMedia];
                              +//    [(AVFMediaPlayerSessionObserver*)m_observer unloadMedia];
                              
                                   m_resources = content;
                                   m_mediaStream = stream;
                              
                              -    setAudioAvailable(false);
                              -    setVideoAvailable(false);
                              -    setSeekable(false);
                              -    m_requestedPosition = -1;
                              -    Q_EMIT positionChanged(position());
                              +    NSLog(@"???????########## ");
                              +//    setAudioAvailable(false);
                              +//    setVideoAvailable(false);
                              +//    setSeekable(false);
                              +//    m_requestedPosition = -1;
                              +//    Q_EMIT positionChanged(position());
                              
                              -    const QMediaPlayer::MediaStatus oldMediaStatus = m_mediaStatus;
                              -    const QMediaPlayer::State oldState = m_state;
                              +//    const QMediaPlayer::MediaStatus oldMediaStatus = m_mediaStatus;
                              +//    const QMediaPlayer::State oldState = m_state;
                              
                              -    if (content.isNull() || content.canonicalUrl().isEmpty()) {
                              -        m_mediaStatus = QMediaPlayer::NoMedia;
                              -        if (m_mediaStatus != oldMediaStatus)
                              -            Q_EMIT mediaStatusChanged(m_mediaStatus);
                              +//    if (content.isNull() || content.canonicalUrl().isEmpty()) {
                              +//        m_mediaStatus = QMediaPlayer::NoMedia;
                              +//        if (m_mediaStatus != oldMediaStatus)
                              +//            Q_EMIT mediaStatusChanged(m_mediaStatus);
                              
                              -        m_state = QMediaPlayer::StoppedState;
                              -        if (m_state != oldState)
                              -            Q_EMIT stateChanged(m_state);
                              +//        m_state = QMediaPlayer::StoppedState;
                              +//        if (m_state != oldState)
                              +//            Q_EMIT stateChanged(m_state);
                              
                              -        return;
                              -    }
                              +//        return;
                              +//    }
                              
                              -    m_mediaStatus = QMediaPlayer::LoadingMedia;
                              -    if (m_mediaStatus != oldMediaStatus)
                              -        Q_EMIT mediaStatusChanged(m_mediaStatus);
                              +//    m_mediaStatus = QMediaPlayer::LoadingMedia;
                              +//    if (m_mediaStatus != oldMediaStatus)
                              +//        Q_EMIT mediaStatusChanged(m_mediaStatus);
                              
                              -    //Load AVURLAsset
                              -    //initialize asset using content's URL
                              -    NSString *urlString = [NSString stringWithUTF8String:content.canonicalUrl().toEncoded().constData()];
                              -    NSURL *url = [NSURL URLWithString:urlString];
                              -    [(AVFMediaPlayerSessionObserver*)m_observer setURL:url];
                              +//    //Load AVURLAsset
                              +//    //initialize asset using content's URL
                              +//    NSString *urlString = [NSString stringWithUTF8String:content.canonicalUrl().toEncoded().constData()];
                              +//    NSURL *url = [NSURL URLWithString:urlString];
                              +//    [(AVFMediaPlayerSessionObserver*)m_observer setURL:url];
                              
                              -    m_state = QMediaPlayer::StoppedState;
                              -    if (m_state != oldState)
                              -        Q_EMIT stateChanged(m_state);
                              +//    m_state = QMediaPlayer::StoppedState;
                              +//    if (m_state != oldState)
                              +//        Q_EMIT stateChanged(m_state);
                               }
                              
                               qint64 AVFMediaPlayerSession::position() const
                              @@ -700,61 +708,62 @@ - (void) dealloc
                              
                               void AVFMediaPlayerSession::play()
                               {
                              -#ifdef QT_DEBUG_AVF
                              -    qDebug() << Q_FUNC_INFO << "currently: " << m_state;
                              -#endif
                              
                              -    if (m_mediaStatus == QMediaPlayer::NoMedia || m_mediaStatus == QMediaPlayer::InvalidMedia)
                              -        return;
                              +    qDebug() << Q_FUNC_INFO << "##########currently: " << m_state;
                              +NSLog(@"################################# ");
                              
                              -    if (m_state == QMediaPlayer::PlayingState)
                              -        return;
                              +//    if (m_mediaStatus == QMediaPlayer::NoMedia || m_mediaStatus == QMediaPlayer::InvalidMedia)
                              +//        return;
                              
                              -    if (m_videoOutput) {
                              -        m_videoOutput->setLayer([(AVFMediaPlayerSessionObserver*)m_observer playerLayer]);
                              -    }
                              +//    if (m_state == QMediaPlayer::PlayingState)
                              +//        return;
                              
                              -    // Reset media status if the current status is EndOfMedia
                              -    if (m_mediaStatus == QMediaPlayer::EndOfMedia)
                              -        setPosition(0);
                              +//    if (m_videoOutput) {
                              +//        m_videoOutput->setLayer([(AVFMediaPlayerSessionObserver*)m_observer playerLayer]);
                              +//    }
                              
                              -    if (m_mediaStatus == QMediaPlayer::LoadedMedia || m_mediaStatus == QMediaPlayer::BufferedMedia) {
                              -        // Setting the rate starts playback
                              -        [[(AVFMediaPlayerSessionObserver*)m_observer player] setRate:m_rate];
                              -    }
                              +//    // Reset media status if the current status is EndOfMedia
                              +//    if (m_mediaStatus == QMediaPlayer::EndOfMedia)
                              +//        setPosition(0);
                              
                              -    m_state = QMediaPlayer::PlayingState;
                              -    processLoadStateChange();
                              +//        return;
                              
                              -    if (m_videoOutput) {
                              -        m_videoOutput->setLayer([(AVFMediaPlayerSessionObserver*)m_observer playerLayer]);
                              -    }
                              +//    if (m_state == QMediaPlayer::PlayingState)
                              +//        return;
                              
                              -    // Reset media status if the current status is EndOfMedia
                              -    if (m_mediaStatus == QMediaPlayer::EndOfMedia)
                              -        setPosition(0);
                              +//    if (m_videoOutput) {
                              +//        m_videoOutput->setLayer([(AVFMediaPlayerSessionObserver*)m_observer playerLayer]);
                              +//    }
                              
                              -    if (m_mediaStatus == QMediaPlayer::LoadedMedia || m_mediaStatus == QMediaPlayer::BufferedMedia) {
                              -        // Setting the rate starts playback
                              -        [[(AVFMediaPlayerSessionObserver*)m_observer player] setRate:m_rate];
                              -    }
                              +//    // Reset media status if the current status is EndOfMedia
                              +//    if (m_mediaStatus == QMediaPlayer::EndOfMedia)
                              +//        setPosition(0);
                              
                              -    m_state = QMediaPlayer::PlayingState;
                              -    processLoadStateChange();
                              +//    if (m_mediaStatus == QMediaPlayer::LoadedMedia || m_mediaStatus == QMediaPlayer::BufferedMedia) {
                              +//        // Setting the rate starts playback
                              +//        [[(AVFMediaPlayerSessionObserver*)m_observer player] setRate:m_rate];
                              +//    }
                              
                              -    Q_EMIT stateChanged(m_state);
                              +//    m_state = QMediaPlayer::PlayingState;
                              +//    processLoadStateChange();
                              +
                              +//    Q_EMIT stateChanged(m_state);
                               }
                              

                              Not really sure anymore what's wrong, by all means, this should make the changes apply on Qt 5.11.3

                              J.HilkJ 1 Reply Last reply
                              0
                              • W Wiru

                                Is there a way to see if the specific part I added is present in the build?
                                Even after building whole qt nothing changed.

                                This is the git commit I added to qtmultimedia, and as far as I know that's the part of code responsible for playback of iOS multimedia component?

                                Based on that it shouldn't even start playing anything.

                                diff --git a/src/plugins/avfoundation/mediaplayer/avfmediaplayersession.mm b/src/plugins/avfoundation/mediaplayer/avfmediaplayersession.mm
                                index 06fb71ef..80033d45 100644
                                --- a/src/plugins/avfoundation/mediaplayer/avfmediaplayersession.mm
                                +++ b/src/plugins/avfoundation/mediaplayer/avfmediaplayersession.mm
                                @@ -111,34 +111,37 @@ - (AVFMediaPlayerSessionObserver *) initWithMediaPlayerSession:(AVFMediaPlayerSe
                                
                                 - (void) setURL:(NSURL *)url
                                 {
                                -    if (m_URL != url)
                                -    {
                                -        [m_URL release];
                                -        m_URL = [url copy];
                                -
                                -        //Create an asset for inspection of a resource referenced by a given URL.
                                -        //Load the values for the asset keys "tracks", "playable".
                                -
                                -        // use __block to avoid maintaining strong references on variables captured by the
                                -        // following block callback
                                -        __block AVURLAsset *asset = [[AVURLAsset URLAssetWithURL:m_URL options:nil] retain];
                                -        __block NSArray *requestedKeys = [[NSArray arrayWithObjects:AVF_TRACKS_KEY, AVF_PLAYABLE_KEY, nil] retain];
                                -
                                -        __block AVFMediaPlayerSessionObserver *blockSelf = self;
                                -        QPointer<AVFMediaPlayerSession> session(m_session);
                                -
                                -        // Tells the asset to load the values of any of the specified keys that are not already loaded.
                                -        [asset loadValuesAsynchronouslyForKeys:requestedKeys completionHandler:
                                -         ^{
                                -             dispatch_async( dispatch_get_main_queue(),
                                -                           ^{
                                -                                if (session)
                                -                                    [blockSelf prepareToPlayAsset:asset withKeys:requestedKeys];
                                -                                 [asset release];
                                -                                 [requestedKeys release];
                                -                            });
                                -         }];
                                -    }
                                +//    if (m_URL != url)
                                +//    {
                                +//        [m_URL release];
                                +//        m_URL = [url copy];
                                +
                                +//qInfo() << "#################################";
                                +
                                +        NSLog(@"#################################  %@", url);
                                +//        //Create an asset for inspection of a resource referenced by a given URL.
                                +//        //Load the values for the asset keys "tracks", "playable".
                                +
                                +//        // use __block to avoid maintaining strong references on variables captured by the
                                +//        // following block callback
                                +//        __block AVURLAsset *asset = [[AVURLAsset URLAssetWithURL:m_URL options:nil] retain];
                                +//        __block NSArray *requestedKeys = [[NSArray arrayWithObjects:AVF_TRACKS_KEY, AVF_PLAYABLE_KEY, nil] retain];
                                +
                                +//        __block AVFMediaPlayerSessionObserver *blockSelf = self;
                                +//        QPointer<AVFMediaPlayerSession> session(m_session);
                                +
                                +//        // Tells the asset to load the values of any of the specified keys that are not already loaded.
                                +//        [asset loadValuesAsynchronouslyForKeys:requestedKeys completionHandler:
                                +//         ^{
                                +//             dispatch_async( dispatch_get_main_queue(),
                                +//                           ^{
                                +//                                if (session)
                                +//                                    [blockSelf prepareToPlayAsset:asset withKeys:requestedKeys];
                                +//                                 [asset release];
                                +//                                 [requestedKeys release];
                                +//                            });
                                +//         }];
                                +//    }
                                 }
                                
                                 - (void) unloadMedia
                                @@ -216,7 +219,10 @@ - (void) prepareToPlayAsset:(AVURLAsset *)asset
                                     }
                                
                                     //Create a new instance of AVPlayerItem from the now successfully loaded AVAsset.
                                -    m_playerItem = [AVPlayerItem playerItemWithAsset:asset];
                                +   //m_playerItem = [AVPlayerItem playerItemWithAsset:asset];
                                +
                                +    m_playerItem = [AVPlayerItem playerItemWithAsset:asset
                                +                           automaticallyLoadedAssetKeys:requestedKeys];
                                
                                     //Observe the player item "status" key to determine when it is ready to play.
                                     [m_playerItem addObserver:self
                                @@ -427,6 +433,7 @@ - (void) dealloc
                                     , m_seekable(false)
                                 {
                                     m_observer = [[AVFMediaPlayerSessionObserver alloc] initWithMediaPlayerSession:this];
                                +NSLog(@"#################################");
                                 }
                                
                                 AVFMediaPlayerSession::~AVFMediaPlayerSession()
                                @@ -494,45 +501,46 @@ - (void) dealloc
                                     qDebug() << Q_FUNC_INFO << content.canonicalUrl();
                                 #endif
                                
                                -    [(AVFMediaPlayerSessionObserver*)m_observer unloadMedia];
                                +//    [(AVFMediaPlayerSessionObserver*)m_observer unloadMedia];
                                
                                     m_resources = content;
                                     m_mediaStream = stream;
                                
                                -    setAudioAvailable(false);
                                -    setVideoAvailable(false);
                                -    setSeekable(false);
                                -    m_requestedPosition = -1;
                                -    Q_EMIT positionChanged(position());
                                +    NSLog(@"???????########## ");
                                +//    setAudioAvailable(false);
                                +//    setVideoAvailable(false);
                                +//    setSeekable(false);
                                +//    m_requestedPosition = -1;
                                +//    Q_EMIT positionChanged(position());
                                
                                -    const QMediaPlayer::MediaStatus oldMediaStatus = m_mediaStatus;
                                -    const QMediaPlayer::State oldState = m_state;
                                +//    const QMediaPlayer::MediaStatus oldMediaStatus = m_mediaStatus;
                                +//    const QMediaPlayer::State oldState = m_state;
                                
                                -    if (content.isNull() || content.canonicalUrl().isEmpty()) {
                                -        m_mediaStatus = QMediaPlayer::NoMedia;
                                -        if (m_mediaStatus != oldMediaStatus)
                                -            Q_EMIT mediaStatusChanged(m_mediaStatus);
                                +//    if (content.isNull() || content.canonicalUrl().isEmpty()) {
                                +//        m_mediaStatus = QMediaPlayer::NoMedia;
                                +//        if (m_mediaStatus != oldMediaStatus)
                                +//            Q_EMIT mediaStatusChanged(m_mediaStatus);
                                
                                -        m_state = QMediaPlayer::StoppedState;
                                -        if (m_state != oldState)
                                -            Q_EMIT stateChanged(m_state);
                                +//        m_state = QMediaPlayer::StoppedState;
                                +//        if (m_state != oldState)
                                +//            Q_EMIT stateChanged(m_state);
                                
                                -        return;
                                -    }
                                +//        return;
                                +//    }
                                
                                -    m_mediaStatus = QMediaPlayer::LoadingMedia;
                                -    if (m_mediaStatus != oldMediaStatus)
                                -        Q_EMIT mediaStatusChanged(m_mediaStatus);
                                +//    m_mediaStatus = QMediaPlayer::LoadingMedia;
                                +//    if (m_mediaStatus != oldMediaStatus)
                                +//        Q_EMIT mediaStatusChanged(m_mediaStatus);
                                
                                -    //Load AVURLAsset
                                -    //initialize asset using content's URL
                                -    NSString *urlString = [NSString stringWithUTF8String:content.canonicalUrl().toEncoded().constData()];
                                -    NSURL *url = [NSURL URLWithString:urlString];
                                -    [(AVFMediaPlayerSessionObserver*)m_observer setURL:url];
                                +//    //Load AVURLAsset
                                +//    //initialize asset using content's URL
                                +//    NSString *urlString = [NSString stringWithUTF8String:content.canonicalUrl().toEncoded().constData()];
                                +//    NSURL *url = [NSURL URLWithString:urlString];
                                +//    [(AVFMediaPlayerSessionObserver*)m_observer setURL:url];
                                
                                -    m_state = QMediaPlayer::StoppedState;
                                -    if (m_state != oldState)
                                -        Q_EMIT stateChanged(m_state);
                                +//    m_state = QMediaPlayer::StoppedState;
                                +//    if (m_state != oldState)
                                +//        Q_EMIT stateChanged(m_state);
                                 }
                                
                                 qint64 AVFMediaPlayerSession::position() const
                                @@ -700,61 +708,62 @@ - (void) dealloc
                                
                                 void AVFMediaPlayerSession::play()
                                 {
                                -#ifdef QT_DEBUG_AVF
                                -    qDebug() << Q_FUNC_INFO << "currently: " << m_state;
                                -#endif
                                
                                -    if (m_mediaStatus == QMediaPlayer::NoMedia || m_mediaStatus == QMediaPlayer::InvalidMedia)
                                -        return;
                                +    qDebug() << Q_FUNC_INFO << "##########currently: " << m_state;
                                +NSLog(@"################################# ");
                                
                                -    if (m_state == QMediaPlayer::PlayingState)
                                -        return;
                                +//    if (m_mediaStatus == QMediaPlayer::NoMedia || m_mediaStatus == QMediaPlayer::InvalidMedia)
                                +//        return;
                                
                                -    if (m_videoOutput) {
                                -        m_videoOutput->setLayer([(AVFMediaPlayerSessionObserver*)m_observer playerLayer]);
                                -    }
                                +//    if (m_state == QMediaPlayer::PlayingState)
                                +//        return;
                                
                                -    // Reset media status if the current status is EndOfMedia
                                -    if (m_mediaStatus == QMediaPlayer::EndOfMedia)
                                -        setPosition(0);
                                +//    if (m_videoOutput) {
                                +//        m_videoOutput->setLayer([(AVFMediaPlayerSessionObserver*)m_observer playerLayer]);
                                +//    }
                                
                                -    if (m_mediaStatus == QMediaPlayer::LoadedMedia || m_mediaStatus == QMediaPlayer::BufferedMedia) {
                                -        // Setting the rate starts playback
                                -        [[(AVFMediaPlayerSessionObserver*)m_observer player] setRate:m_rate];
                                -    }
                                +//    // Reset media status if the current status is EndOfMedia
                                +//    if (m_mediaStatus == QMediaPlayer::EndOfMedia)
                                +//        setPosition(0);
                                
                                -    m_state = QMediaPlayer::PlayingState;
                                -    processLoadStateChange();
                                +//        return;
                                
                                -    if (m_videoOutput) {
                                -        m_videoOutput->setLayer([(AVFMediaPlayerSessionObserver*)m_observer playerLayer]);
                                -    }
                                +//    if (m_state == QMediaPlayer::PlayingState)
                                +//        return;
                                
                                -    // Reset media status if the current status is EndOfMedia
                                -    if (m_mediaStatus == QMediaPlayer::EndOfMedia)
                                -        setPosition(0);
                                +//    if (m_videoOutput) {
                                +//        m_videoOutput->setLayer([(AVFMediaPlayerSessionObserver*)m_observer playerLayer]);
                                +//    }
                                
                                -    if (m_mediaStatus == QMediaPlayer::LoadedMedia || m_mediaStatus == QMediaPlayer::BufferedMedia) {
                                -        // Setting the rate starts playback
                                -        [[(AVFMediaPlayerSessionObserver*)m_observer player] setRate:m_rate];
                                -    }
                                +//    // Reset media status if the current status is EndOfMedia
                                +//    if (m_mediaStatus == QMediaPlayer::EndOfMedia)
                                +//        setPosition(0);
                                
                                -    m_state = QMediaPlayer::PlayingState;
                                -    processLoadStateChange();
                                +//    if (m_mediaStatus == QMediaPlayer::LoadedMedia || m_mediaStatus == QMediaPlayer::BufferedMedia) {
                                +//        // Setting the rate starts playback
                                +//        [[(AVFMediaPlayerSessionObserver*)m_observer player] setRate:m_rate];
                                +//    }
                                
                                -    Q_EMIT stateChanged(m_state);
                                +//    m_state = QMediaPlayer::PlayingState;
                                +//    processLoadStateChange();
                                +
                                +//    Q_EMIT stateChanged(m_state);
                                 }
                                

                                Not really sure anymore what's wrong, by all means, this should make the changes apply on Qt 5.11.3

                                J.HilkJ Offline
                                J.HilkJ Offline
                                J.Hilk
                                Moderators
                                wrote on last edited by
                                #15

                                hi @Wiru
                                might be just me, that I fail to see it, but where exactly do you replace the old QtMulimedia folder with the newly created one?


                                Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct


                                Q: What's that?
                                A: It's blue light.
                                Q: What does it do?
                                A: It turns blue.

                                W 1 Reply Last reply
                                0
                                • J.HilkJ J.Hilk

                                  hi @Wiru
                                  might be just me, that I fail to see it, but where exactly do you replace the old QtMulimedia folder with the newly created one?

                                  W Offline
                                  W Offline
                                  Wiru
                                  wrote on last edited by
                                  #16

                                  @J.Hilk Not really sure what you mean with replace, shouldn't the make install do that part? At least that's how it worked before, and at that time I only used make.
                                  Should I manually copy the folder?

                                  J.HilkJ 1 Reply Last reply
                                  0
                                  • W Wiru

                                    @J.Hilk Not really sure what you mean with replace, shouldn't the make install do that part? At least that's how it worked before, and at that time I only used make.
                                    Should I manually copy the folder?

                                    J.HilkJ Offline
                                    J.HilkJ Offline
                                    J.Hilk
                                    Moderators
                                    wrote on last edited by
                                    #17

                                    @Wiru
                                    I'm not sure, does make install replace already existing files ?

                                    When I change stuff in the Qt Source code I usually compile the whole libary and simply create a new kit linking against it. Never replaced only a single modul.

                                    In fact, the customer support recommended me to build the whole libary once, evenso we made only changes in the BlueTooth Module.


                                    Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct


                                    Q: What's that?
                                    A: It's blue light.
                                    Q: What does it do?
                                    A: It turns blue.

                                    W 1 Reply Last reply
                                    1
                                    • J.HilkJ J.Hilk

                                      @Wiru
                                      I'm not sure, does make install replace already existing files ?

                                      When I change stuff in the Qt Source code I usually compile the whole libary and simply create a new kit linking against it. Never replaced only a single modul.

                                      In fact, the customer support recommended me to build the whole libary once, evenso we made only changes in the BlueTooth Module.

                                      W Offline
                                      W Offline
                                      Wiru
                                      wrote on last edited by
                                      #18

                                      @J.Hilk
                                      I do create a new kit when I build the whole qt source, but for just module it should replace it in the qt version you used qmake from (in this example it should replace qtmultimedia inside qt5.11.3)

                                      1 Reply Last reply
                                      0
                                      • W Offline
                                        W Offline
                                        Wiru
                                        wrote on last edited by
                                        #19

                                        Weird as it may be, nothing worked. In the end I made a new Qml project and all changes are visible there, compiled qtmultimedia 3 times and every time the change was there.
                                        So I don't really understand why the previous project wouldn't use the modified version even after deleting its build folder. I even deleted ~/Library/Developer/Xcode/DerivedData in case there was some cache in it.

                                        1 Reply Last reply
                                        0

                                        • Login

                                        • Login or register to search.
                                        • First post
                                          Last post
                                        0
                                        • Categories
                                        • Recent
                                        • Tags
                                        • Popular
                                        • Users
                                        • Groups
                                        • Search
                                        • Get Qt Extensions
                                        • Unsolved