Add asInputSink() to IComponent

By making IComponent present itself as an IInputSink, the wrapper code
can be made to execute in the same process as the IComponent instance,
hence reducing an IPC hop in the case where an InputSurface comes from a
different process.

Test: make cts -j123 && cts-tradefed run cts-dev -m \
CtsMediaTestCases --compatibility:module-arg \
CtsMediaTestCases:include-annotation:\
android.platform.test.annotations.RequiresDevice

Bug: 126296132
Change-Id: I61409ccfa9a9d6b152e2c9363ff119302ce8ae1a
diff --git a/media/c2/1.0/IComponent.hal b/media/c2/1.0/IComponent.hal
index 7fd551f..abd1448 100644
--- a/media/c2/1.0/IComponent.hal
+++ b/media/c2/1.0/IComponent.hal
@@ -22,6 +22,7 @@
 import IConfigurable;
 import IComponentInterface;
 import IComponentListener;
+import IInputSink;
 import IInputSurface;
 import IInputSurfaceConnection;
 
@@ -355,11 +356,19 @@
      * Returns the @ref IComponentInterface instance associated to this
      * component.
      *
-     * An @p IConfigurable instance for the component can be obtained by calling
+     * An @ref IConfigurable instance for the component can be obtained by calling
      * IComponentInterface::getConfigurable() on the returned @p intf.
      *
      * @return intf `IComponentInterface` instance. This must not be null.
      */
     getInterface() generates (IComponentInterface intf);
+
+    /**
+     * Returns an @ref IInputSink instance that has the component as the
+     * underlying implementation.
+     *
+     * @return sink `IInputSink` instance.
+     */
+    asInputSink() generates (IInputSink sink);
 };