0

Currently I'm working with DirectShow.NET, an unofficial .NET "port" for Microsoft's DirectShow (C++).

Both IAMAnalogVideoDecoder and IAMTVTuner declare the method get_AvailableVideoFormats. This is how the method is defined in the official docs:

HRESULT get_AvailableTVFormats(
  [out]  long *lAnalogVideoStandard
);

It's not clear to me if this parameter is a pointer to a single AnalogVideoStandard, or a enumeration. Unfortunatelly I'm too inexperienced with C++ to fully understand the docs. Because of the methods name, I would expect it to be a enumeration, but is it?

The reason I'm asking this, is because in the .NET library, this parameter is not a enumeration, just a single value. I find this very strange, since I'm expecting to get multiple "available video formats" here.


By the way, AnalogVideoStandard is an enum.

roalz
  • 2,699
  • 3
  • 25
  • 42
Rudey
  • 4,717
  • 4
  • 42
  • 84
  • Look at the [MSDN article about C# enums](http://msdn.microsoft.com/en-us/library/vstudio/cc138362.aspx), particularly the bit about "Enumeration types as bit flags". – Jean Hominal Jan 30 '13 at 10:22

1 Answers1

2

It's not clear to me if this parameter is a pointer to a single AnalogVideoStandard, or a enumeration.

It's neither1:

Pointer to a variable that receives a bitwise OR of zero or more flags from the AnalogVideoStandard enumeration.

It's a pointer to a value that represents zero or more AnalogVideoStandards.

This answer should explain the rest. You should be able to apply this answer to your .NET code.

1 Technically it could be an enumeration value in C# because enum types can have a FlagsAttribute applied to them but there's no equivalent in C++, you just | values together with no special fanfare.

Community
  • 1
  • 1
ta.speot.is
  • 26,914
  • 8
  • 68
  • 96
  • Ah, I was wondering why DirectShow used `1, 2, 4, 8, 16, ...` as enum values. Now I know why. Those links were very helpful, thanks! Just one question though. Do you happen to know how to enumerate through all `AnalogVideoStandard` in this pointer? – Rudey Jan 30 '13 at 10:26