Skip to content

Commit 46f983a

Browse files
author
Clement Champetier
committed
VideoProperties: updated value returned by getGopStructure
* Before: picture type, is key frame * After: picture type, encoded frame size in bytes * Note: "is key frame" info can be found using the picture type (I frame). * Updated SWIG interface.
1 parent 25500d2 commit 46f983a

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

src/AvTranscoder/properties/VideoProperties.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -498,7 +498,7 @@ void VideoProperties::analyseGopStructure(IProgress& progress)
498498
AVFrame& avFrame = frame.getAVFrame();
499499

500500
_gopStructure.push_back(
501-
std::make_pair(av_get_picture_type_char(avFrame.pict_type), avFrame.key_frame));
501+
std::make_pair(av_get_picture_type_char(avFrame.pict_type), frame.getEncodedSize()));
502502
_isInterlaced = avFrame.interlaced_frame;
503503
_isTopFieldFirst = avFrame.top_field_first;
504504
if(avFrame.pict_type == AV_PICTURE_TYPE_I)

src/AvTranscoder/properties/VideoProperties.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ class AvExport VideoProperties : public StreamProperties
7474
* @return the distance between two nearest I frame
7575
*/
7676
size_t getGopSize() const { return _gopSize; }
77-
std::vector<std::pair<char, bool> > getGopStructure() const { return _gopStructure; }
77+
std::vector<std::pair<char, int> > getGopStructure() const { return _gopStructure; }
7878
//@}
7979

8080
#ifndef SWIG
@@ -122,7 +122,7 @@ class AvExport VideoProperties : public StreamProperties
122122
bool _isInterlaced;
123123
bool _isTopFieldFirst;
124124
size_t _gopSize;
125-
std::vector<std::pair<char, bool> > _gopStructure;
125+
std::vector<std::pair<char, int> > _gopStructure; ///< picture type, encoded frame size in bytes
126126
//@}
127127

128128
/**

src/AvTranscoder/properties/properties.i

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ namespace std {
4040
%template(PropertyPair) pair< string, string >;
4141
%template(PropertyVector) vector< pair< string, string > >;
4242

43-
%template(GopPair) pair< char, bool >;
44-
%template(GopVector) vector< pair< char, bool > >;
43+
%template(GopPair) pair< char, int >;
44+
%template(GopVector) vector< pair< char, int > >;
4545

4646
%template(ChannelVector) vector< avtranscoder::Channel >;
4747
}

0 commit comments

Comments
 (0)