PageRenderTime 53ms CodeModel.GetById 16ms RepoModel.GetById 0ms app.codeStats 1ms

/src/avfoundation.cs

https://github.com/kjpou1/maccore
C# | 4350 lines | 3143 code | 1130 blank | 77 comment | 0 complexity | d48d3104850950554269f19cd73a22d0 MD5 | raw file
Possible License(s): Apache-2.0

Large files files are truncated, but you can click here to view the full file

  1. //
  2. // AVFoundation.cs: This file describes the API that the generator will produce for AVFoundation
  3. //
  4. // Authors:
  5. // Miguel de Icaza
  6. // Marek Safar (marek.safar@gmail.com)
  7. //
  8. // Copyright 2009, Novell, Inc.
  9. // Copyright 2010, Novell, Inc.
  10. // Copyright 2011-2012, Xamarin, Inc.
  11. //
  12. // Permission is hereby granted, free of charge, to any person obtaining
  13. // a copy of this software and associated documentation files (the
  14. // "Software"), to deal in the Software without restriction, including
  15. // without limitation the rights to use, copy, modify, merge, publish,
  16. // distribute, sublicense, and/or sell copies of the Software, and to
  17. // permit persons to whom the Software is furnished to do so, subject to
  18. // the following conditions:
  19. //
  20. // The above copyright notice and this permission notice shall be
  21. // included in all copies or substantial portions of the Software.
  22. //
  23. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
  24. // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  25. // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
  26. // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
  27. // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
  28. // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
  29. // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  30. //
  31. using MonoMac.ObjCRuntime;
  32. using MonoMac.Foundation;
  33. using MonoMac.CoreFoundation;
  34. using MonoMac.CoreMedia;
  35. using MonoMac.CoreGraphics;
  36. using MonoMac.CoreAnimation;
  37. using MonoMac.CoreVideo;
  38. using System;
  39. using System.Drawing;
  40. #if !MONOMAC
  41. using MonoTouch.MediaToolbox;
  42. #endif
  43. namespace MonoMac.AVFoundation {
  44. delegate void AVAssetImageGeneratorCompletionHandler (CMTime requestedTime, IntPtr imageRef, CMTime actualTime, AVAssetImageGeneratorResult result, NSError error);
  45. delegate void AVCompletion (bool finished);
  46. [Since (4,0)]
  47. [BaseType (typeof (NSObject))][Static]
  48. interface AVMediaType {
  49. [Field ("AVMediaTypeVideo")]
  50. NSString Video { get; }
  51. [Field ("AVMediaTypeAudio")]
  52. NSString Audio { get; }
  53. [Field ("AVMediaTypeText")]
  54. NSString Text { get; }
  55. [Field ("AVMediaTypeClosedCaption")]
  56. NSString ClosedCaption { get; }
  57. [Field ("AVMediaTypeSubtitle")]
  58. NSString Subtitle { get; }
  59. [Field ("AVMediaTypeTimecode")]
  60. NSString Timecode { get; }
  61. [Field ("AVMediaTypeTimedMetadata")]
  62. [Obsolete ("Deprecated in iOS 6.0, see Metadata")]
  63. NSString TimedMetadata { get; }
  64. [Field ("AVMediaTypeMuxed")]
  65. NSString Muxed { get; }
  66. #if !MONOMAC
  67. [Since (6,0)]
  68. [Field ("AVMediaTypeMetadata")]
  69. NSString Metadata { get; }
  70. #endif
  71. }
  72. [Since (4,0)]
  73. [BaseType (typeof (NSObject))][Static]
  74. interface AVMediaCharacteristic {
  75. [Field ("AVMediaCharacteristicVisual")]
  76. NSString Visual { get; }
  77. [Field ("AVMediaCharacteristicAudible")]
  78. NSString Audible { get; }
  79. [Field ("AVMediaCharacteristicLegible")]
  80. NSString Legible { get; }
  81. [Field ("AVMediaCharacteristicFrameBased")]
  82. NSString FrameBased { get; }
  83. [MountainLion]
  84. [Field ("AVMediaCharacteristicIsMainProgramContent")]
  85. NSString IsMainProgramContent { get; }
  86. [MountainLion]
  87. [Field ("AVMediaCharacteristicIsAuxiliaryContent")]
  88. NSString IsAuxiliaryContent { get; }
  89. [MountainLion]
  90. [Field ("AVMediaCharacteristicContainsOnlyForcedSubtitles")]
  91. NSString ContainsOnlyForcedSubtitles { get; }
  92. [MountainLion]
  93. [Field ("AVMediaCharacteristicTranscribesSpokenDialogForAccessibility")]
  94. NSString TranscribesSpokenDialogForAccessibility { get; }
  95. [MountainLion]
  96. [Field ("AVMediaCharacteristicDescribesMusicAndSoundForAccessibility")]
  97. NSString DescribesMusicAndSoundForAccessibility { get; }
  98. [MountainLion]
  99. [Field ("AVMediaCharacteristicDescribesVideoForAccessibility")]
  100. NSString DescribesVideoForAccessibility { get; }
  101. #if !MONOMAC
  102. [Since (6,0)]
  103. [Field ("AVMediaCharacteristicEasyToRead")]
  104. NSString EasyToRead { get; }
  105. #endif
  106. }
  107. [Since (4,0)]
  108. [BaseType (typeof (NSObject))][Static]
  109. interface AVFileType {
  110. [Field ("AVFileTypeQuickTimeMovie")]
  111. NSString QuickTimeMovie { get; }
  112. [Field ("AVFileTypeMPEG4")]
  113. NSString Mpeg4 { get; }
  114. [Field ("AVFileTypeAppleM4V")]
  115. NSString AppleM4V { get; }
  116. [Field ("AVFileType3GPP")]
  117. NSString ThreeGpp { get; }
  118. [Field ("AVFileTypeAppleM4A")]
  119. NSString AppleM4A { get; }
  120. [Field ("AVFileTypeCoreAudioFormat")]
  121. NSString CoreAudioFormat { get; }
  122. [Field ("AVFileTypeWAVE")]
  123. NSString Wave { get; }
  124. [Field ("AVFileTypeAIFF")]
  125. NSString Aiff { get; }
  126. [Field ("AVFileTypeAIFC")]
  127. NSString Aifc { get; }
  128. [Field ("AVFileTypeAMR")]
  129. NSString Amr { get; }
  130. }
  131. [Since (4,0)]
  132. [BaseType (typeof (NSObject))][Static]
  133. interface AVVideo {
  134. [Field ("AVVideoCodecKey")]
  135. NSString CodecKey { get; }
  136. [Field ("AVVideoCodecH264")]
  137. NSString CodecH264 { get; }
  138. [Field ("AVVideoCodecJPEG")]
  139. NSString CodecJPEG { get; }
  140. [Field ("AVVideoWidthKey")]
  141. NSString WidthKey { get; }
  142. [Field ("AVVideoHeightKey")]
  143. NSString HeightKey { get; }
  144. [Since (5,0)]
  145. [Field ("AVVideoScalingModeKey")]
  146. NSString ScalingModeKey { get; }
  147. [Field ("AVVideoCompressionPropertiesKey")]
  148. NSString CompressionPropertiesKey { get; }
  149. [Field ("AVVideoAverageBitRateKey")]
  150. NSString AverageBitRateKey { get; }
  151. [Field ("AVVideoMaxKeyFrameIntervalKey")]
  152. NSString MaxKeyFrameIntervalKey { get; }
  153. [Field ("AVVideoProfileLevelKey")]
  154. NSString ProfileLevelKey { get; }
  155. [Since (5,0)]
  156. [Field ("AVVideoQualityKey")]
  157. NSString QualityKey { get; }
  158. [Field ("AVVideoProfileLevelH264Baseline30")]
  159. NSString ProfileLevelH264Baseline30 { get; }
  160. [Field ("AVVideoProfileLevelH264Baseline31")]
  161. NSString ProfileLevelH264Baseline31 { get; }
  162. [Field ("AVVideoProfileLevelH264Main30")]
  163. NSString ProfileLevelH264Main30 { get; }
  164. [Field ("AVVideoProfileLevelH264Main31")]
  165. NSString ProfileLevelH264Main31 { get; }
  166. [Since (5,0)]
  167. [Field ("AVVideoProfileLevelH264Baseline41")]
  168. NSString ProfileLevelH264Baseline41 { get; }
  169. [Since (5,0)][MountainLion]
  170. [Field ("AVVideoProfileLevelH264Main32")]
  171. NSString ProfileLevelH264Main32 { get; }
  172. [Since (5,0)]
  173. [Field ("AVVideoProfileLevelH264Main41")]
  174. NSString ProfileLevelH264Main41 { get; }
  175. #if !MONOMAC
  176. [Since (6,0)]
  177. [Field ("AVVideoProfileLevelH264High40")]
  178. NSString ProfileLevelH264High40 { get; }
  179. [Since (6,0)]
  180. [Field ("AVVideoProfileLevelH264High41")]
  181. NSString ProfileLevelH264High41 { get; }
  182. #endif
  183. [Field ("AVVideoPixelAspectRatioKey")]
  184. NSString PixelAspectRatioKey { get; }
  185. [Field ("AVVideoPixelAspectRatioHorizontalSpacingKey")]
  186. NSString PixelAspectRatioHorizontalSpacingKey { get; }
  187. [Field ("AVVideoPixelAspectRatioVerticalSpacingKey")]
  188. NSString PixelAspectRatioVerticalSpacingKey { get; }
  189. [Field ("AVVideoCleanApertureKey")]
  190. NSString CleanApertureKey { get; }
  191. [Field ("AVVideoCleanApertureWidthKey")]
  192. NSString CleanApertureWidthKey { get; }
  193. [Field ("AVVideoCleanApertureHeightKey")]
  194. NSString CleanApertureHeightKey { get; }
  195. [Field ("AVVideoCleanApertureHorizontalOffsetKey")]
  196. NSString CleanApertureHorizontalOffsetKey { get; }
  197. [Field ("AVVideoCleanApertureVerticalOffsetKey")]
  198. NSString CleanApertureVerticalOffsetKey { get; }
  199. }
  200. [Since (5,0)]
  201. [Static]
  202. interface AVVideoScalingModeKey
  203. {
  204. [Field ("AVVideoScalingModeFit")]
  205. NSString Fit { get; }
  206. [Field ("AVVideoScalingModeResize")]
  207. NSString Resize { get; }
  208. [Field ("AVVideoScalingModeResizeAspect")]
  209. NSString ResizeAspect { get; }
  210. [Field ("AVVideoScalingModeResizeAspectFill")]
  211. NSString ResizeAspectFill { get; }
  212. }
  213. [BaseType (typeof (NSObject))]
  214. [DisableDefaultCtor]
  215. interface AVAudioPlayer {
  216. [Export ("initWithContentsOfURL:error:")][Internal]
  217. IntPtr Constructor (NSUrl url, IntPtr outError);
  218. [Export ("initWithData:error:")][Internal]
  219. IntPtr Constructor (NSData data, IntPtr outError);
  220. [Export ("prepareToPlay")]
  221. bool PrepareToPlay ();
  222. [Export ("play")]
  223. bool Play ();
  224. [Export ("pause")]
  225. void Pause ();
  226. [Export ("stop")]
  227. void Stop ();
  228. [Export ("playing")]
  229. bool Playing { [Bind ("isPlaying")] get; }
  230. [Export ("numberOfChannels")]
  231. uint NumberOfChannels { get; }
  232. [Export ("duration")]
  233. double Duration { get; }
  234. [Export ("delegate", ArgumentSemantic.Assign)]
  235. NSObject WeakDelegate { get; set; }
  236. [Wrap ("WeakDelegate")]
  237. AVAudioPlayerDelegate Delegate { get; set; }
  238. [Export ("url")]
  239. NSUrl Url { get; }
  240. [Export ("data")]
  241. NSData Data { get; }
  242. [Export ("volume")]
  243. float Volume { get; set; }
  244. [Export ("currentTime")]
  245. double CurrentTime { get; set; }
  246. [Export ("numberOfLoops")]
  247. int NumberOfLoops { get; set; }
  248. [Export ("meteringEnabled")]
  249. bool MeteringEnabled { [Bind ("isMeteringEnabled")] get; set; }
  250. [Export ("updateMeters")]
  251. void UpdateMeters ();
  252. [Export ("peakPowerForChannel:")]
  253. float PeakPower (uint channelNumber);
  254. [Export ("averagePowerForChannel:")]
  255. float AveragePower (uint channelNumber);
  256. [Since (4,0)]
  257. [Export ("deviceCurrentTime")]
  258. double DeviceCurrentTime { get; }
  259. [Since (4,0)]
  260. [Export ("pan")]
  261. float Pan { get; set; }
  262. [Since (4,0)]
  263. [Export ("playAtTime:")]
  264. bool PlayAtTime (double time);
  265. [Since (4,0)]
  266. [Export ("settings")][Protected]
  267. NSDictionary WeakSettings { get; }
  268. [Wrap ("WeakSettings")]
  269. AudioSettings SoundSetting { get; }
  270. [Since (5,0)]
  271. [Export ("enableRate")]
  272. bool EnableRate { get; set; }
  273. [Since (5,0)]
  274. [Export ("rate")]
  275. float Rate { get; set; }
  276. #if !MONOMAC
  277. [Since (6,0)]
  278. [Export ("channelAssignments")]
  279. AVAudioSessionChannelDescription [] ChannelAssignments { get; set; }
  280. #endif
  281. }
  282. [BaseType (typeof (NSObject))]
  283. [Model]
  284. [Protocol]
  285. interface AVAudioPlayerDelegate {
  286. [Export ("audioPlayerDidFinishPlaying:successfully:"), CheckDisposed]
  287. void FinishedPlaying (AVAudioPlayer player, bool flag);
  288. [Export ("audioPlayerDecodeErrorDidOccur:error:")]
  289. void DecoderError (AVAudioPlayer player, NSError error);
  290. #if !MONOMAC
  291. [Export ("audioPlayerBeginInterruption:")]
  292. void BeginInterruption (AVAudioPlayer player);
  293. [Export ("audioPlayerEndInterruption:")]
  294. [Obsolete ("Deprecated in iOS 6.0")]
  295. void EndInterruption (AVAudioPlayer player);
  296. // Deprecated in iOS 6.0 but we have same C# signature
  297. [Since (4,0)]
  298. [Export ("audioPlayerEndInterruption:withFlags:")]
  299. void EndInterruption (AVAudioPlayer player, AVAudioSessionInterruptionFlags flags);
  300. //[Since (6,0)]
  301. //[Export ("audioPlayerEndInterruption:withOptions:")]
  302. //void EndInterruption (AVAudioPlayer player, AVAudioSessionInterruptionFlags flags);
  303. #endif
  304. }
  305. [BaseType (typeof (NSObject))]
  306. interface AVAudioRecorder {
  307. [Export ("initWithURL:settings:error:")][Internal]
  308. IntPtr Constructor (NSUrl url, NSDictionary settings, IntPtr outError);
  309. [Export ("prepareToRecord")]
  310. bool PrepareToRecord ();
  311. [Export ("record")]
  312. bool Record ();
  313. [Export ("recordForDuration:")]
  314. bool RecordFor (double duration);
  315. [Export ("pause")]
  316. void Pause ();
  317. [Export ("stop")]
  318. void Stop ();
  319. [Export ("deleteRecording")]
  320. bool DeleteRecording ();
  321. [Export ("recording")]
  322. bool Recording { [Bind ("isRecording")] get; }
  323. [Export ("url")]
  324. NSUrl Url { get; }
  325. [Advice ("Use AudioSettings")]
  326. [Export ("settings")]
  327. NSDictionary Settings { get; }
  328. [Wrap ("Settings")]
  329. AudioSettings AudioSettings { get; }
  330. [Export ("delegate")]
  331. NSObject WeakDelegate { get; set; }
  332. [Wrap ("WeakDelegate")]
  333. AVAudioRecorderDelegate Delegate { get; set; }
  334. [Export ("currentTime")]
  335. double currentTime { get; }
  336. [Export ("meteringEnabled")]
  337. bool MeteringEnabled { [Bind ("isMeteringEnabled")] get; set; }
  338. [Export ("updateMeters")]
  339. void UpdateMeters ();
  340. [Export ("peakPowerForChannel:")]
  341. float PeakPower (uint channelNumber);
  342. [Export ("averagePowerForChannel:")]
  343. float AveragePower (uint channelNumber);
  344. #if !MONOMAC
  345. [Since (6,0)]
  346. [Export ("channelAssignments")]
  347. AVAudioSessionChannelDescription [] ChannelAssignments { get; set; }
  348. [Since (6,0)]
  349. [Export ("recordAtTime:")]
  350. bool RecordAt (double time);
  351. [Since (6,0)]
  352. [Export ("recordAtTime:forDuration:")]
  353. bool RecordAt (double time, double duration);
  354. [Since (6,0)]
  355. [Export ("deviceCurrentTime")]
  356. double DeviceCurrentTime { get; }
  357. #endif
  358. }
  359. [BaseType (typeof (NSObject))]
  360. [Model]
  361. [Protocol]
  362. interface AVAudioRecorderDelegate {
  363. [Export ("audioRecorderDidFinishRecording:successfully:"), CheckDisposed]
  364. void FinishedRecording (AVAudioRecorder recorder, bool flag);
  365. [Export ("audioRecorderEncodeErrorDidOccur:error:")]
  366. void EncoderError (AVAudioRecorder recorder, NSError error);
  367. #if !MONOMAC
  368. [Export ("audioRecorderBeginInterruption:")]
  369. void BeginInterruption (AVAudioRecorder recorder);
  370. [Obsolete ("Deprecated in iOS 6.0")]
  371. [Export ("audioRecorderEndInterruption:")]
  372. void EndInterruption (AVAudioRecorder recorder);
  373. // Deprecated in iOS 6.0 but we have same C# signature
  374. [Since (4,0)]
  375. [Export ("audioRecorderEndInterruption:withFlags:")]
  376. void EndInterruption (AVAudioRecorder recorder, AVAudioSessionInterruptionFlags flags);
  377. //[Since (6,0)]
  378. //[Export ("audioRecorderEndInterruption:withOptions:")]
  379. //void EndInterruption (AVAudioRecorder recorder, AVAudioSessionInterruptionFlags flags);
  380. #endif
  381. }
  382. #if !MONOMAC
  383. [BaseType (typeof (NSObject))]
  384. interface AVAudioSession {
  385. [Export ("sharedInstance"), Static]
  386. AVAudioSession SharedInstance ();
  387. [Export ("delegate")]
  388. NSObject WeakDelegate { get; set; }
  389. [Wrap ("WeakDelegate")]
  390. [Obsolete ("Deprecated in iOS 6.0. Use AVAudioSession.Notification.Observe* methods instead")]
  391. AVAudioSessionDelegate Delegate { get; set; }
  392. [Export ("setActive:error:")]
  393. bool SetActive (bool beActive, out NSError outError);
  394. [Since (4,0)]
  395. [Export ("setActive:withFlags:error:")]
  396. [Obsolete ("Deprecated in iOS 6.0. Use SetActive (bool, AVAudioSessionSetActiveOptions, out NSError) instead")]
  397. bool SetActive (bool beActive, AVAudioSessionFlags flags, out NSError outError);
  398. [Export ("setCategory:error:")]
  399. bool SetCategory (NSString theCategory, out NSError outError);
  400. [Obsolete ("Deprecated in iOS 6.0, use SetPreferredSampleRate")]
  401. [Export ("setPreferredHardwareSampleRate:error:")]
  402. bool SetPreferredHardwareSampleRate (double sampleRate, out NSError outError);
  403. [Export ("setPreferredIOBufferDuration:error:")]
  404. bool SetPreferredIOBufferDuration (double duration, out NSError outError);
  405. [Export ("category")]
  406. NSString Category { get; }
  407. [Export ("mode")]
  408. NSString Mode { get; }
  409. [Export ("setMode:error:")]
  410. bool SetMode (NSString mode, out NSError error);
  411. [Export ("preferredHardwareSampleRate")]
  412. [Obsolete ("Deprecated in iOS 6.0")]
  413. double PreferredHardwareSampleRate { get; }
  414. [Export ("preferredIOBufferDuration")]
  415. double PreferredIOBufferDuration { get; }
  416. [Export ("inputIsAvailable")]
  417. [Obsolete ("Deprecated in iOS 6.0")]
  418. bool InputIsAvailable { get; }
  419. [Export ("currentHardwareSampleRate")]
  420. [Obsolete ("Deprecated in iOS 6.0, use SampleRate instead")]
  421. double CurrentHardwareSampleRate { get; }
  422. [Export ("currentHardwareInputNumberOfChannels")]
  423. [Obsolete ("Deprecated in iOS 6.0, use InputNumberOfChannels instead")]
  424. int CurrentHardwareInputNumberOfChannels { get; }
  425. [Export ("currentHardwareOutputNumberOfChannels")]
  426. [Obsolete ("Deprecated in iOS 6.0, use OutputNumberOfChannels instead")]
  427. int CurrentHardwareOutputNumberOfChannels { get; }
  428. [Field ("AVAudioSessionCategoryAmbient")]
  429. NSString CategoryAmbient { get; }
  430. [Field ("AVAudioSessionCategorySoloAmbient")]
  431. NSString CategorySoloAmbient { get; }
  432. [Field ("AVAudioSessionCategoryPlayback")]
  433. NSString CategoryPlayback { get; }
  434. [Field ("AVAudioSessionCategoryRecord")]
  435. NSString CategoryRecord { get; }
  436. [Field ("AVAudioSessionCategoryPlayAndRecord")]
  437. NSString CategoryPlayAndRecord { get; }
  438. [Field ("AVAudioSessionCategoryAudioProcessing")]
  439. NSString CategoryAudioProcessing { get; }
  440. [Field ("AVAudioSessionModeDefault")]
  441. NSString ModeDefault { get; }
  442. [Field ("AVAudioSessionModeVoiceChat")]
  443. NSString ModeVoiceChat { get; }
  444. [Field ("AVAudioSessionModeVideoRecording")]
  445. NSString ModeVideoRecording { get; }
  446. [Field ("AVAudioSessionModeMeasurement")]
  447. NSString ModeMeasurement { get; }
  448. [Field ("AVAudioSessionModeGameChat")]
  449. NSString ModeGameChat { get; }
  450. [Since (6,0)]
  451. [Export ("setActive:withOptions:error:")]
  452. bool SetActive (bool active, AVAudioSessionSetActiveOptions options, out NSError outError);
  453. [Since (6,0)]
  454. [Export ("setCategory:withOptions:error:")]
  455. bool SetCategory (string category, AVAudioSessionCategoryOptions options, out NSError outError);
  456. [Since (6,0)]
  457. [Export ("categoryOptions")]
  458. AVAudioSessionCategoryOptions CategoryOptions { get; }
  459. [Since (6,0)]
  460. [Export ("overrideOutputAudioPort:error:")]
  461. bool OverrideOutputAudioPort (AVAudioSessionPortOverride portOverride, out NSError outError);
  462. [Since (6,0)]
  463. [Export ("otherAudioPlaying")]
  464. bool OtherAudioPlaying { [Bind ("isOtherAudioPlaying")] get; }
  465. [Since (6,0)]
  466. [Export ("currentRoute")]
  467. AVAudioSessionRouteDescription CurrentRoute { get; }
  468. [Since (6,0)]
  469. [Export ("setPreferredSampleRate:error:")]
  470. bool SetPreferredSampleRate (double sampleRate, out NSError error);
  471. [Since (6,0)]
  472. [Export ("preferredSampleRate")]
  473. double PreferredSampleRate { get; }
  474. [Since (6,0)]
  475. [Export ("inputGain")]
  476. float InputGain { get; }
  477. [Since (6,0)]
  478. [Export ("inputGainSettable")]
  479. bool InputGainSettable { [Bind ("isInputGainSettable")] get; }
  480. [Since (6,0)]
  481. [Export ("inputAvailable")]
  482. bool InputAvailable { [Bind ("isInputAvailable")] get; }
  483. [Since (6,0)]
  484. [Export ("sampleRate")]
  485. double SampleRate { get; }
  486. [Since (6,0)]
  487. [Export ("inputNumberOfChannels")]
  488. int InputNumberOfChannels { get; }
  489. [Since (6,0)]
  490. [Export ("outputNumberOfChannels")]
  491. int OutputNumberOfChannels { get; }
  492. [Since (6,0)]
  493. [Export ("outputVolume")]
  494. float OutputVolume { get; }
  495. [Since (6,0)]
  496. [Export ("inputLatency")]
  497. double InputLatency { get; }
  498. [Since (6,0)]
  499. [Export ("outputLatency")]
  500. double OutputLatency { get; }
  501. [Since (6,0)]
  502. [Export ("IOBufferDuration")]
  503. double IOBufferDuration { get; }
  504. [Since (6,0)]
  505. [Export ("setInputGain:error:")]
  506. bool SetInputGain (float gain, out NSError outError);
  507. [Since (6,0)]
  508. [Field ("AVAudioSessionInterruptionNotification")]
  509. [Notification (typeof (AVAudioSessionInterruptionEventArgs))]
  510. NSString InterruptionNotification { get; }
  511. [Since (6,0)]
  512. [Field ("AVAudioSessionRouteChangeNotification")]
  513. [Notification (typeof (AVAudioSessionRouteChangeEventArgs))]
  514. NSString RouteChangeNotification { get; }
  515. [Since (6,0)]
  516. [Field ("AVAudioSessionMediaServicesWereResetNotification")]
  517. [Notification]
  518. NSString MediaServicesWereResetNotification { get; }
  519. [Since (6,0)]
  520. [Field ("AVAudioSessionCategoryMultiRoute")]
  521. NSString CategoryMultiRoute { get; }
  522. [Since (6,0)]
  523. [Field ("AVAudioSessionModeMoviePlayback")]
  524. NSString ModeMoviePlayback { get; }
  525. [Since (6,0)]
  526. [Field ("AVAudioSessionPortLineIn")]
  527. NSString PortLineIn { get; }
  528. [Since (6,0)]
  529. [Field ("AVAudioSessionPortBuiltInMic")]
  530. NSString PortBuiltInMic { get; }
  531. [Since (6,0)]
  532. [Field ("AVAudioSessionPortHeadsetMic")]
  533. NSString PortHeadsetMic { get; }
  534. [Since (6,0)]
  535. [Field ("AVAudioSessionPortLineOut")]
  536. NSString PortLineOut { get; }
  537. [Since (6,0)]
  538. [Field ("AVAudioSessionPortHeadphones")]
  539. NSString PortHeadphones { get; }
  540. [Since (6,0)]
  541. [Field ("AVAudioSessionPortBluetoothA2DP")]
  542. NSString PortBluetoothA2DP { get; }
  543. [Since (6,0)]
  544. [Field ("AVAudioSessionPortBuiltInReceiver")]
  545. NSString PortBuiltInReceiver { get; }
  546. [Since (6,0)]
  547. [Field ("AVAudioSessionPortBuiltInSpeaker")]
  548. NSString PortBuiltInSpeaker { get; }
  549. [Since (6,0)]
  550. [Field ("AVAudioSessionPortHDMI")]
  551. NSString PortHdmi { get; }
  552. [Since (6,0)]
  553. [Field ("AVAudioSessionPortAirPlay")]
  554. NSString PortAirPlay { get; }
  555. [Since (6,0)]
  556. [Field ("AVAudioSessionPortBluetoothHFP")]
  557. NSString PortBluetoothHfp { get; }
  558. [Since (6,0)]
  559. [Field ("AVAudioSessionPortUSBAudio")]
  560. NSString PortUsbAudio { get; }
  561. [Since (6,0)]
  562. [Export ("inputDataSources")]
  563. AVAudioSessionDataSourceDescription [] InputDataSources { get; }
  564. [Since (6,0)]
  565. [Export ("inputDataSource")]
  566. AVAudioSessionDataSourceDescription InputDataSource { get; }
  567. [Since (6,0)]
  568. [Export ("outputDataSources")]
  569. AVAudioSessionDataSourceDescription [] OutputDataSources { get; }
  570. [Since (6,0)]
  571. [Export ("outputDataSource")]
  572. AVAudioSessionDataSourceDescription OutputDataSource { get; }
  573. [Since (6,0)]
  574. [Export ("setInputDataSource:error:")]
  575. [PostGet ("InputDataSource")]
  576. bool SetInputDataSource (AVAudioSessionDataSourceDescription dataSource, out NSError outError);
  577. [Since (6,0)]
  578. [Export ("setOutputDataSource:error:")]
  579. [PostGet ("OutputDataSource")]
  580. bool SetOutputDataSource (AVAudioSessionDataSourceDescription dataSource, out NSError outError);
  581. }
  582. [Since (6,0)]
  583. [BaseType (typeof (NSObject))]
  584. interface AVAudioSessionDataSourceDescription {
  585. [Export ("dataSourceID")]
  586. NSNumber DataSourceID { get; }
  587. [Export ("dataSourceName")]
  588. string DataSourceName { get; }
  589. }
  590. interface AVAudioSessionInterruptionEventArgs {
  591. [Export ("AVAudioSessionInterruptionTypeKey")]
  592. AVAudioSessionInterruptionType InterruptionType { get; }
  593. [Export ("AVAudioSessionInterruptionOptionKey")]
  594. AVAudioSessionInterruptionOptions Option { get; }
  595. }
  596. interface AVAudioSessionRouteChangeEventArgs {
  597. [Export ("AVAudioSessionRouteChangeReasonKey")]
  598. AVAudioSessionRouteChangeReason Reason { get; }
  599. [Export ("AVAudioSessionRouteChangePreviousRouteKey")]
  600. AVAudioSessionRouteDescription PreviousRoute { get; }
  601. }
  602. [BaseType (typeof (NSObject))]
  603. [Model]
  604. [Protocol]
  605. interface AVAudioSessionDelegate {
  606. [Export ("beginInterruption")]
  607. void BeginInterruption ();
  608. [Export ("endInterruption")]
  609. void EndInterruption ();
  610. [Export ("inputIsAvailableChanged:")]
  611. void InputIsAvailableChanged (bool isInputAvailable);
  612. [Since (4,0)]
  613. [Export ("endInterruptionWithFlags:")]
  614. void EndInterruption (AVAudioSessionInterruptionFlags flags);
  615. }
  616. [Since (6,0)]
  617. [BaseType (typeof (NSObject))]
  618. interface AVAudioSessionChannelDescription {
  619. [Export ("channelName")]
  620. string ChannelName { get; }
  621. [Export ("owningPortUID")]
  622. string OwningPortUID { get; }
  623. [Export ("channelNumber")]
  624. int ChannelNumber { get; }
  625. }
  626. [Since (6,0)]
  627. [BaseType (typeof (NSObject))]
  628. interface AVAudioSessionPortDescription {
  629. [Export ("portType")]
  630. NSString PortType { get; }
  631. [Export ("portName")]
  632. string PortName { get; }
  633. [Export ("UID")]
  634. string UID { get; }
  635. [Export ("channels")]
  636. AVAudioSessionChannelDescription [] Channels { get; }
  637. }
  638. [Since (6,0)]
  639. [BaseType (typeof (NSObject))]
  640. interface AVAudioSessionRouteDescription {
  641. [Export ("inputs")]
  642. AVAudioSessionPortDescription [] Inputs { get; }
  643. [Export ("outputs")]
  644. AVAudioSessionPortDescription [] Outputs { get; }
  645. }
  646. #endif
  647. [Since (4,0)]
  648. [BaseType (typeof (NSObject))]
  649. // Objective-C exception thrown. Name: NSInvalidArgumentException Reason: *** initialization method -init cannot be sent to an abstract object of class AVAsset: Create a concrete instance!
  650. [DisableDefaultCtor]
  651. interface AVAsset {
  652. [Export ("duration")]
  653. CMTime Duration { get; }
  654. [Export ("preferredRate")]
  655. float PreferredRate { get; }
  656. [Export ("preferredVolume")]
  657. float PreferredVolume { get; }
  658. [Export ("preferredTransform")]
  659. CGAffineTransform PreferredTransform { get; }
  660. [Export ("naturalSize"), Obsolete ("Deprecated in iOS 5.0. Use NaturalSize/PreferredTransform as appropriate on the video track")]
  661. SizeF NaturalSize { get; }
  662. [Export ("providesPreciseDurationAndTiming")]
  663. bool ProvidesPreciseDurationAndTiming { get; }
  664. [Export ("cancelLoading")]
  665. void CancelLoading ();
  666. [Export ("tracks")]
  667. AVAssetTrack [] Tracks { get; }
  668. [Export ("trackWithTrackID:")]
  669. AVAssetTrack TrackWithTrackID (int trackID);
  670. [Export ("tracksWithMediaType:")]
  671. AVAssetTrack [] TracksWithMediaType (string mediaType);
  672. [Export ("tracksWithMediaCharacteristic:")]
  673. AVAssetTrack [] TracksWithMediaCharacteristic (string mediaCharacteristic);
  674. [Export ("lyrics")]
  675. string Lyrics { get; }
  676. [Export ("commonMetadata")]
  677. AVMetadataItem [] CommonMetadata { get; }
  678. [Export ("availableMetadataFormats")]
  679. string [] AvailableMetadataFormats { get; }
  680. [Export ("metadataForFormat:")]
  681. AVMetadataItem [] MetadataForFormat (string format);
  682. [Since (4,2)]
  683. [Export ("hasProtectedContent")]
  684. bool ProtectedContent { get; }
  685. [Since (4,3)]
  686. [Export ("availableChapterLocales")]
  687. NSLocale [] AvailableChapterLocales { get; }
  688. [Since (4,3)]
  689. [Export ("chapterMetadataGroupsWithTitleLocale:containingItemsWithCommonKeys:")]
  690. AVMetadataItem [] ChapterMetadataGroups (NSLocale forLocale, [NullAllowed] AVMetadataItem [] commonKeys);
  691. [Since (4,3)]
  692. [Export ("isPlayable")]
  693. bool Playable { get; }
  694. [Since (4,3)]
  695. [Export ("isExportable")]
  696. bool Exportable { get; }
  697. [Since (4,3)]
  698. [Export ("isReadable")]
  699. bool Readable { get; }
  700. [Since (4,3)]
  701. [Export ("isComposable")]
  702. bool Composable { get; }
  703. // 5.0 APIs:
  704. [Since (5,0)]
  705. [Static, Export ("assetWithURL:")]
  706. AVAsset FromUrl (NSUrl url);
  707. #if !MONOMAC
  708. [Since (5,0)]
  709. [Export ("availableMediaCharacteristicsWithMediaSelectionOptions")]
  710. string [] AvailableMediaCharacteristicsWithMediaSelectionOptions { get; }
  711. [Since (5,0)]
  712. [Export ("compatibleWithSavedPhotosAlbum")]
  713. bool CompatibleWithSavedPhotosAlbum { [Bind ("isCompatibleWithSavedPhotosAlbum")] get; }
  714. [Since (5,0)]
  715. [Export ("creationDate")]
  716. AVMetadataItem CreationDate { get; }
  717. #endif
  718. [Since (5,0)]
  719. [Export ("referenceRestrictions")]
  720. AVAssetReferenceRestrictions ReferenceRestrictions { get; }
  721. #if !MONOMAC
  722. [Since (5,0)]
  723. [Export ("mediaSelectionGroupForMediaCharacteristic:")]
  724. AVMediaSelectionGroup MediaSelectionGroupForMediaCharacteristic (string avMediaCharacteristic);
  725. #endif
  726. [Export ("statusOfValueForKey:error:")]
  727. AVKeyValueStatus StatusOfValue (string key, out NSError error);
  728. [Export ("loadValuesAsynchronouslyForKeys:completionHandler:")]
  729. [Async ("LoadValuesTaskAsync")]
  730. void LoadValuesAsynchronously (string [] keys, NSAction handler);
  731. #if !MONOMAC
  732. [Since (6,0)]
  733. [Export ("chapterMetadataGroupsBestMatchingPreferredLanguages:")]
  734. AVTimedMetadataGroup [] GetChapterMetadataGroupsBestMatchingPreferredLanguages (string [] languages);
  735. #endif
  736. }
  737. [BaseType (typeof (NSObject))]
  738. // <quote>You create an asset generator using initWithAsset: or assetImageGeneratorWithAsset:</quote> http://developer.apple.com/library/ios/#documentation/AVFoundation/Reference/AVAssetImageGenerator_Class/Reference/Reference.html
  739. // calling 'init' returns a NIL handle
  740. [DisableDefaultCtor]
  741. interface AVAssetImageGenerator {
  742. [Export ("maximumSize")]
  743. SizeF MaximumSize { get; set; }
  744. [Export ("apertureMode")]
  745. NSString ApertureMode { get; set; }
  746. [Export ("videoComposition", ArgumentSemantic.Copy)]
  747. AVVideoComposition VideoComposition { get; set; }
  748. [Export ("appliesPreferredTrackTransform")]
  749. bool AppliesPreferredTrackTransform { get; set; }
  750. [Static]
  751. [Export ("assetImageGeneratorWithAsset:")]
  752. AVAssetImageGenerator FromAsset (AVAsset asset);
  753. [Export ("initWithAsset:")]
  754. IntPtr Constructor (AVAsset asset);
  755. [Export ("copyCGImageAtTime:actualTime:error:")]
  756. CGImage CopyCGImageAtTime (CMTime requestedTime, out CMTime actualTime, out NSError outError);
  757. [Export ("generateCGImagesAsynchronouslyForTimes:completionHandler:")]
  758. void GenerateCGImagesAsynchronously (NSValue[] cmTimesRequestedTimes, AVAssetImageGeneratorCompletionHandler handler);
  759. [Export ("cancelAllCGImageGeneration")]
  760. void CancelAllCGImageGeneration ();
  761. [Field ("AVAssetImageGeneratorApertureModeCleanAperture")]
  762. NSString ApertureModeCleanAperture { get; }
  763. [Field ("AVAssetImageGeneratorApertureModeProductionAperture")]
  764. NSString ApertureModeProductionAperture { get; }
  765. [Field ("AVAssetImageGeneratorApertureModeEncodedPixels")]
  766. NSString ApertureModeEncodedPixels { get; }
  767. // 5.0 APIs
  768. [Since (5,0)]
  769. [Export ("requestedTimeToleranceBefore")]
  770. CMTime RequestedTimeToleranceBefore { get; set; }
  771. [Since (5,0)]
  772. [Export ("requestedTimeToleranceAfter")]
  773. CMTime RequestedTimeToleranceAfter { get; set; }
  774. #if !MONOMAC
  775. [Since (6,0)]
  776. [Export ("asset")]
  777. AVAsset Asset { get; }
  778. #endif
  779. }
  780. [Since (4,1)]
  781. [BaseType (typeof (NSObject))]
  782. // Objective-C exception thrown. Name: NSInvalidArgumentException Reason: *** -[AVAssetReader initWithAsset:error:] invalid parameter not satisfying: asset != ((void*)0)
  783. [DisableDefaultCtor]
  784. interface AVAssetReader {
  785. [Export ("asset")]
  786. AVAsset Asset { get; }
  787. [Export ("status")]
  788. AVAssetReaderStatus Status { get; }
  789. [Export ("error")]
  790. NSError Error { get; }
  791. [Export ("timeRange")]
  792. CMTimeRange TimeRange { get; set; }
  793. [Export ("outputs")]
  794. AVAssetReaderOutput [] Outputs { get; }
  795. [Static, Export ("assetReaderWithAsset:error:")]
  796. AVAssetReader FromAsset (AVAsset asset, out NSError error);
  797. [Export ("initWithAsset:error:")]
  798. IntPtr Constructor (AVAsset asset, out NSError error);
  799. [Export ("canAddOutput:")]
  800. bool CanAddOutput (AVAssetReaderOutput output);
  801. [Export ("addOutput:")]
  802. void AddOutput (AVAssetReaderOutput output);
  803. [Export ("startReading")]
  804. bool StartReading ();
  805. [Export ("cancelReading")]
  806. void CancelReading ();
  807. }
  808. [Since (4,1)]
  809. [BaseType (typeof (NSObject))]
  810. // Objective-C exception thrown. Name: NSInvalidArgumentException Reason: *** initialization method -init cannot be sent to an abstract object of class AVAssetReaderOutput: Create a concrete instance!
  811. [DisableDefaultCtor]
  812. interface AVAssetReaderOutput {
  813. [Export ("mediaType")]
  814. string MediaType { get; }
  815. [Export ("copyNextSampleBuffer")]
  816. CMSampleBuffer CopyNextSampleBuffer ();
  817. [Export ("alwaysCopiesSampleData")]
  818. bool AlwaysCopiesSampleData { get; set; }
  819. }
  820. [Since (4,1)]
  821. [BaseType (typeof (AVAssetReaderOutput))]
  822. // Objective-C exception thrown. Name: NSInvalidArgumentException Reason: *** -[AVAssetReaderTrackOutput initWithTrack:outputSettings:] invalid parameter not satisfying: track != ((void*)0)
  823. [DisableDefaultCtor]
  824. interface AVAssetReaderTrackOutput {
  825. [Export ("track")]
  826. AVAssetTrack Track { get; }
  827. [Advice ("Use Create method")]
  828. [Static, Export ("assetReaderTrackOutputWithTrack:outputSettings:")]
  829. AVAssetReaderTrackOutput FromTrack (AVAssetTrack track, [NullAllowed] NSDictionary outputSettings);
  830. [Static, Wrap ("FromTrack (track, settings == null ? null : settings.Dictionary)")]
  831. AVAssetReaderTrackOutput Create (AVAssetTrack track, [NullAllowed] AudioSettings settings);
  832. [Static, Wrap ("FromTrack (track, settings == null ? null : settings.Dictionary)")]
  833. AVAssetReaderTrackOutput Create (AVAssetTrack track, [NullAllowed] AVVideoSettingsUncompressed settings);
  834. [Export ("initWithTrack:outputSettings:")]
  835. IntPtr Constructor (AVAssetTrack track, [NullAllowed] NSDictionary outputSettings);
  836. [Wrap ("this (track, settings == null ? null : settings.Dictionary)")]
  837. IntPtr Constructor (AVAssetTrack track, [NullAllowed] AudioSettings settings);
  838. [Wrap ("this (track, settings == null ? null : settings.Dictionary)")]
  839. IntPtr Constructor (AVAssetTrack track, [NullAllowed] AVVideoSettingsUncompressed settings);
  840. [Export ("outputSettings")]
  841. NSDictionary OutputSettings { get; }
  842. }
  843. [Since (4,1)]
  844. [BaseType (typeof (AVAssetReaderOutput))]
  845. // Objective-C exception thrown. Name: NSInvalidArgumentException Reason: *** -[AVAssetReaderAudioMixOutput initWithAudioTracks:audioSettings:] invalid parameter not satisfying: audioTracks != ((void*)0)
  846. [DisableDefaultCtor]
  847. interface AVAssetReaderAudioMixOutput {
  848. [Export ("audioTracks")]
  849. AVAssetTrack [] AudioTracks { get; }
  850. [Export ("audioMix", ArgumentSemantic.Copy)]
  851. AVAudioMix AudioMix { get; set; }
  852. [Advice ("Use Create method")]
  853. [Static, Export ("assetReaderAudioMixOutputWithAudioTracks:audioSettings:")]
  854. AVAssetReaderAudioMixOutput FromTracks (AVAssetTrack [] audioTracks, [NullAllowed] NSDictionary audioSettings);
  855. [Wrap ("FromTracks (audioTracks, settings == null ? null : settings.Dictionary)")]
  856. AVAssetReaderAudioMixOutput Create (AVAssetTrack [] audioTracks, [NullAllowed] AudioSettings settings);
  857. [Export ("initWithAudioTracks:audioSettings:")]
  858. IntPtr Constructor (AVAssetTrack [] audioTracks, [NullAllowed] NSDictionary audioSettings);
  859. [Wrap ("this (audioTracks, settings == null ? null : settings.Dictionary)")]
  860. IntPtr Constructor (AVAssetTrack [] audioTracks, [NullAllowed] AudioSettings settings);
  861. [Advice ("Use Settings property")]
  862. [Export ("audioSettings")]
  863. NSDictionary AudioSettings { get; }
  864. [Wrap ("AudioSettings")]
  865. AudioSettings Settings { get; }
  866. }
  867. [Since (4,1)]
  868. [BaseType (typeof (AVAssetReaderOutput))]
  869. // crash application if 'init' is called
  870. [DisableDefaultCtor]
  871. interface AVAssetReaderVideoCompositionOutput {
  872. [Export ("videoTracks")]
  873. AVAssetTrack [] VideoTracks { get; }
  874. [Export ("videoComposition", ArgumentSemantic.Copy)]
  875. AVVideoComposition VideoComposition { get; set; }
  876. [Advice ("Use Create method")]
  877. [Static]
  878. [Export ("assetReaderVideoCompositionOutputWithVideoTracks:videoSettings:")]
  879. AVAssetReaderVideoCompositionOutput WeakFromTracks (AVAssetTrack [] videoTracks, [NullAllowed] NSDictionary videoSettings);
  880. [Wrap ("WeakFromTracks (videoTracks, settings == null ? null : settings.Dictionary)")]
  881. [Static]
  882. AVAssetReaderVideoCompositionOutput Create (AVAssetTrack [] videoTracks, [NullAllowed] CVPixelBufferAttributes settings);
  883. [Export ("initWithVideoTracks:videoSettings:")]
  884. IntPtr Constructor (AVAssetTrack [] videoTracks, [NullAllowed] NSDictionary videoSettings);
  885. [Wrap ("this (videoTracks, settings == null ? null : settings.Dictionary)")]
  886. IntPtr Constructor (AVAssetTrack [] videoTracks, [NullAllowed] CVPixelBufferAttributes settings);
  887. [Export ("videoSettings")]
  888. NSDictionary WeakVideoSettings { get; }
  889. [Wrap ("WeakVideoSettings")]
  890. CVPixelBufferAttributes UncompressedVideoSettings { get; }
  891. }
  892. #if !MONOMAC
  893. [Since (6,0)]
  894. [BaseType (typeof (NSObject))]
  895. interface AVAssetResourceLoader {
  896. [Export ("delegate")]
  897. AVAssetResourceLoaderDelegate Delegate { get; }
  898. [Export ("delegateQueue")]
  899. DispatchQueue DelegateQueue { get; }
  900. [Export ("setDelegate:queue:")]
  901. void SetDelegate (AVAssetResourceLoaderDelegate resourceLoaderDelegate, DispatchQueue delegateQueue);
  902. }
  903. [Since (6,0)]
  904. [BaseType (typeof (NSObject))]
  905. [Model]
  906. [Protocol]
  907. interface AVAssetResourceLoaderDelegate {
  908. [Abstract]
  909. [Export ("resourceLoader:shouldWaitForLoadingOfRequestedResource:")]
  910. bool ShouldWaitForLoadingOfRequestedResource (AVAssetResourceLoader resourceLoader, AVAssetResourceLoadingRequest loadingRequest);
  911. }
  912. [Since (6,0)]
  913. [BaseType (typeof (NSObject))]
  914. interface AVAssetResourceLoadingRequest {
  915. [Export ("request")]
  916. NSUrlRequest Request { get; }
  917. [Export ("finished")]
  918. bool Finished { get; }
  919. [Export ("finishLoadingWithResponse:data:redirect:")]
  920. void FinishLoading (NSUrlResponse usingResponse, [NullAllowed] NSData data, [NullAllowed] NSUrlRequest redirect);
  921. [Export ("finishLoadingWithError:")]
  922. void FinishLoadingWithError (NSError error);
  923. [Export ("streamingContentKeyRequestDataForApp:contentIdentifier:options:error:")]
  924. NSData GetStreamingContentKey (NSData appIdentifier, NSData contentIdentifier, [NullAllowed] NSDictionary options, out NSError error);
  925. }
  926. #endif
  927. [Since (4,1)]
  928. [BaseType (typeof (NSObject))]
  929. // Objective-C exception thrown. Name: NSInvalidArgumentException Reason: *** -[AVAssetWriter initWithURL:fileType:error:] invalid parameter not satisfying: outputURL != ((void*)0)
  930. [DisableDefaultCtor]
  931. interface AVAssetWriter {
  932. [Export ("outputURL", ArgumentSemantic.Copy)]
  933. NSUrl OutputURL { get; }
  934. [Export ("outputFileType")]
  935. string OutputFileType { get; }
  936. [Export ("status")]
  937. AVAssetWriterStatus Status { get; }
  938. [Export ("error")]
  939. NSError Error { get; }
  940. [Export ("movieFragmentInterval")]
  941. CMTime MovieFragmentInterval { get; set; }
  942. [Export ("shouldOptimizeForNetworkUse")]
  943. bool ShouldOptimizeForNetworkUse { get; set; }
  944. [Export ("inputs")]
  945. AVAssetWriterInput [] inputs { get; }
  946. [Export ("metadata")]
  947. AVMetadataItem [] Metadata { get; set; }
  948. [Static, Export ("assetWriterWithURL:fileType:error:")]
  949. AVAssetWriter FromUrl (NSUrl outputUrl, string outputFileType, out NSError error);
  950. [Export ("initWithURL:fileType:error:")]
  951. IntPtr Constructor (NSUrl outputUrl, string outputFileType, out NSError error);
  952. [Export ("canApplyOutputSettings:forMediaType:")]
  953. bool CanApplyOutputSettings (NSDictionary outputSettings, string mediaType);
  954. [Wrap ("CanApplyOutputSettings (outputSettings == null ? null : outputSettings.Dictionary, mediaType)")]
  955. bool CanApplyOutputSettings (AudioSettings outputSettings, string mediaType);
  956. [Wrap ("CanApplyOutputSettings (outputSettings == null ? null : outputSettings.Dictionary, mediaType)")]
  957. bool CanApplyOutputSettings (AVVideoSettingsCompressed outputSettings, string mediaType);
  958. [Export ("canAddInput:")]
  959. bool CanAddInput (AVAssetWriterInput input);
  960. [Export ("addInput:")]
  961. void AddInput (AVAssetWriterInput input);
  962. [Export ("startWriting")]
  963. bool StartWriting ();
  964. [Export ("startSessionAtSourceTime:")]
  965. void StartSessionAtSourceTime (CMTime startTime);
  966. [Export ("endSessionAtSourceTime:")]
  967. void EndSessionAtSourceTime (CMTime endTime);
  968. [Export ("cancelWriting")]
  969. void CancelWriting ();
  970. [Export ("finishWriting")]
  971. [Obsolete ("Deprecated in iOS 6.0. Use the asynchronous FinishWriting(NSAction completionHandler) instead")]
  972. bool FinishWriting ();
  973. #if !MONOMAC
  974. [Since (6,0)]
  975. [Export ("finishWritingWithCompletionHandler:")]
  976. [Async]
  977. void FinishWriting (NSAction completionHandler);
  978. #endif
  979. [Export ("movieTimeScale")]
  980. int MovieTimeScale { get; set; }
  981. }
  982. [Since (4,1)]
  983. [BaseType (typeof (NSObject))]
  984. // Objective-C exception thrown. Name: NSInvalidArgumentException Reason: *** -[AVAssetWriterInput initWithMediaType:outputSettings:] invalid parameter not satisfying: mediaType != ((void*)0)
  985. [DisableDefaultCtor]
  986. interface AVAssetWriterInput {
  987. #if !MONOMAC
  988. [Since (6,0)]
  989. [Protected]
  990. [Export ("initWithMediaType:outputSettings:sourceFormatHint:")]
  991. IntPtr Constructor (string mediaType, [NullAllowed] NSDictionary outputSettings, CMFormatDescription sourceFormatHint);
  992. [Since (6,0)]
  993. [Wrap ("this (mediaType, outputSettings == null ? null : outputSettings.Dictionary, sourceFormatHint)")]
  994. IntPtr Constructor (string mediaType, [NullAllowed] AudioSettings outputSettings, CMFormatDescription sourceFormatHint);
  995. [Since (6,0)]
  996. [Wrap ("this (mediaType, outputSettings == null ? null : outputSettings.Dictionary, sourceFormatHint)")]
  997. IntPtr Constructor (string mediaType, [NullAllowed] AVVideoSettingsCompressed outputSettings, CMFormatDescription sourceFormatHint);
  998. [Since (6,0)]
  999. [Static, Internal]
  1000. [Export ("assetWriterInputWithMediaType:outputSettings:sourceFormatHint:")]
  1001. AVAssetWriterInput Create (string mediaType, [NullAllowed] NSDictionary outputSettings, CMFormatDescription sourceFormatHint);
  1002. [Since (6,0)]
  1003. [Static]
  1004. [Wrap ("Create(mediaType, outputSettings == null ? null : outputSettings.Dictionary, sourceFormatHint)")]
  1005. AVAssetWriterInput Create (string mediaType, [NullAllowed] AudioSettings outputSettings, CMFormatDescription sourceFormatHint);
  1006. [Since (6,0)]
  1007. [Static]
  1008. [Wrap ("Create(mediaType, outputSettings == null ? null : outputSettings.Dictionary, sourceFormatHint)")]
  1009. AVAssetWriterInput Create (string mediaType, [NullAllowed] AVVideoSettingsCompressed outputSettings, CMFormatDescription sourceFormatHint);
  1010. #endif
  1011. [Export ("mediaType")]
  1012. string MediaType { get; }
  1013. [Export ("outputSettings")]
  1014. NSDictionary OutputSettings { get; }
  1015. [Export ("transform")]
  1016. CGAffineTransform Transform { get; set; }
  1017. [Export ("metadata")]
  1018. AVMetadataItem [] Metadata { get; set; }
  1019. [Export ("readyForMoreMediaData")]
  1020. bool ReadyForMoreMediaData { [Bind ("isReadyForMoreMediaData")] get; }
  1021. [Export ("expectsMediaDataInRealTime")]
  1022. bool ExpectsMediaDataInRealTime { get; set; }
  1023. [Advice ("Use constructor or Create method")]
  1024. [Static, Export ("assetWriterInputWithMediaType:outputSettings:")]
  1025. AVAssetWriterInput FromType (string mediaType, [NullAllowed] NSDictionary outputSettings);
  1026. [Static, Wrap ("FromType (mediaType, outputSettings == null ? null : outputSettings.Dictionary)")]
  1027. AVAssetWriterInput Create (string mediaType, [NullAllowed] AudioSettings outputSettings);
  1028. [Static, Wrap ("FromType (mediaType, outputSettings == null ? null : outputSettings.Dictionary)")]
  1029. AVAssetWriterInput Create (string mediaType, [NullAllowed] AVVideoSettingsCompressed outputSettings);
  1030. // Should be protected
  1031. [Export ("initWithMediaType:outputSettings:")]
  1032. IntPtr Constructor (string mediaType, [NullAllowed] NSDictionary outputSettings);
  1033. [Wrap ("this (mediaType, outputSettings == null ? null : outputSettings.Dictionary)")]
  1034. IntPtr Constructor (string mediaType, [NullAllowed] AudioSettings outputSettings);
  1035. [Wrap ("this (mediaType, outputSettings == null ? null : outputSettings.Dictionary)")]
  1036. IntPtr Constructor (string mediaType, [NullAllowed] AVVideoSettingsCompressed outputSettings);
  1037. [Export ("requestMediaDataWhenReadyOnQueue:usingBlock:")]
  1038. void RequestMediaData (DispatchQueue queue, NSAction action);
  1039. [Export ("appendSampleBuffer:")]
  1040. bool AppendSampleBuffer (CMSampleBuffer sampleBuffer);
  1041. [Export ("markAsFinished")]
  1042. void MarkAsFinished ();
  1043. [Export ("mediaTimeScale")]
  1044. int MediaTimeScale { get; set; }
  1045. #if !MONOMAC
  1046. [Since (6,0)]
  1047. [Export ("sourceFormatHint")]
  1048. CMFormatDescription SourceFormatHint { get; }
  1049. #endif
  1050. }
  1051. [Since (4,1)]
  1052. [BaseType (typeof (NSObject))]
  1053. // Objective-C exception thrown. Name: NSInvalidArgumentException Reason: *** -[AVAssetWriterInputPixelBufferAdaptor initWithAssetWriterInput:sourcePixelBufferAttributes:] invalid parameter not satisfying: input != ((void*)0)
  1054. [DisableDefaultCtor]
  1055. interface AVAssetWriterInputPixelBufferAdaptor {
  1056. [Export ("assetWriterInput")]
  1057. AVAssetWriterInput AssetWriterInput { get; }
  1058. [Export ("sourcePixelBufferAttributes")]
  1059. NSDictionary SourcePixelBufferAttributes { get; }
  1060. [Wrap ("SourcePixelBufferAttributes")]
  1061. CVPixelBufferAttributes Attributes { get; }
  1062. [Export ("pixelBufferPool")]
  1063. CVPixelBufferPool PixelBufferPool { get; }
  1064. [Advice ("Use Create method")]
  1065. [Static, Export ("assetWriterInputPixelBufferAdaptorWithAssetWriterInput:sourcePixelBufferAttributes:")]
  1066. AVAssetWriterInputPixelBufferAdaptor FromInput (AVAssetWriterInput input, [NullAllowed] NSDictionary sourcePixelBufferAttributes);
  1067. [Static, Wrap ("FromInput (input, attributes == null ? null : attributes.Dictionary)")]
  1068. AVAssetWriterInputPixelBufferAdaptor Create (AVAssetWriterInput input, [NullAllowed] CVPixelBufferAttributes attributes);
  1069. [Export ("initWithAssetWriterInput:sourcePixelBufferAttributes:")]
  1070. IntPtr Constructor (AVAssetWriterInput input, [NullAllowed] NSDictionary sourcePixelBufferAttributes);
  1071. [Wrap ("this (input, attributes == null ? null : attributes.Dictionary)")]
  1072. IntPtr Constructor (AVAssetWriterInput input, [NullAllowed] CVPixelBufferAttributes attributes);
  1073. [Export ("appendPixelBuffer:withPresentationTime:")]
  1074. bool AppendPixelBufferWithPresentationTime (CVPixelBuffer pixelBuffer, CMTime presentationTime);
  1075. }
  1076. [Since (4,0)]
  1077. [BaseType (typeof (AVAsset), Name="AVURLAsset")]
  1078. // 'init' returns NIL
  1079. [DisableDefaultCtor]
  1080. interface AVUrlAsset {
  1081. [Export ("URL", ArgumentSemantic.Copy)]
  1082. NSUrl Url { get; }
  1083. [Advice ("Use Create or constructor")]
  1084. [Static, Export ("URLAssetWithURL:options:")]
  1085. AVUrlAsset FromUrl (NSUrl URL, [NullAllowed] NSDictionary options);
  1086. [Static]
  1087. [Wrap ("FromUrl (url, options == null ? null : options.Dictionary)")]
  1088. AVUrlAsset Create (NSUrl url, [NullAllowed] AVUrlAssetOptions options);
  1089. [Export ("initWithURL:options:")]
  1090. IntPtr Constructor (NSUrl URL, [NullAllowed] NSDictionary options);
  1091. [Wrap ("this (url, options == null ? null : options.Dictionary)")]
  1092. IntPtr Constructor (NSUrl url, [NullAllowed] AVUrlAssetOptions options);
  1093. [Export ("compatibleTrackForCompositionTrack:")]
  1094. AVAssetTrack CompatibleTrack (AVCompositionTrack forCompositionTrack);
  1095. [Field ("AVURLAssetPreferPreciseDurationAndTimingKey")]
  1096. NSString PreferPreciseDurationAndTimingKey { get; }
  1097. [Field ("AVURLAssetReferenceRestrictionsKey")]
  1098. NSString ReferenceRestrictionsKey { get; }
  1099. [Since (5,0)]
  1100. [Static, Export ("audiovisualMIMETypes")]
  1101. string [] AudiovisualMimeTypes { get; }
  1102. [Since (5,0)]
  1103. [Static, Export ("audiovisualTypes")]
  1104. string [] AudiovisualTypes { get; }
  1105. [Since (5,0)]
  1106. [Static, Export ("isPlayableExtendedMIMEType:")]
  1107. bool IsPlayable (string extendedMimeType);
  1108. #if !MONOMAC
  1109. [Since (6,0)]
  1110. [Export ("resourceLoader")]
  1111. AVAssetResourceLoader ResourceLoader { get; }
  1112. #endif
  1113. }
  1114. [BaseType (typeof (NSObject))]
  1115. // 'init' returns NIL
  1116. [DisableDefaultCtor]
  1117. interface AVAssetTrack {
  1118. [Export ("trackID")]
  1119. int TrackID { get; }
  1120. [Export ("asset")]
  1121. AVAsset Asset { get; }
  1122. [Export ("mediaType")]
  1123. string MediaType { get; }
  1124. // Weak version
  1125. [Export ("formatDescriptions")]
  1126. NSObject [] FormatDescriptionsAsObjects { get; }
  1127. [Wrap ("Array.ConvertAll (FormatDescriptionsAsObjects, l => CMFormatDescription.Create (l.Handle, false))")]
  1128. CMFormatDescription[] FormatDescriptions { get; }
  1129. [Export ("enabled")]
  1130. bool Enabled { [Bind ("isEnabled")] get; }
  1131. [Export ("selfContained")]
  1132. bool SelfContained { [Bind ("isSelfContained")] get; }
  1133. [Export ("totalSampleDataLength")]
  1134. long TotalSampleDataLength { get; }
  1135. [Export ("hasMediaCharacteristic:")]
  1136. bool HasMediaCharacteristic (string mediaCharacteristic);
  1137. [Export ("timeRange")]
  1138. CMTimeRange TimeRange { get; }
  1139. [Export ("naturalTimeScale")]
  1140. int NaturalTimeScale { get; }
  1141. [Export ("estimatedDataRate")]
  1142. float EstimatedDataRate { get; }
  1143. [Export ("languageCode")]
  1144. string LanguageCode { get; }
  1145. [Export ("extendedLanguageTag")]
  1146. string ExtendedLanguageTag { get; }
  1147. [Export ("naturalSize")]
  1148. SizeF NaturalSize { get; }
  1149. [Export ("preferredVolume")]
  1150. float PreferredVolume { get; }
  1151. [Export ("preferredTransform")]
  1152. CGAffineTransform PreferredTransform { get; }
  1153. [Export ("nominalFrameRate")]
  1154. float NominalFrameRate { get; }
  1155. [Export ("segments", ArgumentSemantic.Copy)]
  1156. AVAssetTrackSegment [] Segments { get; }
  1157. [Export ("segmentForTrackTime:")]
  1158. AVAssetTrackSegment SegmentForTrackTime (CMTime trackTime);
  1159. [Export ("samplePresentationTimeForTrackTime:")]
  1160. CMTime SamplePresentationTimeForTrackTime (CMTime trackTime);
  1161. [Export ("availableMetadataFormats")]
  1162. string [] AvailableMetadataFormats { get; }
  1163. [Export ("commonMetadata")]
  1164. AVMetadataItem [] CommonMetadata { get; }
  1165. [Export ("metadataForFormat:")]
  1166. AVMetadataItem [] MetadataForFormat (string format);
  1167. [Export ("isPlayable")]
  1168. bool Playable { get; }
  1169. }
  1170. #if !MONOMAC
  1171. [BaseType (typeof (NSObject))]
  1172. interface AVMediaSelectionGroup {
  1173. [Export ("options")]
  1174. AVMediaSelectionOption [] Options { get; }
  1175. [Export ("allowsEmptySelection")]
  1176. bool AllowsEmptySelection { get; }
  1177. [Export ("mediaSelectionOptionWithPropertyList:")]
  1178. AVMediaSelectionOption GetMediaSelectionOptionForPropertyList (NSObject propertyList);
  1179. [Static]
  1180. [Export ("playableMediaSelectionOptionsFromArray:")]
  1181. AVMediaSelectionOption [] PlayableMediaSelectionOptions (AVMediaSelectionOption [] source);
  1182. [Static]
  1183. [Export ("mediaSelectionOptionsFromArray:withLocale:")]
  1184. AVMediaSelectionOption [] MediaSelectionOptions (AVMediaSelectionOption [] source, NSLocale locale);
  1185. [Static]
  1186. [Export ("mediaSelectionOptionsFromArray:withMediaCharacteristics:")]
  1187. AVMediaSelectionOption [] MediaSelectionOptions (AVMediaSelectionOption [] source, NSString [] avmediaCharacteristics);
  1188. [Static]
  1189. [Export ("mediaSelectionOptionsFromArray:withoutMediaCharacteristics:")]
  1190. AVMediaSelectionOption [] MediaSelectionOptionsExcludingCharacteristics (AVMediaSelectionOption [] source, NSString [] avmediaCharacteristics);
  1191. }
  1192. [BaseType (typeof (NSObject))]
  1193. interface AVMediaSelectionOption {
  1194. [Export ("mediaType")]
  1195. string MediaType { get; }
  1196. [Export ("mediaSubTypes")]
  1197. NSNumber [] MediaSubTypes { get; }
  1198. [Export ("playable")]
  1199. bool Playable { [Bind ("isPlayable")] get; }
  1200. [Export ("locale")]
  1201. NSLocale Locale { get; }
  1202. [Export ("commonMetadata")]
  1203. AVMetadataItem [] CommonMetadata { get; }
  1204. [Export ("availableMetadataFormats")]
  1205. string [] AvailableMetadataFormats { get; }
  1206. [Export ("hasMediaCharacteristic:")]
  1207. bool HasMediaCharacteristic (string mediaCharacteristic);
  1208. [Export ("metadataForFormat:")]
  1209. AVMetadataItem [] GetMetadataForFormat (string format);
  1210. [Export ("associatedMediaSelectionOptionInMediaSelectionGroup:")]
  1211. AVMediaSelectionOption AssociatedMediaSelectionOptionInMediaSelectionGroup (AVMediaSelectionGroup mediaSelectionGroup);
  1212. [Export ("propertyList")]
  1213. NSObject PropertyList { get; }
  1214. }
  1215. #endif
  1216. [Static]
  1217. interface AVMetadata {
  1218. [Field ("AVMetadataKeySpaceCommon")]
  1219. NSString KeySpaceCommon { get; }
  1220. [Field ("AVMetadataCommonKeyTitle")]
  1221. NSString CommonKeyTitle { g

Large files files are truncated, but you can click here to view the full file