I'm confused about the declaration of properties in an AVStream driver.
The samples and the documentation seem to contradict each other, as do the
code I've found through Google.
Let's take an example. We're writing, among others, a TV tuner driver.
Looking in the Europa sample, in the analog tuner properties, we find,
among others:
DEFINE_KSPROPERTY_ITEM
(
KSPROPERTY_TUNER_CAPS,
AnlgTunerCapsGetHandler,
sizeof(KSPROPERTY_TUNER_CAPS_S),
sizeof(KSPROPERTY_TUNER_CAPS_S),
NULL,
NULL,
0,
NULL,
NULL,
0
),
DEFINE_KSPROPERTY_ITEM
(
KSPROPERTY_TUNER_MODE_CAPS,
AnlgTunerCapsGetHandler,
sizeof(KSPROPERTY_TUNER_MODE_CAPS_S),
sizeof(KSPROPERTY_TUNER_MODE_CAPS_S),
NULL,
NULL,
0,
NULL,
NULL,
0
),
Notice the two "sizeof" entries. According to the documentation, the first
one is supposed to have the minimum size needed to identify the request.
The second one is supposed to have the size of the data being read and
written. In both of these entries, BOTH sizes are set to the full
structure, which includes both the KSPROPERTY structure that identifies the
property, and the data to be read/written. I'm conviced the sample is
wrong. Further, if we look at the docuemntation for KSPROPERTY_TUNER_CAPS
and KSPROPERTY_TUNER_MODE_CAPS, in BOTH cases the return value is
documented as a single ULONG.
When we copy the structures above into our own AVStream analog tuner
driver, KSStudio fails to get the properties. Single-stepping through the
code, I see that the upper-level drivers are returning
STATUS_BUFFER_TOO_SMALL.
We know that the analog parts of the Europa sample have never been tested,
so I have no reason to believe the code above is actually correct.
Further, I suspect from other property samples that the first size should
actually be sizeof(KSPROPERTY), and the second size should actually be
sizeof(ULONG).
Does anyone within the sound of my voice have a WORKING AVStream tuner
driver? Can you share with me the definitions of your KSPROPERTY_ITEMS?
--
- Tim Roberts, timr@probo.com
Providenza & Boekelheide, Inc