Пример #1
0
        public static CMBufferQueue FromCallbacks(int count, CMBufferGetTime getDecodeTimeStamp, CMBufferGetTime getPresentationTimeStamp, CMBufferGetTime getDuration,
                                                  CMBufferGetBool isDataReady, CMBufferCompare compare, NSString dataBecameReadyNotification, CMBufferGetSize getTotalSize)
        {
            var bq     = new CMBufferQueue(count);
            var cbacks = new CMBufferCallbacks()
            {
                version                   = (uint)(getTotalSize == null ? 0 : 1),
                refcon                    = GCHandle.ToIntPtr(bq.gch),
                XgetDecodeTimeStamp       = getDecodeTimeStamp == null ? (BufferGetTimeCallback)null : GetDecodeTimeStamp,
                XgetPresentationTimeStamp = getPresentationTimeStamp == null ? (BufferGetTimeCallback)null : GetPresentationTimeStamp,
                XgetDuration              = getDuration == null ? (BufferGetTimeCallback)null : GetDuration,
                XisDataReady              = isDataReady == null ? (BufferGetBooleanCallback)null : GetDataReady,
                Xcompare                  = compare == null ? (BufferCompareCallback)null : Compare,
                cfStringPtr_dataBecameReadyNotification = dataBecameReadyNotification == null ? IntPtr.Zero : dataBecameReadyNotification.Handle,
                XgetSize = getTotalSize == null ? (BufferGetSizeCallback)null : GetTotalSize
            };

            bq.getDecodeTimeStamp       = getDecodeTimeStamp;
            bq.getPresentationTimeStamp = getPresentationTimeStamp;
            bq.getDuration  = getDuration;
            bq.isDataReady  = isDataReady;
            bq.compare      = compare;
            bq.getTotalSize = getTotalSize;

            if (CMBufferQueueCreate(IntPtr.Zero, count, cbacks, out bq.handle) == 0)
            {
                return(bq);
            }

            bq.Dispose();
            return(null);
        }
Пример #2
0
		public static CMBufferQueue FromCallbacks (int count, CMBufferGetTime getDecodeTimeStamp, CMBufferGetTime getPresentationTimeStamp, CMBufferGetTime getDuration,
			CMBufferGetBool isDataReady, CMBufferCompare compare, NSString dataBecameReadyNotification, CMBufferGetSize getTotalSize)
		{
			var bq = new CMBufferQueue (count);
			var cbacks = new CMBufferCallbacks () {
				version = (uint) (getTotalSize == null ? 0 : 1),
				refcon = GCHandle.ToIntPtr (bq.gch),
				XgetDecodeTimeStamp = getDecodeTimeStamp == null ? (BufferGetTimeCallback) null : GetDecodeTimeStamp,
				XgetPresentationTimeStamp = getPresentationTimeStamp == null ? (BufferGetTimeCallback) null : GetPresentationTimeStamp,
				XgetDuration = getDuration == null ? (BufferGetTimeCallback) null : GetDuration,
				XisDataReady = isDataReady == null ? (BufferGetBooleanCallback) null : GetDataReady,
				Xcompare = compare == null ? (BufferCompareCallback) null : Compare,
				cfStringPtr_dataBecameReadyNotification = dataBecameReadyNotification == null ? IntPtr.Zero : dataBecameReadyNotification.Handle,
				XgetSize = getTotalSize == null ? (BufferGetSizeCallback) null : GetTotalSize
			};

			bq.getDecodeTimeStamp = getDecodeTimeStamp;
			bq.getPresentationTimeStamp = getPresentationTimeStamp;
			bq.getDuration = getDuration;
			bq.isDataReady = isDataReady;
			bq.compare = compare;
			bq.getTotalSize = getTotalSize;

			if (CMBufferQueueCreate (IntPtr.Zero, count, cbacks, out bq.handle) == 0)
				return bq;

			bq.Dispose ();
			return null;
		}
Пример #3
0
 // for compatibility with 7.0 and earlier
 public static CMBufferQueue FromCallbacks(int count, CMBufferGetTime getDecodeTimeStamp, CMBufferGetTime getPresentationTimeStamp, CMBufferGetTime getDuration,
                                           CMBufferGetBool isDataReady, CMBufferCompare compare, NSString dataBecameReadyNotification)
 {
     return(FromCallbacks(count, getDecodeTimeStamp, getPresentationTimeStamp, getDuration, isDataReady,
                          compare, dataBecameReadyNotification, null));
 }
Пример #4
0
		// for compatibility with 7.0 and earlier
		public static CMBufferQueue FromCallbacks (int count, CMBufferGetTime getDecodeTimeStamp, CMBufferGetTime getPresentationTimeStamp, CMBufferGetTime getDuration,
			CMBufferGetBool isDataReady, CMBufferCompare compare, NSString dataBecameReadyNotification)
		{
			return FromCallbacks (count, getDecodeTimeStamp, getPresentationTimeStamp, getDuration, isDataReady, 
				compare, dataBecameReadyNotification, null);
		}