Skip to content

Commit 08e53ac

Browse files
author
Clement Champetier
committed
Print: overload operator << for subtitle, attachement and unknown
* Use them in the overload operator << of InputFile.
1 parent 2816496 commit 08e53ac

File tree

1 file changed

+43
-1
lines changed

1 file changed

+43
-1
lines changed

src/AvTranscoder/Metadatas/Print.hpp

Lines changed: 43 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,30 @@ std::ostream& operator<<( std::ostream& flux, const DataProperties& dataProperti
132132
return flux;
133133
}
134134

135+
std::ostream& operator<<( std::ostream& flux, const SubtitleProperties& subtitleProperties )
136+
{
137+
flux << separator << " Subtitle stream " << separator << std::endl;
138+
flux << std::setw( keyWidth ) << "stream id" << ": " << subtitleProperties.streamId << std::endl;
139+
140+
return flux;
141+
}
142+
143+
std::ostream& operator<<( std::ostream& flux, const AttachementProperties& attachementProperties )
144+
{
145+
flux << separator << " Attachement stream " << separator << std::endl;
146+
flux << std::setw( keyWidth ) << "stream id" << ": " << attachementProperties.streamId << std::endl;
147+
148+
return flux;
149+
}
150+
151+
std::ostream& operator<<( std::ostream& flux, const UnknownProperties& unknownProperties )
152+
{
153+
flux << separator << " Unknown stream " << separator << std::endl;
154+
flux << std::setw( keyWidth ) << "stream id" << ": " << unknownProperties.streamId << std::endl;
155+
156+
return flux;
157+
}
158+
135159
std::ostream& operator<<( std::ostream& flux, const InputFile& input )
136160
{
137161
// wrapper
@@ -154,7 +178,25 @@ std::ostream& operator<<( std::ostream& flux, const InputFile& input )
154178
{
155179
flux << input.getProperties().dataStreams.at( dataStreamIndex ) << std::endl;
156180
}
157-
181+
182+
// subtitle streams
183+
for( size_t subtitleStreamIndex = 0; subtitleStreamIndex < input.getProperties().subtitleStreams.size(); ++subtitleStreamIndex )
184+
{
185+
flux << input.getProperties().subtitleStreams.at( subtitleStreamIndex ) << std::endl;
186+
}
187+
188+
// attachement streams
189+
for( size_t attachementStreamIndex = 0; attachementStreamIndex < input.getProperties().attachementStreams.size(); ++attachementStreamIndex )
190+
{
191+
flux << input.getProperties().attachementStreams.at( attachementStreamIndex ) << std::endl;
192+
}
193+
194+
// unknown streams
195+
for( size_t unknownStreamIndex = 0; unknownStreamIndex < input.getProperties().unknownStreams.size(); ++unknownStreamIndex )
196+
{
197+
flux << input.getProperties().unknownStreams.at( unknownStreamIndex ) << std::endl;
198+
}
199+
158200
return flux;
159201
}
160202

0 commit comments

Comments
 (0)