Skip to content

Commit e35d620

Browse files
author
Clement Champetier
committed
IOutputStream: add getNbFrames function
1 parent 0450ffe commit e35d620

File tree

3 files changed

+8
-0
lines changed

3 files changed

+8
-0
lines changed

src/AvTranscoder/stream/IOutputStream.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ class AvExport IOutputStream
2626

2727
virtual size_t getStreamIndex() const = 0;
2828
virtual double getStreamDuration() const = 0;
29+
virtual size_t getNbFrames() const = 0;
2930

3031
virtual EWrappingStatus wrap( const CodedData& data ) = 0;
3132
};

src/AvTranscoder/stream/OutputStream.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,12 @@ double OutputStream::getStreamDuration() const
2525
#endif
2626
}
2727

28+
size_t OutputStream::getNbFrames() const
29+
{
30+
AVStream& outputStream = _outputFile->getFormatContext().getAVStream( _streamIndex );
31+
return outputStream.nb_frames;
32+
}
33+
2834
IOutputStream::EWrappingStatus OutputStream::wrap( const CodedData& data )
2935
{
3036
assert( _outputFile != NULL );

src/AvTranscoder/stream/OutputStream.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ class AvExport OutputStream : public IOutputStream
1515

1616
size_t getStreamIndex() const { return _streamIndex; }
1717
double getStreamDuration() const;
18+
size_t getNbFrames() const;
1819

1920
IOutputStream::EWrappingStatus wrap( const CodedData& data );
2021

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy