Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/apple.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@ jobs:
- run: brew install tree xcodegen
- name: Download Pre Compiled Dependencies
run: |
./FFToolChain/main.sh install -p ios -l 'ass ffmpeg'
./FFToolChain/main.sh install -p macos -l 'ass ffmpeg'
./FFToolChain/main.sh install -p tvos -l 'ass ffmpeg'
./FFToolChain/main.sh install -p ios -l 'ass ffmpeg8'
./FFToolChain/main.sh install -p macos -l 'ass ffmpeg8'
./FFToolChain/main.sh install -p tvos -l 'ass ffmpeg8'
- name: Build iOS Framework
run: ./examples/ios/build-framework.sh
- name: Build macOS Framework
Expand Down
2 changes: 1 addition & 1 deletion FFToolChain
Submodule FFToolChain updated 53 files
+2 −0 .github/workflows/build all libs.yml
+1 −0 .github/workflows/build one lib.yml
+19 −0 .github/workflows/install-dependencies.sh
+8 −6 README.md
+12 −9 README_zh-CN.md
+25 −14 configs/ffconfig/auto-detect-third-libs.sh
+0 −1 configs/ffconfig/module-default.sh
+0 −1 configs/ffconfig/module-full.sh
+0 −1 configs/ffconfig/module-lite-hevc.sh
+0 −1 configs/ffconfig/module-lite.sh
+4 −4 configs/libs/ass.sh
+4 −4 configs/libs/bluray.sh
+41 −0 configs/libs/ffmpeg8.sh
+1 −1 configs/libs/fontconfig.sh
+4 −4 configs/libs/freetype.sh
+4 −4 configs/libs/harfbuzz.sh
+6 −6 configs/libs/openssl3.sh
+6 −6 configs/libs/opus.sh
+4 −4 configs/libs/xml2.sh
+32 −1 do-compile/apple/any.sh
+15 −1 do-compile/apple/bluray.sh
+1 −4 do-compile/apple/xml2.sh
+39 −7 do-install/correct-pc.sh
+2 −0 do-install/install-pre-lib.sh
+0 −4 do-install/main.sh
+52 −0 patches/ffmpeg-n8.1.1/0001-PATCH-restore-ijk-h264_ps-null-pointer-fault-toleran.patch
+671 −0 patches/ffmpeg-n8.1.1/0002-restore-ijk-avformat-add-application-and-dns_cache.patch
+278 −0 patches/ffmpeg-n8.1.1/0003-restore-ijk-http-event-hooks.patch
+404 −0 patches/ffmpeg-n8.1.1/0004-restore-ijk-tcp-dns-cache.patch
+277 −0 patches/ffmpeg-n8.1.1/0005-restore-ijk-custom-protocols-and-demuxers-except-lon.patch
+41 −0 patches/ffmpeg-n8.1.1/0006-add-4-dummy-ijkplaceholder-demuxers.patch
+41 −0 patches/ffmpeg-n8.1.1/0007-add-3-dummy-ijkhttp-protocols.patch
+91 −0 patches/ffmpeg-n8.1.1/0008-restore-ijk-av_dict_get-that-converts-the-value-to-a.patch
+129 −0 patches/ffmpeg-n8.1.1/0009-control-which-http-impl-was-used-by-set-selected_htt.patch
+26 −0 patches/ffmpeg-n8.1.1/0010-correct-file-seekable-value-range-0-means-streamed-c.patch
+43 −0 patches/ffmpeg-n8.1.1/0011-fix-lrcdec-read-line-bug-on-osx.patch
+47 −0 patches/ffmpeg-n8.1.1/0012-avformat-mpegts-index-only-keyframes-to-ensure-accur.patch
+29 −0 patches/ffmpeg-n8.1.1/0013-fix-can-t-seek-to-00-00-bug-baidu-neddisk-hls-start_.patch
+60 −0 patches/ffmpeg-n8.1.1/0014-Correct-the-wrong-codecpar-codec_id-which-read-from-.patch
+32 −0 patches/ffmpeg-n8.1.1/0015-fix-http-chunked-transfer-get-wrong-size-cause-av_re.patch
+76 −0 patches/ffmpeg-n8.1.1/0016-not-very-useful-log-use-trace-level.patch
+1,340 −0 patches/ffmpeg-n8.1.1/0017-Audio-Vivid-Parser-and-Demuxer-but-av3a-Decoder-is-a.patch
+41 −0 patches/ffmpeg-n8.1.1/0018-http-add-reconnect_first_delay-opt.patch
+102 −0 patches/ffmpeg-n8.1.1/0019-fix-http-open-and-http_seek-redirect-authentication-.patch
+495 −0 patches/ffmpeg-n8.1.1/0020-add-built-in-smb2-protocol-via-libsmb2.patch
+55 −0 patches/ffmpeg-n8.1.1/0021-URLProtocol-add-url_parse_priv-function-pointer.patch
+54 −0 patches/ffmpeg-n8.1.1/0022-bluray-protocol-add-dvd-fallback.patch
+673 −0 patches/ffmpeg-n8.1.1/0023-custom-bluray-fs-for-network-Blu-ray-Disc-and-BDMV.patch
+70 −0 patches/ffmpeg-n8.1.1/0024-bluray-open-and-find-the-right-m2ts-then-read-seek-i.patch
+26 −0 patches/ffmpeg-n8.1.1/0025-fix-android-ffmpeg7-test.c-1-10-fatal-error-libxml2-.patch
+43 −0 patches/ffmpeg-n8.1.1/0026-fix-dash-init-fragment-url-is-invalid-truncated-bug.patch
+804 −0 patches/ffmpeg-n8.1.1/0027-add-webp-demuxer-and-libwebp-decoder.patch
+8 −2 tools/export-apple-host-env.sh
302 changes: 302 additions & 0 deletions FSPlayer-5.yml

Large diffs are not rendered by default.

302 changes: 302 additions & 0 deletions FSPlayer-6.yml

Large diffs are not rendered by default.

7 changes: 6 additions & 1 deletion generate-proj.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,9 @@ cd "$THIS_DIR"
set -e

export MY_PROJECT_DIR="$THIS_DIR"
xcodegen -p . -s FSPlayer.yml

if [[ -n $1 ]];then
xcodegen -p . -s FSPlayer-$1.yml
else
xcodegen -p . -s FSPlayer.yml
fi
7 changes: 6 additions & 1 deletion ijkmedia/ijkplayer/ff_ffinc.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,13 @@
#include "libavutil/version.h"
#include "libswresample/swresample.h"
#include "libavformat/avformat.h"
#include "ff_version.h"
#if IS_FFMPEG_6
#include "libavformat/application.h"
#include "libavcodec/avfft.h"
#else
#include "libavutil/application.h"
#endif
//#include "libavcodec/avfft.h"
#include "libswscale/swscale.h"
#include "ijksdl/ijksdl.h"

Expand Down
55 changes: 32 additions & 23 deletions ijkmedia/ijkplayer/ff_ffplay.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
#endif
#include "libswscale/swscale.h"
#include "libavutil/opt.h"
#include "libavcodec/avfft.h"
//#include "libavcodec/avfft.h"
#include "libswresample/swresample.h"
#include "ff_version.h"
#if CONFIG_AUDIO_AVFILTER || CONFIG_VIDEO_AVFILTER
Expand Down Expand Up @@ -1237,7 +1237,7 @@ static int get_z_rotate_degrees(AVStream *video_st)
if (!video_st)
return 0;
int32_t *displaymatrix = NULL;
#if IS_FFMPEG_5
#if IS_FFMPEG_6
const AVPacketSideData *sideData = av_packet_side_data_get(video_st->codecpar->coded_side_data, video_st->codecpar->nb_coded_side_data, AV_PKT_DATA_DISPLAYMATRIX);
if (sideData && sideData->size >= 36) {
displaymatrix = (int32_t *)sideData->data;
Expand Down Expand Up @@ -1397,21 +1397,6 @@ static int queue_picture(FFPlayer *ffp, AVFrame *src_frame, double pts, double d

vp->sar = src_frame->sample_aspect_ratio;

/* HEIC tile-grid: decode 输出是每个 tile 的独立 AVFrame,
* 但 overlay 应当承载整张 canvas;将 tile 的宽高改写为 canvas 宽高
* 以避免 alloc_picture 在 tile 切换时反复重建 overlay。
*/
int tile_canvas_w_fix = 0;
int tile_canvas_h_fix = 0;
if (src_frame->opaque_ref &&
src_frame->opaque_ref->size >= (int)sizeof(FSTileGridMetadata)) {
FSTileGridMetadata *tmeta = (FSTileGridMetadata *)src_frame->opaque_ref->data;
if (tmeta->nb_tiles > 0 && tmeta->canvas_w > 0 && tmeta->canvas_h > 0) {
tile_canvas_w_fix = tmeta->canvas_w;
tile_canvas_h_fix = tmeta->canvas_h;
}
}

//TODO: windows and android plat.
//软解时,上层指定了明确的overlay-format时需要转格式
if (src_frame->format != AV_PIX_FMT_VIDEOTOOLBOX) {
Expand Down Expand Up @@ -1539,9 +1524,30 @@ static int queue_picture(FFPlayer *ffp, AVFrame *src_frame, double pts, double d
}
}

/* alloc or resize hardware picture buffer */
#if IS_TILEGRID_HEIC_ENABLED
/* HEIC tile-grid: decode 输出是每个 tile 的独立 AVFrame,
* 但 overlay 应当承载整张 canvas;将 tile 的宽高改写为 canvas 宽高
* 以避免 alloc_picture 在 tile 切换时反复重建 overlay。
*/
int tile_canvas_w_fix = 0;
int tile_canvas_h_fix = 0;
if (src_frame->opaque_ref &&
src_frame->opaque_ref->size >= (int)sizeof(FSTileGridMetadata)) {
FSTileGridMetadata *tmeta = (FSTileGridMetadata *)src_frame->opaque_ref->data;
if (tmeta->nb_tiles > 0 && tmeta->canvas_w > 0 && tmeta->canvas_h > 0) {
tile_canvas_w_fix = tmeta->canvas_w;
tile_canvas_h_fix = tmeta->canvas_h;
}
}
int cmp_w = tile_canvas_w_fix > 0 ? tile_canvas_w_fix : src_frame->width;
int cmp_h = tile_canvas_h_fix > 0 ? tile_canvas_h_fix : src_frame->height;
#else
int cmp_w = src_frame->width;
int cmp_h = src_frame->height;
#endif

/* alloc or resize hardware picture buffer */

if (!vp->bmp || !vp->allocated ||
vp->width != cmp_w ||
vp->height != cmp_h ||
Expand Down Expand Up @@ -1577,7 +1583,7 @@ static int queue_picture(FFPlayer *ffp, AVFrame *src_frame, double pts, double d
av_log(NULL, AV_LOG_FATAL, "Cannot initialize the conversion context\n");
return -3;
}
#if IS_TILEGRID_HEIC_ENABLED
/* HEIC tile-grid: 如果 overlay 还在累积 tile,不要 push 到渲染队列,
* 保留 writable 槽位给下一个 tile 继续写入。
*/
Expand All @@ -1589,7 +1595,10 @@ static int queue_picture(FFPlayer *ffp, AVFrame *src_frame, double pts, double d
if (isPending) {
return 0;
}

#else
/* update the bitmap content */
SDL_VoutUnlockYUVOverlay(vp->bmp);
#endif
vp->pts = pts;
vp->duration = duration;
vp->pos = pos;
Expand Down Expand Up @@ -3654,7 +3663,7 @@ static int read_thread(void *arg)
do {
if (av_stristart(is->filename, "data:", NULL) && orig_nb_streams > 0) {
for (i = 0; i < orig_nb_streams; i++) {
if (!ic->streams[i] || !ic->streams[i]->codecpar || ic->streams[i]->codecpar->profile == FF_PROFILE_UNKNOWN) {
if (!ic->streams[i] || !ic->streams[i]->codecpar || ic->streams[i]->codecpar->profile == AV_PROFILE_UNKNOWN) {
break;
}
}
Expand Down Expand Up @@ -4166,7 +4175,7 @@ static int read_thread(void *arg)
}

do {
#if IS_TILEGRID_HEIC_ENABLED
if (ic->nb_stream_groups > 0) {
for (unsigned int i = 0; i < ic->nb_stream_groups; i++) {
AVStreamGroup *group = ic->stream_groups[i];
Expand Down Expand Up @@ -4247,7 +4256,7 @@ static int read_thread(void *arg)
}
break;
}
#endif
AVStream *st = ic->streams[pkt->stream_index];
/* check if packet is in play range specified by user, then queue, otherwise discard */
stream_start_time = st->start_time;
Expand Down
2 changes: 1 addition & 1 deletion ijkmedia/ijkplayer/ff_ffplay_def.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
#include "libavformat/avformat.h"
#include "libswscale/swscale.h"
#include "libavutil/opt.h"
#include "libavcodec/avfft.h"
//#include "libavcodec/avfft.h"
#include "libswresample/swresample.h"

#if CONFIG_AUDIO_AVFILTER || CONFIG_VIDEO_AVFILTER
Expand Down
8 changes: 7 additions & 1 deletion ijkmedia/ijkplayer/ff_version.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,15 @@
#include "libavformat/version_major.h"

#define IS_FFMPEG_7 (LIBAVFORMAT_VERSION_MAJOR >= 61)
#define IS_LESS_THAN_FFMPEG_7 (LIBAVFORMAT_VERSION_MAJOR < 61)
#define IS_LESS_THAN_FFMPEG_7 (LIBAVFORMAT_VERSION_MAJOR < 61)
#define IS_FFMPEG_6 (LIBAVFORMAT_VERSION_MAJOR >= 60)
#define IS_LESS_THAN_FFMPEG_6 (LIBAVFORMAT_VERSION_MAJOR < 60)
#define IS_FFMPEG_5 (LIBAVFORMAT_VERSION_MAJOR >= 59)
#define IS_FFMPEG_4 (LIBAVFORMAT_VERSION_MAJOR >= 58)
#define IS_TILEGRID_HEIC_ENABLED IS_FFMPEG_7

#if IS_LESS_THAN_FFMPEG_6
#define AV_PROFILE_UNKNOWN FF_PROFILE_UNKNOWN
#endif

#endif /* ff_version_h */
4 changes: 4 additions & 0 deletions ijkmedia/ijkplayer/ijkavformat/allformats.c
Original file line number Diff line number Diff line change
Expand Up @@ -211,14 +211,18 @@ void ijkav_register_all(void)
#ifdef __ANDROID__
FS_REGISTER_PROTOCOL(ijkmediadatasource);
#endif
#if IS_FFMPEG_6
FS_REGISTER_PROTOCOL(ijkhttp2);
#endif
FS_REGISTER_PROTOCOL(ijkio);
FS_REGISTER_PROTOCOL(ijktcphook);
FS_REGISTER_PROTOCOL(ijkhttphook);
FS_REGISTER_PROTOCOL(ijksegment);
/* demuxers */
FS_REGISTER_DEMUXER(ijklivehook);
#if IS_FFMPEG_6
//private hls demuxer
FS_REGISTER_DEMUXER(ijkplaceholder1);
#endif
av_log(NULL, AV_LOG_INFO, "===== custom modules end =====\n");
}
27 changes: 24 additions & 3 deletions ijkmedia/ijkplayer/ijkavformat/ijkhls.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@
* https://www.rfc-editor.org/rfc/rfc8216.txt
*/

#include "../ff_version.h"
#include "libavformat/avformat.h"
#if IS_FFMPEG_6
#include "libffmpeg/config_components.h"

#include "libavformat/http.h"
Expand All @@ -39,7 +42,7 @@
#include "libavutil/opt.h"
#include "libavutil/dict.h"
#include "libavutil/time.h"
#include "libavformat/avformat.h"

#include "libavformat/demux.h"
#include "libavutil/internal.h"
#include "libavformat/avio_internal.h"
Expand All @@ -48,7 +51,6 @@

#include "libavformat/hls_sample_encryption.h"
#include "libavformat/internal.h"
#include "../ff_version.h"

#define INITIAL_BUFFER_SIZE 32768

Expand Down Expand Up @@ -2761,6 +2763,8 @@ static const AVClass fs_hls_class = {
.version = LIBAVUTIL_VERSION_INT,
};

#endif

#if IS_FFMPEG_7
const FFInputFormat ijkff_ijkplaceholder1_demuxer = {
.p.name = "debug_hls",
Expand All @@ -2776,7 +2780,7 @@ const FFInputFormat ijkff_ijkplaceholder1_demuxer = {
.read_seek = hls_read_seek,
};

#else
#elif IS_FFMPEG_6

const AVInputFormat ijkff_ijkplaceholder1_demuxer = {
.name = "fs_hls",
Expand All @@ -2791,4 +2795,21 @@ const AVInputFormat ijkff_ijkplaceholder1_demuxer = {
.read_close = hls_close,
.read_seek = hls_read_seek,
};

#else

#define IJK_DUMMY_DEMUXER(x) \
static const AVClass ijk_##x##_demuxer_class = { \
.class_name = #x, \
.item_name = av_default_item_name, \
.version = LIBAVUTIL_VERSION_INT, \
}; \
\
AVInputFormat ff_##x##_demuxer = { \
.name = #x, \
.priv_data_size = 1, \
.priv_class = &ijk_##x##_demuxer_class, \
};

IJK_DUMMY_DEMUXER(ijkplaceholder1);
#endif
5 changes: 5 additions & 0 deletions ijkmedia/ijkplayer/ijkavformat/ijkiourlhook.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,12 @@
#include <stdlib.h>
#include "ijkiourl.h"
#include "ijkioprotocol.h"
#include "../ff_version.h"
#if IS_FFMPEG_6
#include "libavformat/application.h"
#else
#include "libavutil/application.h"
#endif
#include "libavformat/avio.h"
#include "libavutil/error.h"
#include "libavutil/avstring.h"
Expand Down
7 changes: 6 additions & 1 deletion ijkmedia/ijkplayer/ijkavformat/ijklivehook.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,13 @@
#include "ijkplayer/ijkavutil/opt.h"

#include "ijkavformat.h"
#include "libavformat/application.h"
#include "../ff_version.h"
#if IS_FFMPEG_6
#include "libavformat/application.h"
#else
#include "libavutil/application.h"
#endif


typedef struct {
AVClass *class;
Expand Down
6 changes: 5 additions & 1 deletion ijkmedia/ijkplayer/ijkavformat/ijksegment.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,12 @@
#include "libavutil/avstring.h"
#include "libavutil/log.h"
#include "libavutil/opt.h"

#include "../ff_version.h"
#if IS_FFMPEG_6
#include "libavformat/application.h"
#else
#include "libavutil/application.h"
#endif

typedef struct Context {
AVClass *class;
Expand Down
6 changes: 5 additions & 1 deletion ijkmedia/ijkplayer/ijkavformat/ijkurlhook.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,12 @@
#include "libavutil/avstring.h"
#include "libavutil/log.h"
#include "libavutil/opt.h"

#include "../ff_version.h"
#if IS_FFMPEG_6
#include "libavformat/application.h"
#else
#include "libavutil/application.h"
#endif

typedef struct Context {
AVClass *class;
Expand Down
3 changes: 2 additions & 1 deletion ijkmedia/ijkplayer/ijkmeta.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
#include "ff_ffinc.h"
#include "ijksdl/ijksdl_misc.h"
#include "ff_ffplay.h"
#include "ff_version.h"

#define FS_META_INIT_CAPACITY 13

Expand Down Expand Up @@ -302,7 +303,7 @@ void ijkmeta_set_avformat_context_l(IjkMediaMeta *meta, AVFormatContext *ic)
const char *codec_name = avcodec_get_name(codecpar->codec_id);
if (codec_name)
ijkmeta_set_string_l(stream_meta, FSM_KEY_CODEC_NAME, codec_name);
if (codecpar->profile != FF_PROFILE_UNKNOWN) {
if (codecpar->profile != AV_PROFILE_UNKNOWN) {
const AVCodec *codec = avcodec_find_decoder(codecpar->codec_id);
if (codec) {
ijkmeta_set_int64_l(stream_meta, FSM_KEY_CODEC_PROFILE_ID, codecpar->profile);
Expand Down
5 changes: 3 additions & 2 deletions ijkmedia/ijksdl/apple/ijksdl_vout_ios_gles2.m
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ static int vout_display_overlay_l(SDL_Vout *vout, SDL_VoutOverlay *overlay, SDL_
ALOGE("vout_display_overlay_l: invalid format:%d\n",overlay->format);
return -4;
}

#if IS_TILEGRID_HEIC_ENABLED
/* HEIC tile grid 路径:把所有 tile 打包到 FSOverlayAttach.tilePieces */
if (overlay->is_tile_grid) {
int count = SDL_VoutOverlay_GetTileCount(overlay);
Expand Down Expand Up @@ -191,7 +191,8 @@ static int vout_display_overlay_l(SDL_Vout *vout, SDL_VoutOverlay *overlay, SDL_
free(bufs); free(xs); free(ys); free(ws); free(hs);
return [gl_view displayAttach:attach];
}

#endif

CVPixelBufferRef videoPic = SDL_Overlay_getCVPixelBufferRef(overlay);
if (videoPic) {
FSOverlayAttach *attach = [[FSOverlayAttach alloc] init];
Expand Down
Loading