I am trying to read GstNavigationEvents (Mouse Click Locations) from osd_sink_pad_buffer_probe. This Mouse clicks are generated by gstreamer’s XvImageSink which are then pushed upstream. I couldnot find any way to read such events inside osd_sink_pad_buffer_probe.
I tried printing info.type inside osd_sink_pad_buffer_probe like below:
print("GST EVENT TYPE: {}".format(info.type))
I get the following :
GST EVENT TYPE: <flags GST_PAD_PROBE_TYPE_BUFFER | GST_PAD_PROBE_TYPE_PUSH of type Gst.PadProbeType>
I want to read mouseclicks from osd_sink_pad_buffer_probe so that I can modify the osd based on the mouseclicks from user.
Please help. Thank you.
Related
Is it possible to handle touch enter or touch leave in cocos creator 1.9?
I don't find any.
i tried to do it with touch move but it doesn't worked.
You need to register callback for touch event.
Read manual here first.
In the sample code:
onLoad: function () {
this.node.on('mousedown', function ( event ) {
console.log('Hello!');
});}
Use cc.Node.EventType.TOUCH_START for touch enter (TOUCH_MOVE / TOUCH_END / TOUCH_CANCEL for other purpose) instead of 'mousedown';
I'm building a custom Chromecast receiver based on the [CAF SDK][1]. I've tried to set the receiver application in IDLE state mode for handling the splash screen during the 5 minutes after the media has ended...
I tried to use :
var video = document.createElement("video");
video.classList.add('castMediaElement');
video.style.setProperty('--splash-image', 'url("img/logo-mySplash.svg")');
document.body.appendChild(video);
var context = cast.framework.CastReceiverContext.getInstance();
context.setInactivityTimeout(300);
playerManager.addEventListener(cast.framework.events.EventType.ALL,
function (event) {
switch(event.type) {
case 'CLIP_ENDED':
context.setApplicationState('IDLE');
break;`
}
})
When the media ended, the receiver dispatches :
{type: "CLIP_ENDED", currentMediaTime: 2673.986261, endedReason: "END_OF_STREAM"}
{type: "MEDIA_FINISHED", currentMediaTime: 2673.986261, endedReason: "END_OF_STREAM"}
and sends error to debug console :
[ 32.846s] [cast.receiver.MediaManager] Unexpected command, player is in IDLE state so the media session ID is not valid yet
I can't find any documentation about this issue. Thanks anyway for your answers.
The context.setApplicationState simply updates the application's statusText. See: https://developers.google.com/cast/docs/reference/caf_receiver/cast.framework.CastReceiverContext#setApplicationState.
What you probably want to do is add a listener to the playerDataBinder on cast.framework.ui.PlayerDataEventType.STATE_CHANGED event. This way you can make your idle screen visible whenever the state property changes.
Also, in order to get the full advantage of using CAF you probably want to to use the cast-media-player element. Additional information on the benefits of using this element instead of a custom video element can be found here: https://developers.google.com/cast/docs/caf_receiver_features
I created a button in the toolbar using
GPS.Toolbar().append(button)
In the On_Click function of the button I want it to print the current file's name.
I wrote print GPS.Current_Context().file()
But it does'nt work and give me the error : Current_Context has no attribute file
Anyone knows why?
Use EditorBuffer to get the current view's name:
EditorBuffer.get().current_view().title()
This will give you the title of the current editor tab, which is the name of the edited file.
I have a cascades project where I use the MediaPlayer class in cpp.
I have defined a handler class, which handles metaDataChanged event, but when I set the source url and call mediaPlayer.prepare() method, it doesn't retrieve anything in metadata, so it's simply empty QVariantMap.
What's interesting is that defined event handler for metaDataChaned event is not even called.
I think there could be something that I can add here to be able to get the metadata, however prepare() method workds sucessfully, so I don't know what's the problem
here is a piece of code I've tried.
bb::multimedia::MediaPlayer* mp = new bb::multimedia::MediaPlayer();
mp->setSourceUrl(resultString);
mp->prepare();
MetaDataReader metaDataReader(mp);
and a class
MetaDataReader::MetaDataReader(bb::multimedia::MediaPlayer* mediaPlayer) : QObject(NULL)
{
connect(mediaPlayer, SIGNAL(metaDataChanged(const QVariantMap&)), this, SLOT(onMetaDataChanged(const QVariantMap&)));
}
void MetaDataReader::onMetaDataChanged(const QVariantMap& metaData)
{
someCode
// It doesn't reach this SLOT
}
How can I get the metadata here?
thanks in advance
It's a bit odd, but you may not get metadata until you start playback for the file. Try starting playback, and you should see the metaDataChanged signal get fired shortly after.
I'm working with a custom List component in flex4. I've created a custom ItemRenderer and everything looks and works as i want, but i'm trying to get the double click event. I'm receiving key down and all other events, but not this one. I've enabled the double click on the List component
doubleClickEnabled="true"
and i've added an event listener for
ListEvent.ITEM_DOUBLE_CLICK
I can click as long as i want, the event just is not triggered.
I could use any advice.
Thanks.
You want to listen for MouseEvent.DOUBLE_CLICK and then you can figure out what was clicked on using event.target.
I banged my head on the wall for hours because of this ! Adobe is going backwards with component functionality ! anyway, I found a decent solution :
We're going to add the DOUBLE_CLICK event listener to the dataGroup of the list, which is the container of the items :
list.dataGroup.doubleClickEnabled = true;
list.dataGroup.addEventListener(MouseEvent.DOUBLE_CLICK, handleDoubleClick);
Now it works nice, not provoking a double click from the scroller, but sill provoking a double click from an open space (the dataGroup itself) in the list where there are no items. so we only continue the event handler if e.target != dataGroup :
private function handleDoubleClick(e:MouseEvent):void
{
if (list.dataGroup != e.target)
{
// double click code
}
}
Now it works fine :) phew ! We shouldn't waste time on this stuff...
Bad solution --> DO NOT try to compare e.target's class to the itemRenderer's class of the list, since sometimes e.target is the actual label of the item.