Hash :
54f8746e
Author :
Date :
2016-03-10T13:47:21
Add initial support for various stream extensions. Add entry points and validation for various egl stream extensions including EGL_KHR_stream_consumer_gltexture and EGL_NV_stream_consumer_gltexture_yuv and NV_EGL_stream_consumer_external. The extensions functionality is not yet implemented and the extension strings are thus not exposed yet. BUG=angleproject:1332 Change-Id: I115d872557db38d8dd94cc367038668406719109 Reviewed-on: https://chromium-review.googlesource.com/332026 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Ian Ewell <ewell@google.com>
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76
//
// Copyright (c) 2016 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
// Stream.cpp: Implements the egl::Stream class, representing the stream
// where frames are streamed in. Implements EGLStreanKHR.
#include "libANGLE/Stream.h"
#include <platform/Platform.h>
#include <EGL/eglext.h>
#include "common/debug.h"
#include "common/mathutil.h"
#include "common/platform.h"
#include "common/utilities.h"
#include "libANGLE/Context.h"
#include "libANGLE/renderer/StreamImpl.h"
namespace egl
{
Stream::Stream(rx::StreamImpl *impl, const AttributeMap &attribs)
: mImplementation(impl),
mState(EGL_STREAM_STATE_CREATED_KHR),
mProducerFrame(0),
mConsumerFrame(0),
mConsumerLatency(static_cast<EGLint>(attribs.get(EGL_CONSUMER_LATENCY_USEC_KHR, 0))),
mConsumerAcquireTimeout(
static_cast<EGLint>(attribs.get(EGL_CONSUMER_ACQUIRE_TIMEOUT_USEC_KHR, 0)))
{
}
Stream::~Stream()
{
SafeDelete(mImplementation);
}
void Stream::setConsumerLatency(EGLint latency)
{
mConsumerLatency = latency;
}
EGLint Stream::getConsumerLatency() const
{
return mConsumerLatency;
}
EGLuint64KHR Stream::getProducerFrame() const
{
return mProducerFrame;
}
EGLuint64KHR Stream::getConsumerFrame() const
{
return mConsumerFrame;
}
EGLenum Stream::getState() const
{
return mState;
}
void Stream::setConsumerAcquireTimeout(EGLint timeout)
{
mConsumerAcquireTimeout = timeout;
}
EGLint Stream::getConsumerAcquireTimeout() const
{
return mConsumerAcquireTimeout;
}
} // namespace egl