From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id 97954434E3 for ; Tue, 14 Jun 2022 08:21:42 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id A2AF368B3B1; Tue, 14 Jun 2022 11:21:39 +0300 (EEST) Received: from iq.passwd.hu (iq.passwd.hu [217.27.212.140]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id E69C668B00F for ; Tue, 14 Jun 2022 11:21:33 +0300 (EEST) Received: from localhost (localhost [127.0.0.1]) by iq.passwd.hu (Postfix) with ESMTP id 7717CE73E0 for ; Tue, 14 Jun 2022 10:21:29 +0200 (CEST) X-Virus-Scanned: amavisd-new at passwd.hu Received: from iq.passwd.hu ([127.0.0.1]) by localhost (iq.passwd.hu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id xV0U60FnUPpe for ; Tue, 14 Jun 2022 10:21:27 +0200 (CEST) Received: from iq (iq [217.27.212.140]) by iq.passwd.hu (Postfix) with ESMTPS id 8B81EE6FC8 for ; Tue, 14 Jun 2022 10:21:27 +0200 (CEST) Date: Tue, 14 Jun 2022 10:21:27 +0200 (CEST) From: Marton Balint To: FFmpeg development discussions and patches In-Reply-To: <20220614080937.5263-1-ffmpeg@gyani.pro> Message-ID: <8eba956c-1462-dbd3-26c5-608688ae3f6@passwd.hu> References: <20220614080937.5263-1-ffmpeg@gyani.pro> MIME-Version: 1.0 Subject: Re: [FFmpeg-devel] [PATCH] avformat: set start_time_realtime when demuxing X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: On Tue, 14 Jun 2022, Gyan Doshi wrote: > Add new flag AVFMT_START_REALTIME for the couple of demuxers that set it > internally. I don't think this is the same semantics. start_time_realtime is the time when the stream was originally captured, and not when the stream was received. So you can't simply use av_gettime() in the demuxers for that field. Regards. Marton > --- > doc/APIchanges | 3 +++ > libavformat/avformat.h | 1 + > libavformat/demux.c | 3 +++ > libavformat/rtsp.c | 3 ++- > libavformat/version.h | 2 +- > 5 files changed, 10 insertions(+), 2 deletions(-) > > diff --git a/doc/APIchanges b/doc/APIchanges > index 5857e67ae6..4aa9e36777 100644 > --- a/doc/APIchanges > +++ b/doc/APIchanges > @@ -14,6 +14,9 @@ libavutil: 2021-04-27 > > API changes, most recent first: > > +2022-06-xx - xxxxxxxxxx - lavf 59.26.100 - avformat.h > + Add AVFMT_START_REALTIME flag. > + > 2022-06-12 - xxxxxxxxxx - lavf 59.25.100 - avio.h > Add avio_vprintf(), similar to avio_printf() but allow to use it > from within a function taking a variable argument list as input. > diff --git a/libavformat/avformat.h b/libavformat/avformat.h > index f12fa7d904..4e247d68fc 100644 > --- a/libavformat/avformat.h > +++ b/libavformat/avformat.h > @@ -499,6 +499,7 @@ typedef struct AVProbeData { > The user or muxer can override this through > AVFormatContext.avoid_negative_ts > */ > +#define AVFMT_START_REALTIME 0x80000 /**< Demuxer sets start_time_realtime */ > > #define AVFMT_SEEK_TO_PTS 0x4000000 /**< Seeking is based on PTS */ > > diff --git a/libavformat/demux.c b/libavformat/demux.c > index 1620716716..28c6966e71 100644 > --- a/libavformat/demux.c > +++ b/libavformat/demux.c > @@ -628,6 +628,9 @@ FF_ENABLE_DEPRECATION_WARNINGS > > force_codec_ids(s, st); > > + if (!(s->iformat->flags & AVFMT_START_REALTIME) && s->start_time_realtime == AV_NOPTS_VALUE) > + s->start_time_realtime = av_gettime(); > + > /* TODO: audio: time filter; video: frame reordering (pts != dts) */ > if (s->use_wallclock_as_timestamps) > pkt->dts = pkt->pts = av_rescale_q(av_gettime(), AV_TIME_BASE_Q, st->time_base); > diff --git a/libavformat/rtsp.c b/libavformat/rtsp.c > index 88e9ef5226..2cafe33887 100644 > --- a/libavformat/rtsp.c > +++ b/libavformat/rtsp.c > @@ -2489,6 +2489,7 @@ const AVInputFormat ff_sdp_demuxer = { > .read_header = sdp_read_header, > .read_packet = ff_rtsp_fetch_packet, > .read_close = sdp_read_close, > + .flags = AVFMT_START_REALTIME, > .priv_class = &sdp_demuxer_class, > }; > #endif /* CONFIG_SDP_DEMUXER */ > @@ -2648,7 +2649,7 @@ const AVInputFormat ff_rtp_demuxer = { > .read_header = rtp_read_header, > .read_packet = ff_rtsp_fetch_packet, > .read_close = sdp_read_close, > - .flags = AVFMT_NOFILE, > + .flags = AVFMT_NOFILE | AVFMT_START_REALTIME, > .priv_class = &rtp_demuxer_class, > }; > #endif /* CONFIG_RTP_DEMUXER */ > diff --git a/libavformat/version.h b/libavformat/version.h > index 966ebb7ed3..0708d619c0 100644 > --- a/libavformat/version.h > +++ b/libavformat/version.h > @@ -31,7 +31,7 @@ > > #include "version_major.h" > > -#define LIBAVFORMAT_VERSION_MINOR 25 > +#define LIBAVFORMAT_VERSION_MINOR 26 > #define LIBAVFORMAT_VERSION_MICRO 100 > > #define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \ > -- > 2.36.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-request@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-request@ffmpeg.org with subject "unsubscribe".