Exemplo n.º 1
0
        /// <summary>
        /// Load the GStreamer library and attach it
        /// to the specified window.
        /// </summary>
        public bool Initiate()
        {
            // load the gstreamer library
            IntPtr ptr = gst_binding_init();

            if (ptr == IntPtr.Zero)
            {
                throwError("Failed to load the Gstreamer library", "");
                return(false);
            }
            else
            {
                engine = new HandleRef(this, ptr);
            }


            // set up callbacks
            eos_cb    = new eosCallback(onEos);
            error_cb  = new errorCallback(onError);
            buffer_cb = new bufferCallback(onBuffer);
            info_cb   = new infoCallback(onInfo);
            tag_cb    = new tagCallback(onTag);

            gst_binding_set_eos_cb(engine, eos_cb);
            gst_binding_set_error_cb(engine, error_cb);
            gst_binding_set_buffer_cb(engine, buffer_cb);
            gst_binding_set_info_cb(engine, info_cb);
            gst_binding_set_tag_cb(engine, tag_cb);


            status = MediaStatus.Unloaded;

            return(true);
        }
Exemplo n.º 2
0
 static extern void gst_binding_set_info_cb(HandleRef play, infoCallback cb);
Exemplo n.º 3
0
 static extern void gst_binding_set_info_cb(HandleRef play, infoCallback cb);
Exemplo n.º 4
0
        /// <summary>
        /// Load the GStreamer library and attach it
        /// to the specified window.
        /// </summary>
        public bool Initiate(ulong x_window_id)
        {
            // load the gstreamer library
            IntPtr ptr = gst_binding_init (x_window_id);

            if(ptr == IntPtr.Zero)
            {
                throwError ("Failed to load the Gstreamer library", "");
                return false;
            }
            else engine = new HandleRef (this, ptr);

            // set up callbacks
            eos_cb = new eosCallback (onEos);
            error_cb = new errorCallback (onError);
            buffer_cb = new bufferCallback (onBuffer);
            info_cb = new infoCallback (onInfo);
            tag_cb = new tagCallback (onTag);

            gst_binding_set_eos_cb (engine, eos_cb);
            gst_binding_set_error_cb (engine, error_cb);
            gst_binding_set_buffer_cb (engine, buffer_cb);
            gst_binding_set_info_cb (engine, info_cb);
            gst_binding_set_tag_cb (engine, tag_cb);

            status = MediaStatus.Stopped;
            return true;
        }