Did some poking around to see how far along Google is with their Chromecast mirroring solution. There's plenty of evidence that there's some (possibly half baked) solution in the Play Services APK and it is not totally disabled. This is why people are seeing their "Cast" quick setting tile sometimes light up.

The odd bit is that they're not using webrtc. From my experimentation, that's the only way to do it and get suitable results.

 * can't package and stream an mp4 without it buffering
 * can't play a raw h264 or vp8 stream
 * sending frame by frames is really slow

I'm wondering if there's another magic protocol that is about to be added to the Chromecast firmware itself to support this directly. That would be ideal.

Search results:

$ grep -r -i createVirtualDisplay *
Binary file lib/armeabi-v7a/libgcastv2_base.so matches
Binary file lib/armeabi-v7a/libgcastv2_support.so matches

$ grep -r -i webrtc * 
<no matches>

$ grep -r -i CAPTURE_VIDEO *
AndroidManifest.xml:    <uses-permission android:name="android.permission.CAPTURE_VIDEO_OUTPUT" />

$ grep -r -i RemoteDisplayPro *
AndroidManifest.xml:        <service android:label="@string/cast_remote_display_provider_service" android:name="com.google.android.gms.cast.media.CastRemoteDisplayProviderService" android:permission="android.permission.BIND_REMOTE_DISPLAY" android:exported="true">

$ grep -r -i h264 *
Binary file lib/armeabi-v7a/libgcastv2_base.so matches
Binary file lib/armeabi-v7a/libgcastv2_support.so matches

$ grep -r -i vp8 *
Binary file lib/armeabi-v7a/libgcastv2_base.so matches
Binary file lib/armeabi-v7a/libgcastv2_support.so matches
Binary file lib/armeabi-v7a/libjgcastservice.so matches
Shared publiclyView activity