00001 #include <iostream>
00002
00003 #include "metadata.h"
00004 #include "encoder.h"
00005
00006 #include <mythcontext.h>
00007
00008 using namespace std;
00009
00010 Encoder::Encoder(const QString &outfile, int qualitylevel, Metadata *metadata)
00011 : m_outfile(outfile), m_out(NULL), m_quality(qualitylevel),
00012 m_metadata(metadata)
00013 {
00014 if (!m_outfile.isEmpty())
00015 {
00016 QByteArray outfile = m_outfile.toLocal8Bit();
00017 m_out = fopen(outfile.constData(), "w+");
00018 if (!m_out)
00019 {
00020 LOG(VB_GENERAL, LOG_ERR, QString("Error opening output file: '%1'")
00021 .arg(m_outfile));
00022 }
00023 }
00024 }
00025
00026 Encoder::~Encoder()
00027 {
00028 if (m_out)
00029 fclose(m_out);
00030 }