Example #1
0
        public CVPixelBuffer CopyPixelBuffer(CMTime itemTime, ref CMTime outItemTimeForDisplay)
        {
            var ptr = WeakCopyPixelBuffer (itemTime, ref outItemTimeForDisplay);
            if (ptr == IntPtr.Zero)
                return null;

            return new CVPixelBuffer (ptr, true);
        }
Example #2
0
		static void DecompressionCallback (IntPtr outputCallbackClosure, IntPtr sourceFrame, VTStatus status, 
			VTDecodeInfoFlags infoFlags, IntPtr imageBufferPtr, CMTime presentationTimeStamp, CMTime presentationDuration)
		{
			var gch = GCHandle.FromIntPtr (outputCallbackClosure);
			var func = (VTDecompressionOutputCallback) gch.Target;

			// Apple headers states that the callback should get a CVImageBuffer but it turned out that not all of them are a
			// CVImageBuffer, some can be instances of CVImageBuffer and others can be instances of CVPixelBuffer. So we go one 
			// step further in the inheritance hierarchy and supply the callback a CVPixelBuffer and the callback supplies 
			// to the developer a CVImageBuffer, so the developer can choose when to use one or the other and we mimic
			// what Apple provides on its headers.
			using (var sampleBuffer = new CVPixelBuffer (imageBufferPtr)) {
				func (sourceFrame, status, infoFlags, sampleBuffer, presentationTimeStamp, presentationDuration);
			}
		}
Example #3
0
 extern static /* Float64 */ double CMTimeGetSeconds(CMTime time);
Example #4
0
 public static CMTime Subtract(CMTime minuend, CMTime subtraend)
 {
     return(CMTimeSubtract(minuend, subtraend));
 }
Example #5
0
		public VTStatus CompleteFrames (CMTime completeUntilPresentationTimeStamp)
		{
			if (Handle == IntPtr.Zero)
				throw new ObjectDisposedException ("CompressionSession");
			return VTCompressionSessionCompleteFrames (Handle, completeUntilPresentationTimeStamp);
		}
Example #6
0
 public static CMTime Multiply(CMTime time, int multiplier, int divisor)
 {
     return CMTimeMultiplyByRatio (time, multiplier, divisor);
 }
Example #7
0
		extern static /* OSStatus */ CMSampleBufferError CMSampleBufferSetOutputPresentationTimeStamp (/* CMSampleBufferRef */ IntPtr sbuf, CMTime outputPresentationTimeStamp);
Example #8
0
 static extern CMTime CMTimeMultiply(CMTime time, /* int32_t */ int multiplier);
Example #9
0
 public static int Compare(CMTime time1, CMTime time2)
 {
     return CMTimeCompare (time1, time2);
 }
Example #10
0
 static extern CMTime CMTimeAbsoluteValue(CMTime time);
Example #11
0
 static extern IntPtr CMTimeCopyAsDictionary(CMTime time, /* CFAllocatorRef */ IntPtr allocator);
Example #12
0
 public static CMTime Multiply(CMTime time, int multiplier, int divisor)
 {
     return(CMTimeMultiplyByRatio(time, multiplier, divisor));
 }
Example #13
0
 extern static CMTime CMTimeConvertScale(CMTime time, /* int32_t */ int newScale, CMTimeRoundingMethod method);
Example #14
0
 extern static CMTime CMTimeMultiplyByRatio(CMTime time, /* int32_t */ int multiplier, /* int32_t */ int divisor);
Example #15
0
 public static CMTime Multiply(CMTime time, double multiplier)
 {
     return(CMTimeMultiplyByFloat64(time, multiplier));
 }
Example #16
0
 extern static CMTime CMTimeMultiplyByFloat64(CMTime time, /* Float64 */ double multiplier);
Example #17
0
 public static CMTime Multiply(CMTime time, int multiplier)
 {
     return(CMTimeMultiply(time, multiplier));
 }
Example #18
0
 extern static CMTime CMTimeMultiply(CMTime time, /* int32_t */ int multiplier);
Example #19
0
 static extern int CMTimeCompare(CMTime time1, CMTime time2);
Example #20
0
 extern static CMTime CMTimeMinimum(CMTime time1, CMTime time2);
Example #21
0
 static extern double CMTimeGetSeconds(CMTime time);
Example #22
0
 public static CMTime GetMinimum(CMTime time1, CMTime time2)
 {
     return(CMTimeMinimum(time1, time2));
 }
Example #23
0
 static extern CMTime CMTimeMultiplyByRatio(CMTime time, /* int32_t */ int multiplier, /* int32_t */ int divisor);
Example #24
0
 extern static /* CFDictionaryRef */ IntPtr CMTimeCopyAsDictionary(CMTime time, /* CFAllocatorRef */ IntPtr allocator);
Example #25
0
 public static CMTime Multiply(CMTime time, int multiplier)
 {
     return CMTimeMultiply (time, multiplier);
 }
Example #26
0
 extern static /* CFStringRef */ IntPtr CMTimeCopyDescription(/* CFAllocatorRef */ IntPtr allocator, CMTime time);
Example #27
0
 public virtual bool InsertTimeRanges(NSValue cmTimeRanges, AVAssetTrack[] tracks, CMTime startTime, out NSError error)
 {
     return InsertTimeRanges (new NSValue [] { cmTimeRanges }, tracks, startTime, out error);
 }
Example #28
0
 public extern static /* uint64_t */ ulong ConvertHostTimeToSystemUnits(CMTime hostTime);
Example #29
0
		extern static /* OSStatus */ CMSampleBufferError CMAudioSampleBufferCreateReadyWithPacketDescriptions (
			/* CFAllocatorRef */ IntPtr allocator,
			/* CMBlockBufferRef */ IntPtr dataBuffer,
			/* CMFormatDescriptionRef */ IntPtr formatDescription,
			/* CMItemCount */ nint numSamples,
			CMTime sbufPTS,
			/* AudioStreamPacketDescription* */ AudioStreamPacketDescription[] packetDescriptions,
			/* CMSampleBufferRef* */ out IntPtr sBufOut);
Example #30
0
 extern static /* OSStatus */ CMTimebaseError CMTimebaseSetTime(/* CMTimebaseRef */ IntPtr timebase, CMTime time);
Example #31
0
		extern static VTStatus VTCompressionSessionCompleteFrames (IntPtr session, CMTime completeUntilPresentationTimeStamp);
Example #32
0
 extern static /* OSStatus */ CMTimebaseError CMTimebaseSetAnchorTime(/* CMTimebaseRef */ IntPtr timebase, CMTime timebaseTime, CMTime immediateMasterTime);
Example #33
0
		static unsafe void VTDecompressionOutputHandlerTrampoline (BlockLiteral *block,
			VTStatus status, VTDecodeInfoFlags infoFlags, IntPtr imageBuffer,
			CMTime presentationTimeStamp, CMTime presentationDuration)
		{
			var del = (VTDecompressionOutputHandler)(block->Target);
			if (del != null)
				del (status, infoFlags, new CVImageBuffer (imageBuffer), presentationTimeStamp, presentationDuration);
		}
Example #34
0
 public CMTimebaseError SetAnchorTime(CMTime timebaseTime, CMTime immediateMasterTime)
 {
     return(CMTimebaseSetAnchorTime(Handle, timebaseTime, immediateMasterTime));
 }
Example #35
0
 public static CMTime Add(CMTime time1, CMTime time2)
 {
     return CMTimeAdd (time1, time2);
 }
Example #36
0
 extern static /* OSStatus */ CMTimebaseError CMTimebaseGetTimeAndRate(/* CMTimebaseRef */ IntPtr timebase, out CMTime time, /* Float64* */ out double rate);
Example #37
0
 static extern CMTime CMTimeAdd(CMTime addend1, CMTime addend2);
Example #38
0
 public CMTimebaseError GetTimeAndRate(out CMTime time, out double rate)
 {
     return(CMTimebaseGetTimeAndRate(Handle, out time, out rate));
 }
Example #39
0
 static extern CMTime CMTimeConvertScale(CMTime time, /* int32_t */ int newScale, CMTimeRoundingMethod method);
Example #40
0
 extern static /* OSStatus */ CMTimebaseError CMTimebaseSetRateAndAnchorTime(/* CMTimebaseRef */ IntPtr timebase, /* Float64 */ double rate, CMTime timebaseTime, CMTime immediateMasterTime);
Example #41
0
 static extern IntPtr CMTimeCopyDescription(/* CFAllocatorRef */ IntPtr allocator, CMTime time);
Example #42
0
 public CMTimebaseError SetRateAndAnchorTime(double rate, CMTime timebaseTime, CMTime immediateMasterTime)
 {
     return(CMTimebaseSetRateAndAnchorTime(Handle, rate, timebaseTime, immediateMasterTime));
 }
Example #43
0
 static extern CMTime CMTimeMinimum(CMTime time1, CMTime time2);
Example #44
0
 extern static /* OSStatus */ CMTimebaseError CMTimebaseSetTimerNextFireTime(/* CMTimebaseRef */ IntPtr timebase, /* CFRunLoopTimerRef */ IntPtr timer, CMTime fireTime, /* uint32_t */ uint flags);
Example #45
0
 static extern CMTime CMTimeMultiplyByFloat64(CMTime time, /* Float64 */ double multiplier);
Example #46
0
 extern static /* OSStatus */ CMSyncError CMSyncGetRelativeRateAndAnchorTime(
     /* CMClockOrTimebaseRef */ IntPtr ofClockOrTimebase,
     /* CMClockOrTimebaseRef */ IntPtr relativeToClockOrTimebase,
     /* Float64* */ out double outRelativeRate,
     out CMTime outOfClockOrTimebaseAnchorTime,
     out CMTime outRelativeToClockOrTimebaseAnchorTime);
Example #47
0
 static extern CMTime CMTimeSubtract(CMTime minuend, CMTime subtrahend);
Example #48
0
        public static CMSyncError GetRelativeRateAndAnchorTime(CMClockOrTimebase clockOrTimebaseA, CMClockOrTimebase clockOrTimebaseB, out double relativeRate, out CMTime timeA, out CMTime timeB)
        {
            if (clockOrTimebaseA == null)
            {
                throw new ArgumentNullException("clockOrTimebaseA");
            }

            if (clockOrTimebaseB == null)
            {
                throw new ArgumentNullException("clockOrTimebaseB");
            }

            return(CMSyncGetRelativeRateAndAnchorTime(clockOrTimebaseA.Handle, clockOrTimebaseB.handle, out relativeRate, out timeA, out timeB));
        }
Example #49
0
 public static CMTime GetMinimum(CMTime time1, CMTime time2)
 {
     return CMTimeMinimum (time1, time2);
 }
Example #50
0
 extern static CMTime CMSyncConvertTime(CMTime time, /* CMClockOrTimebaseRef */ IntPtr fromClockOrTimebase, /* CMClockOrTimebaseRef */ IntPtr toClockOrTimebase);
Example #51
0
 public static CMTime Multiply(CMTime time, double multiplier)
 {
     return CMTimeMultiplyByFloat64 (time, multiplier);
 }
Example #52
0
 extern static /* OSStatus */ CMClockError CMClockGetAnchorTime(/* CMClockRef */ IntPtr clock, out CMTime outClockTime, out CMTime outReferenceClockTime);
Example #53
0
 public static CMTime Subtract(CMTime minuend, CMTime subtraend)
 {
     return CMTimeSubtract (minuend, subtraend);
 }
Example #54
0
 public CMClockError GetAnchorTime(out CMTime clockTime, out CMTime referenceClockTime)
 {
     return(CMClockGetAnchorTime(Handle, out clockTime, out referenceClockTime));
 }
Example #55
0
		extern static CMSampleBufferError CMAudioSampleBufferCreateWithPacketDescriptions (
			/* CFAllocatorRef */ IntPtr allocator,
			/* CMBlockBufferRef */ IntPtr dataBuffer,
			/* Boolean */ bool dataReady,
			/* CMSampleBufferMakeDataReadyCallback */ IntPtr makeDataReadyCallback,
			/* void */ IntPtr makeDataReadyRefcon,
			/* CMFormatDescriptionRef */ IntPtr formatDescription,
			/* CMItemCount */ nint numSamples,
			CMTime sbufPTS,
			/* AudioStreamPacketDescription* */ AudioStreamPacketDescription[] packetDescriptions,
			/* CMSampleBufferRef* */ out IntPtr sBufOut);
Example #56
0
 extern static /* OSStatus */ CMSampleBufferError CMSampleBufferSetOutputPresentationTimeStamp(/* CMSampleBufferRef */ IntPtr sbuf, CMTime outputPresentationTimeStamp);
Example #57
0
		public int SetOutputPresentationTimeStamp (CMTime outputPresentationTimeStamp)
		{
			return (int)CMSampleBufferSetOutputPresentationTimeStamp (handle, outputPresentationTimeStamp);
		}
Example #58
0
 public int SetOutputPresentationTimeStamp(CMTime outputPresentationTimeStamp)
 {
     return((int)CMSampleBufferSetOutputPresentationTimeStamp(handle, outputPresentationTimeStamp));
 }
Example #59
0
		public static CMSampleBuffer CreateReadyWithPacketDescriptions (CMBlockBuffer dataBuffer, CMFormatDescription formatDescription, int samplesCount,
			CMTime sampleTimestamp, AudioStreamPacketDescription[] packetDescriptions, out CMSampleBufferError error)
		{
			if (dataBuffer == null)
				throw new ArgumentNullException ("dataBuffer");
			if (formatDescription == null)
				throw new ArgumentNullException ("formatDescription");
			if (samplesCount <= 0)
				throw new ArgumentOutOfRangeException ("samplesCount");

			IntPtr buffer;
			error = CMAudioSampleBufferCreateReadyWithPacketDescriptions (IntPtr.Zero, dataBuffer.handle,
				formatDescription.handle, samplesCount, sampleTimestamp, packetDescriptions, out buffer);

			if (error != CMSampleBufferError.None)
				return null;

			return new CMSampleBuffer (buffer, true);
		}
Example #60
0
 extern static CMTime CMTimeSubtract(CMTime minuend, CMTime subtrahend);