-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathVmRender.cs
792 lines (667 loc) · 21.4 KB
/
VmRender.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
#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.Drawing;
using System.Runtime.InteropServices;
namespace DirectShowLib
{
#region Declarations
#if ALLOW_UNTESTED_INTERFACES
/// <summary>
/// From VMRPresentationFlags
/// </summary>
[Flags]
public enum VMRPresentationFlags
{
None = 0,
SyncPoint = 0x00000001,
Preroll = 0x00000002,
Discontinuity = 0x00000004,
TimeValid = 0x00000008,
SrcDstRectsValid = 0x00000010
}
/// <summary>
/// From VMRSurfaceAllocationFlags
/// </summary>
[Flags]
public enum VMRSurfaceAllocationFlags
{
None = 0,
PixelFormatValid = 0x01,
ThreeDTarget = 0x02,
AllowSysMem = 0x04,
ForceSysMem = 0x08,
DirectedFlip = 0x10,
DXVATarget = 0x20
}
/// <summary>
/// From VMRPRESENTATIONINFO
/// </summary>
[StructLayout(LayoutKind.Sequential)]
public struct VMRPresentationInfo
{
public VMRPresentationFlags dwFlags;
public IntPtr lpSurf; //LPDIRECTDRAWSURFACE7
public long rtStart;
public long rtEnd;
public Size szAspectRatio;
public DsRect rcSrc;
public DsRect rcDst;
public int dwTypeSpecificFlags;
public int dwInterlaceFlags;
}
/// <summary>
/// From VMRALLOCATIONINFO
/// </summary>
[StructLayout(LayoutKind.Sequential)]
public struct VMRAllocationInfo
{
public VMRSurfaceAllocationFlags dwFlags;
// public BitmapInfoHeader lpHdr;
// public DDPixelFormat lpPixFmt;
public IntPtr lpHdr;
public IntPtr lpPixFmt;
public Size szAspectRatio;
public int dwMinBuffers;
public int dwMaxBuffers;
public int dwInterlaceFlags;
public Size szNativeSize;
}
#endif
/// <summary>
/// From VMRDeinterlaceTech
/// </summary>
[Flags]
public enum VMRDeinterlaceTech
{
Unknown = 0x0000,
BOBLineReplicate = 0x0001,
BOBVerticalStretch = 0x0002,
MedianFiltering = 0x0004,
EdgeFiltering = 0x0010,
FieldAdaptive = 0x0020,
PixelAdaptive = 0x0040,
MotionVectorSteered = 0x0080
}
/// <summary>
/// From VMRBITMAP_* defines
/// </summary>
[Flags]
public enum VMRBitmap
{
None = 0,
Disable = 0x00000001,
Hdc = 0x00000002,
EntireDDS = 0x00000004,
SRCColorKey = 0x00000008,
SRCRect = 0x00000010
}
/// <summary>
/// From VMRDeinterlacePrefs
/// </summary>
[Flags]
public enum VMRDeinterlacePrefs
{
None = 0,
NextBest = 0x01,
BOB = 0x02,
Weave = 0x04,
Mask = 0x07
}
/// <summary>
/// From VMRMixerPrefs
/// </summary>
[Flags]
public enum VMRMixerPrefs
{
None = 0,
NoDecimation = 0x00000001,
DecimateOutput = 0x00000002,
ARAdjustXorY = 0x00000004,
DecimationReserved = 0x00000008,
DecimateMask = 0x0000000F,
BiLinearFiltering = 0x00000010,
PointFiltering = 0x00000020,
FilteringMask = 0x000000F0,
RenderTargetRGB = 0x00000100,
RenderTargetYUV = 0x00001000,
RenderTargetYUV420 = 0x00000200,
RenderTargetYUV422 = 0x00000400,
RenderTargetYUV444 = 0x00000800,
RenderTargetReserved = 0x0000E000,
RenderTargetMask = 0x0000FF00,
DynamicSwitchToBOB = 0x00010000,
DynamicDecimateBy2 = 0x00020000,
DynamicReserved = 0x000C0000,
DynamicMask = 0x000F0000
}
/// <summary>
/// From VMRRenderPrefs
/// </summary>
[Flags]
public enum VMRRenderPrefs
{
RestrictToInitialMonitor = 0x00000000,
ForceOffscreen = 0x00000001,
ForceOverlays = 0x00000002,
AllowOverlays = 0x00000000,
AllowOffscreen = 0x00000000,
DoNotRenderColorKeyAndBorder = 0x00000008,
Reserved = 0x00000010,
PreferAGPMemWhenMixing = 0x00000020,
Mask = 0x0000003f,
}
/// <summary>
/// From VMRMode
/// </summary>
[Flags]
public enum VMRMode
{
None = 0,
Windowed = 0x00000001,
Windowless = 0x00000002,
Renderless = 0x00000004,
}
/// <summary>
/// From VMR_ASPECT_RATIO_MODE
/// </summary>
public enum VMRAspectRatioMode
{
None,
LetterBox
}
/// <summary>
/// From VMRALPHABITMAP
/// </summary>
[StructLayout(LayoutKind.Sequential)]
public struct VMRAlphaBitmap
{
public VMRBitmap dwFlags;
public IntPtr hdc; // HDC
public IntPtr pDDS; //LPDIRECTDRAWSURFACE7
public DsRect rSrc;
public NormalizedRect rDest;
public float fAlpha;
public int clrSrcKey;
}
/// <summary>
/// From VMRDeinterlaceCaps
/// </summary>
[StructLayout(LayoutKind.Sequential)]
public struct VMRDeinterlaceCaps
{
public int dwSize;
public int dwNumPreviousOutputFrames;
public int dwNumForwardRefSamples;
public int dwNumBackwardRefSamples;
public VMRDeinterlaceTech DeinterlaceTechnology;
}
/// <summary>
/// From VMRFrequency
/// </summary>
[StructLayout(LayoutKind.Sequential)]
public struct VMRFrequency
{
public int dwNumerator;
public int dwDenominator;
}
/// <summary>
/// From VMRVideoDesc
/// </summary>
[StructLayout(LayoutKind.Sequential, Pack=1)]
public struct VMRVideoDesc
{
public int dwSize;
public int dwSampleWidth;
public int dwSampleHeight;
[MarshalAs(UnmanagedType.Bool)] public bool SingleFieldPerSample;
public int dwFourCC;
public VMRFrequency InputSampleFreq;
public VMRFrequency OutputFrameFreq;
}
/// <summary>
/// From VMRVIDEOSTREAMINFO
/// </summary>
[StructLayout(LayoutKind.Sequential)]
public struct VMRVideoStreamInfo
{
public IntPtr pddsVideoSurface;
public int dwWidth;
public int dwHeight;
public int dwStrmID;
public float fAlpha;
public DDColorKey ddClrKey;
public NormalizedRect rNormal;
}
/// <summary>
/// From DDCOLORKEY
/// </summary>
[StructLayout(LayoutKind.Sequential)]
public struct DDColorKey
{
public int dw1;
public int dw2;
}
/// <summary>
/// From VMRMONITORINFO
/// </summary>
[StructLayout(LayoutKind.Sequential, CharSet=CharSet.Unicode)]
public struct VMRMonitorInfo
{
public VMRGuid guid;
public DsRect rcMonitor;
public IntPtr hMon; // HMONITOR
public int dwFlags;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst=32)] public string szDevice;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst=256)] public string szDescription;
public long liDriverVersion;
public int dwVendorId;
public int dwDeviceId;
public int dwSubSysId;
public int dwRevision;
}
/// <summary>
/// From VMRGUID
/// </summary>
[StructLayout(LayoutKind.Sequential)]
public struct VMRGuid
{
public IntPtr pGUID; // GUID *
public Guid GUID;
}
#endregion
#region Interfaces
#if ALLOW_UNTESTED_INTERFACES
[ComImport, System.Security.SuppressUnmanagedCodeSecurity,
Guid("CE704FE7-E71E-41fb-BAA2-C4403E1182F5"),
InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
public interface IVMRImagePresenter
{
[PreserveSig]
int StartPresenting([In] IntPtr dwUserID);
[PreserveSig]
int StopPresenting([In] IntPtr dwUserID);
[PreserveSig]
int PresentImage(
[In] IntPtr dwUserID,
[In] ref VMRPresentationInfo lpPresInfo
);
}
[ComImport, System.Security.SuppressUnmanagedCodeSecurity,
Guid("31ce832e-4484-458b-8cca-f4d7e3db0b52"),
InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
public interface IVMRSurfaceAllocator
{
[PreserveSig]
int AllocateSurface(
[In] IntPtr dwUserID,
[In] ref VMRAllocationInfo lpAllocInfo,
[Out] out int lpdwActualBuffers,
[In, Out] ref IntPtr lplpSurface // LPDIRECTDRAWSURFACE7
);
[PreserveSig]
int FreeSurface([In] IntPtr dwID);
[PreserveSig]
int PrepareSurface(
[In] IntPtr dwUserID,
[In] IntPtr lplpSurface, // LPDIRECTDRAWSURFACE7
[In] int dwSurfaceFlags
);
[PreserveSig]
int AdviseNotify([In] IVMRSurfaceAllocatorNotify lpIVMRSurfAllocNotify);
}
[ComImport, System.Security.SuppressUnmanagedCodeSecurity,
Guid("aada05a8-5a4e-4729-af0b-cea27aed51e2"),
InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
public interface IVMRSurfaceAllocatorNotify
{
[PreserveSig]
int AdviseSurfaceAllocator(
[In] IntPtr dwUserID,
[In] IVMRSurfaceAllocator lpIVRMSurfaceAllocator
);
[PreserveSig]
int SetDDrawDevice(
[In] IntPtr lpDDrawDevice, // LPDIRECTDRAW7
[In] IntPtr hMonitor // HMONITOR
);
[PreserveSig]
int ChangeDDrawDevice(
[In] IntPtr lpDDrawDevice, // LPDIRECTDRAW7
[In] IntPtr hMonitor // HMONITOR
);
[PreserveSig]
int RestoreDDrawSurfaces();
[PreserveSig]
int NotifyEvent(
[In] int EventCode,
[In] IntPtr Param1,
[In] IntPtr Param2
);
[PreserveSig]
int SetBorderColor([In] int clrBorder);
}
[ComImport, System.Security.SuppressUnmanagedCodeSecurity,
Guid("a9849bbe-9ec8-4263-b764-62730f0d15d0"),
InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
public interface IVMRSurface
{
[PreserveSig]
int IsSurfaceLocked();
[PreserveSig]
int LockSurface([Out] out IntPtr lpSurface); // BYTE**
[PreserveSig]
int UnlockSurface();
[PreserveSig]
int GetSurface([Out, MarshalAs(UnmanagedType.Interface)] out object lplpSurface);
}
[ComImport, System.Security.SuppressUnmanagedCodeSecurity,
Guid("e6f7ce40-4673-44f1-8f77-5499d68cb4ea"),
InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
public interface IVMRImagePresenterExclModeConfig : IVMRImagePresenterConfig
{
#region IVMRImagePresenterConfig Methods
[PreserveSig]
new int SetRenderingPrefs([In] VMRRenderPrefs dwRenderFlags);
[PreserveSig]
new int GetRenderingPrefs([Out] out VMRRenderPrefs dwRenderFlags);
#endregion
[PreserveSig]
int SetXlcModeDDObjAndPrimarySurface(
[In] IntPtr lpDDObj,
[In] IntPtr lpPrimarySurf
);
[PreserveSig]
int GetXlcModeDDObjAndPrimarySurface(
[Out] out IntPtr lpDDObj,
[Out] out IntPtr lpPrimarySurf
);
}
#endif
[ComImport, System.Security.SuppressUnmanagedCodeSecurity,
Guid("9e5530c5-7034-48b4-bb46-0b8a6efc8e36"),
InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
public interface IVMRFilterConfig
{
[PreserveSig]
int SetImageCompositor([In] IVMRImageCompositor lpVMRImgCompositor);
[PreserveSig]
int SetNumberOfStreams([In] int dwMaxStreams);
[PreserveSig]
int GetNumberOfStreams([Out] out int pdwMaxStreams);
[PreserveSig]
int SetRenderingPrefs([In] VMRRenderPrefs dwRenderFlags);
[PreserveSig]
int GetRenderingPrefs([Out] out VMRRenderPrefs pdwRenderFlags);
[PreserveSig]
int SetRenderingMode([In] VMRMode Mode);
[PreserveSig]
int GetRenderingMode([Out] out VMRMode Mode);
}
[ComImport, System.Security.SuppressUnmanagedCodeSecurity,
Guid("0eb1088c-4dcd-46f0-878f-39dae86a51b7"),
InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
public interface IVMRWindowlessControl
{
[PreserveSig]
int GetNativeVideoSize(
[Out] out int lpWidth,
[Out] out int lpHeight,
[Out] out int lpARWidth,
[Out] out int lpARHeight
);
[PreserveSig]
int GetMinIdealVideoSize(
[Out] out int lpWidth,
[Out] out int lpHeight
);
[PreserveSig]
int GetMaxIdealVideoSize(
[Out] out int lpWidth,
[Out] out int lpHeight
);
[PreserveSig]
int SetVideoPosition(
[In] DsRect lpSRCRect,
[In] DsRect lpDSTRect
);
[PreserveSig]
int GetVideoPosition(
[Out] DsRect lpSRCRect,
[Out] DsRect lpDSTRect
);
[PreserveSig]
int GetAspectRatioMode([Out] out VMRAspectRatioMode lpAspectRatioMode);
[PreserveSig]
int SetAspectRatioMode([In] VMRAspectRatioMode AspectRatioMode);
[PreserveSig]
int SetVideoClippingWindow([In] IntPtr hwnd); // HWND
[PreserveSig]
int RepaintVideo(
[In] IntPtr hwnd, // HWND
[In] IntPtr hdc // HDC
);
[PreserveSig]
int DisplayModeChanged();
/// <summary>
/// the caller is responsible for free the returned memory by calling CoTaskMemFree.
/// </summary>
[PreserveSig]
int GetCurrentImage([Out] out IntPtr lpDib); // BYTE**
[PreserveSig]
int SetBorderColor([In] int Clr);
[PreserveSig]
int GetBorderColor([Out] out int lpClr);
[PreserveSig]
int SetColorKey([In] int Clr);
[PreserveSig]
int GetColorKey([Out] out int lpClr);
}
[ComImport, System.Security.SuppressUnmanagedCodeSecurity,
Guid("ede80b5c-bad6-4623-b537-65586c9f8dfd"),
InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
public interface IVMRAspectRatioControl
{
[PreserveSig]
int GetAspectRatioMode([Out] out VMRAspectRatioMode lpdwARMode);
[PreserveSig]
int SetAspectRatioMode([In] VMRAspectRatioMode lpdwARMode);
}
[ComImport, System.Security.SuppressUnmanagedCodeSecurity,
Guid("bb057577-0db8-4e6a-87a7-1a8c9a505a0f"),
InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
public interface IVMRDeinterlaceControl
{
[PreserveSig]
int GetNumberOfDeinterlaceModes(
[In] ref VMRVideoDesc lpVideoDescription,
[In, Out] ref int lpdwNumDeinterlaceModes,
[Out, MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.Struct)] Guid[] lpDeinterlaceModes
);
[PreserveSig]
int GetDeinterlaceModeCaps(
[In, MarshalAs(UnmanagedType.LPStruct)] Guid lpDeinterlaceMode,
[In] ref VMRVideoDesc lpVideoDescription,
[In, Out] ref VMRDeinterlaceCaps lpDeinterlaceCaps
);
[PreserveSig]
int GetDeinterlaceMode(
[In] int dwStreamID,
[Out] out Guid lpDeinterlaceMode
);
[PreserveSig]
int SetDeinterlaceMode(
[In] int dwStreamID,
[In, MarshalAs(UnmanagedType.LPStruct)] Guid lpDeinterlaceMode
);
[PreserveSig]
int GetDeinterlacePrefs([Out] out VMRDeinterlacePrefs lpdwDeinterlacePrefs);
[PreserveSig]
int SetDeinterlacePrefs([In] VMRDeinterlacePrefs lpdwDeinterlacePrefs);
[PreserveSig]
int GetActualDeinterlaceMode(
[In] int dwStreamID,
[Out] out Guid lpDeinterlaceMode
);
}
[ComImport, System.Security.SuppressUnmanagedCodeSecurity,
Guid("7a4fb5af-479f-4074-bb40-ce6722e43c82"),
InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
public interface IVMRImageCompositor
{
[PreserveSig]
int InitCompositionTarget(
[In] IntPtr pD3DDevice,
[In] IntPtr pddsRenderTarget
);
[PreserveSig]
int TermCompositionTarget(
[In] IntPtr pD3DDevice,
[In] IntPtr pddsRenderTarget
);
[PreserveSig]
int SetStreamMediaType(
[In] int dwStrmID,
[In] AMMediaType pmt,
[In, MarshalAs(UnmanagedType.Bool)] bool fTexture
);
[PreserveSig]
int CompositeImage(
[In] IntPtr pD3DDevice,
[In] IntPtr pddsRenderTarget,
[In] AMMediaType pmtRenderTarget,
[In] long rtStart,
[In] long rtEnd,
[In] int dwClrBkGnd,
[In, MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.Struct, SizeParamIndex=7)] VMRVideoStreamInfo[] pVideoStreamInfo,
[In] int cStreams
);
}
[ComImport, System.Security.SuppressUnmanagedCodeSecurity,
Guid("9f3a1c85-8555-49ba-935f-be5b5b29d178"),
InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
public interface IVMRImagePresenterConfig
{
[PreserveSig]
int SetRenderingPrefs([In] VMRRenderPrefs dwRenderFlags);
[PreserveSig]
int GetRenderingPrefs([Out] out VMRRenderPrefs dwRenderFlags);
}
[ComImport, System.Security.SuppressUnmanagedCodeSecurity,
Guid("1E673275-0257-40aa-AF20-7C608D4A0428"),
InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
public interface IVMRMixerBitmap
{
[PreserveSig]
int SetAlphaBitmap([In] ref VMRAlphaBitmap pBmpParms);
[PreserveSig]
int UpdateAlphaBitmapParameters([In] ref VMRAlphaBitmap pBmpParms);
[PreserveSig]
int GetAlphaBitmapParameters([Out] out VMRAlphaBitmap pBmpParms);
}
[ComImport, System.Security.SuppressUnmanagedCodeSecurity,
Guid("9cf0b1b6-fbaa-4b7f-88cf-cf1f130a0dce"),
InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
public interface IVMRMonitorConfig
{
[PreserveSig]
int SetMonitor([In] ref VMRGuid pGUID);
[PreserveSig]
int GetMonitor([Out] out VMRGuid pGUID);
[PreserveSig]
int SetDefaultMonitor([In] ref VMRGuid pGUID);
[PreserveSig]
int GetDefaultMonitor([Out] out VMRGuid pGUID);
[PreserveSig]
int GetAvailableMonitors(
[Out, MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.Struct)] VMRMonitorInfo[] pInfo,
[In] int dwMaxInfoArraySize,
[Out] out int pdwNumDevices
);
}
[ComImport, System.Security.SuppressUnmanagedCodeSecurity,
Guid("058d1f11-2a54-4bef-bd54-df706626b727"),
InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
public interface IVMRVideoStreamControl
{
[PreserveSig]
int SetColorKey([In] ref DDColorKey lpClrKey);
[PreserveSig]
int GetColorKey([Out] out DDColorKey lpClrKey);
[PreserveSig]
int SetStreamActiveState([In, MarshalAs(UnmanagedType.Bool)] bool fActive);
[PreserveSig]
int GetStreamActiveState([Out, MarshalAs(UnmanagedType.Bool)] out bool fActive);
}
[ComImport, System.Security.SuppressUnmanagedCodeSecurity,
Guid("1c1a17b0-bed0-415d-974b-dc6696131599"),
InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
public interface IVMRMixerControl
{
[PreserveSig]
int SetAlpha(
[In] int dwStreamID,
[In] float Alpha
);
[PreserveSig]
int GetAlpha(
[In] int dwStreamID,
[Out] out float Alpha
);
[PreserveSig]
int SetZOrder(
[In] int dwStreamID,
[In] int dwZ
);
[PreserveSig]
int GetZOrder(
[In] int dwStreamID,
[Out] out int dwZ
);
[PreserveSig]
int SetOutputRect(
[In] int dwStreamID,
[In] ref NormalizedRect pRect
);
[PreserveSig]
int GetOutputRect(
[In] int dwStreamID,
[Out] out NormalizedRect pRect
);
[PreserveSig]
int SetBackgroundClr([In] int ClrBkg);
[PreserveSig]
int GetBackgroundClr([Out] out int ClrBkg);
[PreserveSig]
int SetMixingPrefs([In] VMRMixerPrefs dwMixerPrefs);
[PreserveSig]
int GetMixingPrefs([Out] out VMRMixerPrefs dwMixerPrefs);
}
[ComImport, System.Security.SuppressUnmanagedCodeSecurity,
Guid("aac18c18-e186-46d2-825d-a1f8dc8e395a"),
InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
public interface IVPManager
{
[PreserveSig]
int SetVideoPortIndex([In] int dwVideoPortIndex);
[PreserveSig]
int GetVideoPortIndex([Out] out int dwVideoPortIndex);
}
#endregion
}