Skip to content

Commit

Permalink
Use muxer callback function based on avcodec version
Browse files Browse the repository at this point in the history
  • Loading branch information
kala13x committed Nov 6, 2024
1 parent 8cbe3c0 commit 65e372c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 35 deletions.
34 changes: 0 additions & 34 deletions .vscode/settings.json

This file was deleted.

4 changes: 4 additions & 0 deletions example/xmedia.c
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,11 @@ static void clear_cb(xarray_data_t *pArrData)
free(pArrData->pData);
}

#if XMEDIA_AVCODEC_VER_AT_LEAST(5, 7)
static int muxer_cb(void *pCtx, const uint8_t *pData, int nSize)
#else
static int muxer_cb(void *pCtx, uint8_t *pData, int nSize)
#endif
{
xlogd("Muxer callback: size(%d)", nSize);
xtranscoder_t *pTransmuxer = (xtranscoder_t*)pCtx;
Expand Down
2 changes: 1 addition & 1 deletion src/encoder.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ 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__
#if XMEDIA_AVCODEC_VER_AT_LEAST(5, 7)
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);
Expand Down

0 comments on commit 65e372c

Please sign in to comment.