Merge "Add support to parse DisplayUnit."

This commit is contained in:
Frank Galligan 2015-06-03 00:25:32 +00:00 committed by Gerrit Code Review
commit d66ba4470a
2 changed files with 11 additions and 0 deletions

View File

@ -4581,6 +4581,7 @@ long VideoTrack::Parse(Segment* pSegment, const Info& info,
long long height = 0;
long long display_width = 0;
long long display_height = 0;
long long display_unit = 0;
long long stereo_mode = 0;
double rate = 0.0;
@ -4624,6 +4625,11 @@ long VideoTrack::Parse(Segment* pSegment, const Info& info,
if (display_height <= 0)
return E_FILE_FORMAT_INVALID;
} else if (id == 0x14B2) { // display unit
display_unit = UnserializeUInt(pReader, pos, size);
if (display_unit < 0)
return E_FILE_FORMAT_INVALID;
} else if (id == 0x13B8) { // stereo mode
stereo_mode = UnserializeUInt(pReader, pos, size);
@ -4662,6 +4668,7 @@ long VideoTrack::Parse(Segment* pSegment, const Info& info,
pTrack->m_height = height;
pTrack->m_display_width = display_width;
pTrack->m_display_height = display_height;
pTrack->m_display_unit = display_unit;
pTrack->m_stereo_mode = stereo_mode;
pTrack->m_rate = rate;
@ -4774,6 +4781,8 @@ long long VideoTrack::GetDisplayHeight() const {
return m_display_height > 0 ? m_display_height : GetHeight();
}
long long VideoTrack::GetDisplayUnit() const { return m_display_unit; }
long long VideoTrack::GetStereoMode() const { return m_stereo_mode; }
double VideoTrack::GetFrameRate() const { return m_rate; }

View File

@ -400,6 +400,7 @@ class VideoTrack : public Track {
long long GetHeight() const;
long long GetDisplayWidth() const;
long long GetDisplayHeight() const;
long long GetDisplayUnit() const;
long long GetStereoMode() const;
double GetFrameRate() const;
@ -411,6 +412,7 @@ class VideoTrack : public Track {
long long m_height;
long long m_display_width;
long long m_display_height;
long long m_display_unit;
long long m_stereo_mode;
double m_rate;