diff options
| author | 2025-08-05 10:50:08 -0400 | |
|---|---|---|
| committer | 2025-08-05 10:50:08 -0400 | |
| commit | 2cc385b71e161eae39915bf24de53d5b704e7ea0 (patch) | |
| tree | 0e5ee2dd01b87944b6401ffbb72e5232af5e2767 /src/codec/ffmpeg | |
| parent | e0fcbf0910b52a6e66eb733a2850ec58a53cf0e3 (diff) | |
| download | camu-2cc385b71e161eae39915bf24de53d5b704e7ea0.tar.gz camu-2cc385b71e161eae39915bf24de53d5b704e7ea0.tar.bz2 camu-2cc385b71e161eae39915bf24de53d5b704e7ea0.zip | |
Twitter module work, various cleanups
and comment clarifications
Signed-off-by: Andrew Opalach <andrew@akon.city>
Diffstat (limited to 'src/codec/ffmpeg')
| -rw-r--r-- | src/codec/ffmpeg/decoder.c | 6 | ||||
| -rw-r--r-- | src/codec/ffmpeg/demuxer.c | 6 |
2 files changed, 9 insertions, 3 deletions
diff --git a/src/codec/ffmpeg/decoder.c b/src/codec/ffmpeg/decoder.c index 9693dd9..cfa1dc2 100644 --- a/src/codec/ffmpeg/decoder.c +++ b/src/codec/ffmpeg/decoder.c @@ -268,6 +268,7 @@ static bool ff_decoder_init(struct camu_decoder *dec, struct camu_renderer *rend #ifdef CAMU_FF_DECODER_HWACCEL if (is_video && av->hw_device_type != AV_HWDEVICE_TYPE_NONE) { + //av->codec_context->hwaccel_flags |= AV_HWACCEL_FLAG_IGNORE_LEVEL | AV_HWACCEL_FLAG_ALLOW_PROFILE_MISMATCH; if (init_hwdevice_context(av, av->codec_context) == 0) { av->renderer = renderer; av->codec_context->opaque = av; @@ -282,7 +283,7 @@ static bool ff_decoder_init(struct camu_decoder *dec, struct camu_renderer *rend #endif if (is_video) { - av->thread_count = MIN(6, MAX(1, av_cpu_count() / 2)); + av->thread_count = MIN(8, MAX(1, av_cpu_count() / 2)); #ifdef CAMU_FF_DECODER_HWACCEL if (av->hw_device_type == AV_HWDEVICE_TYPE_NONE) { #endif @@ -298,6 +299,9 @@ static bool ff_decoder_init(struct camu_decoder *dec, struct camu_renderer *rend #endif } + //av->codec_context->flags |= AV_CODEC_FLAG_BITEXACT; + //av->codec_context->flags2 |= AV_CODEC_FLAG2_FAST; + if (!open_avcodec_internal(av, codec)) { goto err; } diff --git a/src/codec/ffmpeg/demuxer.c b/src/codec/ffmpeg/demuxer.c index 6560e0e..f05cfa9 100644 --- a/src/codec/ffmpeg/demuxer.c +++ b/src/codec/ffmpeg/demuxer.c @@ -80,7 +80,9 @@ static bool ff_demuxer_init(struct camu_demuxer *demux, struct cch_handle *handl s64 default_duration = (av->format_context->duration < 0) ? 0 : av->format_context->duration; av->duration = 0; - // @TODO: Handle no-duration video. + // @TODO: + // - 1 frame .gif. + // - No-duration video. (ex: data/test_resources/no_duration.mkv) #define GUESS_STREAM_IS_IMAGE(stream) \ ((stream->duration >= 0 && stream->nb_frames <= 1 && \ (stream->avg_frame_rate.den == 0 && stream->r_frame_rate.den > 0)) || \ @@ -113,7 +115,7 @@ static bool ff_demuxer_init(struct camu_demuxer *demux, struct cch_handle *handl } if (stream->start_time == AV_NOPTS_VALUE) stream->start_time = 0; } else if (type != AVMEDIA_TYPE_ATTACHMENT) { - continue; + type = AVMEDIA_TYPE_UNKNOWN; // Mapped to CAMU_STREAM_UNKNOWN. } al_array_push(av->demux.streams, ((struct camu_codec_stream){ .mode = CAMU_FFMPEG_COMPAT, |