Merge branch 'master' of git://github.com/olive-editor/olive
This commit is contained in:
+3
-1
@@ -805,7 +805,9 @@ void Effect::startEffect() {
|
||||
}
|
||||
|
||||
void Effect::endEffect() {
|
||||
if (bound) glslProgram->release();
|
||||
if (bound) {
|
||||
glslProgram->release();
|
||||
}
|
||||
bound = false;
|
||||
}
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
uniform sampler2D image;
|
||||
|
||||
// uniform float radius;
|
||||
//uniform float radius;
|
||||
uniform float sigma;
|
||||
uniform vec2 resolution;
|
||||
uniform bool horiz_blur;
|
||||
@@ -22,13 +22,13 @@ float gaussian2(float x, float y, float sigma) {
|
||||
}
|
||||
|
||||
void main(void) {
|
||||
float rad = ceil(sigma);
|
||||
float rad = ceil(3.0 * sigma);
|
||||
|
||||
float sum = 0.0;
|
||||
|
||||
vec4 color = vec4(0.0);
|
||||
|
||||
bool radius_is_zero = (rad == 0.0);
|
||||
bool radius_is_zero = (rad == 0.0 || sigma == 0.0);
|
||||
|
||||
if (!radius_is_zero) {
|
||||
for (float x=-rad+0.5;x<=rad;x+=2.0) {
|
||||
|
||||
@@ -35,7 +35,7 @@ system("which git") {
|
||||
GITPATH = $$system(cygpath $$PWD)
|
||||
}
|
||||
|
||||
GITHASHVAR = $$system(git --git-dir="$$GITPATH/.git" --work-tree="$$GITPATH" log -1 --format=%h)
|
||||
GITHASHVAR = $$system(git --git-dir=\"$$GITPATH/.git\" --work-tree=\"$$GITPATH\" log -1 --format=%h)
|
||||
|
||||
# Fallback for Ubuntu/Launchpad (extracts Git hash from debian/changelog rather than Git repo)
|
||||
# (see https://answers.launchpad.net/launchpad/+question/678556)
|
||||
|
||||
+13
-27
@@ -71,7 +71,7 @@ ExportThread::ExportThread(const ExportParams ¶ms,
|
||||
surface.create();
|
||||
}
|
||||
|
||||
bool ExportThread::Encode(AVFormatContext* ofmt_ctx, AVCodecContext* codec_ctx, AVFrame* frame, AVPacket* packet, AVStream* stream, bool rescale) {
|
||||
bool ExportThread::Encode(AVFormatContext* ofmt_ctx, AVCodecContext* codec_ctx, AVFrame* frame, AVPacket* packet, AVStream* stream) {
|
||||
ret = avcodec_send_frame(codec_ctx, frame);
|
||||
if (ret < 0) {
|
||||
qCritical() << "Failed to send frame to encoder." << ret;
|
||||
@@ -92,18 +92,9 @@ bool ExportThread::Encode(AVFormatContext* ofmt_ctx, AVCodecContext* codec_ctx,
|
||||
}
|
||||
|
||||
packet->stream_index = stream->index;
|
||||
if (rescale) {
|
||||
if (packet->pts != AV_NOPTS_VALUE) {
|
||||
packet->pts = qRound(packet->pts * av_q2d(codec_ctx->time_base) / av_q2d(stream->time_base));
|
||||
}
|
||||
if (packet->dts != AV_NOPTS_VALUE) {
|
||||
packet->dts = qRound(packet->dts * av_q2d(codec_ctx->time_base) / av_q2d(stream->time_base));
|
||||
}
|
||||
if (packet->duration > 0) {
|
||||
packet->duration = qRound(packet->duration * av_q2d(codec_ctx->time_base) / av_q2d(stream->time_base));
|
||||
}
|
||||
//av_packet_rescale_ts(packet, codec_ctx->time_base, stream->time_base);
|
||||
}
|
||||
|
||||
av_packet_rescale_ts(packet, codec_ctx->time_base, stream->time_base);
|
||||
|
||||
av_interleaved_write_frame(ofmt_ctx, packet);
|
||||
av_packet_unref(packet);
|
||||
}
|
||||
@@ -483,7 +474,7 @@ void ExportThread::Export()
|
||||
sws_frame->pts = qRound(timecode_secs/av_q2d(vcodec_ctx->time_base));
|
||||
|
||||
// Send frame to encoder
|
||||
if (!Encode(fmt_ctx, vcodec_ctx, sws_frame, &video_pkt, video_stream, true)) {
|
||||
if (!Encode(fmt_ctx, vcodec_ctx, sws_frame, &video_pkt, video_stream)) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -521,7 +512,7 @@ void ExportThread::Export()
|
||||
swr_frame->pts = file_audio_samples;
|
||||
|
||||
// Send frame to encoder
|
||||
if (!Encode(fmt_ctx, acodec_ctx, swr_frame, &audio_pkt, audio_stream, true)) {
|
||||
if (!Encode(fmt_ctx, acodec_ctx, swr_frame, &audio_pkt, audio_stream)) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -570,7 +561,7 @@ void ExportThread::Export()
|
||||
swr_convert_frame(swr_ctx, swr_frame, nullptr);
|
||||
if (swr_frame->nb_samples == 0) break;
|
||||
swr_frame->pts = file_audio_samples;
|
||||
if (!Encode(fmt_ctx, acodec_ctx, swr_frame, &audio_pkt, audio_stream, true)) {
|
||||
if (!Encode(fmt_ctx, acodec_ctx, swr_frame, &audio_pkt, audio_stream)) {
|
||||
return;
|
||||
}
|
||||
file_audio_samples += swr_frame->nb_samples;
|
||||
@@ -583,17 +574,12 @@ void ExportThread::Export()
|
||||
return;
|
||||
}
|
||||
|
||||
bool continueVideo = params_.video_enabled;
|
||||
bool continueAudio = params_.audio_enabled;
|
||||
|
||||
// Flush remaining packets out of video and audio encoders
|
||||
while (continueVideo && continueAudio) {
|
||||
if (continueVideo) {
|
||||
continueVideo = Encode(fmt_ctx, vcodec_ctx, nullptr, &video_pkt, video_stream, true);
|
||||
}
|
||||
if (continueAudio) {
|
||||
continueAudio = Encode(fmt_ctx, acodec_ctx, nullptr, &audio_pkt, audio_stream, true);
|
||||
}
|
||||
// Flush remaining packets out of video and audio encoders by sending a null frame
|
||||
if (params_.video_enabled) {
|
||||
Encode(fmt_ctx, vcodec_ctx, nullptr, &video_pkt, video_stream);
|
||||
}
|
||||
if (params_.audio_enabled) {
|
||||
Encode(fmt_ctx, acodec_ctx, nullptr, &audio_pkt, audio_stream);
|
||||
}
|
||||
|
||||
// Write container trailer
|
||||
|
||||
@@ -83,7 +83,7 @@ signals:
|
||||
public slots:
|
||||
void Interrupt();
|
||||
private:
|
||||
bool Encode(AVFormatContext* ofmt_ctx, AVCodecContext* codec_ctx, AVFrame* frame, AVPacket* packet, AVStream* stream, bool rescale);
|
||||
bool Encode(AVFormatContext* ofmt_ctx, AVCodecContext* codec_ctx, AVFrame* frame, AVPacket* packet, AVStream* stream);
|
||||
bool SetupVideo();
|
||||
bool SetupAudio();
|
||||
bool SetupContainer();
|
||||
|
||||
@@ -26,37 +26,39 @@ void FramebufferObject::Create(QOpenGLContext *ctx, int width, int height)
|
||||
// set context to new context provided
|
||||
ctx_ = ctx;
|
||||
|
||||
QOpenGLFunctions* f = ctx->functions();
|
||||
|
||||
// create framebuffer object
|
||||
ctx->functions()->glGenFramebuffers(1, &buffer_);
|
||||
f->glGenFramebuffers(1, &buffer_);
|
||||
|
||||
// create texture
|
||||
ctx->functions()->glGenTextures(1, &texture_);
|
||||
f->glGenTextures(1, &texture_);
|
||||
|
||||
// bind framebuffer for attaching
|
||||
ctx->functions()->glBindFramebuffer(GL_DRAW_FRAMEBUFFER, buffer_);
|
||||
f->glBindFramebuffer(GL_DRAW_FRAMEBUFFER, buffer_);
|
||||
|
||||
// bind texture
|
||||
ctx->functions()->glBindTexture(GL_TEXTURE_2D, texture_);
|
||||
f->glBindTexture(GL_TEXTURE_2D, texture_);
|
||||
|
||||
// allocate storage for texture
|
||||
ctx->functions()->glTexImage2D(
|
||||
f->glTexImage2D(
|
||||
GL_TEXTURE_2D, 0, GL_RGBA, width, height, 0, GL_RGBA, GL_UNSIGNED_BYTE, nullptr
|
||||
);
|
||||
|
||||
// set texture filtering to bilinear
|
||||
ctx->functions()->glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
|
||||
ctx->functions()->glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
|
||||
f->glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR);
|
||||
f->glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
|
||||
|
||||
// attach texture to framebuffer
|
||||
ctx->functions()->glFramebufferTexture2D(
|
||||
f->glFramebufferTexture2D(
|
||||
GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, texture_, 0
|
||||
);
|
||||
|
||||
// release texture
|
||||
ctx->functions()->glBindTexture(GL_TEXTURE_2D, 0);
|
||||
f->glBindTexture(GL_TEXTURE_2D, 0);
|
||||
|
||||
// release framebuffer
|
||||
ctx->functions()->glBindFramebuffer(GL_DRAW_FRAMEBUFFER, 0);
|
||||
f->glBindFramebuffer(GL_DRAW_FRAMEBUFFER, 0);
|
||||
}
|
||||
|
||||
void FramebufferObject::Destroy()
|
||||
|
||||
@@ -51,7 +51,17 @@ namespace OCIO = OCIO_NAMESPACE;
|
||||
#include "panels/timeline.h"
|
||||
#include "panels/viewer.h"
|
||||
|
||||
void PrepareToDraw(QOpenGLFunctions* f) {
|
||||
f->glGenerateMipmap(GL_TEXTURE_2D);
|
||||
f->glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR);
|
||||
f->glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
|
||||
f->glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_BORDER);
|
||||
f->glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_BORDER);
|
||||
}
|
||||
|
||||
void full_blit() {
|
||||
PrepareToDraw(QOpenGLContext::currentContext()->functions());
|
||||
|
||||
glPushMatrix();
|
||||
glLoadIdentity();
|
||||
glOrtho(0, 1, 0, 1, -1, 1);
|
||||
@@ -484,9 +494,7 @@ GLuint olive::rendering::compose_sequence(ComposeSequenceParams ¶ms) {
|
||||
glBindTexture(GL_TEXTURE_2D, textureID);
|
||||
|
||||
// set texture filter to bilinear
|
||||
params.ctx->functions()->glGenerateMipmap(GL_TEXTURE_2D);
|
||||
params.ctx->functions()->glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR);
|
||||
params.ctx->functions()->glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
|
||||
PrepareToDraw(params.ctx->functions());
|
||||
|
||||
// draw clip on screen according to gl coordinates
|
||||
glBegin(GL_QUADS);
|
||||
|
||||
+1
-1
@@ -574,7 +574,7 @@ bool Clip::Retrieve()
|
||||
|
||||
texture->setFormat(QOpenGLTexture::RGBA8_UNorm);
|
||||
texture->setMipLevels(texture->maximumMipLevels());
|
||||
texture->setMinMagFilters(QOpenGLTexture::Linear, QOpenGLTexture::Linear);
|
||||
texture->setMinMagFilters(QOpenGLTexture::LinearMipMapLinear, QOpenGLTexture::Linear);
|
||||
texture->allocateStorage(QOpenGLTexture::RGBA, QOpenGLTexture::UInt8);
|
||||
}
|
||||
|
||||
|
||||
+1015
-880
File diff suppressed because it is too large
Load Diff
+4
-1
@@ -1080,10 +1080,13 @@ void MainWindow::maximize_panel() {
|
||||
// store the current state of panels
|
||||
temp_panel_state = saveState();
|
||||
|
||||
// remove all dock widgets
|
||||
// remove all dock widgets that aren't the hovered panel
|
||||
for (int i=0;i<olive::panels.size();i++) {
|
||||
if (olive::panels.at(i) != focused_panel) {
|
||||
// hide the panel
|
||||
olive::panels.at(i)->setVisible(false);
|
||||
|
||||
// set it to floating
|
||||
olive::panels.at(i)->setFloating(true);
|
||||
}
|
||||
}
|
||||
|
||||
+3
-1
@@ -548,7 +548,7 @@ void ViewerWidget::paintGL() {
|
||||
makeCurrent();
|
||||
|
||||
// clear to solid black
|
||||
glClearColor(0.0, 0.0, 0.0, 1.0);
|
||||
glClearColor(0.0, 0.0, 0.0, 0.0);
|
||||
glClear(GL_COLOR_BUFFER_BIT);
|
||||
|
||||
// set color multipler to straight white
|
||||
@@ -564,6 +564,8 @@ void ViewerWidget::paintGL() {
|
||||
|
||||
glBindTexture(GL_TEXTURE_2D, tex);
|
||||
|
||||
context()->functions()->glGenerateMipmap(GL_TEXTURE_2D);
|
||||
|
||||
glBegin(GL_QUADS);
|
||||
|
||||
double zoom_factor = container->zoom/(double(width())/double(viewer->seq->width));
|
||||
|
||||
+1
-1
@@ -111,7 +111,7 @@ void ViewerWindow::paintGL() {
|
||||
if (texture > 0) {
|
||||
if (mutex != nullptr) mutex->lock();
|
||||
|
||||
glClearColor(0.0, 0.0, 0.0, 1.0);
|
||||
glClearColor(0.0, 0.0, 0.0, 0.0);
|
||||
glClear(GL_COLOR_BUFFER_BIT);
|
||||
|
||||
glEnable(GL_TEXTURE_2D);
|
||||
|
||||
Reference in New Issue
Block a user