Important: |
---|
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist. |
The CbaseObjectclass is the root of all base classes. It exists primarily to provide debugging assistance by keeping a count of all DirectShow objects that are active.
All derived base class constructors provide a debugging object name as the first parameter and call the CBaseObjectconstructor.
You can view the debugging object name sent to this base class on a debugging monitor.
The following illustration shows the class hierarchy for CBaseObjectand CUnknown.
All DirectShow classes that implement interfaces derive from a base class called CUnknown, which is derived from CBaseObject. CUnknownimplements the INonDelegatingUnknowninterface which, like the IUnknowninterface, provides methods to request an interface, and to add or release references to that interface.
Two interfaces implement the services of IUnknownbecause of aggregation. Aggregation is the COM term for the combining of more than one object into a single larger object.
Although filter graph objects, such as filters and pins, are rarely aggregated, the capability is available for future extensibility and also for implementing plug-in distributors (PID), which are objects that are aggregated with the filter graph manager. In an aggregated object, the outer object(the one containing the other objects) uses the IUnknowninterface to communicate outside the object.
The IUnknowninterface on the outer object passes out references to the IUnknowninterfaces of its internal objects. That is, when an application calls the IUnknowninterface on the outer object and asks for the interface belonging to one of its internal objects, the outer object calls the IUnknowninterface of the internal object to retrieve the requested interface.
Because the internal objects must delegate IUnknowninterfaces to the IUnknownof the outer object, the IUnknowninterface of the internal object should not be accessed privately (that is, without going through the outer object's IUnknowninterface).
The internal object's IUnknownis reserved exclusively for communicating through the outer object. However, it is possible that objects will attempt to connect to other objects privately, without knowledge of the outer object. For example, pins on filters are likely to need to query interfaces on pins of other objects privately.
The INonDelegatingUnknowninterface provides direct, private access to interfaces, regardless of whether the object is aggregated.
Direct access is important in most communication between the DirectShow objects such as pins, allocators, and filters, and is the default method of communication.
In fact, the base classes implement the IUnknowninterface on nonaggregated objects to call the nondelegating interface directly. The nonaggregated objects include almost every object in the filter graph)