Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

QML_Video example: Link error using Qt 5.15.15 for Android #410

Closed
franNadalesDN opened this issue Oct 26, 2023 · 3 comments
Closed

QML_Video example: Link error using Qt 5.15.15 for Android #410

franNadalesDN opened this issue Oct 26, 2023 · 3 comments

Comments

@franNadalesDN
Copy link

franNadalesDN commented Oct 26, 2023

I am trying to build qm_video example for Android using:

  • Qt 5.15.15
  • NDK 23.2
  • SDK 33
  • Target architecture: arm64-v8a

I have following linker error:

ld: error: undefined symbol: QDeclarativeVideoOutput::videoSurface() const

referenced by main.cpp:85 (..\qml_video\main.cpp:85)
ld: error: undefined symbol: QDeclarativeVideoOutput::sourceRectChanged()
referenced by main.cpp:87 (..\qml_video\main.cpp:87)

Any idea about how to solve it?

@franNadalesDN franNadalesDN changed the title Link error using Qt 5.15.15 for Android QML_Video example: Link error using Qt 5.15.15 for Android Oct 26, 2023
@valbok
Copy link
Owner

valbok commented Oct 27, 2023

Hi, thanks for contributing, do you have QT+=multimedia in pro?

@franNadalesDN
Copy link
Author

franNadalesDN commented Oct 27, 2023

Hi, yes.pro conatined multimedia since I was using qml_video example from main branch.

Anyway I think I found a solution.

It seems something was wrong in my environment that does not like this section in QtAVPlayer.pri:

    QT += core-private
    PRIVATE_HEADERS += $$PWD/qavhwdevice_mediacodec_p.h
    SOURCES += $$PWD/qavhwdevice_mediacodec.cpp $$PWD/qavandroidsurfacetexture.cpp

#    equals(ANDROID_TARGET_ARCH, armeabi-v7a): \
#        LIBS += -L$$(AVPLAYER_ANDROID_LIB_ARMEABI_V7A)

#    equals(ANDROID_TARGET_ARCH, arm64-v8a): \
#        LIBS += -L$$(AVPLAYER_ANDROID_LIB_ARMEABI_V8A)

#    equals(ANDROID_TARGET_ARCH, x86): \
#        LIBS += -L$$(AVPLAYER_ANDROID_LIB_X86)

#    equals(ANDROID_TARGET_ARCH, x86_64): \
#        LIBS += -L$$(AVPLAYER_ANDROID_LIB_X86_64)
}```

Solution was to remove linker commands.

@valbok
Copy link
Owner

valbok commented Oct 29, 2023

Thanks, I suggested to use
AVPLAYER_ANDROID_LIB_* exports to define path to the ffmpeg libs, and hardcoded in QtAVPlayer.pri to use them like LIBS += -L$$(AVPLAYER_ANDROID_LIB_ARMEABI_V7A)
Anyway you will have to provide correct paths to link against ffmpeg and also don't forget to deploy the libs together with your apps.

@valbok valbok closed this as completed Oct 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants