diff options
| author | Comment <tim@gray.(none)> | 2013-04-20 02:01:49 +0100 |
|---|---|---|
| committer | Comment <tim@gray.(none)> | 2013-04-20 02:01:49 +0100 |
| commit | b05e391e126f2bba2a4bd2915786d93731d2dbc9 (patch) | |
| tree | 97e525d765043af95837db15bc22cc8bf9f7efb7 /rotord/libavaudioloader.h | |
| parent | da05e29b124b2f6d553dedb1c63a4a655fc4f7b6 (diff) | |
audio muxer ongoing
Diffstat (limited to 'rotord/libavaudioloader.h')
| -rw-r--r-- | rotord/libavaudioloader.h | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/rotord/libavaudioloader.h b/rotord/libavaudioloader.h new file mode 100644 index 0000000..bacd6a9 --- /dev/null +++ b/rotord/libavaudioloader.h @@ -0,0 +1,45 @@ +#include <stdlib.h> +#include <stdio.h> +#include <string> +#include <math.h> +#include <iostream> + +extern "C" { + #include <libavutil/mathematics.h> + #include <libavformat/avformat.h> + #include <libswscale/swscale.h> +} + +namespace libav { + + class audioloader{ + public: + audioloader(){ready=false;sample_start=0;}; + bool setup(const std::string &filename); + AVFrame* get_frame(); + uint16_t* get_samples(int num){ + if(!ready) return nullptr; + if (sample_start>0){ + + } + while (i<num) { + AVFrame *frame=get_frame(); + if (frame==nullptr) return nullptr; + frame.nb_samples* + + } + } + bool close(); + bool ready; + private: + AVFrame* frame; + AVFormatContext* formatContext; + AVStream* audioStream; + AVCodecContext* codecContext; + AVPacket packet; + int sample_processed; + int sample_start; + }; + + +}
\ No newline at end of file |
