From 5ddef2b47d987323419a5411169dbb8a855f2e70 Mon Sep 17 00:00:00 2001 From: methodus Date: Sat, 13 Oct 2012 22:58:00 +0200 Subject: Added codec toolkit for getting detailed media information --- include/tools/codec.h | 53 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 include/tools/codec.h (limited to 'include/tools') 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 +#endif + +extern "C" { +#include +#include +} + +#include + +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_ */ -- cgit v1.2.3