• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java State类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.gstreamer.State的典型用法代码示例。如果您正苦于以下问题:Java State类的具体用法?Java State怎么用?Java State使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



State类属于org.gstreamer包,在下文中一共展示了State类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: stateChanged

import org.gstreamer.State; //导入依赖的package包/类
public void stateChanged(GstObject source, State old, State newState, State pending) {
    if (!source.equals(getPipeline()))
    	return;
    final ClockTime position = getPipeline().queryPosition();
    if (newState.equals(State.PLAYING) && old.equals(State.PAUSED)) {
        fireStartEvent(new StartEvent(PipelineMediaPlayer.this, old, newState, State.VOID_PENDING, position));
    } else if (newState.equals(State.PAUSED) && pending.equals(State.VOID_PENDING)) {
        firePauseEvent(new PauseEvent(PipelineMediaPlayer.this, old, newState, State.VOID_PENDING, position));
    } else if (newState.equals(State.READY) && pending.equals(State.NULL)) {
        fireStopEvent(new StopEvent(PipelineMediaPlayer.this, old, newState, pending, position));
    }

    // Anything else means we are transitioning!
    if (!pending.equals(State.VOID_PENDING) && !pending.equals(State.NULL)) {
        // TODO: Maybe a new callback method on MediaListener with TransitionEvent?
    }
}
 
开发者ID:gstreamer-java,项目名称:gstreamer1.x-java,代码行数:18,代码来源:PipelineMediaPlayer.java


示例2: endOfStream

import org.gstreamer.State; //导入依赖的package包/类
public void endOfStream(GstObject source) {
    URI next = playList.poll();
    if (next != null) {
        setURI(next);
    } else {
        final EndOfMediaEvent evt = new EndOfMediaEvent(PipelineMediaPlayer.this, 
                    State.PLAYING, State.NULL, State.VOID_PENDING);
        // Notify any listeners that the last media file is finished
        fireEndOfMediaEvent(evt);
    }
    
}
 
开发者ID:gstreamer-java,项目名称:gstreamer1.x-java,代码行数:13,代码来源:PipelineMediaPlayer.java


示例3: TransitionEvent

import org.gstreamer.State; //导入依赖的package包/类
public TransitionEvent(MediaPlayer player, State previousState, State currentState, 
        State pendingState) {
    super(player);
    this.previousState = previousState;
    this.currentState = currentState;
    this.pendingState = pendingState;
}
 
开发者ID:gstreamer-java,项目名称:gstreamer1.x-java,代码行数:8,代码来源:TransitionEvent.java


示例4: setURI

import org.gstreamer.State; //导入依赖的package包/类
/**
 * Sets the media file to play.
 * 
 * @param uri The URI that describes the location of the media file.
 */
public void setURI(URI uri) {
    State old = playbin.getState();
    playbin.ready();
    playbin.setURI(uri);
    playbin.setState(old);
}
 
开发者ID:gstreamer-java,项目名称:gstreamer1.x-java,代码行数:12,代码来源:PlayBinMediaPlayer.java


示例5: widgetDisposed

import org.gstreamer.State; //导入依赖的package包/类
/**
 * Dispose this Widget
 */
public void widgetDisposed(DisposeEvent arg0) {
	if (sinkListener != null)
		autosink.disconnect(sinkListener);
	removeDisposeListener(this);
	if (x11Events)
		watcherRunning = false;
	if (videosink != null && !videosink.getState().equals(State.NULL))
		throw new IllegalStateException("Wrong state on dispose: " + videosink.getState() + " -> " + videosink.getName());
}
 
开发者ID:gstreamer-java,项目名称:gstreamer1.x-java,代码行数:13,代码来源:VideoComponent.java


示例6: close

import org.gstreamer.State; //导入依赖的package包/类
public void close() {
    Parent.WriteLogtoConsole("Stopping Gstreamer Video Player");
    pipe.setState(State.NULL);
    Gst.deinit(); // more trouble
    //State test = pipe.getState();
    pipe = null; //do we really need this?
}
 
开发者ID:apertus-open-source-cinema,项目名称:elphelvision_eclipse,代码行数:8,代码来源:GstreamerPlayer.java


示例7: RePlayVideoStream

import org.gstreamer.State; //导入依赖的package包/类
public void RePlayVideoStream() {
    Parent.WriteLogtoConsole("Trying to restart Gstreamer Video Player");
    Playbin.setState(State.PLAYING);
    /*
    String rtspsource = "";
    if (Parent.Camera.GetColorMode() == ColorMode.RGB) {
    rtspsource = "rtspsrc location=rtsp://" + Parent.Camera.GetIP()[0] + ":554 protocols=0x00000001 latency=50 ! rtpjpegdepay ! jpegdec name=elphelstream";
    } else if (Parent.Camera.GetColorMode() == ColorMode.JP46) {
    //            rtspsrc location=rtsp://" + Parent.Camera.GetIP()    + ":554 protocols=0x00000001 latency=50 ! rtpjpegdepay ! jpegdec ! queue ! jp462bayer ! queue ! bayer2rgb2 ! ffmpegcolorspace ! videorate ! "video/x-raw-yuv, format=(fourcc)I420, width=(int)1920, height=(int)1088, framerate=(fraction)25/1" ! xvimagesink sync=false max-lateness=-1
    rtspsource = "rtspsrc location=rtsp://" + Parent.Camera.GetIP()[0] + ":554 protocols=0x00000001 latency=50 ! rtpjpegdepay ! jpegdec ! queue ! jp462bayer ! queue ! bayer2rgb2 method=0 ! ffmpegcolorspace  name=elphelstream";
    } else {
    //TODO in this mode we dont see anything from the non-jpeg compliant stream so the jp46 filter wont help, but what else should we show?
    rtspsource = "rtspsrc location=rtsp://" + Parent.Camera.GetIP()[0] + ":554 protocols=0x00000001 latency=50 ! rtpjpegdepay ! jpegdec ! queue ! jp462bayer ! queue ! bayer2rgb2 method=0 name=elphelstream";
    }
    
    //pipe = null;
    pipe = Pipeline.launch(rtspsource);
    
    videoComponent.setKeepAspect(true);
    Element videosink = videoComponent.getElement();
    pipe.add(videosink);
    pipe.getElementByName("elphelstream").link(videosink);
    
    //List<Element> sinks = pipe.getSinks();
    //pipe.setClock(null);
    //pipe.play();
    
    //pipe.setState(State.PLAYING);
    //pipe.play();*/
}
 
开发者ID:apertus-open-source-cinema,项目名称:elphelvision_eclipse,代码行数:31,代码来源:GstreamerPlayer.java


示例8: StreamingEncodingH263WebCam

import org.gstreamer.State; //导入依赖的package包/类
/**
 * Emitirá el vide proveniente de la webcam codificandolo en H264
 */
private void StreamingEncodingH263WebCam() {

	Gst.init("GStreamer", new String[0]);

	final Pipeline pipe = Pipeline.launch("v4l2src name=v4l2src  ! textoverlay name=textoverlay ! ffenc_h263 name=ffenc_h263 ! rtph263ppay name=rtph263ppay ! udpsink name=udpsinkVideo");
	ref_pipeline = pipe;


	pipe.getElementByName("v4l2src").set("device","/dev/video0");
	pipe.getElementByName("textoverlay").set("text","EMISIÓN DESDE KMC SERVER");
	pipe.getElementByName("ffenc_h263").set("gop-size","0");
	pipe.getElementByName("udpsinkVideo").set("host", getIpMC());
	pipe.getElementByName("udpsinkVideo").set("port", getPortVideo());
	pipe.getElementByName("udpsinkVideo").set("sync", "false");
	pipe.getElementByName("udpsinkVideo").set("async", "false");


	final Thread t = new Thread(
			new Runnable()
			{
				public void run()
				{ 
					pipe.setState(State.PLAYING);
					Gst.main();     
					pipe.setState(State.NULL);
				}
			});
	t.start();
	ref_thread=t;
}
 
开发者ID:laggc,项目名称:rtsp_multicast_pfc,代码行数:34,代码来源:Media.java


示例9: StreamingEncodingH263Screenshot

import org.gstreamer.State; //导入依赖的package包/类
private void StreamingEncodingH263Screenshot() {

		Gst.init("GStreamer", new String[0]);

		final Pipeline pipe = Pipeline.launch("ximagesrc name=ximagesrc ! autovideoconvert ! ffenc_h263 name=ffenc_h263 ! video/x-h263, width=704, height=576, framerate=25/1 ! rtph263ppay name=rtph263ppay ! udpsink name=udpsinkVideo");
		ref_pipeline = pipe;

		pipe.getElementByName("ximagesrc").set("show-pointer",false);
		pipe.getElementByName("ffenc_h263").set("gop-size",0);
		pipe.getElementByName("udpsinkVideo").set("host", getIpMC());
		pipe.getElementByName("udpsinkVideo").set("port", getPortVideo());
		pipe.getElementByName("udpsinkVideo").set("sync", "false");
		pipe.getElementByName("udpsinkVideo").set("async", "false");


		final Thread t = new Thread(
				new Runnable()
				{
					public void run()
					{ 
						pipe.setState(State.PLAYING);
						Gst.main();     
						pipe.setState(State.NULL);
					}
				});
		t.start();
		ref_thread=t;


	}
 
开发者ID:laggc,项目名称:rtsp_multicast_pfc,代码行数:31,代码来源:Media.java


示例10: StopStreaming

import org.gstreamer.State; //导入依赖的package包/类
/**
 * Para el streaming
 */
public void StopStreaming() {
	try {
		sendTeardown();
		ref_pipeline.setState(State.NULL);
		ref_thread.interrupt();
	}catch(Exception e){}

}
 
开发者ID:laggc,项目名称:rtsp_multicast_pfc,代码行数:12,代码来源:Media.java


示例11: PlaySdp

import org.gstreamer.State; //导入依赖的package包/类
/**
 * Toma como argumento una URI que indica el path del SessionDescription que se quiere reproducir.
 * Ejemplo: URI uriSDP = new URI("file:///home/laggc/Escritorio/borrar.sdp");
 * Se creará un JFrame en el cual se reproducirá el medio.
 * @return 
 * @partam uriSDP
 * URI del SDP que se quiere reproducir.
 */
public static void PlaySdp(URI uriSDP)
{
	Gst.init("PLAY SDP", new String[0]);

	final PlayBin2 playbin = new PlayBin2("PlaySDP");

	playbin.setURI(uriSDP);

	SwingUtilities.invokeLater(new Runnable() {

		public void run() {
			VideoComponent videoComponent = new VideoComponent();
			playbin.setVideoSink(videoComponent.getElement());

			JFrame frame = new JFrame("Player");
			frame.getContentPane().add(videoComponent, BorderLayout.CENTER);
			frame.setPreferredSize(new Dimension(640, 480));
			frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
			frame.pack();
			frame.setVisible(true);
			frame.setLocationRelativeTo(null);
			playbin.setState(State.PLAYING);       
		}
	});

	Gst.main();
	playbin.setState(State.NULL);	
}
 
开发者ID:laggc,项目名称:rtsp_multicast_pfc,代码行数:37,代码来源:SimpleClient.java


示例12: StopVideoStream

import org.gstreamer.State; //导入依赖的package包/类
public void StopVideoStream() {
    Parent.WriteLogtoConsole("Stopping Gstreamer Video Player");

    pipe.setState(State.READY);

    //debugGST();

    Element videosink = videoComponent.getElement();
    videoComponent.repaint();
    pipe.getElementByName("elphelstream").unlink(videosink);
    pipe.remove(videosink);

    //debugGST();

    pipe.setState(State.NULL);

    //debugGST();

    List<Element> elements = pipe.getElementsRecursive();
    for (int i = 0; i < elements.size(); i++) {
        pipe.unlink(elements.get(i));
        pipe.remove(elements.get(i));
        elements.get(i).dispose();
    }

    List<Element> sources = pipe.getSources();
    for (int i = 0; i < sources.size(); i++) {
        pipe.unlink(sources.get(i));
        pipe.remove(sources.get(i));
        sources.get(i).dispose();
    }

    //debugGST();
    pipe = null;
    //debugGST();
}
 
开发者ID:apertus-open-source-cinema,项目名称:elphelvision_netbeans,代码行数:37,代码来源:GstreamerPlayer.java


示例13: getOldState

import org.gstreamer.State; //导入依赖的package包/类
/**
 * Gets the previous state.
 * 
 * @return the previous state.
 */
public State getOldState() {
    State[] state = new State[1];
    gst.gst_message_parse_state_changed(this, state, null, null);
    return state[0];
}
 
开发者ID:gstreamer-java,项目名称:gstreamer1.x-java,代码行数:11,代码来源:StateChangedMessage.java


示例14: getNewState

import org.gstreamer.State; //导入依赖的package包/类
/**
 * Gets the new (current) state.
 * 
 * @return the new state.
 */
public State getNewState() {
    State[] state = new State[1];
    gst.gst_message_parse_state_changed(this, null, state, null);
    return state[0];
}
 
开发者ID:gstreamer-java,项目名称:gstreamer1.x-java,代码行数:11,代码来源:StateChangedMessage.java


示例15: getPendingState

import org.gstreamer.State; //导入依赖的package包/类
/**
 * Gets the pending (target) state.
 * 
 * @return the pending state.
 */
public State getPendingState() {
    State[] state = new State[1];
    gst.gst_message_parse_state_changed(this, null, null, state);
    return state[0];
}
 
开发者ID:gstreamer-java,项目名称:gstreamer1.x-java,代码行数:11,代码来源:StateChangedMessage.java


示例16: PauseEvent

import org.gstreamer.State; //导入依赖的package包/类
public PauseEvent(MediaPlayer source, State previous, State current, State pending, ClockTime mediaTime) {
    super(source, previous, current, pending, mediaTime);
}
 
开发者ID:gstreamer-java,项目名称:gstreamer1.x-java,代码行数:4,代码来源:PauseEvent.java


示例17: getPreviousState

import org.gstreamer.State; //导入依赖的package包/类
public State getPreviousState() {
    return previousState;
}
 
开发者ID:gstreamer-java,项目名称:gstreamer1.x-java,代码行数:4,代码来源:TransitionEvent.java


示例18: getCurrentState

import org.gstreamer.State; //导入依赖的package包/类
public State getCurrentState() {
    return currentState;
}
 
开发者ID:gstreamer-java,项目名称:gstreamer1.x-java,代码行数:4,代码来源:TransitionEvent.java


示例19: getPendingState

import org.gstreamer.State; //导入依赖的package包/类
public State getPendingState() {
    return pendingState;
}
 
开发者ID:gstreamer-java,项目名称:gstreamer1.x-java,代码行数:4,代码来源:TransitionEvent.java


示例20: getTargetState

import org.gstreamer.State; //导入依赖的package包/类
public State getTargetState() {
    return pendingState;
}
 
开发者ID:gstreamer-java,项目名称:gstreamer1.x-java,代码行数:4,代码来源:TransitionEvent.java



注:本文中的org.gstreamer.State类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java TestIOUtils类代码示例发布时间:2022-05-22
下一篇:
Java EmptyStep类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap