Skip to content

Commit 16b2e56

Browse files
author
Clement Champetier
committed
Frame: added getEncodedSize method
1 parent 07a71ae commit 16b2e56

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

src/AvTranscoder/data/decoded/Frame.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,11 @@ Frame::~Frame()
4040
}
4141
}
4242

43+
int Frame::getEncodedSize() const
44+
{
45+
return av_frame_get_pkt_size(_frame);
46+
}
47+
4348
void Frame::copyData(const Frame& frameToRef)
4449
{
4550
const int ret = av_frame_copy(_frame, &frameToRef.getAVFrame());

src/AvTranscoder/data/decoded/Frame.hpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,12 @@ class AvExport Frame
4343
*/
4444
int* getLineSize() const { return _frame->linesize; }
4545

46+
/**
47+
* @return Size of the corresponding packet containing the compressed frame (in bytes)
48+
* @warning returns a negative value if the size is unknown
49+
*/
50+
int getEncodedSize() const;
51+
4652
/**
4753
* @brief Copy the data of the given Frame.
4854
* @note This function does not allocate anything: the current frame must be already initialized and

0 commit comments

Comments
 (0)