@@ -18,22 +18,59 @@ class AVCodecContext;
18
18
namespace avtranscoder
19
19
{
20
20
21
+ /* *
22
+ * Outputfile is a simple C++ API to wrap and write medias.
23
+ * the default implentation use avformat wrapper frome the LibAV/FFMpeg
24
+ * It can be overloaded to integrate custom wrapper.
25
+ **/
21
26
class AvExport OutputFile
22
27
{
23
28
public:
24
- OutputFile ( const std::string& file = " " );
29
+ /* *
30
+ * @brief Open an output media file
31
+ * @param filename resource to access
32
+ **/
33
+ OutputFile ( const std::string& filename = " " );
25
34
26
35
virtual ~OutputFile (){};
27
36
37
+ /* *
38
+ * @brief Initialize the OutputFile, create format context to wrap essences into output file.
39
+ * @note call this before adding streams using addVideoStream() or addAudioStream()
40
+ **/
28
41
virtual bool setup ();
29
42
43
+ /* *
44
+ * @brief Add an video output stream using the description.
45
+ * @note call setup() before adding any stream
46
+ * @param videoDesc description of output stream
47
+ **/
30
48
virtual void addVideoStream ( const VideoDesc& videoDesc );
49
+
50
+ /* *
51
+ * @brief Add an audio output stream using the description.
52
+ * @note call setup() before adding any stream
53
+ * @param audioDesc description of output stream
54
+ **/
31
55
virtual void addAudioStream ( const AudioDesc& audioDesc );
32
56
57
+ /* *
58
+ * @brief Initialise the wrapping
59
+ * @note this method write the header of file if necessary
60
+ **/
33
61
virtual bool beginWrap ( );
34
62
63
+ /* *
64
+ * @brief Wrap a packet of data in the output ressource
65
+ * @param data coded packet information for the current stream
66
+ * @param streamId refers to the stream in output ressource
67
+ **/
35
68
virtual bool wrap ( const DataStream& data, const size_t streamId );
36
69
70
+ /* *
71
+ * @brief Finalize the end of the wrapping
72
+ * @note this method write the footer of file if necessary
73
+ **/
37
74
virtual bool endWrap ( );
38
75
39
76
private:
0 commit comments