@@ -74,6 +74,54 @@ size_t FileProperties::getPacketSize() const
74
74
return _formatContext->packet_size ;
75
75
}
76
76
77
+ VideoProperties& FileProperties::getVideoPropertiesWithStreamIndex ( const size_t streamIndex )
78
+ {
79
+ for ( std::vector< VideoProperties >::iterator it = _videoStreams.begin (); it != _videoStreams.end (); ++it )
80
+ {
81
+ if ( it->getStreamIndex () == streamIndex )
82
+ return *it;
83
+ }
84
+ std::string msg ( " no video properties correspond to stream at index " );
85
+ msg += streamIndex;
86
+ throw std::runtime_error ( msg );
87
+ }
88
+
89
+ const avtranscoder::VideoProperties& FileProperties::getVideoPropertiesWithStreamIndex ( const size_t streamIndex ) const
90
+ {
91
+ for ( std::vector< VideoProperties >::const_iterator it = _videoStreams.begin (); it != _videoStreams.end (); ++it )
92
+ {
93
+ if ( it->getStreamIndex () == streamIndex )
94
+ return *it;
95
+ }
96
+ std::string msg ( " no video properties correspond to stream at index " );
97
+ msg += streamIndex;
98
+ throw std::runtime_error ( msg );
99
+ }
100
+
101
+ AudioProperties& FileProperties::getAudioPropertiesWithStreamIndex ( const size_t streamIndex )
102
+ {
103
+ for ( std::vector< AudioProperties >::iterator it = _audioStreams.begin (); it != _audioStreams.end (); ++it )
104
+ {
105
+ if ( it->getStreamIndex () == streamIndex )
106
+ return *it;
107
+ }
108
+ std::string msg ( " no audio properties correspond to stream at index " );
109
+ msg += streamIndex;
110
+ throw std::runtime_error ( msg );
111
+ }
112
+
113
+ const avtranscoder::AudioProperties& FileProperties::getAudioPropertiesWithStreamIndex ( const size_t streamIndex ) const
114
+ {
115
+ for ( std::vector< AudioProperties >::const_iterator it = _audioStreams.begin (); it != _audioStreams.end (); ++it )
116
+ {
117
+ if ( it->getStreamIndex () == streamIndex )
118
+ return *it;
119
+ }
120
+ std::string msg ( " no audio properties correspond to stream at index " );
121
+ msg += streamIndex;
122
+ throw std::runtime_error ( msg );
123
+ }
124
+
77
125
size_t FileProperties::getNbStreams () const
78
126
{
79
127
if ( ! _formatContext )
0 commit comments