Skip to content

Commit

Permalink
Fixed build on MacOS
Browse files Browse the repository at this point in the history
  • Loading branch information
kala13x committed Sep 23, 2024
1 parent ac7e212 commit 700056a
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
5 changes: 2 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ set(SOURCES
)

add_library(${PROJECT_NAME} STATIC ${SOURCES})
SET(DST_DIR "/usr/local/include/xmedia")

target_link_libraries(${PROJECT_NAME}
xutils
Expand All @@ -33,5 +32,5 @@ target_link_libraries(${PROJECT_NAME}
swresample
)

install(TARGETS ${PROJECT_NAME} ARCHIVE DESTINATION /usr/local/lib)
install(DIRECTORY ${PROJECT_SOURCE_DIR}/src/ DESTINATION ${DST_DIR} FILES_MATCHING PATTERN "*.h")
install(TARGETS ${PROJECT_NAME} ARCHIVE DESTINATION lib)
install(DIRECTORY ${PROJECT_SOURCE_DIR}/src/ DESTINATION xmedia FILES_MATCHING PATTERN "*.h")
5 changes: 5 additions & 0 deletions src/encoder.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,12 @@ extern "C" {
typedef void(*xencoder_stat_cb_t)(void *pUserCtx, const char *pStatus);
typedef void(*xencoder_err_cb_t)(void *pUserCtx, const char *pErrStr);
typedef int(*xencoder_pkt_cb_t)(void *pUserCtx, AVPacket *pPacket);

#ifdef __APPLE__
typedef int(*xmuxer_cb_t)(void *pUserCtx, const uint8_t *pData, int nSize);
#else
typedef int(*xmuxer_cb_t)(void *pUserCtx, uint8_t *pData, int nSize);
#endif

#define XENCODER_IO_SIZE (1024 * 64)

Expand Down
4 changes: 2 additions & 2 deletions src/stdinc.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,13 @@
and we need to use the new AVChannelLayout structure instead.
*/
#ifndef XCODEC_USE_NEW_CHANNEL
#if FF_API_OLD_CHANNEL_LAYOUT
#if defined(FF_API_OLD_CHANNEL_LAYOUT) || defined(__APPLE__)
#define XCODEC_USE_NEW_CHANNEL 1
#endif
#endif

#ifndef XCODEC_USE_NEW_FIFO
#if FF_API_FIFO_OLD_API
#if defined(FF_API_FIFO_OLD_API) || defined(__APPLE__)
#define XCODEC_USE_NEW_FIFO 1
#endif
#endif
Expand Down

0 comments on commit 700056a

Please sign in to comment.