Skip to content
Permalink
Browse files

AvFormatDecoder: Add a GetSubHeader method.

This is the first of the SSA support patches. Refs #9294
  • Loading branch information
Mark Kendall
Mark Kendall committed May 3, 2011
1 parent fbe0feb commit 4b48823847eeb2923c563cb98609166a325b84d5
@@ -3365,6 +3365,19 @@ QString AvFormatDecoder::GetXDS(const QString &key) const
return ccd608->GetXDS(key);
}

QByteArray AvFormatDecoder::GetSubHeader(uint trackNo) const
{
if (trackNo >= tracks[kTrackTypeSubtitle].size())
return QByteArray();

int index = tracks[kTrackTypeSubtitle][trackNo].av_stream_index;
if (!ic->streams[index]->codec)
return QByteArray();

return QByteArray((char *)ic->streams[index]->codec->subtitle_header,
ic->streams[index]->codec->subtitle_header_size);
}

bool AvFormatDecoder::SetAudioByComponentTag(int tag)
{
for (uint i = 0; i < tracks[kTrackTypeAudio].size(); i++)
@@ -168,6 +168,7 @@ class AvFormatDecoder : public DecoderBase
virtual int GetTeletextDecoderType(void) const;

virtual QString GetXDS(const QString&) const;
virtual QByteArray GetSubHeader(uint trackNo) const;

// MHEG stuff
virtual bool SetAudioByComponentTag(int tag);
@@ -194,6 +194,7 @@ class DecoderBase
virtual int GetTeletextDecoderType(void) const { return -1; }

virtual QString GetXDS(const QString&) const { return QString::null; }
virtual QByteArray GetSubHeader(uint trackNo) const { return QByteArray(); }

// MHEG/MHI stuff
virtual bool SetAudioByComponentTag(int) { return false; }

0 comments on commit 4b48823

Please sign in to comment.
You can’t perform that action at this time.