Skip to content
This repository has been archived by the owner on Apr 28, 2022. It is now read-only.

Commit

Permalink
add VideoSource::configure() (#47)
Browse files Browse the repository at this point in the history
… to support up-front initialization/pre-allocation of pipeline, instead of waiting to configure based on first input frame.  This avoid this need for a dummy frame.  Bump minor version for public api update.
  • Loading branch information
headupinclouds authored Jun 13, 2018
1 parent df1dde0 commit faf83dc
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ HunterGate(
LOCAL
)

project(ogles_gpgpu VERSION 0.2.11)
project(ogles_gpgpu VERSION 0.3.0)

hunter_add_package(check_ci_tag)
find_package(check_ci_tag CONFIG REQUIRED)
Expand Down
11 changes: 11 additions & 0 deletions ogles_gpgpu/common/proc/video.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,15 @@ void VideoSource::operator()(const FrameInput& frame) {
return (*this)(frame.size, frame.pixelBuffer, frame.useRawPixels, frame.inputTexture, frame.textureFormat);
}

void VideoSource::configure(const Size2d& size, GLenum inputPixFormat)
{
if (firstFrame || size != frameSize)
{
configurePipeline(size, inputPixFormat);
firstFrame = false;
}
}

void VideoSource::operator()(const Size2d& size, void* pixelBuffer, bool useRawPixels, GLuint inputTexture, GLenum inputPixFormat) {
preConfig();

Expand All @@ -78,6 +87,8 @@ void VideoSource::operator()(const Size2d& size, void* pixelBuffer, bool useRawP

assert(pipeline);

configure(size, inputPixFormat);

if (firstFrame || size != frameSize) {
configurePipeline(size, inputPixFormat);
firstFrame = false;
Expand Down
2 changes: 2 additions & 0 deletions ogles_gpgpu/common/proc/video.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ class VideoSource {

void init(void* glContext);

void configure(const Size2d& size, GLenum inputPixFormat = DFLT_PIX_FORMAT);

void operator()(const FrameInput& frame);

void operator()(const Size2d& size, void* pixelBuffer, bool useRawPixels, GLuint inputTexture = 0, GLenum inputPixFormat = DFLT_PIX_FORMAT);
Expand Down

0 comments on commit faf83dc

Please sign in to comment.