diff options
Diffstat (limited to 'include/tools')
-rw-r--r-- | include/tools/codec.h | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/include/tools/codec.h b/include/tools/codec.h new file mode 100644 index 0000000..768fa15 --- /dev/null +++ b/include/tools/codec.h @@ -0,0 +1,53 @@ +/* + * codec.h + * + * Created on: 12.10.2012 + * Author: savop + */ + +#ifndef CODEC_H_ +#define CODEC_H_ + +#ifdef __cplusplus + #define __STDC_CONSTANT_MACROS + #ifdef _STDINT_H + #undef _STDINT_H + #endif + #include <stdint.h> +#endif + +extern "C" { +#include <libavcodec/avcodec.h> +#include <libavformat/avformat.h> +} + +#include <string> + +using namespace std; + +namespace upnp { + +namespace codec { + +class cFormatContext { +public: + cFormatContext(); + virtual ~cFormatContext(); + + bool Open(const string& file); + + const AVCodec* GetCodec(AVMediaType Type) const; + const AVCodecContext* GetCodecContext(AVMediaType Type) const; + const AVStream* GetStream(AVMediaType Type) const; + + AVFormatContext* operator*() const; +private: + AVFormatContext* formatCtx; +}; + +} + +} + + +#endif /* CODEC_H_ */ |