本文整理汇总了C++中IDirectFBDisplayLayer类的典型用法代码示例。如果您正苦于以下问题:C++ IDirectFBDisplayLayer类的具体用法?C++ IDirectFBDisplayLayer怎么用?C++ IDirectFBDisplayLayer使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了IDirectFBDisplayLayer类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Q_ASSERT
void QDirectFbWindow::createDirectFBWindow()
{
Q_ASSERT(!m_dfbWindow.data());
DFBDisplayLayerConfig layerConfig;
IDirectFBDisplayLayer *layer;
layer = toDfbScreen(window())->dfbLayer();
layer->GetConfiguration(layer, &layerConfig);
DFBWindowDescription description;
memset(&description,0,sizeof(DFBWindowDescription));
description.flags = DFBWindowDescriptionFlags(DWDESC_WIDTH|DWDESC_HEIGHT|DWDESC_POSX|DWDESC_POSY|DWDESC_SURFACE_CAPS
|DWDESC_OPTIONS
|DWDESC_CAPS);
description.width = qMax(1, window()->width());
description.height = qMax(1, window()->height());
description.posx = window()->x();
description.posy = window()->y();
if (layerConfig.surface_caps & DSCAPS_PREMULTIPLIED)
description.surface_caps = DSCAPS_PREMULTIPLIED;
description.pixelformat = layerConfig.pixelformat;
description.options = DFBWindowOptions(DWOP_ALPHACHANNEL);
description.caps = DFBWindowCapabilities(DWCAPS_DOUBLEBUFFER|DWCAPS_ALPHACHANNEL);
DFBResult result = layer->CreateWindow(layer, &description, m_dfbWindow.outPtr());
if (result != DFB_OK)
DirectFBError("QDirectFbWindow: failed to create window", result);
m_dfbWindow->SetOpacity(m_dfbWindow.data(), 0xff);
m_inputHandler->addWindow(m_dfbWindow.data(), window());
}
示例2: dfb_create_window
/* DFB API */
IDirectFBWindow* dfb_create_window (IDirectFB *dfb, int x, int y, int width, int height, gboolean isAlpha)
{
DFBResult err;
DFBWindowDescription dsc;
IDirectFBWindow *window = NULL;
IDirectFBDisplayLayer *layer = NULL;
DFBCHECK(dfb->GetDisplayLayer(dfb, DLID_PRIMARY, &layer));
layer->SetCooperativeLevel(layer, DLSCL_ADMINISTRATIVE);
dsc.flags = DWDESC_POSX | DWDESC_POSY | DWDESC_WIDTH | DWDESC_HEIGHT;
dsc.posx = x;
dsc.posy = y;
dsc.width = width;
dsc.height = height;
if(isAlpha) {
dsc.flags |= DWDESC_CAPS;
dsc.caps = DWCAPS_ALPHACHANNEL;
}
err = layer->CreateWindow (layer, &dsc, &window);
if (err!=DR_OK) {
ZError(DBG_INIT, "Failed to dfb_create_window.");
return NULL;
}
/* Set ZKPlayer to Bottom but upper ZImagePlayer */
DFBCHECK(window->LowerToBottom(window));
DFBCHECK(window->SetOpacity(window, 0x0));
return window;
}
示例3: Q_ASSERT
void QDirectFbWindowEGL::createDirectFBWindow()
{
// Use the default for the raster surface.
if (window()->surfaceType() == QSurface::RasterSurface)
return QDirectFbWindow::createDirectFBWindow();
Q_ASSERT(!m_dfbWindow.data());
DFBWindowDescription description;
memset(&description, 0, sizeof(DFBWindowDescription));
description.flags = DFBWindowDescriptionFlags(DWDESC_WIDTH | DWDESC_HEIGHT|
DWDESC_POSX | DWDESC_POSY|
DWDESC_PIXELFORMAT | DWDESC_SURFACE_CAPS);
description.width = qMax(1, window()->width());
description.height = qMax(1, window()->height());
description.posx = window()->x();
description.posy = window()->y();
description.surface_caps = DSCAPS_GL;
description.pixelformat = DSPF_RGB16;
IDirectFBDisplayLayer *layer;
layer = toDfbScreen(window())->dfbLayer();
DFBResult result = layer->CreateWindow(layer, &description, m_dfbWindow.outPtr());
if (result != DFB_OK)
DirectFBError("QDirectFbWindow: failed to create window", result);
m_dfbWindow->SetOpacity(m_dfbWindow.data(), 0xff);
m_inputHandler->addWindow(m_dfbWindow.data(), window());
}
示例4: get_display_layer_window
int get_display_layer_window() {
IDirectFB *dfb = NULL;
IDirectFBDisplayLayer *layer = NULL;
IDirectFBWindow *window = NULL;
DFBWindowDescription desc;
DFBCHECK(DirectFBInit(NULL, NULL));
DFBCHECK(DirectFBCreate(&dfb));
push_release(dfb,dfb->Release);
DFBCHECK(dfb->GetDisplayLayer(dfb, DLID_PRIMARY, &layer));
push_release(layer, layer->Release);
desc.flags = DWDESC_WIDTH | DWDESC_HEIGHT | DWDESC_POSX | DWDESC_POSY;
desc.posx = desc.posy = desc.width = desc.height = 20;
DFBCHECK(layer->CreateWindow(layer, &desc, &window));
push_release(window, window->Release);
/* check window */
release_all();
return 0;
}
示例5: toDfbLayer
void QDirectFBCursor::changeCursor(QCursor *cursor, QWindow *)
{
int xSpot;
int ySpot;
QPixmap map;
if (cursor->shape() != Qt::BitmapCursor) {
m_image->set(cursor->shape());
xSpot = m_image->hotspot().x();
ySpot = m_image->hotspot().y();
QImage *i = m_image->image();
map = QPixmap::fromImage(*i);
} else {
QPoint point = cursor->hotSpot();
xSpot = point.x();
ySpot = point.y();
map = cursor->pixmap();
}
DFBResult res;
IDirectFBDisplayLayer *layer = toDfbLayer(m_screen);
IDirectFBSurface* surface(QDirectFbConvenience::dfbSurfaceForPlatformPixmap(map.handle()));
res = layer->SetCooperativeLevel(layer, DLSCL_ADMINISTRATIVE);
if (res != DFB_OK) {
DirectFBError("Failed to set DLSCL_ADMINISTRATIVE", res);
return;
}
layer->SetCursorShape(layer, surface, xSpot, ySpot);
layer->SetCooperativeLevel(layer, DLSCL_SHARED);
}
示例6: Java_vdr_mhp_awt_DFBWindowPeer_createDFBWindow
jlong Java_vdr_mhp_awt_DFBWindowPeer_createDFBWindow(JNIEnv* env, jobject obj, jlong nativeLayer, jint x, jint y, jint width, jint height) {
IDirectFBDisplayLayer *layer = (IDirectFBDisplayLayer *)nativeLayer;
IDirectFBWindow *window;
DFBWindowDescription desc;
if (!layer)
layer=MhpOutput::System::self()->GetMainLayer();
//printf("createDFBWindow %d, %d - %dx%d on layer %p ID %d\n", x, y, width, height, layer, layer->GetID());
/*if (getenv( "MHP_NO_ALPHA" ))
bgAlpha = 255;
if (bgAlpha < 255) {
desc.flags = DWDESC_CAPS;
desc.caps = DWCAPS_ALPHACHANNEL;
}
else
desc.flags = 0;*/
desc.flags=(DFBWindowDescriptionFlags)0;
if (!getenv( "MHP_NO_ALPHA" )) {
DFB_ADD_WINDOW_DESC(desc.flags, DWDESC_CAPS);
desc.caps=DWCAPS_NONE;
DFB_ADD_WINDOW_CAPS(desc.caps, DWCAPS_ALPHACHANNEL);
DFB_ADD_WINDOW_CAPS(desc.caps, DWCAPS_DOUBLEBUFFER);
}
if (x >= 0) {
DFB_ADD_WINDOW_DESC(desc.flags, DWDESC_POSX);
desc.posx = x;
}
if (y >= 0) {
DFB_ADD_WINDOW_DESC(desc.flags, DWDESC_POSY);
desc.posy = y;
}
if (width > 0) {
DFB_ADD_WINDOW_DESC(desc.flags, DWDESC_WIDTH);
desc.width = width;
}
if (height > 0) {
DFB_ADD_WINDOW_DESC(desc.flags, DWDESC_HEIGHT);
desc.height = height;
}
try {
window=layer->CreateWindow(desc);
} catch (DFBException *e) {
printf("DirectFB: Error %s, %s\n", e->GetAction(), e->GetResult());
delete e;
return 0;
}
int ww,hh;window->GetSize(&ww, &hh);
//printf("Created window %p, size %dx%d\n", window, ww, hh);
return (jlong )window;
}
示例7: DFBCHECK
/** Opens application window and return pointer to offscreen buffer for */
char *directfbapp_open_window() {
DFBWindowDescription wdesc;
DFBDisplayLayerConfig lconfig;
static char *argv_array[] = {
"CVM",
"--dfb:system=FBDev"
",force-windowed" /* use windows instead of surfaces */
",no-vt-switch" /* do not switch between Linux' VT */
",no-cursor" /* do not use pointer */
// ",no-deinit-check" /* do not check for deinit */
,NULL
};
int argc = sizeof argv_array / sizeof argv_array[0] - 1;
char **argv = argv_array;
IDirectFBDisplayLayer *dlayer;
char *dst;
int pitch;
unsigned int win_id;
int win_x, win_y;
DFBCHECK(DirectFBInit(&argc, &argv));
DFBCHECK(DirectFBCreate(&dfb));
DFBCHECK(dfb->SetCooperativeLevel(dfb, DFSCL_NORMAL));
DFBCHECK(dfb->GetDisplayLayer(dfb, DLID_PRIMARY, &dlayer));
DFBCHECK(dlayer->GetConfiguration(dlayer, &lconfig));
wdesc.caps = DWCAPS_DOUBLEBUFFER;
wdesc.surface_caps = DSCAPS_DOUBLE;
wdesc.pixelformat = DSPF_RGB16;
wdesc.width = CHAM_WIDTH;
wdesc.height = CHAM_HEIGHT;
wdesc.flags = DWDESC_CAPS | DWDESC_WIDTH | DWDESC_HEIGHT | DWDESC_PIXELFORMAT |
DWDESC_SURFACE_CAPS;
DFBCHECK(dlayer->CreateWindow(dlayer, &wdesc, &window));
releaseInterface(dlayer);
if ((lconfig.flags & (DLCONF_WIDTH | DLCONF_HEIGHT)) == (DLCONF_WIDTH | DLCONF_HEIGHT)) {
DFBCHECK(window->GetID(window, &win_id));
set_win_position(win_id, lconfig.width, lconfig.height, win_x, win_y);
DFBCHECK(window->MoveTo(window, win_x, win_y));
}
DFBCHECK(window->RaiseToTop(window));
DFBCHECK(window->SetOpacity(window, 0xff));
DFBCHECK(window->RequestFocus(window));
DFBCHECK(window->GetSurface(window, &screen));
DFBCHECK(screen->GetSize(screen, &screen_width, &screen_height));
DFBCHECK(screen->Lock(screen, DSLF_WRITE, (void**)(void*)&dst, &pitch));
if (pitch != (int)sizeof(gxj_pixel_type) * screen_width) {
REPORT_ERROR(LC_LOWUI,
"Invalid pixel format: Supports only 16-bit, 5:6:5 display");
goto dfb_err;
}
return dst;
dfb_err:;
directfbapp_finalize();
exit(1); /* TODO: exit from Java */
/* return NULL; */
}
示例8: createWindow
void QDirectFBWindowSurface::createWindow(const QRect &rect)
{
IDirectFBDisplayLayer *layer = screen->dfbDisplayLayer();
if (!layer)
qFatal("QDirectFBWindowSurface: Unable to get primary display layer!");
updateIsOpaque();
DFBWindowDescription description;
memset(&description, 0, sizeof(DFBWindowDescription));
description.flags = DWDESC_CAPS|DWDESC_HEIGHT|DWDESC_WIDTH|DWDESC_POSX|DWDESC_POSY|DWDESC_SURFACE_CAPS|DWDESC_PIXELFORMAT;
description.caps = DWCAPS_NODECORATION;
description.surface_caps = DSCAPS_NONE;
imageFormat = screen->pixelFormat();
if (!(surfaceFlags() & Opaque)) {
imageFormat = screen->alphaPixmapFormat();
description.caps |= DWCAPS_ALPHACHANNEL;
#if (Q_DIRECTFB_VERSION >= 0x010200)
description.flags |= DWDESC_OPTIONS;
description.options |= DWOP_ALPHACHANNEL;
#endif
}
description.pixelformat = QDirectFBScreen::getSurfacePixelFormat(imageFormat);
description.posx = rect.x();
description.posy = rect.y();
description.width = rect.width();
description.height = rect.height();
if (QDirectFBScreen::isPremultiplied(imageFormat))
description.surface_caps = DSCAPS_PREMULTIPLIED;
if (screen->directFBFlags() & QDirectFBScreen::VideoOnly)
description.surface_caps |= DSCAPS_VIDEOONLY;
DFBResult result = layer->CreateWindow(layer, &description, &dfbWindow);
if (result != DFB_OK)
DirectFBErrorFatal("QDirectFBWindowSurface::createWindow", result);
if (window()) {
if (window()->windowFlags() & Qt::WindowStaysOnTopHint) {
dfbWindow->SetStackingClass(dfbWindow, DWSC_UPPER);
}
DFBWindowID winid;
result = dfbWindow->GetID(dfbWindow, &winid);
if (result != DFB_OK) {
DirectFBError("QDirectFBWindowSurface::createWindow. Can't get ID", result);
} else {
window()->setProperty("_q_DirectFBWindowID", winid);
}
}
Q_ASSERT(!dfbSurface);
dfbWindow->GetSurface(dfbWindow, &dfbSurface);
}
示例9: main
int
main( int argc, char *argv[] )
{
int i;
DFBResult ret;
IDirectFB *dfb;
IDirectFBDisplayLayer *layer = NULL;
App apps[1];
DFBDisplayLayerConfig config;
/* Parse arguments. */
for (i=1; i<argc; i++) {
if (!strcmp( argv[i], "-h" ))
return show_usage( argv[0] );
}
/* Initialize DirectFB. */
ret = DirectFBInit( &argc, &argv );
if (ret) {
D_DERROR( ret, "DFBTest/WindowFlip: DirectFBInit() failed!\n" );
return ret;
}
/* Create super interface. */
ret = DirectFBCreate( &dfb );
if (ret) {
D_DERROR( ret, "DFBTest/WindowFlip: DirectFBCreate() failed!\n" );
return ret;
}
/* Get primary layer. */
ret = dfb->GetDisplayLayer( dfb, DLID_PRIMARY, &layer );
if (ret) {
D_DERROR( ret, "DFBTest/WindowFlip: IDirectFB::GetDisplayLayer( PRIMARY ) failed!\n" );
goto out;
}
layer->GetConfiguration( layer, &config );
app_init( &apps[0], layer, 100, 50, config.width-300, config.height-150, 0 );
while (true) {
direct_thread_sleep( 1000000 );
app_update( &apps[0] );
}
out:
/* Shutdown DirectFB. */
dfb->Release( dfb );
return ret;
}
示例10: geometry
void QDirectFbWindow::setVisible(bool visible)
{
if (visible) {
int x = geometry().x();
int y = geometry().y();
m_dfbWindow->MoveTo(m_dfbWindow,x,y);
} else {
IDirectFBDisplayLayer *displayLayer;
QDirectFbConvenience::dfbInterface()->GetDisplayLayer(QDirectFbConvenience::dfbInterface(),DLID_PRIMARY,&displayLayer);
DFBDisplayLayerConfig config;
displayLayer->GetConfiguration(displayLayer,&config);
m_dfbWindow->MoveTo(m_dfbWindow,config.width+1,config.height + 1);
}
}
示例11: QPlatformWindow
QT_BEGIN_NAMESPACE
QDirectFbWindow::QDirectFbWindow(QWidget *tlw, QDirectFbInput *inputhandler)
: QPlatformWindow(tlw), m_inputHandler(inputhandler)
{
DFBDisplayLayerConfig layerConfig;
IDirectFBDisplayLayer *layer;
layer = toDfbScreen(tlw)->dfbLayer();
toDfbScreen(tlw)->dfbLayer()->GetConfiguration(layer, &layerConfig);
DFBWindowDescription description;
memset(&description,0,sizeof(DFBWindowDescription));
description.flags = DFBWindowDescriptionFlags(DWDESC_WIDTH|DWDESC_HEIGHT|DWDESC_POSX|DWDESC_POSY|DWDESC_SURFACE_CAPS
#if DIRECTFB_MINOR_VERSION >= 1
|DWDESC_OPTIONS
#endif
|DWDESC_CAPS);
description.width = tlw->width();
description.height = tlw->height();
description.posx = tlw->x();
description.posy = tlw->y();
if (layerConfig.surface_caps & DSCAPS_PREMULTIPLIED)
description.surface_caps = DSCAPS_PREMULTIPLIED;
description.pixelformat = layerConfig.pixelformat;
#if DIRECTFB_MINOR_VERSION >= 1
description.options = DFBWindowOptions(DWOP_ALPHACHANNEL);
#endif
description.caps = DFBWindowCapabilities(DWCAPS_DOUBLEBUFFER|DWCAPS_ALPHACHANNEL);
description.surface_caps = DSCAPS_PREMULTIPLIED;
DFBResult result = layer->CreateWindow(layer, &description, m_dfbWindow.outPtr());
if (result != DFB_OK) {
DirectFBError("QDirectFbGraphicsSystemScreen: failed to create window",result);
}
m_dfbWindow->SetOpacity(m_dfbWindow.data(), 0xff);
setVisible(widget()->isVisible());
m_inputHandler->addWindow(m_dfbWindow.data(), tlw);
}
示例12: DirectFB_DisplayYUVOverlay
int DirectFB_DisplayYUVOverlay(_THIS, SDL_Overlay *overlay, SDL_Rect *src, SDL_Rect *dst)
{
DFBResult ret;
DFBDisplayLayerConfig conf;
IDirectFBDisplayLayer *primary = HIDDEN->layer;
IDirectFBDisplayLayer *layer = overlay->hwdata->layer;
primary->GetConfiguration (primary, &conf);
ret = layer->SetScreenLocation (layer,
dst->x / (float) conf.width, dst->y / (float) conf.height,
dst->w / (float) conf.width, dst->h / (float) conf.height );
if (ret)
{
SetDirectFBerror("IDirectFBDisplayLayer::SetScreenLocation", ret);
return -1;
}
return 0;
}
示例13: main
int main(int argc, char** argv) {
IDirectFB *dfb = NULL;
IDirectFBDisplayLayer *layer = NULL;
IDirectFBSurface *surface = NULL;
IDirectFBVideoProvider *vp = NULL;
CHECK(DirectFBInit (&argc, &argv));
if (argc != 2) {
return 1;
}
CHECK(DirectFBCreate(&dfb));
/* Signals */
signal(SIGINT, signal_handler);
signal(SIGTERM, signal_handler);
signal(SIGUSR1, signal_handler);
signal(SIGUSR2, signal_handler);
CHECK(dfb->GetDisplayLayer(dfb, 0, &layer));
CHECK(dfb->CreateVideoProvider(dfb, argv[1], &vp));
CHECK(layer->GetSurface(layer, &surface));
CHECK(vp->PlayTo(vp, surface, NULL, flip, surface));
while(to_exit == 0) {
sleep(1);
}
CHECK(vp->Stop(vp));
CHECK(vp->Release(vp));
CHECK(surface->Release(surface));
CHECK(layer->Release(layer));
CHECK(dfb->Release(dfb));
return 0;
}
示例14: setPermanentState
void QDirectFBWindowSurface::setPermanentState(const QByteArray &state)
{
const char *ptr = state.constData();
IDirectFBDisplayLayer *layer = screen->dfbDisplayLayer();
SurfaceFlags flags;
memcpy(&flags, ptr, sizeof(SurfaceFlags));
setSurfaceFlags(flags);
ptr += sizeof(SurfaceFlags);
DFBWindowID id;
memcpy(&id, ptr, sizeof(DFBWindowID));
if (dfbSurface)
dfbSurface->Release(dfbSurface);
if (id != (DFBWindowID)-1) {
IDirectFBWindow *dw;
layer->GetWindow(layer, id, &dw);
if (dw->GetSurface(dw, &dfbSurface) != DFB_OK)
dfbSurface = 0;
dw->Release(dw);
}
else {
dfbSurface = 0;
}
}
示例15: get_display_layer_surface
int get_display_layer_surface() {
int i;
IDirectFB *dfb = NULL;
IDirectFBSurface *surface = NULL;
DFBSurfaceCapabilities caps;
IDirectFBDisplayLayer *layer = NULL;
int width, height;
DFBSurfacePixelFormat p_format;
DFBCHECK(DirectFBInit(NULL, NULL));
DFBCHECK(DirectFBCreate(&dfb));
push_release(dfb, dfb->Release);
DFBCHECK(dfb->GetDisplayLayer(dfb, DLID_PRIMARY, &layer));
push_release(layer, layer->Release);
DFBCHECK(layer->SetCooperativeLevel(layer, DLSCL_EXCLUSIVE));
DFBCHECK(layer->GetSurface(layer, &surface));
push_release(surface, surface->Release);
DFBCHECK(surface->GetCapabilities(surface, &caps));
if (caps & DSCAPS_PRIMARY) {
printf("Surface Primary\n");
}
if (caps & DSCAPS_SYSTEMONLY) {
printf("Surface SystemOnly\n");
}
if (caps & DSCAPS_VIDEOONLY) {
printf("Surface VideoOnly\n");
}
if (caps & DSCAPS_DOUBLE) {
printf("Surface Double buffered\n");
}
if (caps & DSCAPS_SUBSURFACE) {
printf("Surface is a sub surface\n");
}
if (caps & DSCAPS_INTERLACED) {
printf("Surface is Interlaced\n");
}
if (caps & DSCAPS_SEPARATED) {
printf("Surface is separated\n");
}
if (caps & DSCAPS_STATIC_ALLOC) {
printf("Surface is static alloc\n");
}
if (caps & DSCAPS_TRIPLE) {
printf("Surface is triple buffered\n");
}
if (caps & DSCAPS_PREMULTIPLIED) {
printf("Surface stores premiltiplied alpha\n");
}
if (caps & DSCAPS_DEPTH) {
printf("Surface has a depth buffer\n");
}
DFBCHECK(surface->GetSize(surface, &width, &height));
printf("Surface size: %dx%d\n", width, height);
DFBCHECK(surface->GetPixelFormat(surface, &p_format));
for(i = 0; pformat_names[i].format; i++) {
if (pformat_names[i].format == p_format) {
printf("Surface pixelformat: %s\n", pformat_names[i].name);
}
}
release_all();
return 0;
}