Initial import from SVN

This commit is contained in:
emeric
2014-03-09 10:58:52 +01:00
commit b6abce0c2f
440 changed files with 30862 additions and 0 deletions
+35
View File
@@ -0,0 +1,35 @@
#include <stdexcept>
#include <iostream>
#include <iomanip>
#include <boost/array.hpp>
#include "CodecContext.hpp"
namespace Av
{
CodecContext::CodecContext(AVCodecContext* CodecContext)
: _codecContext(CodecContext)
{
assert(_codecContext != nullptr);
}
void
CodecContext::dumpInfo(std::ostream& ost) const
{
ost << "BitRate = " << getBitRate() << ", SampleFormat = " << getSampleFormat() << ", SampleRate = " << getSampleRate() << ", ChannelLayout = " << getChannelLayout() << ", NbChannels = " << getNbChannels() << ", Timebase = " << getTimeBase().num << "/" << getTimeBase().den;
}
std::string
CodecContext::getCodecDesc(void) const
{
std::vector<char> buf(256, 0);
avcodec_string(&buf[0], buf.size(), _codecContext, 0);
return std::string(buf.begin(), buf.end());
}
} // namespace Av