Re: [FFmpeg-devel] [PATCH] libavcodec/avpacket: add av_packet_remove_side_data

2021-11-04 Thread zhilizhao(赵志立)


> On Oct 12, 2021, at 10:42 AM, zhilizhao(赵志立)  wrote:
> 
>> On Oct 12, 2021, at 2:20 AM, Marton Balint  wrote:
>> 
>> On Mon, 11 Oct 2021, Zhao Zhili wrote:
>> 
>>> ---
>>> doc/APIchanges  |  3 +++
>>> libavcodec/avpacket.c   | 15 +++
>>> libavcodec/packet.h |  5 +
>>> libavcodec/tests/avpacket.c |  9 +
>>> libavcodec/version.h|  2 +-
>>> 5 files changed, 33 insertions(+), 1 deletion(-)
>>> 
> 

Ping.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-devel] [PATCH] avutil: deprecate AVRational field inside AVOption::default_val

2021-11-04 Thread zhilizhao(赵志立)



> On Oct 21, 2021, at 5:23 PM, Zhao Zhili  wrote:
> 
> It's not being used. For backward compatibility, AV_OPT_TYPE_RATIONAL
> cannot be changed to use it.
> ---
> libavutil/opt.h | 2 ++
> libavutil/version.h | 3 +++
> 2 files changed, 5 insertions(+)
> 

Ping.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-devel] [PATCH 1/3] avformat/dashenc: enabling streaming automatically for ldash

2021-11-04 Thread zhilizhao(赵志立)
Ping for the patch set.

> On Oct 21, 2021, at 4:15 PM, Zhao Zhili  wrote:
> 
> There is a little chance that user specified contradicted options
> like -streaming 0 -ldash 1, however, it's more likely that user
> didn't know or forgot to enable streaming for ldash. So enabling
> streaming automatically to make the feature easier to use, similar
> like enable FF_MOV_FLAG_FRAGMENT/EMPTY_MOOV/DEFAULT_BASE_MOOF and
> so on for FF_MOV_FLAG_CMAF.
> ---
> libavformat/dashenc.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/libavformat/dashenc.c b/libavformat/dashenc.c
> index 06bbf36c95..0370a482fb 100644
> --- a/libavformat/dashenc.c
> +++ b/libavformat/dashenc.c
> @@ -1406,8 +1406,8 @@ static int dash_init(AVFormatContext *s)
> }
> 
> if (c->ldash && !c->streaming) {
> -av_log(s, AV_LOG_WARNING, "LDash option will be ignored as streaming 
> is not enabled\n");
> -c->ldash = 0;
> +av_log(s, AV_LOG_WARNING, "Enabling streaming as LDash is 
> enabled\n");
> +c->streaming = 1;
> }
> 
> if (c->target_latency && !c->streaming) {
> -- 
> 2.31.1
> 

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-devel] [PATCH] lavc/{av1, h264, h265}_metadata_bsf: fix description of tick_rate

2021-11-04 Thread zhilizhao(赵志立)


> On Sep 29, 2021, at 11:21 AM, zhilizhao(赵志立)  wrote:
> 
> Ping for review.
> 
>> On Aug 27, 2021, at 3:13 PM, Zhao Zhili  wrote:
>> 
>> Users may take the description literally which leads to inverted
>> results.
>> ---
>> doc/bitstream_filters.texi | 8 
>> libavcodec/av1_metadata_bsf.c  | 2 +-
>> libavcodec/h264_metadata_bsf.c | 2 +-
>> libavcodec/h265_metadata_bsf.c | 2 +-
>> 4 files changed, 7 insertions(+), 7 deletions(-)
>> 
> 

Ping.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-devel] [PATCH 2/2] Fix missing PCM sample size option when it is used as the lone option for DirectShow audio capture

2021-11-04 Thread Michael Niedermayer
On Wed, Nov 03, 2021 at 10:41:24PM -0600, Roger Pack wrote:
> I have looked at these two patches and they look good to me, if
> anybody could commit them for me, that would be great.

The patches are corrupted
Applying: Use WAVEFORMATEX from AM_MEDIA_TYPE for describing device 
capabilities. (Fixes #9420)
error: corrupt patch at line 10
error: could not build fake ancestor
Patch failed at 0001 Use WAVEFORMATEX from AM_MEDIA_TYPE for describing device 
capabilities. (Fixes #9420)

[...]
-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

The bravest are surely those who have the clearest vision
of what is before them, glory and danger alike, and yet
notwithstanding go out to meet it. -- Thucydides


signature.asc
Description: PGP signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-devel] [PATCH] lavf/mov: Always prefer tfdt over sidx

2021-11-04 Thread Thilo Borgmann
Am 03.11.21 um 17:41 schrieb Gyan Doshi:
> 
> 
> On 2021-11-03 03:16 pm, Thilo Borgmann wrote:
>> Hi,
>>
>> this effectively reverts 071930de724166bfb90fc6d368c748771188fd94 and fixes 
>> the underlying issue by always preferring TFDT.
>>
>> Furthermore, the current solution fails if the -use_tfdt flag is given but 
>> no TFDT box is found in the stream.
> 
> Thanks for the heads-up.
> 
> The original impetus for my patch was a client's sample file which had 
> rubbish sidx values but sane tfdt ones, likely due to a buggy muxer.
> The motivation for an option was to give the user control.
> 
> I think hardcoding a reversed preference can lead to the same impasse. How 
> about change the default value of use_tfdt and check for tfdt presence when 
> enabled?

Changed the default to use TFDT and add warnings about fallback to SIDX or TFDT 
where useful.
Looks better?

Thanks,
Thilo
From 435196bbb406ed7d4311f327d96664cb140af048 Mon Sep 17 00:00:00 2001
From: Thilo Borgmann 
Date: Thu, 4 Nov 2021 12:00:07 +0100
Subject: [PATCH] lavf/mov: Change default to prefer TFDT time and allow for
 fallback to SIDX or TFDT

---
 doc/demuxers.texi |  2 +-
 libavformat/mov.c | 42 --
 2 files changed, 29 insertions(+), 15 deletions(-)

diff --git a/doc/demuxers.texi b/doc/demuxers.texi
index 1c9575b2e8..cab8a7072c 100644
--- a/doc/demuxers.texi
+++ b/doc/demuxers.texi
@@ -691,7 +691,7 @@ Don't use mfra box to set timestamps
 
 @item use_tfdt
 For fragmented input, set fragment's starting timestamp to 
@code{baseMediaDecodeTime} from the @code{tfdt} box.
-Default is disabled, which will preferentially use the 
@code{earliest_presentation_time} from the @code{sidx} box.
+Default is enabled, which will prefer to use the @code{tfdt} box to set DTS. 
Disable to use the @code{earliest_presentation_time} from the @code{sidx} box.
 In either case, the timestamp from the @code{mfra} box will be used if it's 
available and @code{use_mfra_for} is
 set to pts or dts.
 
diff --git a/libavformat/mov.c b/libavformat/mov.c
index 3fcb1dc908..8a910a3165 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -4828,20 +4828,34 @@ static int mov_read_trun(MOVContext *c, AVIOContext 
*pb, MOVAtom atom)
 dts = frag_stream_info->first_tfra_pts;
 av_log(c->fc, AV_LOG_DEBUG, "found mfra time %"PRId64
 ", using it for dts\n", pts);
-} else if (frag_stream_info->sidx_pts != AV_NOPTS_VALUE && 
!c->use_tfdt) {
-// FIXME: sidx earliest_presentation_time is *PTS*, s.b.
-// pts = frag_stream_info->sidx_pts;
-dts = frag_stream_info->sidx_pts - sc->time_offset;
-av_log(c->fc, AV_LOG_DEBUG, "found sidx time %"PRId64
-", using it for pts\n", pts);
-} else if (frag_stream_info->tfdt_dts != AV_NOPTS_VALUE) {
-dts = frag_stream_info->tfdt_dts - sc->time_offset;
-av_log(c->fc, AV_LOG_DEBUG, "found tfdt time %"PRId64
-", using it for dts\n", dts);
 } else {
-dts = sc->track_end - sc->time_offset;
-av_log(c->fc, AV_LOG_DEBUG, "found track end time %"PRId64
-", using it for dts\n", dts);
+int has_tfdt = frag_stream_info->tfdt_dts != AV_NOPTS_VALUE;
+int has_sidx = frag_stream_info->sidx_pts != AV_NOPTS_VALUE;
+int fallback_tfdt = !c->use_tfdt && !has_sidx && has_tfdt;
+int fallback_sidx =  c->use_tfdt && !has_tfdt && has_sidx;
+
+if (fallback_sidx) {
+av_log(c->fc, AV_LOG_DEBUG, "use_tfdt set but no tfdt found, 
using sidx instead\n");
+}
+if (fallback_tfdt) {
+av_log(c->fc, AV_LOG_DEBUG, "use_tfdt not set but no sidx 
found, using tfdt instead\n");
+}
+
+if (has_tfdt && c->use_tfdt || fallback_tfdt) {
+dts = frag_stream_info->tfdt_dts - sc->time_offset;
+av_log(c->fc, AV_LOG_DEBUG, "found tfdt time %"PRId64
+", using it for dts\n", dts);
+} else if (has_sidx && !c->use_tfdt || fallback_sidx) {
+// FIXME: sidx earliest_presentation_time is *PTS*, s.b.
+// pts = frag_stream_info->sidx_pts;
+dts = frag_stream_info->sidx_pts - sc->time_offset;
+av_log(c->fc, AV_LOG_DEBUG, "found sidx time %"PRId64
+", using it for pts\n", pts);
+} else {
+dts = sc->track_end - sc->time_offset;
+av_log(c->fc, AV_LOG_DEBUG, "found track end time %"PRId64
+", using it for dts\n", dts);
+}
 }
 } else {
 dts = sc->track_end - sc->time_offset;
@@ -8533,7 +8547,7 @@ static const AVOption mov_options[] = {
 FLAGS, "use_mfra_for" },
 {"pts", "pts", 0, AV_OPT_TYPE_CONST, {.i64 = FF_MOV_FLAG_MFRA_PTS}, 0, 0,
 FLAGS, "use_mfra_for

Re: [FFmpeg-devel] [PATCH 1/2] Use WAVEFORMATEX from AM_MEDIA_TYPE for describing device capabilities. (Fixes #9420)

2021-11-04 Thread Brad Isbell
Re-sending with correct line endings.  Thanks!


>From fd6bfd237d4d25de04d8179ccb1ff2d2f0aa904f Mon Sep 17 00:00:00 2001
From: Brad Isbell 
Date: Sun, 3 Oct 2021 00:16:05 -0500
Subject: [PATCH 1/2] Use WAVEFORMATEX from AM_MEDIA_TYPE for describing device
 capabilities.  (Fixes #9420)

Signed-off-by: Brad Isbell 
---
 libavdevice/dshow.c | 32 
 1 file changed, 12 insertions(+), 20 deletions(-)

diff --git a/libavdevice/dshow.c b/libavdevice/dshow.c
index 8d0a6fc..5c1e494 100644
--- a/libavdevice/dshow.c
+++ b/libavdevice/dshow.c
@@ -422,28 +422,20 @@ dshow_cycle_formats(AVFormatContext *avctx, enum
dshowDeviceType devtype,
 goto next;
 }
 if (!pformat_set) {
-av_log(avctx, AV_LOG_INFO, "  min ch=%lu bits=%lu
rate=%6lu max ch=%lu bits=%lu rate=%6lu\n",
-   acaps->MinimumChannels,
acaps->MinimumBitsPerSample, acaps->MinimumSampleFrequency,
-   acaps->MaximumChannels,
acaps->MaximumBitsPerSample, acaps->MaximumSampleFrequency);
+av_log(
+avctx,
+AV_LOG_INFO,
+"  ch=%2lu, bits=%2lu, rate=%6lu\n",
+fx->nChannels, fx->wBitsPerSample, fx->nSamplesPerSec
+);
 continue;
 }
-if (ctx->sample_rate) {
-if (ctx->sample_rate > acaps->MaximumSampleFrequency ||
-ctx->sample_rate < acaps->MinimumSampleFrequency)
-goto next;
-fx->nSamplesPerSec = ctx->sample_rate;
-}
-if (ctx->sample_size) {
-if (ctx->sample_size > acaps->MaximumBitsPerSample ||
-ctx->sample_size < acaps->MinimumBitsPerSample)
-goto next;
-fx->wBitsPerSample = ctx->sample_size;
-}
-if (ctx->channels) {
-if (ctx->channels > acaps->MaximumChannels ||
-ctx->channels < acaps->MinimumChannels)
-goto next;
-fx->nChannels = ctx->channels;
+if (
+(ctx->sample_rate && ctx->sample_rate != fx->nSamplesPerSec) ||
+(ctx->sample_size && ctx->sample_size != fx->wBitsPerSample) ||
+(ctx->channels&& ctx->channels!= fx->nChannels )
+) {
+goto next;
 }
 }
 if (IAMStreamConfig_SetFormat(config, type) != S_OK)
--
2.32.0.windows.1

On Wed, Nov 3, 2021 at 9:09 PM Brad Isbell  wrote:
>
> From fd6bfd237d4d25de04d8179ccb1ff2d2f0aa904f Mon Sep 17 00:00:00 2001
> From: Brad Isbell 
> Date: Sun, 3 Oct 2021 00:16:05 -0500
> Subject: [PATCH 1/2] Use WAVEFORMATEX from AM_MEDIA_TYPE for describing device
>  capabilities.  (Fixes #9420)
>
> Signed-off-by: Brad Isbell 
> ---
>  libavdevice/dshow.c | 32 
>  1 file changed, 12 insertions(+), 20 deletions(-)
>
> diff --git a/libavdevice/dshow.c b/libavdevice/dshow.c
> index 8d0a6fc..5c1e494 100644
> --- a/libavdevice/dshow.c
> +++ b/libavdevice/dshow.c
> @@ -422,28 +422,20 @@ dshow_cycle_formats(AVFormatContext *avctx, enum 
> dshowDeviceType devtype,
>  goto next;
>  }
>  if (!pformat_set) {
> -av_log(avctx, AV_LOG_INFO, "  min ch=%lu bits=%lu rate=%6lu 
> max ch=%lu bits=%lu rate=%6lu\n",
> -   acaps->MinimumChannels, acaps->MinimumBitsPerSample, 
> acaps->MinimumSampleFrequency,
> -   acaps->MaximumChannels, acaps->MaximumBitsPerSample, 
> acaps->MaximumSampleFrequency);
> +av_log(
> +avctx,
> +AV_LOG_INFO,
> +"  ch=%2lu, bits=%2lu, rate=%6lu\n",
> +fx->nChannels, fx->wBitsPerSample, fx->nSamplesPerSec
> +);
>  continue;
>  }
> -if (ctx->sample_rate) {
> -if (ctx->sample_rate > acaps->MaximumSampleFrequency ||
> -ctx->sample_rate < acaps->MinimumSampleFrequency)
> -goto next;
> -fx->nSamplesPerSec = ctx->sample_rate;
> -}
> -if (ctx->sample_size) {
> -if (ctx->sample_size > acaps->MaximumBitsPerSample ||
> -ctx->sample_size < acaps->MinimumBitsPerSample)
> -goto next;
> -fx->wBitsPerSample = ctx->sample_size;
> -}
> -if (ctx->channels) {
> -if (ctx->channels > acaps->MaximumChannels ||
> -ctx->channels < acaps->MinimumChannels)
> -goto next;
> -fx->nChannels = ctx->channels;
> +if (
> +(ctx->sample_rate && ctx->sample_rate != fx->nSamplesPerSec) 
> ||
> +(ctx->sample_size && ctx->sample_size != fx->wBitsPer

Re: [FFmpeg-devel] [PATCH 2/2] Fix missing PCM sample size option when it is used as the lone option for DirectShow audio capture

2021-11-04 Thread Brad Isbell
Re-sending with correct line endings.  Thanks!



>From 25e34ef9f995afffe67e519bb6f03a750aa09ae2 Mon Sep 17 00:00:00 2001
From: Brad Isbell 
Date: Wed, 3 Nov 2021 20:38:59 -0500
Subject: [PATCH 2/2] Fix missing PCM sample size option when it is used as the
 lone option for DirectShow audio capture

Signed-off-by: Brad Isbell 
---
 libavdevice/dshow.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavdevice/dshow.c b/libavdevice/dshow.c
index 5c1e494..e313c9a 100644
--- a/libavdevice/dshow.c
+++ b/libavdevice/dshow.c
@@ -569,7 +569,7 @@ dshow_cycle_pins(AVFormatContext *avctx, enum
dshowDeviceType devtype,
 (ctx->requested_width
&& ctx->requested_height) ||
  ctx->pixel_format !=
AV_PIX_FMT_NONE ||
  ctx->video_codec_id
!= AV_CODEC_ID_RAWVIDEO))
-  || (devtype == AudioDevice && (ctx->channels ||
ctx->sample_rate));
+  || (devtype == AudioDevice && (ctx->channels ||
ctx->sample_rate || ctx->sample_size));
 int format_set = 0;
 int should_show_properties = (devtype == VideoDevice) ?
ctx->show_video_device_dialog : ctx->show_audio_device_dialog;

-- 
2.32.0.windows.1



On Thu, Nov 4, 2021 at 5:53 AM Michael Niedermayer
 wrote:
>
> On Wed, Nov 03, 2021 at 10:41:24PM -0600, Roger Pack wrote:
> > I have looked at these two patches and they look good to me, if
> > anybody could commit them for me, that would be great.
>
> The patches are corrupted
> Applying: Use WAVEFORMATEX from AM_MEDIA_TYPE for describing device 
> capabilities. (Fixes #9420)
> error: corrupt patch at line 10
> error: could not build fake ancestor
> Patch failed at 0001 Use WAVEFORMATEX from AM_MEDIA_TYPE for describing 
> device capabilities. (Fixes #9420)
>
> [...]
> --
> Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
>
> The bravest are surely those who have the clearest vision
> of what is before them, glory and danger alike, and yet
> notwithstanding go out to meet it. -- Thucydides
> ___
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
> To unsubscribe, visit link above, or email
> ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-devel] [PATCH 2/2] Fix missing PCM sample size option when it is used as the lone option for DirectShow audio capture

2021-11-04 Thread Brad Isbell
Brad Isbell // AudioPump, Inc.
b...@audiopump.co
Skype: bradisbell
Phone: +1 312-488-4680


On Thu, Nov 4, 2021 at 12:21 PM Brad Isbell  wrote:
>
> Re-sending with correct line endings.  Thanks!
>
>
>
> From 25e34ef9f995afffe67e519bb6f03a750aa09ae2 Mon Sep 17 00:00:00 2001
> From: Brad Isbell 
> Date: Wed, 3 Nov 2021 20:38:59 -0500
> Subject: [PATCH 2/2] Fix missing PCM sample size option when it is used as the
>  lone option for DirectShow audio capture
>
> Signed-off-by: Brad Isbell 
> ---
>  libavdevice/dshow.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/libavdevice/dshow.c b/libavdevice/dshow.c
> index 5c1e494..e313c9a 100644
> --- a/libavdevice/dshow.c
> +++ b/libavdevice/dshow.c
> @@ -569,7 +569,7 @@ dshow_cycle_pins(AVFormatContext *avctx, enum
> dshowDeviceType devtype,
>  (ctx->requested_width
> && ctx->requested_height) ||
>   ctx->pixel_format !=
> AV_PIX_FMT_NONE ||
>   ctx->video_codec_id
> != AV_CODEC_ID_RAWVIDEO))
> -  || (devtype == AudioDevice && (ctx->channels ||
> ctx->sample_rate));
> +  || (devtype == AudioDevice && (ctx->channels ||
> ctx->sample_rate || ctx->sample_size));
>  int format_set = 0;
>  int should_show_properties = (devtype == VideoDevice) ?
> ctx->show_video_device_dialog : ctx->show_audio_device_dialog;
>
> --
> 2.32.0.windows.1
>
>
>
> On Thu, Nov 4, 2021 at 5:53 AM Michael Niedermayer
>  wrote:
> >
> > On Wed, Nov 03, 2021 at 10:41:24PM -0600, Roger Pack wrote:
> > > I have looked at these two patches and they look good to me, if
> > > anybody could commit them for me, that would be great.
> >
> > The patches are corrupted
> > Applying: Use WAVEFORMATEX from AM_MEDIA_TYPE for describing device 
> > capabilities. (Fixes #9420)
> > error: corrupt patch at line 10
> > error: could not build fake ancestor
> > Patch failed at 0001 Use WAVEFORMATEX from AM_MEDIA_TYPE for describing 
> > device capabilities. (Fixes #9420)
> >
> > [...]
> > --
> > Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
> >
> > The bravest are surely those who have the clearest vision
> > of what is before them, glory and danger alike, and yet
> > notwithstanding go out to meet it. -- Thucydides
> > ___
> > ffmpeg-devel mailing list
> > ffmpeg-devel@ffmpeg.org
> > https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
> >
> > To unsubscribe, visit link above, or email
> > ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
From 25e34ef9f995afffe67e519bb6f03a750aa09ae2 Mon Sep 17 00:00:00 2001
From: Brad Isbell 
Date: Wed, 3 Nov 2021 20:38:59 -0500
Subject: [PATCH 2/2] Fix missing PCM sample size option when it is used as the
 lone option for DirectShow audio capture

Signed-off-by: Brad Isbell 
---
 libavdevice/dshow.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavdevice/dshow.c b/libavdevice/dshow.c
index 5c1e494..e313c9a 100644
--- a/libavdevice/dshow.c
+++ b/libavdevice/dshow.c
@@ -569,7 +569,7 @@ dshow_cycle_pins(AVFormatContext *avctx, enum 
dshowDeviceType devtype,
 (ctx->requested_width && 
ctx->requested_height) ||
  ctx->pixel_format != 
AV_PIX_FMT_NONE ||
  ctx->video_codec_id != 
AV_CODEC_ID_RAWVIDEO))
-  || (devtype == AudioDevice && (ctx->channels || 
ctx->sample_rate));
+  || (devtype == AudioDevice && (ctx->channels || 
ctx->sample_rate || ctx->sample_size));
 int format_set = 0;
 int should_show_properties = (devtype == VideoDevice) ? 
ctx->show_video_device_dialog : ctx->show_audio_device_dialog;
 
-- 
2.32.0.windows.1

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-devel] [PATCH 1/2] Use WAVEFORMATEX from AM_MEDIA_TYPE for describing device capabilities. (Fixes #9420)

2021-11-04 Thread Brad Isbell
On Thu, Nov 4, 2021 at 12:20 PM Brad Isbell  wrote:
>
> Re-sending with correct line endings.  Thanks!
>
>
> From fd6bfd237d4d25de04d8179ccb1ff2d2f0aa904f Mon Sep 17 00:00:00 2001
> From: Brad Isbell 
> Date: Sun, 3 Oct 2021 00:16:05 -0500
> Subject: [PATCH 1/2] Use WAVEFORMATEX from AM_MEDIA_TYPE for describing device
>  capabilities.  (Fixes #9420)
>
> Signed-off-by: Brad Isbell 
> ---
>  libavdevice/dshow.c | 32 
>  1 file changed, 12 insertions(+), 20 deletions(-)
>
> diff --git a/libavdevice/dshow.c b/libavdevice/dshow.c
> index 8d0a6fc..5c1e494 100644
> --- a/libavdevice/dshow.c
> +++ b/libavdevice/dshow.c
> @@ -422,28 +422,20 @@ dshow_cycle_formats(AVFormatContext *avctx, enum
> dshowDeviceType devtype,
>  goto next;
>  }
>  if (!pformat_set) {
> -av_log(avctx, AV_LOG_INFO, "  min ch=%lu bits=%lu
> rate=%6lu max ch=%lu bits=%lu rate=%6lu\n",
> -   acaps->MinimumChannels,
> acaps->MinimumBitsPerSample, acaps->MinimumSampleFrequency,
> -   acaps->MaximumChannels,
> acaps->MaximumBitsPerSample, acaps->MaximumSampleFrequency);
> +av_log(
> +avctx,
> +AV_LOG_INFO,
> +"  ch=%2lu, bits=%2lu, rate=%6lu\n",
> +fx->nChannels, fx->wBitsPerSample, fx->nSamplesPerSec
> +);
>  continue;
>  }
> -if (ctx->sample_rate) {
> -if (ctx->sample_rate > acaps->MaximumSampleFrequency ||
> -ctx->sample_rate < acaps->MinimumSampleFrequency)
> -goto next;
> -fx->nSamplesPerSec = ctx->sample_rate;
> -}
> -if (ctx->sample_size) {
> -if (ctx->sample_size > acaps->MaximumBitsPerSample ||
> -ctx->sample_size < acaps->MinimumBitsPerSample)
> -goto next;
> -fx->wBitsPerSample = ctx->sample_size;
> -}
> -if (ctx->channels) {
> -if (ctx->channels > acaps->MaximumChannels ||
> -ctx->channels < acaps->MinimumChannels)
> -goto next;
> -fx->nChannels = ctx->channels;
> +if (
> +(ctx->sample_rate && ctx->sample_rate != fx->nSamplesPerSec) 
> ||
> +(ctx->sample_size && ctx->sample_size != fx->wBitsPerSample) 
> ||
> +(ctx->channels&& ctx->channels!= fx->nChannels )
> +) {
> +goto next;
>  }
>  }
>  if (IAMStreamConfig_SetFormat(config, type) != S_OK)
> --
> 2.32.0.windows.1
>
> On Wed, Nov 3, 2021 at 9:09 PM Brad Isbell  wrote:
> >
> > From fd6bfd237d4d25de04d8179ccb1ff2d2f0aa904f Mon Sep 17 00:00:00 2001
> > From: Brad Isbell 
> > Date: Sun, 3 Oct 2021 00:16:05 -0500
> > Subject: [PATCH 1/2] Use WAVEFORMATEX from AM_MEDIA_TYPE for describing 
> > device
> >  capabilities.  (Fixes #9420)
> >
> > Signed-off-by: Brad Isbell 
> > ---
> >  libavdevice/dshow.c | 32 
> >  1 file changed, 12 insertions(+), 20 deletions(-)
> >
> > diff --git a/libavdevice/dshow.c b/libavdevice/dshow.c
> > index 8d0a6fc..5c1e494 100644
> > --- a/libavdevice/dshow.c
> > +++ b/libavdevice/dshow.c
> > @@ -422,28 +422,20 @@ dshow_cycle_formats(AVFormatContext *avctx, enum 
> > dshowDeviceType devtype,
> >  goto next;
> >  }
> >  if (!pformat_set) {
> > -av_log(avctx, AV_LOG_INFO, "  min ch=%lu bits=%lu 
> > rate=%6lu max ch=%lu bits=%lu rate=%6lu\n",
> > -   acaps->MinimumChannels, 
> > acaps->MinimumBitsPerSample, acaps->MinimumSampleFrequency,
> > -   acaps->MaximumChannels, 
> > acaps->MaximumBitsPerSample, acaps->MaximumSampleFrequency);
> > +av_log(
> > +avctx,
> > +AV_LOG_INFO,
> > +"  ch=%2lu, bits=%2lu, rate=%6lu\n",
> > +fx->nChannels, fx->wBitsPerSample, fx->nSamplesPerSec
> > +);
> >  continue;
> >  }
> > -if (ctx->sample_rate) {
> > -if (ctx->sample_rate > acaps->MaximumSampleFrequency ||
> > -ctx->sample_rate < acaps->MinimumSampleFrequency)
> > -goto next;
> > -fx->nSamplesPerSec = ctx->sample_rate;
> > -}
> > -if (ctx->sample_size) {
> > -if (ctx->sample_size > acaps->MaximumBitsPerSample ||
> > -ctx->sample_size < acaps->MinimumBitsPerSample)
> > -goto next;
> > -fx->wBitsPerSample = ctx->sample_size;
> > -}
> > -if (ctx->channels) {
> > -if (ctx->channels > acaps->MaximumChannels ||
> > -ctx->chan

Re: [FFmpeg-devel] [PATCH 1/1] swscale/input: fix planar_rgb16_to_a for gbrap10be and gbrap12be formats

2021-11-04 Thread Michael Niedermayer
On Wed, Nov 03, 2021 at 10:55:14AM -0700, mindm...@gmail.com wrote:
> From: Mark Reid 
> 
> ---
>  libswscale/input.c  | 2 +-
>  tests/ref/fate/filter-pixfmts-scale | 4 ++--
>  2 files changed, 3 insertions(+), 3 deletions(-)

will apply

thx

[...]
-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Take away the freedom of one citizen and you will be jailed, take away
the freedom of all citizens and you will be congratulated by your peers
in Parliament.


signature.asc
Description: PGP signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".


[FFmpeg-devel] [PATCH v2 1/4] avformat/imf: Headers and build files

2021-11-04 Thread pal
From: Pierre-Anthony Lemieux 

Signed-off-by: Pierre-Anthony Lemieux 
---

Notes:
The IMF demuxer accepts as input an IMF CPL. The assets referenced by the 
CPL can be
contained in multiple deliveries, each defined by an ASSETMAP file:

ffmpeg -assetmaps ,,... -i 

If -assetmaps is not specified, FFMPEG looks for a file called ASSETMAP.xml 
in the same directory as the CPL.

EXAMPLE:
ffmpeg -i 
http://ffmpeg-imf-samples-public.s3-website-us-west-1.amazonaws.com/countdown/CPL_f5095caa-f204-4e1c-8a84-7af48c7ae16b.xml
 out.mp4

The Interoperable Master Format (IMF) is a file-based media format for the
delivery and storage of professional audio-visual masters.
An IMF Composition consists of an XML playlist (the Composition Playlist)
and a collection of MXF files (the Track Files). The Composition Playlist 
(CPL)
assembles the Track Files onto a timeline, which consists of multiple 
tracks.
The location of the Track Files referenced by the Composition Playlist is 
stored
in one or more XML documents called Asset Maps. More details at 
https://www.imfug.com/explainer.
The IMF standard was first introduced in 2013 and is managed by the SMPTE.

Header and build files.

CHANGE NOTES:

- fixed patchwork warnings
- updated patch notes
- added LGPL license
- removed imf_internal.h
- Improve error handling, including removing exit()
- Fix code style

 MAINTAINERS  |   1 +
 configure|   3 +-
 doc/demuxers.texi|   6 ++
 libavformat/Makefile |   2 +
 libavformat/allformats.c |   1 +
 libavformat/imf.h| 197 +++
 6 files changed, 209 insertions(+), 1 deletion(-)
 create mode 100644 libavformat/imf.h

diff --git a/MAINTAINERS b/MAINTAINERS
index dcac46003e..7a6972fe1a 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -433,6 +433,7 @@ Muxers/Demuxers:
   idroqdec.cMike Melanson
   iff.c Jaikrishnan Menon
   img2*.c   Michael Niedermayer
+  imf*.cMarc-Antoine Arnaud, Pierre-Anthony 
Lemieux, Valentin Noël
   ipmovie.c Mike Melanson
   ircam*Paul B Mahol
   iss.c Stefan Gehrer
diff --git a/configure b/configure
index c01aa480c7..56d4022010 100755
--- a/configure
+++ b/configure
@@ -297,7 +297,7 @@ External library support:
   --enable-libxvid enable Xvid encoding via xvidcore,
native MPEG-4/Xvid encoder exists [no]
   --enable-libxml2 enable XML parsing using the C library libxml2, 
needed
-   for dash demuxing support [no]
+   for dash and imf demuxing support [no]
   --enable-libzimg enable z.lib, needed for zscale filter [no]
   --enable-libzmq  enable message passing via libzmq [no]
   --enable-libzvbi enable teletext support via libzvbi [no]
@@ -3374,6 +3374,7 @@ hls_muxer_select="mpegts_muxer"
 hls_muxer_suggest="gcrypt openssl"
 image2_alias_pix_demuxer_select="image2_demuxer"
 image2_brender_pix_demuxer_select="image2_demuxer"
+imf_demuxer_deps="libxml2"
 ipod_muxer_select="mov_muxer"
 ismv_muxer_select="mov_muxer"
 ivf_muxer_select="av1_metadata_bsf vp9_superframe_bsf"
diff --git a/doc/demuxers.texi b/doc/demuxers.texi
index 1c9575b2e8..37efe6ce1a 100644
--- a/doc/demuxers.texi
+++ b/doc/demuxers.texi
@@ -267,6 +267,12 @@ which streams to actually receive.
 Each stream mirrors the @code{id} and @code{bandwidth} properties from the
 @code{} as metadata keys named "id" and "variant_bitrate" 
respectively.
 
+@section imf
+
+Interoperable Master Format demuxer.
+
+This demuxer presents audio and video streams found in an IMF Composition.
+
 @section flv, live_flv, kux
 
 Adobe Flash Video Format demuxer.
diff --git a/libavformat/Makefile b/libavformat/Makefile
index 3d6c8ef8f5..dda2bc9a47 100644
--- a/libavformat/Makefile
+++ b/libavformat/Makefile
@@ -285,6 +285,7 @@ OBJS-$(CONFIG_IMAGE_WEBP_PIPE_DEMUXER)+= img2dec.o 
img2.o
 OBJS-$(CONFIG_IMAGE_XBM_PIPE_DEMUXER) += img2dec.o img2.o
 OBJS-$(CONFIG_IMAGE_XPM_PIPE_DEMUXER) += img2dec.o img2.o
 OBJS-$(CONFIG_IMAGE_XWD_PIPE_DEMUXER) += img2dec.o img2.o
+OBJS-$(CONFIG_IMF_DEMUXER)   += imfdec.o imf_cpl.o
 OBJS-$(CONFIG_INGENIENT_DEMUXER) += ingenientdec.o rawdec.o
 OBJS-$(CONFIG_IPMOVIE_DEMUXER)   += ipmovie.o
 OBJS-$(CONFIG_IPU_DEMUXER)   += ipudec.o rawdec.o
@@ -694,6 +695,7 @@ TESTPROGS-$(CONFIG_FFRTMPCRYPT_PROTOCOL) += rtmpdh
 TESTPROGS-$(CONFIG_MOV_MUXER)+= movenc
 TESTPROGS-$(CONFIG_NETWORK)  += noproxy
 TESTPROGS-$(CONFIG_SRTP) += srtp
+TESTPROGS-$(CONFIG_IMF_DEMUXER)  += imf
 
 TOOLS = aviocat

[FFmpeg-devel] [PATCH v2 2/4] avformat/imf: CPL processor

2021-11-04 Thread pal
From: Pierre-Anthony Lemieux 

Signed-off-by: Pierre-Anthony Lemieux 
---

Notes:
Implements IMF Composition Playlist (CPL) parsing.

 libavformat/imf_cpl.c | 706 ++
 1 file changed, 706 insertions(+)
 create mode 100644 libavformat/imf_cpl.c

diff --git a/libavformat/imf_cpl.c b/libavformat/imf_cpl.c
new file mode 100644
index 00..ad4d2c70ca
--- /dev/null
+++ b/libavformat/imf_cpl.c
@@ -0,0 +1,706 @@
+/*
+ * Copyright (c) Sandflow Consulting LLC
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * * Redistributions of source code must retain the above copyright notice, 
this
+ *   list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright notice,
+ *   this list of conditions and the following disclaimer in the documentation
+ *   and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * FFmpeg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+/**
+ * Implements IMP CPL processing
+ *
+ * @author Pierre-Anthony Lemieux
+ * @file
+ * @ingroup lavu_imf
+ */
+
+#include "imf.h"
+#include "libavformat/mxf.h"
+#include "libavutil/bprint.h"
+#include "libavutil/error.h"
+#include 
+
+xmlNodePtr imf_xml_get_child_element_by_name(xmlNodePtr parent, const char 
*name_utf8)
+{
+xmlNodePtr cur_element;
+
+cur_element = xmlFirstElementChild(parent);
+while (cur_element) {
+if (xmlStrcmp(cur_element->name, name_utf8) == 0)
+return cur_element;
+cur_element = xmlNextElementSibling(cur_element);
+}
+return NULL;
+}
+
+int imf_xml_read_UUID(xmlNodePtr element, uint8_t uuid[16])
+{
+xmlChar *element_text = NULL;
+int scanf_ret;
+int ret = 0;
+
+element_text = xmlNodeListGetString(element->doc, 
element->xmlChildrenNode, 1);
+scanf_ret = sscanf(element_text,
+IMF_UUID_FORMAT,
+&uuid[0],
+&uuid[1],
+&uuid[2],
+&uuid[3],
+&uuid[4],
+&uuid[5],
+&uuid[6],
+&uuid[7],
+&uuid[8],
+&uuid[9],
+&uuid[10],
+&uuid[11],
+&uuid[12],
+&uuid[13],
+&uuid[14],
+&uuid[15]);
+if (scanf_ret != 16) {
+av_log(NULL, AV_LOG_ERROR, "Invalid UUID\n");
+ret = AVERROR_INVALIDDATA;
+}
+xmlFree(element_text);
+
+return ret;
+}
+
+int imf_xml_read_rational(xmlNodePtr element, AVRational *rational)
+{
+xmlChar *element_text = NULL;
+int ret = 0;
+
+element_text = xmlNodeListGetString(element->doc, 
element->xmlChildrenNode, 1);
+if (sscanf(element_text, "%i %i", &rational->num, &rational->den) != 2) {
+av_log(NULL, AV_LOG_ERROR, "Invalid rational number\n");
+ret = AVERROR_INVALIDDATA;
+}
+xmlFree(element_text);
+
+return ret;
+}
+
+int imf_xml_read_ulong(xmlNodePtr element, unsigned long *number)
+{
+xmlChar *element_text = NULL;
+int ret = 0;
+
+element_text = xmlNodeListGetString(element->doc, 
element->xmlChildrenNode, 1);
+if (sscanf(element_text, "%lu", number) != 1) {
+av_log(NULL, AV_LOG_ERROR, "Invalid unsigned long");
+ret = AVERROR_INVALIDDATA;
+}
+xmlFree(element_text);
+
+return ret;
+}
+
+static void imf_base_virtual_track_init(IMFBaseVirtualTrack *track)
+{
+memset(track->id_uuid, 0, sizeof(track->id_u

[FFmpeg-devel] [PATCH v2 3/4] avformat/imf: Demuxer implementation

2021-11-04 Thread pal
From: Pierre-Anthony Lemieux 

Signed-off-by: Pierre-Anthony Lemieux 
---

Notes:
Implements the IMF demuxer.

 libavformat/imfdec.c | 735 +++
 1 file changed, 735 insertions(+)
 create mode 100644 libavformat/imfdec.c

diff --git a/libavformat/imfdec.c b/libavformat/imfdec.c
new file mode 100644
index 00..96272e04d8
--- /dev/null
+++ b/libavformat/imfdec.c
@@ -0,0 +1,735 @@
+/*
+ * Copyright (c) Sandflow Consulting LLC
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * * Redistributions of source code must retain the above copyright notice, 
this
+ *   list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright notice,
+ *   this list of conditions and the following disclaimer in the documentation
+ *   and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * FFmpeg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+/**
+ * Demuxes an IMF Composition
+ *
+ * References
+ * OV 2067-0:2018 - SMPTE Overview Document - Interoperable Master Format
+ * ST 2067-2:2020 - SMPTE Standard - Interoperable Master Format — Core 
Constraints
+ * ST 2067-3:2020 - SMPTE Standard - Interoperable Master Format — Composition 
Playlist
+ * ST 2067-5:2020 - SMPTE Standard - Interoperable Master Format — Essence 
Component
+ * ST 2067-20:2016 - SMPTE Standard - Interoperable Master Format — 
Application #2
+ * ST 2067-21:2020 - SMPTE Standard - Interoperable Master Format — 
Application #2 Extended
+ * ST 2067-102:2017 - SMPTE Standard - Interoperable Master Format — Common 
Image Pixel Color Schemes
+ * ST 429-9:2007 - SMPTE Standard - D-Cinema Packaging — Asset Mapping and 
File Segmentation
+ *
+ * @author Marc-Antoine Arnaud
+ * @author Valentin Noel
+ * @file
+ * @ingroup lavu_imf
+ */
+
+#include "imf.h"
+#include "internal.h"
+#include "libavutil/avstring.h"
+#include "libavutil/bprint.h"
+#include "libavutil/opt.h"
+#include "mxf.h"
+#include "url.h"
+#include 
+#include 
+
+#define MAX_BPRINT_READ_SIZE (UINT_MAX - 1)
+#define DEFAULT_ASSETMAP_SIZE 8 * 1024
+#define IMF_AVRATIONAL_FORMAT "%d/%d"
+#define IMF_AVRATIONAL_ARG(rational) rational.num, rational.den
+
+/**
+ * IMF Asset locator
+ */
+typedef struct IMFAssetLocator {
+UUID uuid;
+char *absolute_uri;
+} IMFAssetLocator;
+
+/**
+ * IMF Asset locator map
+ * Results from the parsing of one or more ASSETMAP XML files
+ */
+typedef struct IMFAssetLocatorMap {
+uint8_t asset_count;
+IMFAssetLocator **assets;
+} IMFAssetLocatorMap;
+
+typedef struct IMFVirtualTrackResourcePlaybackCtx {
+IMFAssetLocator *locator;
+IMFTrackFileResource *resource;
+AVFormatContext *ctx;
+} IMFVirtualTrackResourcePlaybackCtx;
+
+typedef struct IMFVirtualTrackPlaybackCtx {
+// Track index in playlist
+int32_t index;
+// Time counters
+AVRational current_timestamp;
+AVRational duration;
+// Resources
+unsigned int resource_count;
+IMFVirtualTrackResourcePlaybackCtx **resources;
+// Decoding cursors
+uint32_t current_resource_index;
+int64_t last_pts;
+} IMFVirtualTrackPlaybackCtx;
+
+typedef struct IMFContext {
+const AVClass *class;
+const char *base_url;
+char *asset_map_paths;
+AVIOInterruptCB *interrupt_callback;
+AVDictionary *avio_opts;
+IMFCPL *cpl;
+IMFAssetLocatorMa

[FFmpeg-devel] [PATCH v2 4/4] avformat/imf: Tests

2021-11-04 Thread pal
From: Pierre-Anthony Lemieux 

Signed-off-by: Pierre-Anthony Lemieux 
---

Notes:
Tests for the public API of the IMF demuxer.

 libavformat/tests/imf.c | 498 
 1 file changed, 498 insertions(+)
 create mode 100644 libavformat/tests/imf.c

diff --git a/libavformat/tests/imf.c b/libavformat/tests/imf.c
new file mode 100644
index 00..ba61e5c7c3
--- /dev/null
+++ b/libavformat/tests/imf.c
@@ -0,0 +1,498 @@
+/*
+ * Copyright (c) Sandflow Consulting LLC
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * * Redistributions of source code must retain the above copyright notice, 
this
+ *   list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright notice,
+ *   this list of conditions and the following disclaimer in the documentation
+ *   and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * FFmpeg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+/**
+ * Tests for IMF CPL and ASSETMAP processing
+ * 
+ * @author Valentin Noel
+ * @author Pierre-Anthony Lemieux
+ * @file
+ * @ingroup lavu_imf
+ */
+
+#include "libavformat/imf_cpl.c"
+#include "libavformat/imfdec.c"
+#include "libavformat/mxf.h"
+
+#include 
+
+const char *cpl_doc =
+"http://www.smpte-ra.org/schemas/2067-3/2016\"";
+" xmlns:cc=\"http://www.smpte-ra.org/schemas/2067-2/2016\"";
+" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\";>"
+"urn:uuid:8713c020-2489-45f5-a9f7-87be539e20b5"
+"2021-07-13T17:06:22Z"
+"FFMPEG"
+"FFMPEG sample content"
+""
+"  "
+"urn:uuid:8e097bb0-cff7-4969-a692-bad47bfb528f"
+"  "
+""
+"24000 1001"
+""
+""
+"urn:uuid:81fed4e5-9722-400a-b9d1-7f2bd21df4b6"
+""
+""
+"urn:uuid:16327185-9205-47ef-a17b-ee28df251db7"
+"urn:uuid:461f5424-8f6e-48a9-a385-5eda46fda381"
+""
+""
+"urn:uuid:ea3d0f23-55d6-4e03-86ec-cfe0666f0e6a"
+"24"
+""
+"LFOA"
+"5"
+""
+""
+""
+""
+""
+"urn:uuid:6ae100b0-92d1-41be-9321-85e0933dfc42"
+"urn:uuid:e8ef9653-565c-479c-8039-82d4547973c5"
+""
+""
+"urn:uuid:7d418acb-07a3-4e57-984c-b8ea2f7de4ec"
+"24"
+
"urn:uuid:f00e49a8-0dec-4e6c-95e7-078df988b751"
+"urn:uuid:6f768ca4-c89e-4dac-9056-a29425d40ba1"
+""
+""
+""
+""
+"urn:uuid:754dae53-c25f-4f3c-97e4-2bfe5463f83b"
+"urn:uuid:68e3fae5-d94b-44d2-92a6-b94877fbcdb5"
+""
+""
+"urn:uuid:61ce2a70-10a2-4521-850b-4218755ff3c9"
+"24"
+
"urn:uuid:f00e49a8-0dec-4e6c-95e7-078df988b751"
+"urn:uuid:381dadd2-061e-46cc-a63a-e3d58ce7f488"
+""
+""
+""
+""
+"urn:uuid:d29b3884-6633-4dad-9c67-7154af342bc6"
+"urn:uuid:6978c106-95bc-424b-a17c-628206a5892d"
+""
+""
+"urn:uuid:001ea472-f5da-436c-86de-acaa68c1a7e4"
+"24"
+
"urn:uuid:f00e49a8-0dec-4e6c-95e7-078df988b751"
+"urn:uuid:381dadd2-061e-46cc-a63a-e3d58ce7f488"
+""
+""
+""
+""
+"urn:uuid:02af22bf-f776-488a-b001-eb6e16953119"
+"urn:uuid:19ff6da1-be79-4235-8d04-42201ad06e65"
+""
+""
+"urn:uuid:dfa84292-0609-4097-824c-8e2e15e2ce4d"
+"24"
+
"urn:uuid:f00e49a8-0dec-4e6c-95e7-078df988b751"
+"urn:uuid:bd6272b6-511e-47c1-93bc-d56ebd314a70"
+""
+""
+""
+""
+""
+""
+"urn:uuid:a94be493-cd5

Re: [FFmpeg-devel] [PATCH 1/3] avformat/dashenc: enabling streaming automatically for ldash

2021-11-04 Thread James Almer

On 11/4/2021 5:03 AM, "zhilizhao(赵志立)" wrote:

Ping for the patch set.


On Oct 21, 2021, at 4:15 PM, Zhao Zhili  wrote:

There is a little chance that user specified contradicted options
like -streaming 0 -ldash 1, however, it's more likely that user
didn't know or forgot to enable streaming for ldash. So enabling
streaming automatically to make the feature easier to use, similar
like enable FF_MOV_FLAG_FRAGMENT/EMPTY_MOOV/DEFAULT_BASE_MOOF and
so on for FF_MOV_FLAG_CMAF.
---
libavformat/dashenc.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavformat/dashenc.c b/libavformat/dashenc.c
index 06bbf36c95..0370a482fb 100644
--- a/libavformat/dashenc.c
+++ b/libavformat/dashenc.c
@@ -1406,8 +1406,8 @@ static int dash_init(AVFormatContext *s)
 }

 if (c->ldash && !c->streaming) {
-av_log(s, AV_LOG_WARNING, "LDash option will be ignored as streaming is not 
enabled\n");
-c->ldash = 0;
+av_log(s, AV_LOG_WARNING, "Enabling streaming as LDash is enabled\n");
+c->streaming = 1;
 }

 if (c->target_latency && !c->streaming) {
--
2.31.1


Will apply the set.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-devel] [PATCH] lavf/mov: Always prefer tfdt over sidx

2021-11-04 Thread Gyan Doshi




On 2021-11-04 04:33 pm, Thilo Borgmann wrote:

Am 03.11.21 um 17:41 schrieb Gyan Doshi:


On 2021-11-03 03:16 pm, Thilo Borgmann wrote:

Hi,

this effectively reverts 071930de724166bfb90fc6d368c748771188fd94 and fixes the 
underlying issue by always preferring TFDT.

Furthermore, the current solution fails if the -use_tfdt flag is given but no 
TFDT box is found in the stream.

Thanks for the heads-up.

The original impetus for my patch was a client's sample file which had rubbish 
sidx values but sane tfdt ones, likely due to a buggy muxer.
The motivation for an option was to give the user control.

I think hardcoding a reversed preference can lead to the same impasse. How 
about change the default value of use_tfdt and check for tfdt presence when 
enabled?

Changed the default to use TFDT and add warnings about fallback to SIDX or TFDT 
where useful.
Looks better?


LGTM.

Thanks,
Gyan
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".