I sent the message only to Niels Roest and not to list, Sorry Flavio 2010/5/24 Flavio Alberto Lopes Soares <flavio.thun...@gmail.com>
> Hello, > > 2010/5/23 Niels Roest <ni...@directfb.org> > > I am not sure I understand what you want to do fully, so some questions: >> >> In one thread I'm using libVLC configured to use DirectFB as video out to > show video and the other thread to show OSD information, in some events > (changes on video source for example) the VLC reinitialize the video out and > consequently it recriates your DFB surface and thereafter the video "stays > over" my DFB graphics and I canot see my OSD graphics > > >> did you create two separate windows? >> do you have two different surface, i.e. are the two pointers different? >> > > The surface creation inside VLC vout module and my application graphic > system was essentially the same way, I do DirectFBCreate(&directfb) > and directfb->CreateSurface(directfb, &dsc, &primary) after, I verify and > really have different surface pointers inside VLC and inside my application > but the main interface has the same pointer value. > > >> >> If you are using a single surface, than it is logical what happens - the >> last drawing operation is the one that you see. >> > > I understood, and despite was not the same surface the main interface is > the same, appears exactly this is the problem - last surface created is the > surface that stays over when draw. > > >> If you use windows, you can simply change the Z-order to define which >> window is seen. > > > Really, I'm not using windows and as I saw in the DirectFB module > implementation do the same thing, doing in this way I was assuring that the > graphics and video stays on the same window. > I want to know if is possible configure my surface to place my graphics > always over the video but by the way I will need get this "video destruction > event" from libVLC to destroy and recreate my surface after this. > > >> >> Greets >> Niels > > > Thanks > Greets > Flavio > > > >> >> >> Flavio Alberto Lopes Soares wrote: >> >>> After some investigation (and some DirectFB source code reading) I >>> understood a bit more from my problem, I believed that DirectFB was using >>> Fusion between the 2 threads that instantiates DirectFB different contexts, >>> but I was wrong, because the process that call the two DirectFB contexts was >>> the same, I noticed that the DirectFB context will be the same, because the >>> DirectFB super interface is a singleton and nothing to do with Fusion >>> (because I have only one process), the problem occurs when the thread that >>> decodes the video needs restart the DirectFB for some internal event and >>> reconfigures your surfaces without transparency and the other thread don't >>> know that this occured, the consequence that the video was placed over the >>> graphics. >>> There's some way to configure my graphic surface to be always placed >>> over the graphic surface create after by other DirectFB initialization ? >>> >>> Thanks for all help >>> Flavio Alberto Lopes Soares >>> >>> 2010/5/20 Flavio Alberto Lopes Soares <flavio.thun...@gmail.com <mailto: >>> flavio.thun...@gmail.com>> >>> >>> >>> Hello all, >>> >>> I'm writing an application that starts a thread that uses DirectFB >>> to show video, and my code shows some graphic information over >>> this video, my application cannot access the DirectFB context of >>> this thread and I'm using Fusion to create other DirectFB context >>> to draw my DFB graphics, my code are initialized after the video >>> thread and my graphic are shown OK over the video but in some >>> situations the video thread needs reinitialize/reconfigure DFB >>> context and my own DFB context don't know that this ocurred and >>> cannot be reinitialized, there's some way to force my DFB context >>> be always shown over the video even the first Directfb context was >>> reinitializated ? >>> >>> My DirectFB initialization code snippet are bellow : >>> >>> int >>> BackendDFB::initialize() >>> { >>> int result = 0; >>> bckType = BACKEND_TYPE_DIRECTFB; >>> dfbPicDescriptor = 0; >>> dfbFontDescriptor = 0; >>> fprintf(stderr, "Initializing DirectFB...\n"); >>> if( DirectFBInit(NULL, NULL) != DFB_OK ) { >>> fprintf(stderr, "Error initializing DirectFB.\n"); >>> result = -1; >>> } else { >>> fprintf(stderr, "DirectFB initializing OK, creating DFB >>> superinterface...\n"); >>> if( DirectFBCreate( &dfb ) != DFB_OK ) { >>> fprintf(stderr, "Error creating DFB super interface.\n"); >>> result = -2; >>> } else { >>> dfb->EnumDisplayLayers(dfb, dfbDisplayLayerCallback, >>> this); >>> >>> pictMap = new PictureMap(); >>> createDFBmainSurface(false); /*false - create surface >>> without create window and layer*/ >>> } >>> } >>> return result; >>> } >>> >>> int >>> BackendDFB::createDFBmainSurface(bool fromMainWindow) >>> { >>> int result = 0; >>> >>> if ( ! dfb ) >>> return -1; >>> if (wsurface) { >>> wsurface->Release(wsurface); >>> wsurface = NULL; >>> } >>> if (fromMainWindow) { >>> if (window) >>> window->GetSurface(window, &wsurface); >>> else >>> result = -1; >>> } else { >>> memset(&dsc, 0, sizeof(DFBSurfaceDescription)); >>> dsc.flags = DFBSurfaceDescriptionFlags(DSDESC_CAPS | >>> DSDESC_PIXELFORMAT); >>> dsc.caps = DFBSurfaceCapabilities(DSCAPS_PRIMARY | >>> DSCAPS_VIDEOONLY | >>> >>> DSCAPS_PREMULTIPLIED | >>> DSCAPS_FLIPPING); >>> dsc.pixelformat = DSPF_ARGB; >>> dfb->CreateSurface( dfb, &dsc, >>> &wsurface ); >>> if (wsurface) { >>> int w, h; >>> wsurface->GetSize (wsurface, &w, &h); >>> setWindowDimensions(0, 0, w, h); >>> } >>> } >>> if (wsurface) { >>> wsurface->SetBlittingFlags( wsurface, >>> DFBSurfaceBlittingFlags(DSBLIT_BLEND_ALPHACHANNEL)); >>> wsurface->SetPorterDuff( wsurface, DSPD_SRC_OVER ); >>> wsurface->SetDstBlendFunction(wsurface, DSBF_INVSRCALPHA); >>> wsurface->SetDrawingFlags(wsurface, DSDRAW_BLEND); >>> wsurface->Clear(wsurface, 0x00, 0x00, 0x00, 0x00); >>> } else >>> result = -2; >>> return result; >>> } >>> >>> And I will update the screen I use this function : >>> void >>> BackendDFB::update_screen() >>> { >>> if (wsurface) >>> wsurface->Flip(wsurface, NULL, DSFLIP_ONSYNC); >>> } >>> >>> Thanks for all help >>> Flávio Alberto Lopes Soares >>> >>> >>> ------------------------------------------------------------------------ >>> >>> _______________________________________________ >>> directfb-users mailing list >>> directfb-users@directfb.org >>> http://mail.directfb.org/cgi-bin/mailman/listinfo/directfb-users >>> >>> >> >> >> -- >> >> .------------------------------------------. >> | DirectFB - Hardware accelerated graphics | >> | http://www.directfb.org/ | >> "------------------------------------------" >> > >
_______________________________________________ directfb-users mailing list directfb-users@directfb.org http://mail.directfb.org/cgi-bin/mailman/listinfo/directfb-users