@@ -22,33 +22,80 @@ namespace avtranscoder
22
22
class AvExport InputFile
23
23
{
24
24
public:
25
+ /* *
26
+ * @brief Open a media file
27
+ * @param filename resource to access
28
+ * \exception runtime_error launched if unable to open file
29
+ **/
25
30
InputFile ( const std::string& filename );
31
+
26
32
~InputFile ();
27
33
34
+ /* *
35
+ * @return Return the resource to access
36
+ **/
28
37
std::string getFilename () const { return m_filename; }
29
38
30
- // *** Metadatas section ***
31
- // run the analyse on the file after a setup.
39
+ /* *
40
+ * @brief Run the analyse on the file after a setup.
41
+ * call this function before getProperties().
42
+ **/
32
43
InputFile& analyse ();
33
44
34
- // / get file properties
45
+ /* *
46
+ * @brief Return media properties on the current InputFile.
47
+ * @note require to launch analyse() before to fill the property struture
48
+ * @return structure of media metadatas
49
+ **/
35
50
const Properties& getProperties () const { return m_properties; }
36
51
37
52
void getProperties ( Properties& properties ) const { properties = m_properties; }
38
53
54
+ /* *
55
+ * @brief Get media file properties using static method.
56
+ * @return structure of media metadatas
57
+ **/
39
58
static Properties analyseFile ( const std::string& filename );
40
59
60
+ /* *
61
+ * @brief Get stream type: video, audio, subtitle, etc.
62
+ * @param index stream index
63
+ * @return media stream type of specified index stream
64
+ **/
41
65
AVMediaType getStreamType ( size_t index );
42
66
67
+ /* *
68
+ * @brief Get stream type: video, audio, subtitle, etc.
69
+ * @param index stream index
70
+ * @return media stream type of specified index stream
71
+ **/
43
72
AvInputStream& getStream ( size_t index );
44
73
74
+ /* *
75
+ * @brief Get LibAV/FFmpeg AVFormatContext
76
+ * @return format context on current InputFile
77
+ **/
45
78
AVFormatContext& getFormatContext () const { return *m_formatContext; }
46
79
80
+ /* *
81
+ * @brief Read the next packet for the specified stream
82
+ * @note For performances, each readed stream needs to be bufferized using the readStream() method.
83
+ * @return if next packet was succefully readed
84
+ **/
47
85
bool readNextPacket ( const size_t streamIndex );
48
86
87
+ /* *
88
+ * @brief Seek input stream at specified frame
89
+ * @note clean also buffers in each InputStream
90
+ * @return if next packet was succefully readed
91
+ **/
49
92
void seekAtFrame ( const size_t frame );
50
93
51
- // / @brief Indicate that the stream should be bufferized
94
+ /* *
95
+ * @brief Indicate that the stream should be bufferized
96
+ * @param streamIndex index of the stream need to be read
97
+ * @param readStream specify if the stream need to be buffurized
98
+ **/
52
99
void readStream ( const size_t streamIndex, const bool readStream = true );
53
100
54
101
protected:
0 commit comments