Ejemplo n.º 1
0
 internal sImageFormat(ref sImageFormatDescription src)
 {
     bufferType  = src.type;
     index       = src.index;
     description = src.description;
     pixelFormat = src.pixelFormat;
     flags       = src.flags;
 }
Ejemplo n.º 2
0
        public sPixelFormatMP getDataFormat(eBufferType bufferType)
        {
            Debug.Assert(bufferType.isMultiPlaneBufferType());
            sStreamDataFormat sdf = default;

            sdf.bufferType = bufferType;
            file.call(eControlCode.G_FMT, ref sdf);
            return(sdf.pix_mp);
        }
Ejemplo n.º 3
0
        public void setDataFormat(eBufferType bufferType, ref sPixelFormatMP pixelFormat)
        {
            Debug.Assert(bufferType.isMultiPlaneBufferType());
            sStreamDataFormat sdf = default;

            sdf.bufferType = bufferType;
            sdf.pix_mp     = pixelFormat;
            file.call(eControlCode.S_FMT, ref sdf);
        }
Ejemplo n.º 4
0
        public bool tryDataFormat(eBufferType bufferType, sPixelFormatMP pixelFormat)
        {
            Debug.Assert(bufferType.isMultiPlaneBufferType());
            sStreamDataFormat sdf = default;

            sdf.bufferType = bufferType;
            sdf.pix_mp     = pixelFormat;

            return(file.tryCall(eControlCode.TRY_FMT, ref sdf));
        }
Ejemplo n.º 5
0
        internal bool queryBufferCaps(eBufferType bufferType, eMemory type)
        {
            // If you want to query the capabilities with a minimum of side-effects, then this can be called with count set to 0, memory set to V4L2_MEMORY_MMAP and type set to the buffer type.
            // This will free any previously allocated buffers, so this is typically something that will be done at the start of the application.
            sRequestBuffers requestBuffers = new sRequestBuffers();

            requestBuffers.memory = type;
            requestBuffers.type   = eBufferType.VideoOutputMPlane;
            return(file.tryCall(eControlCode.REQBUFS, ref requestBuffers));
        }
Ejemplo n.º 6
0
        /// <summary>Enumerate image formats</summary>
        public IEnumerable <sImageFormatDescription> enumerateFormats(eBufferType bufferType)
        {
            sImageFormatDescription desc = new sImageFormatDescription();

            desc.type = bufferType;
            for (int i = 0; true; i++)
            {
                desc.index = i;
                if (!file.enumerate(eControlCode.ENUM_FMT, ref desc))
                {
                    yield break;
                }
                yield return(desc);
            }
        }
Ejemplo n.º 7
0
        static eBufferCapabilityFlags query(VideoDevice device, eBufferType bt)
        {
            eBufferCapabilityFlags res = eBufferCapabilityFlags.None;

            if (device.queryBufferCaps(bt, eMemory.MemoryMap))
            {
                res |= eBufferCapabilityFlags.MemoryMap;
            }
            if (device.queryBufferCaps(bt, eMemory.UserPointer))
            {
                res |= eBufferCapabilityFlags.UserPointer;
            }
            if (device.queryBufferCaps(bt, eMemory.DmaSharedBuffer))
            {
                res |= eBufferCapabilityFlags.DmaSharedBuffer;
            }

            return(res);
        }
Ejemplo n.º 8
0
 public static bool isMultiPlaneBufferType(this eBufferType bt)
 {
     return(bt == eBufferType.VideoOutputMPlane || bt == eBufferType.VideoCaptureMPlane);
 }
Ejemplo n.º 9
0
 public void stopStreaming(eBufferType bt)
 {
     file.call(eControlCode.STREAMOFF, ref bt);
 }