Skip to content

Commit 2e6fd67

Browse files
author
Clement Champetier
committed
util: add typedef OptionArrayMap
* Easier to manipulate complexe data (in AvTranscoder and in other libraries...). * Remove forward declaration of 'Option': need to include 'Context' to get 'OptionArray' typedef.
1 parent 7c885d3 commit 2e6fd67

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

src/AvTranscoder/util.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ std::vector<std::string> getAudioCodecsShortNames()
261261
return audioCodecsShortNames;
262262
}
263263

264-
std::map< std::string, std::vector<Option> > getOutputFormatOptions()
264+
OptionArrayMap getOutputFormatOptions()
265265
{
266266
av_register_all();
267267

@@ -288,7 +288,7 @@ std::map< std::string, std::vector<Option> > getOutputFormatOptions()
288288
return optionsPerFormat;
289289
}
290290

291-
std::map< std::string, std::vector<Option> > getVideoCodecOptions()
291+
OptionArrayMap getVideoCodecOptions()
292292
{
293293
std::map< std::string, std::vector<Option> > videoCodecOptions;
294294

@@ -319,7 +319,7 @@ std::map< std::string, std::vector<Option> > getVideoCodecOptions()
319319
return videoCodecOptions;
320320
}
321321

322-
std::map< std::string, std::vector<Option> > getAudioCodecOptions()
322+
OptionArrayMap getAudioCodecOptions()
323323
{
324324
std::map< std::string, std::vector<Option> > audioCodecOptions;
325325

src/AvTranscoder/util.hpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33

44
#include "common.hpp"
55

6+
#include <AvTranscoder/option/Context.hpp>
7+
68
extern "C" {
79
#include <libavutil/pixfmt.h>
810
#include <libavutil/samplefmt.h>
@@ -15,7 +17,7 @@ extern "C" {
1517
namespace avtranscoder
1618
{
1719

18-
class Option;
20+
typedef std::map<std::string, OptionArray> OptionArrayMap;
1921

2022
/**
2123
* @brief Get pixel format supported by a video codec.
@@ -65,17 +67,17 @@ std::vector<std::string> getAudioCodecsShortNames();
6567
/**
6668
* @brief Get the list of options for each output format
6769
*/
68-
std::map< std::string, std::vector<Option> > getOutputFormatOptions();
70+
OptionArrayMap getOutputFormatOptions();
6971

7072
/**
7173
* @brief Get the list of options for each video codec
7274
*/
73-
std::map< std::string, std::vector<Option> > getVideoCodecOptions();
75+
OptionArrayMap getVideoCodecOptions();
7476

7577
/**
7678
* @brief Get the list of options for each audio codec
7779
*/
78-
std::map< std::string, std::vector<Option> > getAudioCodecOptions();
80+
OptionArrayMap getAudioCodecOptions();
7981

8082
}
8183

0 commit comments

Comments
 (0)