Source code for Android HDMI IN apk -VIM 4

Dear Nick,
I have a streaming product where I use BPI-W2 (android) and stream HDMI Input from camera to youtube with custom HTML overlays.

I want to switch to VIM 4 and use same app here. Need to get code on getting HDMI video source.

Can you please share source code for any APK that has functionality to take the HDMI input video? Preferably the one where hdmi source is exposed as default camera.

Yes, we will upload the source code to GitHub, will update you when we done.

Great. Really appreciate that.

may be im wrong ? but whats relation with Realtek RTD1296 and Amlogic ?

No relationship.

He is just informing that he uses W2 currently and want to replace it with Vim4.

Correct. I am currently using W2. Want to check my app on VIM4 as it has touch screen on android and wifi6.

You can get the source code here: https://dl.khadas.com/development/LiveTv.tgz

Thanks a lot. Will go over and get back if there are any questions.

I went over but this seems to be a smart TV app to reads HDMI Inputs connected to TV. Please correct me if I am wrong. The box is yet to reach me so not able to check completely.
I am looking at an android apk example where hdmi input source is accessed on VIM4 android box. I want the library that gives access to the Video and Audio of the HDMI Input source (like a camera) connected to the HDMI IN of VIM4 with android OS. If there is any documentation please share along with APK and the Source Code.
Really appreciate any help on this.

@Ven_Ira You can git clone this code. The source code of HDMI in is apps/TvInput.

KSettings 64bit code

an android apk example where hdmi input source is accessed on VIM4 android box:

    public static final String EXTRA_INPUT_ID = "android.media.tv.extra.INPUT_ID";

    if (HDMI_IN_KEY.equals(key)){
            //HDMI2
            Intent intent = new Intent(TvInputManager.ACTION_SETUP_INPUTS);
            intent.putExtra("from_tv_source", true);
            intent.putExtra(TvInputInfo.EXTRA_INPUT_ID, "com.droidlogic.tvinput/.services.Hdmi2InputService/HW6");
            startActivity(intent);
            //Settings.System.putInt(mContext.getContentResolver(), DroidLogicTvUtils.TV_CURRENT_DEVICE_ID, TvControlManager.AM_AUDIO_HDMI2);

        }
1 Like

Really appreciate it. Thank you. Will check this out.

Attached is more or less roughly what I am trying to accomplish.
I should be able to do this with VIM4 Android right.

Got the board and was able to get HDMI input working but need small insight here.

I am getting the camera input through intent (below code you recommended) but I want to show the camera preview on a surface. Can you point to me on how can I access HDMI2 without using intent.


Intent intent = new Intent(TvInputManager.ACTION_SETUP_INPUTS);
intent.putExtra(“from_tv_source”, true);
intent.putExtra(TvInputInfo.EXTRA_INPUT_ID, “com.droidlogic.tvinput/.services.Hdmi2InputService/HW6”);
startActivity(intent);

Sorry. I don’t know. However, you can study the code to see how to implement it.

Hi Team,
I am in similar boat. When i go through code, I am unable to find and make a call to display my input surface on Vim4’s native preview display.

I was using Realtek HDMI IN and passing my surface for preview like below:

private RtkHDMIRxManager hdmiRxManager;

hdmiRxManager.setPreviewDisplay3(surfaceTexture); // Exposed method from Realtek to display my surface

And the internal code(from .class file) looks like below

public final void setPreviewDisplay3(SurfaceTexture surfaceTexture) throws IOException {
        Surface surface = new Surface(surfaceTexture);
        this.native_setPreviewDisplay(surface);
    }

It will be very helpful for me, if you can guide me how to make a call to native preview display.

Thanks.

Hmm, I want to build LiveTV.apk but My Android Studio doesn’t work.

Task :common:extractDebugProto FAILED
Task :common:extractIncludeDebugProto FAILED
Task :common:extractProto FAILED
Task :tuner:extractDebugProto FAILED
Task :tuner:extractProto FAILED

Anybody have this working? I’ve tried running the LiveTV app but I cant get android studio to build it. Is there a simple demo somewhere of using the HDMI input? It would be great to use the Camera APIs to record the HDMI input. Is that possible?

Also interested in this. I want to do OSD overlay on top of the HDMI input and best thing would be grabbing each frame, modifying and senting to HDMI out. Is that doable?

PS. Lookin at this example: GitHub - JakeWharton/Telecine: Record full-resolution video on your Android devices.