I'm developing a video stream software, I'm using libvlc and qt-vlc for playing videos from network stream. Everything is good just one problem. When VlcMediaPlayer starts to playing, the mouse pointer hide over VlcWidgetVideo widget.
If mouse move around application it will be shown but only on the VlcWidgetVideo there are no mouse
My simple code is like that:
auto _instance = new VlcInstance(VlcCommon::args(), this);
auto _player = new VlcMediaPlayer(_instance);
auto playerWidget = new VlcWidgetVideo(_player, this);
auto _media = new VlcMedia(mediaUrl.toString(), _instance);
_player->setVideoWidget(playerWidget);
_player->play();
// mediaUrl is type of QUrl
_player->open(_media);
Now, my question is that: How can I force qt-vlc to don't hide pointer? I want to mouse pointer be visible always. My development environment is:
CentOS 7.2 on VirtualBox
Qt 5.5
Excuse for my bad English
Note 1:
Two points:
Playing same stream video with vlc media player on same computer doesn't hide the cursor!
When I try to simulate the mouse pointer with a shape in QLabel the player widget flush by repeat
Note 2:
I dropped using of qt-vlc and used libvlc directly, But no changes! Mouse hide and some times it appear as a single black pixel
Note 3:
Running same code on debian 9 works fine
Use --mouse-hide-timeout=<integer> from https://wiki.videolan.org/VLC_command-line_help/
If that doesn't work, consider opening an issue as I'm not sure vlc-qt offers a way to configure that option.
Related
I've got a quite persistent problem regarding the d3dvideosink.
My GStreamer pipeline is written by using the GStreamer SDK 1.14.2 in Qt/C++ and looks like this:
videotestsrc -> d3dvideosink
I use gst_video_overlay_set_window_handle to place the sinks output over the corresponding QWidget (using WId QWidget::winId() const).
The stream works as expected, but will produce flicker whenever the widget (or any parent widget) is repainting (e.g. while resizing).
How can I configure the widget / pipeline / d3dvideosink / ... to eliminate flickers ?
P.S. Using glimagesink instead of d3dvideosink works, but will be less performant.
Disable Qt repaints over the Window. To do this:
setAttribute(Qt::WA_PaintOnScreen);
Overload paintEngine() to return nullptr.
I'm working to a BB application, using standard UI controls (Edits, Buttons, etc) - you can navigate through these controls using the trackball.
In a certain point I must open a BrowserField with an URL.
When I leave the BrowserField (and come back to the "standard UI controls" part, the pointer of BrowserField is still present on the screen, and the trackball cannot be used. From that point, I cannot use the application anymore.
I'm creating the OS 6 browser using following code:
final BrowserFieldConfig browserConfig = new BrowserFieldConfig();
browserConfig.setProperty(BrowserFieldConfig.JAVASCRIPT_ENABLED, Boolean.TRUE);
browserConfig.setProperty(BrowserFieldConfig.ENABLE_COOKIES,Boolean.TRUE);
browserConfig.setProperty(BrowserFieldConfig.ALLOW_CS_XHR, Boolean.TRUE);
browserConfig.setProperty(BrowserFieldConfig.NAVIGATION_MODE,
BrowserFieldConfig.NAVIGATION_MODE_POINTER);
on exit, I don't have a specific code. I've tried with BrowserFieldConfig and NAVIGATION_MODE, to set back the default navigation mode, but it doesn't have any effect.
browserConfig = mWeb.getConfig();
browserConfig.setProperty(BrowserFieldConfig.NAVIGATION_MODE,
BrowserFieldConfig.NAVIGATION_MODE_NODE);
[OS 6.0, BrowserField]
Tested with 9700, 9800 emulators, and to a 9900 real device.
I am currently developing a video player.
The GUI as the topmost layer is written in QML. It should be transparent to lower layers. It contains control elements, some Lists etc., It's displayed using a QDeclarativeView.
Description
QDeclarativeView *upperLayer = new QDeclarativeView(this);
upperLayer->setSource(QUrl("/home/projects/QtVideo/qml/videoControl.qml"));
upperLayer->setStyleSheet(QString("background: transparent");
upperLayer->setResizeMode(QDeclarativeView::SizeRootObjectToView);
uperLayer->showFullScreen();
The layer underneath is a QWidget: I use the libvlc to display the video content
in this widget.
Reason: I am receiving MPEG-TS, which can not be decoded by phonon, afaik. Therefore I need the libvlc to decode the incoming *.ts stream and put the output onto the display.
QWidget *lowerLayer = new QWidget(this);
lowerLayer.setGeometry(QString("background: red"));
QUrl* url = new QUrl("file:///home/projects/QtVideo/video.ts");
libvlc_instance_t*vlcObject;
libvlc_media_t*vlcMedia;
libvlc_media_player_t*vlcPlayer;
vlcPlayer = NULL;
if(vlcObject = libvlc_new(argc, argv)) == NULL)
{
printf("Not able to initialize";
exit(1);
}
if(vlcPlayer && libvlc_media_player_is_playing(vlcPlayer))
{
libvlc_media_player_stop(vlcPlayer);
}
vlcPlayer = libvlc_media_player_new(vlcObject);
vlcMedia = libvlc_media_new_location(vlcObject, url.toString().toUtf8().constData());
libvlc_media_player_set_media(vlcPlayer, vlcMedia);
#if defined(Q_OS_MAC)
libvlc_media_player_set_nsobject(vlcPlayer, lowerLayer->winId());
#elif defined(Q_OS_UNIX)
libvlc_media_player_set_x_window(vlcPlayer, lowerLayer->winId());
#elif defined(Q_OS_WIN)
libvlc_media_player_set_hwnd(vlcPlayer, lowerLayer->winId());
#endif
libvlc_media_player_play(vlc_player);
Both Elements, the QDeclarativeView and the QWidget
are embedded in a QMainWindow, lowerLayer created before the upperLayer,
upperLayer Transparent to the lowerLayer.
The Problem:
As long as the lowerLayer is displaying static elements such as a picture, or some colored shapes, everything works fine, full transparency and functionality.
As soon as I start displaying a video, such as the described *.ts using the libvlc OR some random video using the Phonon::VideoPlayer, the parts of the upperLayer which are above the video parts of the lowerLayer are displayed in the color of the lowerLayer(default: gray), the parts of the upperLayer which are positioned above parts of the lowerLayer or others which do not contain video elements are displayed in correct behaviour.
Question:
Is there any posibility and if, how, to get the upperLayer transparent, even if there is a video playing?
Are you still fighting with this issue? I, sadly, do not have a satisfying answer for you. The best I can do is point you to reasons why it doesn't work:
http://lists.trolltech.com/qt-interest/2007-02/thread01061-0.html
See Message #4 in the link above.
I have tried many different methods to get transparent painting over a video (specifically Phonon::VideoPlayer) using Qt. The only method I've found so far, is to set the overlaying QWidget as a toolTip doing something like
pWidget->setWindowFlags(Qt::ToolTip)
Depending on what exactly you're wanting to do this may be sufficient, but (in my opinion) it's a hack at best. I'm actively struggling with this issue and if I can find some sort of solution, I'll be sure to post it here.
Best of luck.
you're using direct rendering (by passing the wid of the widget) which draws the video overtop at that geometry:
libvlc_media_player_set_x_window
you need to use offscreen rendering and draw that to your qwidget. this can be done with an opengl context (complicated) or using the callback methods available in libvlc.
if you use the display callback (libvlc_video_display_cb) libvlc will also generate lock/unlock methods also, if you need. in this method libvlc will expect some parameters to be set such as canvas geometry and pixel format.
that said, phonon has a libvlc backend which might help, but may still use direct rendering depending on some factors..
I have a flex 3 application that creates an Image from a canvas which the user draws on. I use the ImageSnapshot class to create the image
var imageSnap:ImageSnapshot=ImageSnapshot.captureImage(myCanvas);
var imageByteArray:ByteArray=imageSnap.data as ByteArray;
I want the user to be able to print or save the image. I can use the following code to print the image but flex does not provide good control over printing across multiple pages
var printJob:FlexPrintJob=new FlexPrintJob();
printJob.start();
printJob.addObject(myCanvas, FlexPrintJobScaleType.SHOW_ALL);
I would like to display the image in a browser window so that the user could print it using the built in browser functionality or right click on the image and save it. Can this be done without requesting server side code to do it?
I know that flash player 10 and flex 4 allow you to save files locally but for now I am stuck with player 9 and flex 3
You can still use the new features of FileReference (the save() and load() methods) in Flex 3 as long as the application is running in Flash Player 10. But if you are definitely stuck with Flash Player 9 then you will need to push the image up to the server first. If you are looking for a good way to push that data up to the server, please reference my solution in this question:
Flex: Render an unrealized UIComponent to BitmapData?
I don't believe you can do this, as it would violate the sandbox. For example, if this worked, it means you could put arbitrary code (analogous to an image) on the user's machine without their consent or knowledge.
I'm not sure if this will work, but try this:
Show a link to the image (file://path/to/image/img.ext) and set window.htmlLoader.navigateInSystemBrowser = true;
I have a Carbon LSUIElement application, which runs in the background (possibly with an icon in the menubar, depending on a pref) and occasionally needs to show a dialog to the user - sometimes in response to a user event, but sometimes in response to a background task failing or similar.
(I'm using Qt 4.5, so the application is Carbon based; With Qt 4.6 things will be Cocoa based, but it sounds as if the problem may exist there too).
The problem is that when I open a window, and show it, it doesn't get brought to the front. I assume this is an artefect of being an LSUIElement app. Qt uses SelectWindow in Carbon, and [makeKeyAndOrderFront] in Cocoa, to bring a window (and the app) to the front.
To work around the problem, I tried going direct to the window server: (the first few steps are to get the WindowID, this will be simpler with Qt-Cocoa, since I can use NSWindow:nativeWindow)
WindowRef ref = HIViewGetWindow((HIViewRef) aWidget->winId());
CGSWindow wid = GetNativeWindowFromWindowRef(ref);
CGSConnection cid =_CGSDefaultConnection();
CGSOrderWindow(cid, wid, 1 /* above everything */, 0 /* NULL */);
This works, sort of - the window comes to the front, but it's not highlighted or keyboard focused. Are there additional steps to fix those issues, or is there a simpler solution to the whole problem?
Use SetFrontProcessWithOptions to bring your window in front of other apps.
Try:
[NSApp activateIgnoringOtherApps: YES]