Skip to content

Commit c0aed47

Browse files
author
Clement Champetier
committed
mediaProperty: rename typedef PropertiesMap to PropertyVector
* Same same in SWIG interface. * It's a vector of pair, not a map!
1 parent 05389cd commit c0aed47

21 files changed

+195
-195
lines changed

src/AvTranscoder/file/OutputFile.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,9 +132,9 @@ bool OutputFile::endWrap( )
132132
return true;
133133
}
134134

135-
void OutputFile::addMetadata( const PropertiesMap& dataMap )
135+
void OutputFile::addMetadata( const PropertyVector& data )
136136
{
137-
for( PropertiesMap::const_iterator it = dataMap.begin(); it != dataMap.end(); ++it )
137+
for( PropertyVector::const_iterator it = data.begin(); it != data.end(); ++it )
138138
{
139139
addMetadata( it->first, it->second );
140140
}

src/AvTranscoder/file/OutputFile.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ class AvExport OutputFile : public IOutputFile
4141
* @brief Add metadata to the output file.
4242
* @note Depending on the format, you are not sure to find your metadata after the transcode.
4343
*/
44-
void addMetadata( const PropertiesMap& dataMap );
44+
void addMetadata( const PropertyVector& data );
4545
void addMetadata( const std::string& key, const std::string& value );
4646

4747
IOutputStream& getStream( const size_t streamId );

src/AvTranscoder/mediaProperty/AttachementProperties.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,25 +20,25 @@ size_t AttachementProperties::getStreamId() const
2020
return _formatContext->streams[_streamIndex]->id;
2121
}
2222

23-
PropertiesMap AttachementProperties::getPropertiesAsMap() const
23+
PropertyVector AttachementProperties::getPropertiesAsVector() const
2424
{
25-
PropertiesMap dataMap;
25+
PropertyVector data;
2626

2727
try
2828
{
29-
detail::add( dataMap, "streamId", getStreamId() );
29+
detail::add( data, "streamId", getStreamId() );
3030
}
3131
catch( const std::exception& e )
3232
{
33-
detail::add( dataMap, "streamId", e.what() );
33+
detail::add( data, "streamId", e.what() );
3434
}
3535

3636
for( size_t metadataIndex = 0; metadataIndex < _metadatas.size(); ++metadataIndex )
3737
{
38-
detail::add( dataMap, _metadatas.at( metadataIndex ).first, _metadatas.at( metadataIndex ).second );
38+
detail::add( data, _metadatas.at( metadataIndex ).first, _metadatas.at( metadataIndex ).second );
3939
}
4040

41-
return dataMap;
41+
return data;
4242
}
4343

4444
}

src/AvTranscoder/mediaProperty/AttachementProperties.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,19 +15,19 @@ class AvExport AttachementProperties
1515

1616
size_t getStreamIndex() const { return _streamIndex; }
1717
size_t getStreamId() const;
18-
PropertiesMap& getMetadatas() { return _metadatas; }
18+
PropertyVector& getMetadatas() { return _metadatas; }
1919

2020
#ifndef SWIG
2121
const AVFormatContext& getAVFormatContext() { return *_formatContext; }
2222
#endif
2323

24-
PropertiesMap getPropertiesAsMap() const; ///< Return all attachement properties as a map (name of property: value)
24+
PropertyVector getPropertiesAsVector() const; ///< Return all attachement properties as a vector (name of property: value)
2525

2626
private:
2727
const AVFormatContext* _formatContext; ///< Has link (no ownership)
2828

2929
size_t _streamIndex;
30-
PropertiesMap _metadatas;
30+
PropertyVector _metadatas;
3131
};
3232

3333
}

src/AvTranscoder/mediaProperty/AudioProperties.cpp

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -202,33 +202,33 @@ double AudioProperties::getDuration() const
202202
return duration;
203203
}
204204

205-
PropertiesMap AudioProperties::getPropertiesAsMap() const
206-
{
207-
PropertiesMap dataMap;
208-
209-
addProperty( dataMap, "streamId", &AudioProperties::getStreamId );
210-
addProperty( dataMap, "codecId", &AudioProperties::getCodecId );
211-
addProperty( dataMap, "codecName", &AudioProperties::getCodecName );
212-
addProperty( dataMap, "codecLongName", &AudioProperties::getCodecLongName );
213-
addProperty( dataMap, "sampleFormatName", &AudioProperties::getSampleFormatName );
214-
addProperty( dataMap, "sampleFormatLongName", &AudioProperties::getSampleFormatLongName );
215-
addProperty( dataMap, "sampleRate", &AudioProperties::getSampleRate );
216-
addProperty( dataMap, "bitRate", &AudioProperties::getBitRate );
217-
addProperty( dataMap, "nbSamples", &AudioProperties::getNbSamples );
218-
addProperty( dataMap, "channels", &AudioProperties::getChannels );
219-
addProperty( dataMap, "channelLayout", &AudioProperties::getChannelLayout );
220-
addProperty( dataMap, "channelName", &AudioProperties::getChannelName );
221-
addProperty( dataMap, "channelDescription", &AudioProperties::getChannelDescription );
222-
addProperty( dataMap, "ticksPerFrame", &AudioProperties::getTicksPerFrame );
223-
addProperty( dataMap, "timeBase", &AudioProperties::getTimeBase );
224-
addProperty( dataMap, "duration", &AudioProperties::getDuration );
205+
PropertyVector AudioProperties::getPropertiesAsVector() const
206+
{
207+
PropertyVector data;
208+
209+
addProperty( data, "streamId", &AudioProperties::getStreamId );
210+
addProperty( data, "codecId", &AudioProperties::getCodecId );
211+
addProperty( data, "codecName", &AudioProperties::getCodecName );
212+
addProperty( data, "codecLongName", &AudioProperties::getCodecLongName );
213+
addProperty( data, "sampleFormatName", &AudioProperties::getSampleFormatName );
214+
addProperty( data, "sampleFormatLongName", &AudioProperties::getSampleFormatLongName );
215+
addProperty( data, "sampleRate", &AudioProperties::getSampleRate );
216+
addProperty( data, "bitRate", &AudioProperties::getBitRate );
217+
addProperty( data, "nbSamples", &AudioProperties::getNbSamples );
218+
addProperty( data, "channels", &AudioProperties::getChannels );
219+
addProperty( data, "channelLayout", &AudioProperties::getChannelLayout );
220+
addProperty( data, "channelName", &AudioProperties::getChannelName );
221+
addProperty( data, "channelDescription", &AudioProperties::getChannelDescription );
222+
addProperty( data, "ticksPerFrame", &AudioProperties::getTicksPerFrame );
223+
addProperty( data, "timeBase", &AudioProperties::getTimeBase );
224+
addProperty( data, "duration", &AudioProperties::getDuration );
225225

226226
for( size_t metadataIndex = 0; metadataIndex < _metadatas.size(); ++metadataIndex )
227227
{
228-
detail::add( dataMap, _metadatas.at( metadataIndex ).first, _metadatas.at( metadataIndex ).second );
228+
detail::add( data, _metadatas.at( metadataIndex ).first, _metadatas.at( metadataIndex ).second );
229229
}
230230

231-
return dataMap;
231+
return data;
232232
}
233233

234234
}

src/AvTranscoder/mediaProperty/AudioProperties.hpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,27 +35,27 @@ class AvExport AudioProperties
3535
Rational getTimeBase() const;
3636
double getDuration() const;
3737

38-
PropertiesMap& getMetadatas() { return _metadatas; }
38+
PropertyVector& getMetadatas() { return _metadatas; }
3939

4040
#ifndef SWIG
4141
const AVFormatContext& getAVFormatContext() { return *_formatContext; }
4242
AVCodecContext& getAVCodecContext() { return *_codecContext; }
4343
#endif
4444

45-
PropertiesMap getPropertiesAsMap() const; ///< Return all audio properties as a map (name of property: value)
45+
PropertyVector getPropertiesAsVector() const; ///< Return all audio properties as a vector (name of property: value)
4646

4747
private:
4848
#ifndef SWIG
4949
template<typename T>
50-
void addProperty( PropertiesMap& dataMap, const std::string& key, T (AudioProperties::*getter)(void) const ) const
50+
void addProperty( PropertyVector& data, const std::string& key, T (AudioProperties::*getter)(void) const ) const
5151
{
5252
try
5353
{
54-
detail::add( dataMap, key, (this->*getter)() );
54+
detail::add( data, key, (this->*getter)() );
5555
}
5656
catch( const std::exception& e )
5757
{
58-
detail::add( dataMap, key, e.what() );
58+
detail::add( data, key, e.what() );
5959
}
6060
}
6161
#endif
@@ -66,7 +66,7 @@ class AvExport AudioProperties
6666
AVCodec* _codec; ///< Has link (no ownership)
6767

6868
size_t _streamIndex;
69-
PropertiesMap _metadatas;
69+
PropertyVector _metadatas;
7070
};
7171

7272
}

src/AvTranscoder/mediaProperty/DataProperties.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,25 +29,25 @@ size_t DataProperties::getStreamId() const
2929
return _formatContext->streams[_streamIndex]->id;
3030
}
3131

32-
PropertiesMap DataProperties::getPropertiesAsMap() const
32+
PropertyVector DataProperties::getPropertiesAsVector() const
3333
{
34-
PropertiesMap dataMap;
34+
PropertyVector data;
3535

3636
try
3737
{
38-
detail::add( dataMap, "streamId", getStreamId() );
38+
detail::add( data, "streamId", getStreamId() );
3939
}
4040
catch( const std::exception& e )
4141
{
42-
detail::add( dataMap, "streamId", e.what() );
42+
detail::add( data, "streamId", e.what() );
4343
}
4444

4545
for( size_t metadataIndex = 0; metadataIndex < _metadatas.size(); ++metadataIndex )
4646
{
47-
detail::add( dataMap, _metadatas.at( metadataIndex ).first, _metadatas.at( metadataIndex ).second );
47+
detail::add( data, _metadatas.at( metadataIndex ).first, _metadatas.at( metadataIndex ).second );
4848
}
4949

50-
return dataMap;
50+
return data;
5151
}
5252

5353
void DataProperties::detectAncillaryData()

src/AvTranscoder/mediaProperty/DataProperties.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,13 @@ class AvExport DataProperties
1515

1616
size_t getStreamIndex() const { return _streamIndex; }
1717
size_t getStreamId() const;
18-
PropertiesMap& getMetadatas() { return _metadatas; }
18+
PropertyVector& getMetadatas() { return _metadatas; }
1919

2020
#ifndef SWIG
2121
const AVFormatContext& getAVFormatContext() { return *_formatContext; }
2222
#endif
2323

24-
PropertiesMap getPropertiesAsMap() const; ///< Return all data properties as a map (name of property: value)
24+
PropertyVector getPropertiesAsVector() const; ///< Return all data properties as a vector (name of property: value)
2525

2626
private:
2727
void detectAncillaryData();
@@ -30,7 +30,7 @@ class AvExport DataProperties
3030
const AVFormatContext* _formatContext; ///< Has link (no ownership)
3131

3232
size_t _streamIndex;
33-
PropertiesMap _metadatas;
33+
PropertyVector _metadatas;
3434
};
3535

3636
}

src/AvTranscoder/mediaProperty/FileProperties.cpp

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -129,33 +129,33 @@ size_t FileProperties::getNbStreams() const
129129
return _formatContext->nb_streams;
130130
}
131131

132-
PropertiesMap FileProperties::getPropertiesAsMap() const
132+
PropertyVector FileProperties::getPropertiesAsVector() const
133133
{
134-
PropertiesMap dataMap;
134+
PropertyVector data;
135135

136-
addProperty( dataMap, "filename", &FileProperties::getFilename );
137-
addProperty( dataMap, "formatName", &FileProperties::getFormatName );
138-
addProperty( dataMap, "formatLongName", &FileProperties::getFormatLongName );
136+
addProperty( data, "filename", &FileProperties::getFilename );
137+
addProperty( data, "formatName", &FileProperties::getFormatName );
138+
addProperty( data, "formatLongName", &FileProperties::getFormatLongName );
139139

140-
addProperty( dataMap, "startTime", &FileProperties::getStartTime );
141-
addProperty( dataMap, "duration", &FileProperties::getDuration );
142-
addProperty( dataMap, "bitrate", &FileProperties::getBitRate );
143-
addProperty( dataMap, "numberOfStreams", &FileProperties::getNbStreams );
144-
addProperty( dataMap, "numberOfPrograms", &FileProperties::getProgramsCount );
140+
addProperty( data, "startTime", &FileProperties::getStartTime );
141+
addProperty( data, "duration", &FileProperties::getDuration );
142+
addProperty( data, "bitrate", &FileProperties::getBitRate );
143+
addProperty( data, "numberOfStreams", &FileProperties::getNbStreams );
144+
addProperty( data, "numberOfPrograms", &FileProperties::getProgramsCount );
145145

146-
detail::add( dataMap, "numberOfVideoStreams", getNbVideoStreams() );
147-
detail::add( dataMap, "numberOfAudioStreams", getNbAudioStreams() );
148-
detail::add( dataMap, "numberOfDataStreams", getNbDataStreams() );
149-
detail::add( dataMap, "numberOfSubtitleStreams", getNbSubtitleStreams() );
150-
detail::add( dataMap, "numberOfAttachementStreams", getNbAttachementStreams() );
151-
detail::add( dataMap, "numberOfUnknownStreams", getNbUnknownStreams() );
146+
detail::add( data, "numberOfVideoStreams", getNbVideoStreams() );
147+
detail::add( data, "numberOfAudioStreams", getNbAudioStreams() );
148+
detail::add( data, "numberOfDataStreams", getNbDataStreams() );
149+
detail::add( data, "numberOfSubtitleStreams", getNbSubtitleStreams() );
150+
detail::add( data, "numberOfAttachementStreams", getNbAttachementStreams() );
151+
detail::add( data, "numberOfUnknownStreams", getNbUnknownStreams() );
152152

153153
for( size_t metadataIndex = 0; metadataIndex < _metadatas.size(); ++metadataIndex )
154154
{
155-
detail::add( dataMap, _metadatas.at( metadataIndex ).first, _metadatas.at( metadataIndex ).second );
155+
detail::add( data, _metadatas.at( metadataIndex ).first, _metadatas.at( metadataIndex ).second );
156156
}
157157

158-
return dataMap;
158+
return data;
159159
}
160160

161161
void FileProperties::clearStreamProperties()

src/AvTranscoder/mediaProperty/FileProperties.hpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class AvExport FileProperties
3232
size_t getBitRate() const; ///< total stream bitrate in bit/s, 0 if not available (result of a computation by ffmpeg)
3333
size_t getPacketSize() const;
3434

35-
PropertiesMap& getMetadatas() { return _metadatas; }
35+
PropertyVector& getMetadatas() { return _metadatas; }
3636

3737
size_t getNbStreams() const;
3838
size_t getNbVideoStreams() const { return _videoStreams.size(); }
@@ -72,22 +72,22 @@ class AvExport FileProperties
7272
const std::vector< avtranscoder::UnknownProperties >& getUnknownPropertiesProperties() const { return _unknownStreams; }
7373
#endif
7474

75-
PropertiesMap getPropertiesAsMap() const; ///< Return all file properties as a map (name of property: value)
75+
PropertyVector getPropertiesAsVector() const; ///< Return all file properties as a vector (name of property: value)
7676

7777
void clearStreamProperties(); ///< Clear all array of stream properties
7878

7979
private:
8080
#ifndef SWIG
8181
template<typename T>
82-
void addProperty( PropertiesMap& dataMap, const std::string& key, T (FileProperties::*getter)(void) const ) const
82+
void addProperty( PropertyVector& data, const std::string& key, T (FileProperties::*getter)(void) const ) const
8383
{
8484
try
8585
{
86-
detail::add( dataMap, key, (this->*getter)() );
86+
detail::add( data, key, (this->*getter)() );
8787
}
8888
catch( const std::exception& e )
8989
{
90-
detail::add( dataMap, key, e.what() );
90+
detail::add( data, key, e.what() );
9191
}
9292
}
9393
#endif
@@ -102,7 +102,7 @@ class AvExport FileProperties
102102
std::vector< AttachementProperties > _attachementStreams; ///< Array of properties per attachement stream
103103
std::vector< UnknownProperties > _unknownStreams; ///< Array of properties per unknown stream
104104

105-
PropertiesMap _metadatas;
105+
PropertyVector _metadatas;
106106
};
107107

108108
}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy