Beispiel #1
0
    public void Initialize()
    {
        m_HasBeenInitialized = true;

        GStreamerCore.Ref();
        _initialize();
    }
Beispiel #2
0
    public void Init(RobotInfo ifo)
    {
        GStreamerCore.Ref();
        m_Texture = TargetNode.AddComponent <GstCustomTexture> ();
        m_Texture.Initialize();

        FileName = ifo.URL;

        _Processor            = new OffscreenProcessor();
        _Processor.ShaderName = "Image/I420ToRGB";
        _needProcessing       = false;

        string path = Application.dataPath + "/" + FileName;

        m_Texture.SetPipeline("filesrc location=\"" + path + "\" ! qtdemux name=demux " +
                              "demux.video_0 ! queue ! avdec_h264 ! videoconvert ! video/x-raw,format=I420 ! appsink name=videoSink " +
                              "demux.audio_0 ! queue ! decodebin ! audioconvert ! volume volume=5 ! appsink name=audioSink");
        m_Texture.OnFrameGrabbed += OnFrameGrabbed;
        m_Texture.Play();


        GameObject audioObj = new GameObject("AudioObject_" + TargetNode.name);

        audioObj.transform.parent   = TargetNode.transform;
        audioObj.transform.position = Vector3.zero;
        AudioObject       = audioObj.AddComponent <AudioSource> ();
        AudioObject.loop  = true;
        _player           = audioObj.AddComponent <GstAudioPlayer> ();
        _player.Player    = m_Texture.Player.AudioWrapper;
        _player.TargetSrc = AudioObject;
    }
    public void Initialize()
    {
        m_HasBeenInitialized = true;

        GStreamerCore.Ref();
        _player = new GstNetworkPlayer();

        // Call resize which will create a texture and a webview for us if they do not exist yet at this point.
        Resize(m_Width, m_Height);

        if (GetComponent <GUITexture>())
        {
            GetComponent <GUITexture>().texture = m_Texture;
        }
        else if (GetComponent <Renderer>() && GetComponent <Renderer>().material)
        {
            GetComponent <Renderer>().material.mainTexture      = m_Texture;
            GetComponent <Renderer>().material.mainTextureScale = new Vector2(Mathf.Abs(GetComponent <Renderer>().material.mainTextureScale.x) * (m_FlipX ? -1.0f : 1.0f),
                                                                              Mathf.Abs(GetComponent <Renderer>().material.mainTextureScale.y) * (m_FlipY ? -1.0f : 1.0f));
        }
        else
        {
            Debug.LogWarning("There is no Renderer or guiTexture attached to this GameObject! GstTexture will render to a texture but it will not be visible.");
        }
    }
 protected override GstIAudioGrabber GetAudioGrabber()
 {
     if (_grabber == null)
     {
         GStreamerCore.Ref();
         _grabber = new GstNetworkAudioGrabber();
         _grabber.Init(port, Channels, SamplingRate);
         _grabber.Start();
     }
     return(_grabber);
 }
Beispiel #5
0
    // Use this for initialization
    void Start()
    {
        GStreamerCore.Ref();

        _Processor            = new OffscreenProcessor();
        _Processor.ShaderName = "Image/I420ToRGB";
        _needProcessing       = false;

        _texture = gameObject.AddComponent <GstCustomTexture> ();
        _texture.Initialize();

        string path = Application.dataPath + "/" + FileName;

        _texture.SetPipeline("filesrc location=\"" + path + "\" ! qtdemux name=demux demux.video_0 ! avdec_h264 ! videorate ! videoconvert ! video/x-raw,format=I420,framerate=30/1 ");

        _texture.OnFrameGrabbed += _OnFrameGrabbed;
        _texture.Play();
    }
Beispiel #6
0
 public GstLocalAudioGrabber()
 {
     GStreamerCore.Ref();
     m_Instance = mray_gst_createLocalAudioGrabber();
 }
Beispiel #7
0
 public GstNetworkAudioPlayer()
 {
     GStreamerCore.Ref();
     m_Instance    = mray_gst_createNetworkAudioPlayer();
     _audioWrapper = new Wrapper(this);
 }
 public GstUnityImageGrabber()
 {
     GStreamerCore.Ref();
     m_Instance = mray_gst_createUnityImageGrabber();
 }
 public GstAppAudioPlayer()
 {
     GStreamerCore.Ref();
     m_Instance = mray_gst_createAppAudioPlayer();
 }
 public GstCustomDataPlayer()
 {
     GStreamerCore.Ref();
     m_Instance = mray_gst_customDataPlayerCreate();
 }
Beispiel #11
0
 public GstIAudioGrabber()
 {
     GStreamerCore.Ref();
 }
 public GstCustomVideoStreamer()
 {
     GStreamerCore.Ref();
     m_Instance = mray_gst_createCustomImageStreamer();
 }
Beispiel #13
0
 public GstIAudioGrabber()
 {
     GStreamerCore.Ref();
     Ref();
     _processingThread = new Thread(new ThreadStart(_Process));
 }
Beispiel #14
0
 public GstNetworkAudioStreamer()
 {
     GStreamerCore.Ref();
     m_Instance = mray_gst_createAudioNetworkStreamer();
 }
Beispiel #15
0
 public GstCustomAudioGrabber()
 {
     GStreamerCore.Ref();
     m_Instance = mray_gst_createCustomAudioGrabber();
 }
Beispiel #16
0
 public GstNetworkImageStreamer()
 {
     GStreamerCore.Ref();
     m_Instance = mray_gst_createNetworkStreamer();
 }