mirror of
https://github.com/gnif/LookingGlass.git
synced 2025-01-12 07:47:04 +00:00
[decoders] change the API to allow more flexability in the future
This commit is contained in:
parent
332d53e016
commit
3a2d612b41
@ -39,7 +39,7 @@ static LG_OutFormat lgd_null_get_out_format (void * opaque);
|
|||||||
static unsigned int lgd_null_get_frame_pitch (void * opaque);
|
static unsigned int lgd_null_get_frame_pitch (void * opaque);
|
||||||
static unsigned int lgd_null_get_frame_stride(void * opaque);
|
static unsigned int lgd_null_get_frame_stride(void * opaque);
|
||||||
static bool lgd_null_decode (void * opaque, const uint8_t * src, size_t srcSize);
|
static bool lgd_null_decode (void * opaque, const uint8_t * src, size_t srcSize);
|
||||||
static bool lgd_null_get_buffer (void * opaque, uint8_t * dst, size_t dstSize);
|
static const uint8_t * lgd_null_get_buffer (void * opaque);
|
||||||
|
|
||||||
static bool lgd_null_create(void ** opaque)
|
static bool lgd_null_create(void ** opaque)
|
||||||
{
|
{
|
||||||
@ -96,14 +96,13 @@ static bool lgd_null_decode(void * opaque, const uint8_t * src, size_t srcSize)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool lgd_null_get_buffer(void * opaque, uint8_t * dst, size_t dstSize)
|
static const uint8_t * lgd_null_get_buffer(void * opaque)
|
||||||
{
|
{
|
||||||
struct Inst * this = (struct Inst *)opaque;
|
struct Inst * this = (struct Inst *)opaque;
|
||||||
if (!this->src)
|
if (!this->src)
|
||||||
return false;
|
return NULL;
|
||||||
|
|
||||||
memcpySSE(dst, this->src, dstSize);
|
return this->src;
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const LG_Decoder LGD_NULL =
|
const LG_Decoder LGD_NULL =
|
||||||
|
@ -42,7 +42,7 @@ typedef LG_OutFormat (* LG_DecoderGetOutFormat )(void * opaque);
|
|||||||
typedef unsigned int (* LG_DecoderGetFramePitch )(void * opaque);
|
typedef unsigned int (* LG_DecoderGetFramePitch )(void * opaque);
|
||||||
typedef unsigned int (* LG_DecoderGetFrameStride)(void * opaque);
|
typedef unsigned int (* LG_DecoderGetFrameStride)(void * opaque);
|
||||||
typedef bool (* LG_DecoderDecode )(void * opaque, const uint8_t * src, size_t srcSize);
|
typedef bool (* LG_DecoderDecode )(void * opaque, const uint8_t * src, size_t srcSize);
|
||||||
typedef bool (* LG_DecoderGetBuffer )(void * opaque, uint8_t * dst, size_t dstSize);
|
typedef const uint8_t * (* LG_DecoderGetBuffer )(void * opaque);
|
||||||
|
|
||||||
typedef bool (* LG_DecoderInitGLTexture )(void * opaque, GLenum target, GLuint texture, void ** ref);
|
typedef bool (* LG_DecoderInitGLTexture )(void * opaque, GLenum target, GLuint texture, void ** ref);
|
||||||
typedef void (* LG_DecoderFreeGLTexture )(void * opaque, void * ref);
|
typedef void (* LG_DecoderFreeGLTexture )(void * opaque, void * ref);
|
||||||
|
@ -1070,17 +1070,16 @@ static bool draw_frame(struct Inst * this)
|
|||||||
this->fences[this->texIndex] = NULL;
|
this->fences[this->texIndex] = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!this->decoder->get_buffer(
|
const uint8_t * data = this->decoder->get_buffer(this->decoderData);
|
||||||
this->decoderData,
|
if (!data)
|
||||||
this->texPixels[this->texIndex],
|
|
||||||
this->texSize
|
|
||||||
))
|
|
||||||
{
|
{
|
||||||
LG_UNLOCK(this->formatLock);
|
LG_UNLOCK(this->formatLock);
|
||||||
DEBUG_ERROR("Failed to get the buffer from the decoder");
|
DEBUG_ERROR("Failed to get the buffer from the decoder");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
memcpySSE(this->texPixels[this->texIndex], data, this->texSize);
|
||||||
|
|
||||||
if (this->amdPinnedMemSupport)
|
if (this->amdPinnedMemSupport)
|
||||||
this->fences[this->texIndex] = glFenceSync(GL_SYNC_GPU_COMMANDS_COMPLETE, 0);
|
this->fences[this->texIndex] = glFenceSync(GL_SYNC_GPU_COMMANDS_COMPLETE, 0);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user