Exemple #1
0
 //
 // Size
 //
 internal void SetSize(eNkMAIDCapability capability, NkMAIDSize size)
 {
     CapSet(
         capability,
         eNkMAIDDataType.kNkMAIDDataType_SizePtr,
         new IntPtr(&size));
 }
Exemple #2
0
        internal NkMAIDSize GetDefaultSize(eNkMAIDCapability capability)
        {
            NkMAIDSize size = new NkMAIDSize();

            CapGetDefault(
                capability,
                eNkMAIDDataType.kNkMAIDDataType_SizePtr,
                new IntPtr(&size));

            return(size);
        }
Exemple #3
0
        unsafe void DataItemGetVideoImage(NikonObject data)
        {
            string     name            = data.GetString(eNkMAIDCapability.kNkMAIDCapability_Name);
            NkMAIDSize videoDimensions = data.GetSize(eNkMAIDCapability.kNkMAIDCapability_Pixels);

            NkMAIDGetVideoImage videoImage = new NkMAIDGetVideoImage();

            data.GetGeneric(eNkMAIDCapability.kNkMAIDCapability_GetVideoImage, new IntPtr(&videoImage));

            // Note: Download 4MB at the time
            const int chunkSize = 4 * 1024 * 1024;

            uint totalSize = videoImage.ulDataSize;

            for (uint offset = 0; offset < totalSize; offset += chunkSize)
            {
                uint fragmentSize = Math.Min(chunkSize, totalSize - offset);

                byte[] buffer = new byte[fragmentSize];

                fixed(byte *pBuffer = buffer)
                {
                    videoImage.ulOffset   = offset;
                    videoImage.ulReadSize = (uint)buffer.Length;
                    videoImage.ulDataSize = (uint)buffer.Length;
                    videoImage.pData      = new IntPtr(pBuffer);

                    data.GetArrayGeneric(eNkMAIDCapability.kNkMAIDCapability_GetVideoImage, new IntPtr(&videoImage));
                }

                NikonVideoFragment fragment = new NikonVideoFragment(
                    name,
                    totalSize,
                    offset,
                    buffer,
                    videoDimensions.w,
                    videoDimensions.h);

                Scheduler.Callback(new VideoFragmentReadyDelegate(OnVideoFragmentReady), this, fragment);
            }
        }
Exemple #4
0
 public void SetSize(eNkMAIDCapability cap, NkMAIDSize value)
 {
     Set(cap, value);
 }
Exemple #5
0
 public void SetSize(eNkMAIDCapability cap, NkMAIDSize value)
 {
     Set(cap, value);
 }
        internal NkMAIDSize GetSize(eNkMAIDCapability capability)
        {
            NkMAIDSize size = new NkMAIDSize();

            CapGet(
                capability,
                eNkMAIDDataType.kNkMAIDDataType_SizePtr,
                new IntPtr(&size));

            return size;
        }
 //
 // Size
 //
 internal void SetSize(eNkMAIDCapability capability, NkMAIDSize size)
 {
     CapSet(
         capability,
         eNkMAIDDataType.kNkMAIDDataType_SizePtr,
         new IntPtr(&size));
 }