fixed gcc compile issues

This commit is contained in:
itsmattkc
2020-01-19 20:39:48 +11:00
parent 1101b58ee8
commit 4697b98980
30 changed files with 55 additions and 46 deletions
+1 -1
View File
@@ -54,7 +54,7 @@ find_package(Qt5 5.6 REQUIRED
LinguistTools
)
find_package(FFMPEG 3.4 REQUIRED
find_package(FFMPEG 3.0 REQUIRED
COMPONENTS
avutil
avcodec
+4 -1
View File
@@ -83,12 +83,15 @@ qint64 AudioOutputDeviceProxy::readData(char *data, qint64 maxlen)
qint64 AudioOutputDeviceProxy::writeData(const char *data, qint64 maxSize)
{
Q_UNUSED(data)
Q_UNUSED(maxSize)
return -1;
}
qint64 AudioOutputDeviceProxy::ReverseAwareRead(char *data, qint64 maxlen)
{
qint64 new_pos;
qint64 new_pos = -1;
if (playback_speed_ < 0) {
// If we're reversing, we'll seek back by maxlen bytes before we read
+1
View File
@@ -21,6 +21,7 @@
#ifndef AUDIOHYBRIDDEVICE_H
#define AUDIOHYBRIDDEVICE_H
#include <memory>
#include <QAudioOutput>
#include <QBuffer>
#include <QIODevice>
+2 -2
View File
@@ -162,7 +162,7 @@ void TempoProcessor::Push(const char *data, int length)
}
// Copy buffer from data array to frame
memcpy(src_frame->data[0], data, length);
memcpy(src_frame->data[0], data, static_cast<size_t>(length));
}
int ret = av_buffersrc_add_frame_flags(buffersrc_ctx_, src_frame, AV_BUFFERSRC_FLAG_KEEP_REF);
@@ -204,7 +204,7 @@ int TempoProcessor::Pull(char *data, int max_length)
int copy_length = qMin(max_length, processed_frame_max_bytes_ - processed_frame_byte_index_);
// Copy the bytes
memcpy(data, processed_frame_->data[0] + processed_frame_byte_index_, copy_length);
memcpy(data, processed_frame_->data[0] + processed_frame_byte_index_, static_cast<size_t>(copy_length));
// Add the copied amount to the current index
processed_frame_byte_index_ += copy_length;
+2
View File
@@ -75,6 +75,8 @@ const AudioRenderingParams &EncodingParams::audio_params() const
Encoder* Encoder::CreateFromID(const QString &id, const EncodingParams& params)
{
Q_UNUSED(id)
return new FFmpegEncoder(params);
}
+2 -2
View File
@@ -37,10 +37,10 @@ void FFmpegEncoder::WriteAudio(const AudioRenderingParams &pcm_info, const QStri
}
SwrContext* swr_ctx = swr_alloc_set_opts(nullptr,
audio_codec_ctx_->channel_layout,
static_cast<int64_t>(audio_codec_ctx_->channel_layout),
audio_codec_ctx_->sample_fmt,
audio_codec_ctx_->sample_rate,
pcm_info.channel_layout(),
static_cast<int64_t>(pcm_info.channel_layout()),
FFmpegCommon::GetFFmpegSampleFormat(pcm_info.format()),
pcm_info.sample_rate(),
0,
+1 -1
View File
@@ -38,7 +38,7 @@ ExportAudioTab::ExportAudioTab(QWidget* parent) :
channel_layout_combobox_ = new QComboBox();
channel_layouts_ = Core::SupportedChannelLayouts();
foreach (const uint64_t& layout, channel_layouts_) {
channel_layout_combobox_->addItem(Core::ChannelLayoutToString(layout), layout);
channel_layout_combobox_->addItem(Core::ChannelLayoutToString(layout), QVariant::fromValue(layout));
}
layout->addWidget(channel_layout_combobox_, row, 1);
@@ -90,7 +90,7 @@ void PreferencesGeneralTab::Accept()
Config::Current()["DefaultSequenceHeight"] = default_sequence_.video_params().height();;
Config::Current()["DefaultSequenceFrameRate"] = QVariant::fromValue(default_sequence_.video_params().time_base());
Config::Current()["DefaultSequenceAudioFrequency"] = default_sequence_.audio_params().sample_rate();
Config::Current()["DefaultSequenceAudioLayout"] = default_sequence_.audio_params().channel_layout();
Config::Current()["DefaultSequenceAudioLayout"] = QVariant::fromValue(default_sequence_.audio_params().channel_layout());
Config::Current()["Autoscroll"] = autoscroll_method_->currentData();
}
+1 -1
View File
@@ -116,7 +116,7 @@ SequenceDialog::SequenceDialog(Sequence* s, Type t, QWidget* parent) :
// Set up available channel layouts
QList<uint64_t> channel_layouts = Core::SupportedChannelLayouts();
foreach (const uint64_t& layout, channel_layouts) {
audio_channels_field_->addItem(Core::ChannelLayoutToString(layout), layout);
audio_channels_field_->addItem(Core::ChannelLayoutToString(layout), QVariant::fromValue(layout));
}
// Set values based on input sequence
+2
View File
@@ -43,6 +43,8 @@ NodeInput *VolumeNode::ProcessesSamplesFrom() const
void VolumeNode::ProcessSamples(const NodeValueDatabase *values, const AudioRenderingParams& params, const float* input, float* output, int index) const
{
Q_UNUSED(params)
float volume_val = (*values)[volume_input_].Get(NodeParam::kFloat).toFloat();
output[index] = input[index] * volume_val;
+2 -2
View File
@@ -241,11 +241,11 @@ const NodeParam::DataType &NodeInput::data_type() const
return data_type_;
}
void NodeInput::LoadInternal(QXmlStreamReader *reader, QHash<quintptr, NodeOutput *> &param_ptrs, QList<SerializedConnection> &input_connections, QList<FootageConnection>& footage_connections)
void NodeInput::LoadInternal(QXmlStreamReader*, QHash<quintptr, NodeOutput *>&, QList<SerializedConnection>&, QList<FootageConnection>&)
{
}
void NodeInput::SaveInternal(QXmlStreamWriter *writer) const
void NodeInput::SaveInternal(QXmlStreamWriter*) const
{
}
+1
View File
@@ -22,6 +22,7 @@
#define NODEKEYFRAME_H
#include <memory>
#include <QPointF>
#include <QVariant>
#include "common/rational.h"
+1 -1
View File
@@ -42,7 +42,7 @@ QString NodeOutput::name()
return NodeParam::name();
}
void NodeOutput::Load(QXmlStreamReader* reader, QHash<quintptr, NodeOutput*>& param_ptrs, QList<SerializedConnection> &input_connections, QList<FootageConnection>& footage_connections)
void NodeOutput::Load(QXmlStreamReader* reader, QHash<quintptr, NodeOutput*>& param_ptrs, QList<SerializedConnection>&, QList<FootageConnection>&)
{
XMLAttributeLoop(reader, attr) {
if (attr.name() == "ptr") {
+1 -1
View File
@@ -37,7 +37,7 @@ Footage::~Footage()
ClearStreams();
}
void Footage::Load(QXmlStreamReader *reader, QHash<quintptr, StreamPtr>& footage_ptrs, QList<NodeParam::FootageConnection>& footage_connections)
void Footage::Load(QXmlStreamReader *reader, QHash<quintptr, StreamPtr>& footage_ptrs, QList<NodeParam::FootageConnection>&)
{
QXmlStreamAttributes attributes = reader->attributes();
+3 -3
View File
@@ -140,15 +140,15 @@ StreamID Stream::ToID() const
return StreamID(footage_->filename(), index_);
}
void Stream::FootageSetEvent(Footage *)
void Stream::FootageSetEvent(Footage*)
{
}
void Stream::LoadCustomParameters(QXmlStreamReader* reader)
void Stream::LoadCustomParameters(QXmlStreamReader*)
{
}
void Stream::SaveCustomParameters(QXmlStreamWriter *writer) const
void Stream::SaveCustomParameters(QXmlStreamWriter*) const
{
}
+1 -1
View File
@@ -157,7 +157,7 @@ bool Item::ChildExistsWithName(const QString &name)
return ChildExistsWithNameInternal(name, this);
}
void Item::NameChangedEvent(const QString &name)
void Item::NameChangedEvent(const QString &)
{
}
+1 -1
View File
@@ -42,7 +42,7 @@ Sequence::Sequence()
AddNode(viewer_output_);
}
void Sequence::Load(QXmlStreamReader *reader, QHash<quintptr, StreamPtr> &footage_ptrs, QList<NodeInput::FootageConnection>& footage_connections)
void Sequence::Load(QXmlStreamReader *reader, QHash<quintptr, StreamPtr> &, QList<NodeInput::FootageConnection>& footage_connections)
{
XMLAttributeLoop(reader, attr) {
if (attr.name() == "name") {
+1 -6
View File
@@ -37,7 +37,7 @@ bool VideoRenderFrameCache::IsCaching(const QByteArray &hash)
return is_caching;
}
bool VideoRenderFrameCache::TryCache(const rational& time, const QByteArray &hash)
bool VideoRenderFrameCache::TryCache(const QByteArray &hash)
{
currently_caching_lock_.lock();
@@ -69,11 +69,6 @@ void VideoRenderFrameCache::SetHash(const rational &time, const QByteArray &hash
time_hash_map_.insert(time, hash);
}
void VideoRenderFrameCache::RemoveHash(const rational &time, const QByteArray &hash)
{
time_hash_map_.remove(time);
}
void VideoRenderFrameCache::Truncate(const rational &time)
{
QMap<rational, QByteArray>::iterator i = time_hash_map_.begin();
+1 -2
View File
@@ -26,7 +26,7 @@ public:
/**
* @brief Check if a frame is currently being cached, and if not reserve it
*/
bool TryCache(const rational &time, const QByteArray& hash);
bool TryCache(const QByteArray& hash);
/**
* @brief Return the path of the cached image at this time
@@ -38,7 +38,6 @@ public:
QByteArray TimeToHash(const rational& time) const;
void SetHash(const rational& time, const QByteArray& hash);
void RemoveHash(const rational& time, const QByteArray &hash);
void Truncate(const rational& time);
+3 -3
View File
@@ -54,7 +54,7 @@ NodeValueTable VideoRenderWorker::RenderInternal(const NodeDependency& path, con
// We've already cached this hash, no need to continue
emit HashAlreadyExists(path, job_time, hash);
} else if (!(operating_mode_ & kHashOnly) || frame_cache_->TryCache(path.in(), hash)) {
} else if (!(operating_mode_ & kHashOnly) || frame_cache_->TryCache(hash)) {
// This hash is available for us to cache, start traversing graph
value = ProcessNode(path);
@@ -67,7 +67,7 @@ NodeValueTable VideoRenderWorker::RenderInternal(const NodeDependency& path, con
// If we actually have a texture, download it into the disk cache
if ((operating_mode_ & kDownloadOnly) && !texture.isNull()) {
Download(path, hash, texture, frame_cache_->CachePathName(hash, video_params_.format()));
Download(texture, frame_cache_->CachePathName(hash, video_params_.format()));
}
frame_cache_->RemoveHashFromCurrentlyCaching(hash);
@@ -206,7 +206,7 @@ void VideoRenderWorker::CloseInternal()
download_buffer_.clear();
}
void VideoRenderWorker::Download(NodeDependency dep, QByteArray hash, QVariant texture, QString filename)
void VideoRenderWorker::Download(QVariant texture, QString filename)
{
PixelFormat::Info format_info = PixelService::GetPixelFormatInfo(video_params().format());
+1 -1
View File
@@ -78,7 +78,7 @@ protected:
private:
void HashNodeRecursively(QCryptographicHash* hash, const Node *n, const rational &time);
void Download(NodeDependency dep, QByteArray hash, QVariant texture, QString filename);
void Download(QVariant texture, QString filename);
VideoRenderingParams video_params_;
+2
View File
@@ -194,6 +194,8 @@ void CurveView::ScaleChangedEvent(double scale)
void CurveView::VerticalScaleChangedEvent(double scale)
{
Q_UNUSED(scale)
QMap<NodeKeyframe*, KeyframeViewItem*>::const_iterator iterator;
for (iterator=item_map().begin();iterator!=item_map().end();iterator++) {
+4 -4
View File
@@ -197,7 +197,7 @@ void KeyframeViewBase::ScaleChangedEvent(double scale)
}
}
void KeyframeViewBase::VerticalScaleChangedEvent(double scale)
void KeyframeViewBase::VerticalScaleChangedEvent(double)
{
}
@@ -300,9 +300,9 @@ void KeyframeViewBase::ShowContextMenu()
MenuShared::instance()->AddItemsForEditMenu(&m);
QAction* linear_key_action;
QAction* bezier_key_action;
QAction* hold_key_action;
QAction* linear_key_action = nullptr;
QAction* bezier_key_action = nullptr;
QAction* hold_key_action = nullptr;
QList<QGraphicsItem*> items = scene()->selectedItems();
if (!items.isEmpty()) {
@@ -228,5 +228,7 @@ void NodeParamView::ItemRequestedTimeChanged(const rational &time)
void NodeParamView::ForceKeyframeViewToScroll(int min, int max)
{
Q_UNUSED(min)
bottom_item_->setY(keyframe_view_->viewport()->height() + max);
}
+3 -3
View File
@@ -33,17 +33,17 @@ int IntegerSlider::GetValue()
void IntegerSlider::SetValue(const int64_t &v)
{
SliderBase::SetValue(v);
SliderBase::SetValue(QVariant::fromValue(v));
}
void IntegerSlider::SetMinimum(const int64_t &d)
{
SetMinimumInternal(d);
SetMinimumInternal(QVariant::fromValue(d));
}
void IntegerSlider::SetMaximum(const int64_t &d)
{
SetMaximumInternal(d);
SetMaximumInternal(QVariant::fromValue(d));
}
QVariant IntegerSlider::StringToValue(const QString &s, bool *ok)
+1 -1
View File
@@ -30,5 +30,5 @@ QString TimeSlider::ValueToString(const QVariant &v)
QVariant TimeSlider::StringToValue(const QString &s, bool *ok)
{
return Timecode::timecode_to_timestamp(s, timebase_, Timecode::CurrentDisplay(), ok);
return QVariant::fromValue(Timecode::timecode_to_timestamp(s, timebase_, Timecode::CurrentDisplay(), ok));
}
+3 -3
View File
@@ -7,15 +7,15 @@ TimelineWidget::EditTool::EditTool(TimelineWidget* parent) :
void TimelineWidget::EditTool::MousePress(TimelineViewMouseEvent *event)
{
Q_UNUSED(event)
}
void TimelineWidget::EditTool::MouseMove(TimelineViewMouseEvent *event)
{
Q_UNUSED(event)
}
void TimelineWidget::EditTool::MouseRelease(TimelineViewMouseEvent *event)
{
Q_UNUSED(event)
}
+2
View File
@@ -32,6 +32,8 @@ void TimelineWidget::ZoomTool::MousePress(TimelineViewMouseEvent *event)
void TimelineWidget::ZoomTool::MouseMove(TimelineViewMouseEvent *event)
{
Q_UNUSED(event)
if (dragging_) {
parent()->MoveRubberBandSelect(false, false);
} else {
@@ -139,7 +139,7 @@ bool TimelineViewBase::PlayheadMove(QMouseEvent *event)
return true;
}
bool TimelineViewBase::PlayheadRelease(QMouseEvent *event)
bool TimelineViewBase::PlayheadRelease(QMouseEvent*)
{
if (dragging_playhead_) {
dragging_playhead_ = false;
@@ -210,7 +210,7 @@ bool TimelineViewBase::HandRelease(QMouseEvent *event)
return false;
}
void TimelineViewBase::ToolChangedEvent(Tool::Item tool)
void TimelineViewBase::ToolChangedEvent(Tool::Item)
{
}
@@ -326,7 +326,7 @@ bool TimelineViewBase::WheelEventIsAZoomEvent(QWheelEvent *event)
return (static_cast<bool>(event->modifiers() & Qt::ControlModifier) == !Config::Current()["ScrollZooms"].toBool());
}
void TimelineViewBase::SetLimitYAxis(bool e)
void TimelineViewBase::SetLimitYAxis(bool)
{
limit_y_axis_ = true;
UpdateSceneRect();
+2 -2
View File
@@ -143,7 +143,7 @@ void TimeRuler::paintEvent(QPaintEvent *)
double width_of_day = width_of_hour * 24;
double long_interval, short_interval;
int long_rate;
int long_rate = 0;
// Used for comparison, even if one unit can technically fit, we have to fit at least two for it to matter
int doubled_gap = minimum_gap_between_lines_ * 2;
@@ -252,7 +252,7 @@ void TimeRuler::paintEvent(QPaintEvent *)
if (timecode_left > last_text_draw) {
p.drawText(text_rect,
text_align,
static_cast<int>(text_align),
timecode_str);
last_text_draw = timecode_left + timecode_width;