diff mbox

[FFmpeg-devel,2/4] avformat/avframe.h: Add a flag in AVIndexEntry to discard frame after decoding.

Message ID 1470793702-19747-3-git-send-email-isasi@google.com
State Superseded
Headers show

Commit Message

Sasi Inguva Aug. 10, 2016, 1:48 a.m. UTC
Signed-off-by: Sasi Inguva <isasi@google.com>
---
 libavformat/avformat.h | 3 +++
 libavformat/version.h  | 2 +-
 2 files changed, 4 insertions(+), 1 deletion(-)

Comments

Sasi Inguva Aug. 10, 2016, 4:49 p.m. UTC | #1
Mov demuxer first builds the index, containing all the samples and their
timestamps, in its read_header function. It then simply searches this index
for the required sample on every read_packet call, and constructs an
AVPacket out of that sample. Implementation wise the edit list code
basically parses all these edit lists once to mark the index samples which
are/are not in the edit lists, when we read the header. If I have to avoid
this I would have to move the quite complicated logic of deciding if the
current packet is  in any of the  edit lists or not and  the logic of
rewriting the timestamps, inside the read_packet function.

On Wed, Aug 10, 2016 at 5:08 AM, Hendrik Leppkes <h.leppkes@gmail.com>
wrote:

> On Wed, Aug 10, 2016 at 3:48 AM, Sasi Inguva
> <isasi-at-google.com@ffmpeg.org> wrote:
> > Signed-off-by: Sasi Inguva <isasi@google.com>
> > ---
> >  libavformat/avformat.h | 3 +++
> >  libavformat/version.h  | 2 +-
> >  2 files changed, 4 insertions(+), 1 deletion(-)
> >
> > diff --git a/libavformat/avformat.h b/libavformat/avformat.h
> > index d8a6cf3..8cf1401 100644
> > --- a/libavformat/avformat.h
> > +++ b/libavformat/avformat.h
> > @@ -814,6 +814,9 @@ typedef struct AVIndexEntry {
> >                                 * is known
> >                                 */
> >  #define AVINDEX_KEYFRAME 0x0001
> > +#define AVINDEX_DISCARD_FRAME  0x0002    /**
> > +                                          * Flag is used to indicate
> which frame should be discarded after decoding.
> > +                                          */
>
> Having this flag on the index seems ... odd. If I would expect to get
> it from anywhere, it would be the AVPacket the demuxer outputs (which
> you add later), but not having to cross-check the index for this.
> What purpose does it really server to have it here, and not only on
> AVPacket?
>
> - Hendrik
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
diff mbox

Patch

diff --git a/libavformat/avformat.h b/libavformat/avformat.h
index d8a6cf3..8cf1401 100644
--- a/libavformat/avformat.h
+++ b/libavformat/avformat.h
@@ -814,6 +814,9 @@  typedef struct AVIndexEntry {
                                * is known
                                */
 #define AVINDEX_KEYFRAME 0x0001
+#define AVINDEX_DISCARD_FRAME  0x0002    /**
+                                          * Flag is used to indicate which frame should be discarded after decoding.
+                                          */
     int flags:2;
     int size:30; //Yeah, trying to keep the size of this small to reduce memory requirements (it is 24 vs. 32 bytes due to possible 8-byte alignment).
     int min_distance;         /**< Minimum distance between this and the previous keyframe, used to avoid unneeded searching. */
diff --git a/libavformat/version.h b/libavformat/version.h
index 07df407..f23d427 100644
--- a/libavformat/version.h
+++ b/libavformat/version.h
@@ -32,7 +32,7 @@ 
 // Major bumping may affect Ticket5467, 5421, 5451(compatibility with Chromium)
 // Also please add any ticket numbers that you belive might be affected here
 #define LIBAVFORMAT_VERSION_MAJOR  57
-#define LIBAVFORMAT_VERSION_MINOR  46
+#define LIBAVFORMAT_VERSION_MINOR  47
 #define LIBAVFORMAT_VERSION_MICRO 100
 
 #define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \