began base encoder type for abstracting around exporting
Essentially the same principle as Decoders but somewhat different functionality.
This commit is contained in:
@@ -30,6 +30,7 @@ add_subdirectory(common)
|
||||
add_subdirectory(config)
|
||||
add_subdirectory(decoder)
|
||||
add_subdirectory(dialog)
|
||||
add_subdirectory(encoder)
|
||||
add_subdirectory(node)
|
||||
add_subdirectory(panel)
|
||||
add_subdirectory(project)
|
||||
|
||||
@@ -57,7 +57,7 @@ public:
|
||||
Decoder(Stream* fs);
|
||||
|
||||
// Necessary for subclassing, it's empty
|
||||
virtual ~Decoder();
|
||||
virtual ~Decoder() override;
|
||||
|
||||
DISABLE_COPY_MOVE(Decoder)
|
||||
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
# Olive - Non-Linear Video Editor
|
||||
# Copyright (C) 2019 Olive Team
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
#add_subdirectory(oiio)
|
||||
|
||||
set(OLIVE_SOURCES
|
||||
${OLIVE_SOURCES}
|
||||
encoder/encoder.h
|
||||
encoder/encoder.cpp
|
||||
PARENT_SCOPE
|
||||
)
|
||||
@@ -0,0 +1,31 @@
|
||||
#include "encoder.h"
|
||||
|
||||
Encoder::Encoder(const EncodingParams ¶ms) :
|
||||
params_(params)
|
||||
{
|
||||
}
|
||||
|
||||
EncodingParams::EncodingParams() :
|
||||
video_enabled_(false),
|
||||
audio_enabled_(false)
|
||||
{
|
||||
}
|
||||
|
||||
void EncodingParams::SetFilename(const QString &filename)
|
||||
{
|
||||
filename_ = filename;
|
||||
}
|
||||
|
||||
void EncodingParams::EnableVideo(const VideoParams &video_params, const QString &vcodec)
|
||||
{
|
||||
video_enabled_ = true;
|
||||
video_params_ = video_params;
|
||||
video_codec_ = vcodec;
|
||||
}
|
||||
|
||||
void EncodingParams::EnableAudio(const AudioParams &audio_params, const QString &acodec)
|
||||
{
|
||||
audio_enabled_ = true;
|
||||
audio_params_ = audio_params;
|
||||
audio_codec_ = acodec;
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
#ifndef ENCODER_H
|
||||
#define ENCODER_H
|
||||
|
||||
#include <memory>
|
||||
#include <QString>
|
||||
|
||||
#include "common/constructors.h"
|
||||
#include "render/audioparams.h"
|
||||
#include "render/videoparams.h"
|
||||
|
||||
class Encoder;
|
||||
using EncoderPtr = std::shared_ptr<Encoder>;
|
||||
|
||||
class EncodingParams {
|
||||
public:
|
||||
EncodingParams();
|
||||
|
||||
void SetFilename(const QString& filename);
|
||||
void EnableVideo(const VideoParams& video_params, const QString& vcodec);
|
||||
void EnableAudio(const AudioParams& audio_params, const QString& acodec);
|
||||
|
||||
private:
|
||||
QString filename_;
|
||||
|
||||
QString video_codec_;
|
||||
bool video_enabled_;
|
||||
VideoParams video_params_;
|
||||
|
||||
QString audio_codec_;
|
||||
bool audio_enabled_;
|
||||
AudioParams audio_params_;
|
||||
};
|
||||
|
||||
class Encoder
|
||||
{
|
||||
public:
|
||||
Encoder(const EncodingParams& params);
|
||||
|
||||
DISABLE_COPY_MOVE(Encoder)
|
||||
|
||||
virtual bool Open() = 0;
|
||||
|
||||
virtual void Close() = 0;
|
||||
|
||||
private:
|
||||
EncodingParams params_;
|
||||
};
|
||||
|
||||
#endif // ENCODER_H
|
||||
Reference in New Issue
Block a user