
qt_add_library(video STATIC "")

target_sources(video
PRIVATE
    videowidget.cpp
    readstream.cpp
    pushstream.cpp
    decodestream.cpp
    savestream.cpp
    avpacketqueuemanager.cpp
PUBLIC
    ffmpeginclude.h
    videowidget.h
    readstream.h
    pushstream.h
    decodestream.h
    savestream.h
    avpacketqueuemanager.h
)

# qt6_add_resources(video
# PRIVATE
#     FILES glrc.qrc
# )
# qt6_add_resources(video glrc.qrc)
qt6_add_resources(video "gl"
    PREFIX "/"
    FILES
        fragment.fsh
        vertex.vsh
)

target_link_libraries(video PRIVATE
    Qt6::Core
    Qt6::OpenGLWidgets
    Qt6::Network
    ${FFMPEG_DIR}/lib/avcodec.lib
    ${FFMPEG_DIR}/lib/avdevice.lib
    ${FFMPEG_DIR}/lib/avfilter.lib
    ${FFMPEG_DIR}/lib/avformat.lib
    ${FFMPEG_DIR}/lib/avutil.lib
    ${FFMPEG_DIR}/lib/postproc.lib
    ${FFMPEG_DIR}/lib/swresample.lib
    ${FFMPEG_DIR}/lib/swscale.lib
)

target_include_directories(video
PUBLIC
    ${CMAKE_CURRENT_LIST_DIR}
    ${FFMPEG_DIR}/include
)
