-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathAxCore.cs
931 lines (754 loc) · 25 KB
/
AxCore.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
#region license
/*
DirectShowLib - Provide access to DirectShow interfaces via .NET
Copyright (C) 2007
http://sourceforge.net/projects/directshownet/
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#endregion
using System;
using System.Runtime.InteropServices;
namespace DirectShowLib
{
#region Declarations
/// <summary>
/// From AM_GBF_* defines
/// </summary>
[Flags]
public enum AMGBF
{
None = 0,
PrevFrameSkipped = 1,
NotAsyncPoint = 2,
NoWait = 4,
NoDDSurfaceLock = 8
}
/// <summary>
/// From AM_VIDEO_FLAG_* defines
/// </summary>
[Flags]
public enum AMVideoFlag
{
FieldMask = 0x0003,
InterleavedFrame = 0x0000,
Field1 = 0x0001,
Field2 = 0x0002,
Field1First = 0x0004,
Weave = 0x0008,
IPBMask = 0x0030,
ISample = 0x0000,
PSample = 0x0010,
BSample = 0x0020,
RepeatField = 0x0040
}
/// <summary>
/// From AM_SAMPLE_PROPERTY_FLAGS
/// </summary>
[Flags]
public enum AMSamplePropertyFlags
{
SplicePoint = 0x01,
PreRoll = 0x02,
DataDiscontinuity = 0x04,
TypeChanged = 0x08,
TimeValid = 0x10,
MediaTimeValid = 0x20,
TimeDiscontinuity = 0x40,
FlushOnPause = 0x80,
StopValid = 0x100,
EndOfStream = 0x200,
Media = 0,
Control = 1
}
/// <summary>
/// From PIN_INFO
/// </summary>
[StructLayout(LayoutKind.Sequential, CharSet=CharSet.Unicode)]
public struct PinInfo
{
[MarshalAs(UnmanagedType.Interface)] public IBaseFilter filter;
public PinDirection dir;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst=128)] public string name;
}
/// <summary>
/// From AM_MEDIA_TYPE - When you are done with an instance of this class,
/// it should be released with FreeAMMediaType() to avoid leaking
/// </summary>
[StructLayout(LayoutKind.Sequential)]
public class AMMediaType
{
public Guid majorType;
public Guid subType;
[MarshalAs(UnmanagedType.Bool)] public bool fixedSizeSamples;
[MarshalAs(UnmanagedType.Bool)] public bool temporalCompression;
public int sampleSize;
public Guid formatType;
public IntPtr unkPtr; // IUnknown Pointer
public int formatSize;
public IntPtr formatPtr; // Pointer to a buff determined by formatType
}
/// <summary>
/// From PIN_DIRECTION
/// </summary>
public enum PinDirection
{
Input,
Output
}
/// <summary>
/// From AM_SEEKING_SeekingCapabilities
/// </summary>
[Flags]
public enum AMSeekingSeekingCapabilities
{
None = 0,
CanSeekAbsolute = 0x001,
CanSeekForwards = 0x002,
CanSeekBackwards = 0x004,
CanGetCurrentPos = 0x008,
CanGetStopPos = 0x010,
CanGetDuration = 0x020,
CanPlayBackwards = 0x040,
CanDoSegments = 0x080,
Source = 0x100
}
/// <summary>
/// From FILTER_STATE
/// </summary>
public enum FilterState
{
Stopped,
Paused,
Running
}
/// <summary>
/// From FILTER_INFO
/// </summary>
[StructLayout(LayoutKind.Sequential, CharSet=CharSet.Unicode)]
public struct FilterInfo
{
[MarshalAs(UnmanagedType.ByValTStr, SizeConst=128)] public string achName;
[MarshalAs(UnmanagedType.Interface)] public IFilterGraph pGraph;
}
/// <summary>
/// From AM_SEEKING_SeekingFlags
/// </summary>
[Flags]
public enum AMSeekingSeekingFlags
{
NoPositioning = 0x00,
AbsolutePositioning = 0x01,
RelativePositioning = 0x02,
IncrementalPositioning = 0x03,
PositioningBitsMask = 0x03,
SeekToKeyFrame = 0x04,
ReturnTime = 0x08,
Segment = 0x10,
NoFlush = 0x20
}
/// <summary>
/// From ALLOCATOR_PROPERTIES
/// </summary>
[StructLayout(LayoutKind.Sequential)]
public class AllocatorProperties
{
public int cBuffers;
public int cbBuffer;
public int cbAlign;
public int cbPrefix;
}
/// <summary>
/// From AM_SAMPLE2_PROPERTIES
/// </summary>
[StructLayout(LayoutKind.Sequential)]
public class AMSample2Properties
{
public int cbData;
public AMVideoFlag dwTypeSpecificFlags;
public AMSamplePropertyFlags dwSampleFlags;
public int lActual;
public long tStart;
public long tStop;
public int dwStreamId;
public IntPtr pMediaType;
public IntPtr pbBuffer; // BYTE *
public int cbBuffer;
}
#endregion
#region Interfaces
#if ALLOW_UNTESTED_INTERFACES
[ComImport, System.Security.SuppressUnmanagedCodeSecurity,
Guid("68961E68-832B-41ea-BC91-63593F3E70E3"),
InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
public interface IMediaSample2Config
{
[PreserveSig]
int GetSurface(
[MarshalAs(UnmanagedType.IUnknown)] out object ppDirect3DSurface9
);
}
[ComImport, System.Security.SuppressUnmanagedCodeSecurity,
Guid("36b73885-c2c8-11cf-8b46-00805f6cef60"),
InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
public interface IReferenceClock2 : IReferenceClock
{
#region IReferenceClock Methods
[PreserveSig]
new int GetTime([Out] out long pTime);
[PreserveSig]
new int AdviseTime(
[In] long baseTime,
[In] long streamTime,
[In] IntPtr hEvent, // System.Threading.WaitHandle?
[Out] out int pdwAdviseCookie
);
[PreserveSig]
new int AdvisePeriodic(
[In] long startTime,
[In] long periodTime,
[In] IntPtr hSemaphore, // System.Threading.WaitHandle?
[Out] out int pdwAdviseCookie
);
[PreserveSig]
new int Unadvise([In] int dwAdviseCookie);
#endregion
}
[ComImport, System.Security.SuppressUnmanagedCodeSecurity,
Guid("56a8689d-0ad4-11ce-b03a-0020af0ba770"),
InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
public interface IMemInputPin
{
[PreserveSig]
int GetAllocator([Out] out IMemAllocator ppAllocator);
[PreserveSig]
int NotifyAllocator(
[In] IMemAllocator pAllocator,
[In, MarshalAs(UnmanagedType.Bool)] bool bReadOnly
);
[PreserveSig]
int GetAllocatorRequirements([Out] out AllocatorProperties pProps);
[PreserveSig]
int Receive([In] IMediaSample pSample);
[PreserveSig]
int ReceiveMultiple(
[In] IntPtr pSamples, // IMediaSample[]
[In] int nSamples,
[Out] out int nSamplesProcessed
);
[PreserveSig]
int ReceiveCanBlock();
}
[ComImport, System.Security.SuppressUnmanagedCodeSecurity,
Guid("a3d8cec0-7e5a-11cf-bbc5-00805f6cef20"),
Obsolete("This interface has been deprecated.", false),
InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
public interface IAMovieSetup
{
[PreserveSig]
int Register();
[PreserveSig]
int Unregister();
}
#endif
[ComImport, System.Security.SuppressUnmanagedCodeSecurity,
Guid("56a86891-0ad4-11ce-b03a-0020af0ba770"),
InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
public interface IPin
{
[PreserveSig]
int Connect(
[In] IPin pReceivePin,
[In, MarshalAs(UnmanagedType.LPStruct)] AMMediaType pmt
);
[PreserveSig]
int ReceiveConnection(
[In] IPin pReceivePin,
[In, MarshalAs(UnmanagedType.LPStruct)] AMMediaType pmt
);
[PreserveSig]
int Disconnect();
[PreserveSig]
int ConnectedTo(
[Out] out IPin ppPin);
/// <summary>
/// Release returned parameter with DsUtils.FreeAMMediaType
/// </summary>
[PreserveSig]
int ConnectionMediaType(
[Out, MarshalAs(UnmanagedType.LPStruct)] AMMediaType pmt);
/// <summary>
/// Release returned parameter with DsUtils.FreePinInfo
/// </summary>
[PreserveSig]
int QueryPinInfo([Out] out PinInfo pInfo);
[PreserveSig]
int QueryDirection(out PinDirection pPinDir);
[PreserveSig]
int QueryId([Out, MarshalAs(UnmanagedType.LPWStr)] out string Id);
[PreserveSig]
int QueryAccept([In, MarshalAs(UnmanagedType.LPStruct)] AMMediaType pmt);
[PreserveSig]
int EnumMediaTypes([Out] out IEnumMediaTypes ppEnum);
[PreserveSig]
int QueryInternalConnections(
[Out, MarshalAs(UnmanagedType.LPArray, SizeParamIndex=1)] IPin[] ppPins,
[In, Out] ref int nPin
);
[PreserveSig]
int EndOfStream();
[PreserveSig]
int BeginFlush();
[PreserveSig]
int EndFlush();
[PreserveSig]
int NewSegment(
[In] long tStart,
[In] long tStop,
[In] double dRate
);
}
[ComImport, System.Security.SuppressUnmanagedCodeSecurity,
Guid("36b73880-c2c8-11cf-8b46-00805f6cef60"),
InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
public interface IMediaSeeking
{
[PreserveSig]
int GetCapabilities([Out] out AMSeekingSeekingCapabilities pCapabilities);
[PreserveSig]
int CheckCapabilities([In, Out] ref AMSeekingSeekingCapabilities pCapabilities);
[PreserveSig]
int IsFormatSupported([In, MarshalAs(UnmanagedType.LPStruct)] Guid pFormat);
[PreserveSig]
int QueryPreferredFormat([Out] out Guid pFormat);
[PreserveSig]
int GetTimeFormat([Out] out Guid pFormat);
[PreserveSig]
int IsUsingTimeFormat([In, MarshalAs(UnmanagedType.LPStruct)] Guid pFormat);
[PreserveSig]
int SetTimeFormat([In, MarshalAs(UnmanagedType.LPStruct)] Guid pFormat);
[PreserveSig]
int GetDuration([Out] out long pDuration);
[PreserveSig]
int GetStopPosition([Out] out long pStop);
[PreserveSig]
int GetCurrentPosition([Out] out long pCurrent);
[PreserveSig]
int ConvertTimeFormat(
[Out] out long pTarget,
[In, MarshalAs(UnmanagedType.LPStruct)] DsGuid pTargetFormat,
[In] long Source,
[In, MarshalAs(UnmanagedType.LPStruct)] DsGuid pSourceFormat
);
[PreserveSig]
int SetPositions(
[In, Out, MarshalAs(UnmanagedType.LPStruct)] DsLong pCurrent,
[In] AMSeekingSeekingFlags dwCurrentFlags,
[In, Out, MarshalAs(UnmanagedType.LPStruct)] DsLong pStop,
[In] AMSeekingSeekingFlags dwStopFlags
);
[PreserveSig]
int GetPositions(
[Out] out long pCurrent,
[Out] out long pStop
);
[PreserveSig]
int GetAvailable(
[Out] out long pEarliest,
[Out] out long pLatest
);
[PreserveSig]
int SetRate([In] double dRate);
[PreserveSig]
int GetRate([Out] out double pdRate);
[PreserveSig]
int GetPreroll([Out] out long pllPreroll);
}
[ComImport, System.Security.SuppressUnmanagedCodeSecurity,
Guid("56a8689a-0ad4-11ce-b03a-0020af0ba770"),
InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
public interface IMediaSample
{
[PreserveSig]
int GetPointer([Out] out IntPtr ppBuffer); // BYTE **
[PreserveSig]
int GetSize();
[PreserveSig]
int GetTime(
[Out] out long pTimeStart,
[Out] out long pTimeEnd
);
[PreserveSig]
int SetTime(
[In, MarshalAs(UnmanagedType.LPStruct)] DsLong pTimeStart,
[In, MarshalAs(UnmanagedType.LPStruct)] DsLong pTimeEnd
);
[PreserveSig]
int IsSyncPoint();
[PreserveSig]
int SetSyncPoint([In, MarshalAs(UnmanagedType.Bool)] bool bIsSyncPoint);
[PreserveSig]
int IsPreroll();
[PreserveSig]
int SetPreroll([In, MarshalAs(UnmanagedType.Bool)] bool bIsPreroll);
[PreserveSig]
int GetActualDataLength();
[PreserveSig]
int SetActualDataLength([In] int len);
/// <summary>
/// Returned object must be released with DsUtils.FreeAMMediaType()
/// </summary>
[PreserveSig]
int GetMediaType([Out, MarshalAs(UnmanagedType.LPStruct)] out AMMediaType ppMediaType);
[PreserveSig]
int SetMediaType([In, MarshalAs(UnmanagedType.LPStruct)] AMMediaType pMediaType);
[PreserveSig]
int IsDiscontinuity();
[PreserveSig]
int SetDiscontinuity([In, MarshalAs(UnmanagedType.Bool)] bool bDiscontinuity);
[PreserveSig]
int GetMediaTime(
[Out] out long pTimeStart,
[Out] out long pTimeEnd
);
[PreserveSig]
int SetMediaTime(
[In, MarshalAs(UnmanagedType.LPStruct)] DsLong pTimeStart,
[In, MarshalAs(UnmanagedType.LPStruct)] DsLong pTimeEnd
);
}
[ComImport, System.Security.SuppressUnmanagedCodeSecurity,
Guid("56a86899-0ad4-11ce-b03a-0020af0ba770"),
InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
public interface IMediaFilter : IPersist
{
#region IPersist Methods
[PreserveSig]
new int GetClassID(
[Out] out Guid pClassID);
#endregion
[PreserveSig]
int Stop();
[PreserveSig]
int Pause();
[PreserveSig]
int Run([In] long tStart);
[PreserveSig]
int GetState(
[In] int dwMilliSecsTimeout,
[Out] out FilterState filtState
);
[PreserveSig]
int SetSyncSource([In] IReferenceClock pClock);
[PreserveSig]
int GetSyncSource([Out] out IReferenceClock pClock);
}
[ComImport, System.Security.SuppressUnmanagedCodeSecurity,
Guid("56a86895-0ad4-11ce-b03a-0020af0ba770"),
InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
public interface IBaseFilter : IMediaFilter
{
#region IPersist Methods
[PreserveSig]
new int GetClassID(
[Out] out Guid pClassID);
#endregion
#region IMediaFilter Methods
[PreserveSig]
new int Stop();
[PreserveSig]
new int Pause();
[PreserveSig]
new int Run(long tStart);
[PreserveSig]
new int GetState([In] int dwMilliSecsTimeout, [Out] out FilterState filtState);
[PreserveSig]
new int SetSyncSource([In] IReferenceClock pClock);
[PreserveSig]
new int GetSyncSource([Out] out IReferenceClock pClock);
#endregion
[PreserveSig]
int EnumPins([Out] out IEnumPins ppEnum);
[PreserveSig]
int FindPin(
[In, MarshalAs(UnmanagedType.LPWStr)] string Id,
[Out] out IPin ppPin
);
[PreserveSig]
int QueryFilterInfo([Out] out FilterInfo pInfo);
[PreserveSig]
int JoinFilterGraph(
[In] IFilterGraph pGraph,
[In, MarshalAs(UnmanagedType.LPWStr)] string pName
);
[PreserveSig]
int QueryVendorInfo([Out, MarshalAs(UnmanagedType.LPWStr)] out string pVendorInfo);
}
[ComImport, System.Security.SuppressUnmanagedCodeSecurity,
Guid("56a8689f-0ad4-11ce-b03a-0020af0ba770"),
InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
public interface IFilterGraph
{
[PreserveSig]
int AddFilter(
[In] IBaseFilter pFilter,
[In, MarshalAs(UnmanagedType.LPWStr)] string pName
);
[PreserveSig]
int RemoveFilter([In] IBaseFilter pFilter);
[PreserveSig]
int EnumFilters([Out] out IEnumFilters ppEnum);
[PreserveSig]
int FindFilterByName(
[In, MarshalAs(UnmanagedType.LPWStr)] string pName,
[Out] out IBaseFilter ppFilter
);
[PreserveSig]
int ConnectDirect(
[In] IPin ppinOut,
[In] IPin ppinIn,
[In, MarshalAs(UnmanagedType.LPStruct)] AMMediaType pmt
);
[PreserveSig]
[Obsolete("This method is obsolete; use the IFilterGraph2.ReconnectEx method instead.")]
int Reconnect([In] IPin ppin);
[PreserveSig]
int Disconnect([In] IPin ppin);
[PreserveSig]
int SetDefaultSyncSource();
}
[ComImport, System.Security.SuppressUnmanagedCodeSecurity,
Guid("56a86893-0ad4-11ce-b03a-0020af0ba770"),
InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
public interface IEnumFilters
{
[PreserveSig]
int Next(
[In] int cFilters,
[Out, MarshalAs(UnmanagedType.LPArray, SizeParamIndex=0)] IBaseFilter[] ppFilter,
[In] IntPtr pcFetched
);
[PreserveSig]
int Skip([In] int cFilters);
[PreserveSig]
int Reset();
[PreserveSig]
int Clone([Out] out IEnumFilters ppEnum);
}
[ComImport, System.Security.SuppressUnmanagedCodeSecurity,
Guid("56a86892-0ad4-11ce-b03a-0020af0ba770"),
InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
public interface IEnumPins
{
[PreserveSig]
int Next(
[In] int cPins,
[Out, MarshalAs(UnmanagedType.LPArray, SizeParamIndex=0)] IPin[] ppPins,
[In] IntPtr pcFetched
);
[PreserveSig]
int Skip([In] int cPins);
[PreserveSig]
int Reset();
[PreserveSig]
int Clone([Out] out IEnumPins ppEnum);
}
[ComImport, System.Security.SuppressUnmanagedCodeSecurity,
Guid("56a86897-0ad4-11ce-b03a-0020af0ba770"),
InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
public interface IReferenceClock
{
[PreserveSig]
int GetTime([Out] out long pTime);
[PreserveSig]
int AdviseTime(
[In] long baseTime,
[In] long streamTime,
[In] IntPtr hEvent, // System.Threading.WaitHandle?
[Out] out int pdwAdviseCookie
);
[PreserveSig]
int AdvisePeriodic(
[In] long startTime,
[In] long periodTime,
[In] IntPtr hSemaphore, // System.Threading.WaitHandle?
[Out] out int pdwAdviseCookie
);
[PreserveSig]
int Unadvise([In] int dwAdviseCookie);
}
[ComImport, System.Security.SuppressUnmanagedCodeSecurity,
Guid("89c31040-846b-11ce-97d3-00aa0055595a"),
InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
public interface IEnumMediaTypes
{
[PreserveSig]
int Next(
[In] int cMediaTypes,
[In, Out, MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(EMTMarshaler), SizeParamIndex = 0)] AMMediaType[] ppMediaTypes,
[In] IntPtr pcFetched
);
[PreserveSig]
int Skip([In] int cMediaTypes);
[PreserveSig]
int Reset();
[PreserveSig]
int Clone([Out] out IEnumMediaTypes ppEnum);
}
[ComImport, System.Security.SuppressUnmanagedCodeSecurity,
Guid("36b73884-c2c8-11cf-8b46-00805f6cef60"),
InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
public interface IMediaSample2 : IMediaSample
{
#region IMediaSample Methods
[PreserveSig]
new int GetPointer([Out] out IntPtr ppBuffer); // BYTE **
[PreserveSig]
new int GetSize();
[PreserveSig]
new int GetTime(
[Out] out long pTimeStart,
[Out] out long pTimeEnd
);
[PreserveSig]
new int SetTime(
[In, MarshalAs(UnmanagedType.LPStruct)] DsLong pTimeStart,
[In, MarshalAs(UnmanagedType.LPStruct)] DsLong pTimeEnd
);
[PreserveSig]
new int IsSyncPoint();
[PreserveSig]
new int SetSyncPoint([In, MarshalAs(UnmanagedType.Bool)] bool bIsSyncPoint);
[PreserveSig]
new int IsPreroll();
[PreserveSig]
new int SetPreroll([In, MarshalAs(UnmanagedType.Bool)] bool bIsPreroll);
[PreserveSig]
new int GetActualDataLength();
[PreserveSig]
new int SetActualDataLength([In] int len);
[PreserveSig]
new int GetMediaType([Out] out AMMediaType ppMediaType);
[PreserveSig]
new int SetMediaType([In] AMMediaType pMediaType);
[PreserveSig]
new int IsDiscontinuity();
[PreserveSig]
new int SetDiscontinuity([In, MarshalAs(UnmanagedType.Bool)] bool bDiscontinuity);
[PreserveSig]
new int GetMediaTime(
[Out] out long pTimeStart,
[Out] out long pTimeEnd
);
[PreserveSig]
new int SetMediaTime(
[In, MarshalAs(UnmanagedType.LPStruct)] DsLong pTimeStart,
[In, MarshalAs(UnmanagedType.LPStruct)] DsLong pTimeEnd
);
#endregion
[PreserveSig]
int GetProperties(
[In] int cbProperties,
[In] IntPtr pbProperties // BYTE *
);
[PreserveSig]
int SetProperties(
[In] int cbProperties,
[In] IntPtr pbProperties // BYTE *
);
}
[ComImport, System.Security.SuppressUnmanagedCodeSecurity,
Guid("92980b30-c1de-11d2-abf5-00a0c905f375"),
InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
public interface IMemAllocatorNotifyCallbackTemp
{
[PreserveSig]
int NotifyRelease();
}
[ComImport, System.Security.SuppressUnmanagedCodeSecurity,
Guid("379a0cf0-c1de-11d2-abf5-00a0c905f375"),
InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
public interface IMemAllocatorCallbackTemp : IMemAllocator
{
#region IMemAllocator Methods
[PreserveSig]
new int SetProperties(
[In] AllocatorProperties pRequest,
[Out, MarshalAs(UnmanagedType.LPStruct)] AllocatorProperties pActual
);
[PreserveSig]
new int GetProperties([Out] AllocatorProperties pProps);
[PreserveSig]
new int Commit();
[PreserveSig]
new int Decommit();
[PreserveSig]
new int GetBuffer(
[Out] out IMediaSample ppBuffer,
[In] long pStartTime,
[In] long pEndTime,
[In] AMGBF dwFlags
);
[PreserveSig]
new int ReleaseBuffer([In] IMediaSample pBuffer);
#endregion
[PreserveSig]
int SetNotify([In] IMemAllocatorNotifyCallbackTemp pNotify);
[PreserveSig]
int GetFreeCount([Out] out int plBuffersFree);
}
[ComImport, System.Security.SuppressUnmanagedCodeSecurity,
Guid("56a8689c-0ad4-11ce-b03a-0020af0ba770"),
InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
public interface IMemAllocator
{
[PreserveSig]
int SetProperties(
[In, MarshalAs(UnmanagedType.LPStruct)] AllocatorProperties pRequest,
[Out, MarshalAs(UnmanagedType.LPStruct)] AllocatorProperties pActual
);
[PreserveSig]
int GetProperties(
[Out, MarshalAs(UnmanagedType.LPStruct)] AllocatorProperties pProps
);
[PreserveSig]
int Commit();
[PreserveSig]
int Decommit();
[PreserveSig]
int GetBuffer(
[Out] out IMediaSample ppBuffer,
[In] long pStartTime,
[In] long pEndTime,
[In] AMGBF dwFlags
);
[PreserveSig]
int ReleaseBuffer(
[In] IMediaSample pBuffer
);
}
[ComImport, System.Security.SuppressUnmanagedCodeSecurity,
Guid("ebec459c-2eca-4d42-a8af-30df557614b8"),
InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
public interface IReferenceClockTimerControl
{
[PreserveSig]
int SetDefaultTimerResolution(
long timerResolution
);
[PreserveSig]
int GetDefaultTimerResolution(
out long pTimerResolution
);
}
#endregion
}