Skip to main content

JNI ...AudioOutputPortImpl.c and how/where videoInfo.audioPort should be...

9 replies [Last post]
david_crandall
Offline
Joined: 2010-01-05

Deep within the JNI functionality in 'ds' there's a function call:

org_cablelabs_impl_ocap_hardware_device_AudioOutputPortImpl.c :

<br />
JNIEXPORT jboolean JNICALL<br />
Java_org_cablelabs_impl_ocap_hardware_device_AudioOutputPortImpl_nInitInfo(<br />
        JNIEnv *env, jobject obj, jint videoPortHandle)<br />

and in this call, there's this reference....

<br />
    if (MPE_SUCCESS != mpe_sndGetAudioOutputPortInfo(videoInfo.audioPort, &audioInfo))<br />
    {<br />
        return JNI_FALSE;<br />
    }<br />

and I never see videoInfo.audioPort getting set. Or at least the equivalent of the captured videoInfo getting set. (I'm fully aware that it's a local variable populated in the lines before that.)

Now I know the first thing one would have to suggest is, "I think that's an MPE layer implementation." ...and I would agree, however, some of the most prime candidates for assigning an audioPort:

<br />
mpeos_sndAddAudioOutputPort<br />
mpeos_sndRemoveAudioOutputPort<br />
mpeos_sndSetAudioOutputPortValue<br />
mpeos_sndGetAudioOutputPortInfo<br />

In this particular instance, either aren't in the code, or even mpeos_sndSetAudioOutputPortValue doesn't get called.

...and even then, that does nothing to really adhere a handle to an mpeSndAudioOutputPortInfo structure.

So, my question are:
1.) Where was the videoInfo.audioPort supposed to be assigned a handle?
2.) How was that supposed to be linked to mpe_sndAudioOutputPortInfo?

I realize I might be missing something, but I've grepped through the code pretty hard in the last couple of days, and I think I'm solid in asking this. Thanks in advance.

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
david_crandall
Offline
Joined: 2010-01-05

question for you:

On a quick grep for ri_backpanel, I really don't have a declaration of the ri_get_backpanel() functionality within the ocap tree I have (revision 10188 of the RI_Stack)

https://community.cablelabs.com/svn/OCAPRI/tags/RI_I1_1_4_REL_B/ri/RI_Stack
with root repository
Repository Root: https://community.cablelabs.com/svn
Repository UUID: e6edf6fb-f266-4316-afb4-e53d95876a76

I do see it being called, and I do see this as being a huge lightbulb moment of functionality that would be incredibly useful.

Likewise, a few of the identifiers within mpeos_dispGetoutputPortInfo from RI_Common are missing as well, but I assume that's related.

greg80303
Offline
Joined: 2008-07-03

The URL you describe contains only the RI Stack and its port to the RI PC Platform. The RI PC Platform is a PC-based set-top-box emulator which provides all of the media and cable-specific functionality. The PC Platform code is found in https://community.cablelabs.com/svn/OCAPRI/tags/RI_I1_1_4_REL_B/ri/RI_Pl... ($PLATFORMROOT).

Typically, a standard port of the RI has all of the MPEOS porting APIs under a single directory in $OCAPROOT/mpe/os. However, for the RI PC Platform port, we actually split the porting APIs in 2 pieces. The first piece contains the standard operating system functionality such as threads, networking, memory, etc. Since the RI PC Platform port runs on both Windows and Linux you will see this piece implemented twice -- $OCAPROOT/mpe/os/RI_Linux and $OCAPROOT/mpe/os/RI_Win32. The rest of the stack's MPEOS API implementations are found in ($OCAPROOT/mpe/os/RI_Common) and use the RI PC Platform APIs which can be found in $PLATFORMROOT/include. The RI PC Platform is already ported to both Windows and Linux so only one implementation of those MPEOS APIs is needed.

G

davecrandall
Offline
Joined: 2009-12-23

So... the linux port should have the ri_backpanel stuff in it?

greg80303
Offline
Joined: 2008-07-03

The RI PC Platform has the ri_backpanel APIs.

david_crandall
Offline
Joined: 2010-01-05

I can't seem to find the ri_backpanel, in that case.

I've got the PC platform copy of the RI stack---per the discussion above. I see the RI_common, RI_Linux, RI_Win32 in mpe/os. It happens to be on a linux filesystem, so I do this from [code]RI_Stack/mpe/os[/code]:

[code]grep ri_get_backpanel * -riI[/code]

...and it lists...

[code]
RI_Common/mpeos_snd.c: ri_backpanel_t* bp = ri_get_backpanel();
RI_Common/mpeos_snd.c: ri_backpanel_t* bp = ri_get_backpanel();
RI_Common/.svn/text-base/mpeos_snd.c.svn-base: ri_backpanel_t* bp = ri_get_backpanel();
RI_Common/.svn/text-base/mpeos_snd.c.svn-base: ri_backpanel_t* bp = ri_get_backpanel();
RI_Common/.svn/text-base/mpeos_disp.c.svn-base: *nPorts = ri_get_backpanel()->getVideoOutputPortNameList(
RI_Common/.svn/text-base/mpeos_disp.c.svn-base: ri_get_backpanel()->freeVideoOutputPortNameList(videoOutputPortNames);
RI_Common/.svn/text-base/mpeos_disp.c.svn-base: ri_backpanel_t* bp = ri_get_backpanel();
RI_Common/.svn/text-base/mpeos_disp.c.svn-base: ri_backpanel_t* bp = ri_get_backpanel();
RI_Common/.svn/text-base/mpeos_disp.c.svn-base: ri_backpanel_t* bp = ri_get_backpanel();
RI_Common/mpeos_disp.c: *nPorts = ri_get_backpanel()->getVideoOutputPortNameList(
RI_Common/mpeos_disp.c: ri_get_backpanel()->freeVideoOutputPortNameList(videoOutputPortNames);
RI_Common/mpeos_disp.c: ri_backpanel_t* bp = ri_get_backpanel();
RI_Common/mpeos_disp.c: ri_backpanel_t* bp = ri_get_backpanel();
RI_Common/mpeos_disp.c: ri_backpanel_t* bp = ri_get_backpanel();
[/code]

I don't see where a function definition for ri_get_backpanel().

Likewise, just grabbing an identifier out of mpeos_disp.c in RI_common:
[code]VIDEO_OUTPUT_DTCP_SUPPORTED[/code]

A grep for this yields:
[code]
grep VIDEO_OUTPUT_DTCP_SUPPORTED * -rI
mpe/os/RI_Common/.svn/text-base/mpeos_disp.c.svn-base: bp->getVideoOutputPortValue(port, VIDEO_OUTPUT_DTCP_SUPPORTED,
mpe/os/RI_Common/mpeos_disp.c: bp->getVideoOutputPortValue(port, VIDEO_OUTPUT_DTCP_SUPPORTED,
[/code]

So, I'm 99% sure I'm missing something, because I don't see where those constants are defined within the RI_Stack, either.

Thanks for your time and patience in working with me through this, I'm sure it's something simple.

greg80303
Offline
Joined: 2008-07-03

I'll try to explain it another way. There are 2 major components to this project:

1) The Open Cable Reference Implementation Stack

This is the OCAP "stack". This is all the code that implements the various OCAP/MHP specifications. If you want to port the stack to your own set-top-box, this is all you need. This is also where you would add your implementation of the MPEOS stack porting APIs for your set-top-box. The stack is located here:

https://community.cablelabs.com/svn/OCAPRI/trunk/ri/RI_Stack

The location of this SVN directory on your local system is what we define as the env var OCAPROOT.

2) The RI PC Platform

This is our virtual set-top box emulation software that runs on Windows and Linux PCs. It provides tuning, media decoding, CableCARD and other set-top specific functionality that we need to excecute the OCAP stack on a PC. We port the media and cable-specific MPEOS APIs to the APIs we have defined in this code base. The PC Platform is located here:

https://community.cablelabs.com/svn/OCAPRI/trunk/ri/RI_Platform

The location of this SVN directory on your local system is what we define as the env var PLATFORMROOT.

-------------------------------------------------------------

For Linux, our port of the OCAP stack MPEOS APIs to the PC Platform is located in $OCAPROOT/mpe/os/RI_Linux and $OCAPROOT/mpe/os/RI_Common. For Windows our port of the OCAP stack MPEOS APIs to the PC Platform is located in $OCAPROOT/mpe/os/RI_Win32 and $OCAPROOT/mpe/os/RI_Common. The files in RI_Common all reference APIs defined in the PC Platform. In all of your posts, I never once see you grepping through $PLATFORMROOT/include -- this what you are missing.

G

david_crandall
Offline
Joined: 2010-01-05

AHHH! I see the disambiguation!

EDIT: ...and subsequently the backpanel stuff. So sorry for the denseness on my part.

Message was edited by: david_crandall

csweeney
Offline
Joined: 2009-04-11

Re:1)The videoInfo.audioPort is initialized in JNIEXPORT jboolean JNICALL Java_org_cablelabs_impl_ocap_hardware_VideoOutputPortImpl_nInitInfo(JNIEnv *env, jobject obj, jint handle) (org_cablelabs_impl_ocap_hardware_VideoOutputPortImpl.c) with a call to mpe_dispGetOutputPortInfo (which maps to mpeos_dispGetOutputPortInfo, mpeos_disp.c).

mpeos_dispGetOutputPortInfo uses an RI specific concept (ri_backpanel) which utilizes information contained in platform.cfg to populate the videoInfo and videoInfo.audioPort.

Re:2) - mpe_sndAudioOutputPortInfo is populated via mpeos_sndGetAudioOutputPortInfo (mpeos_snd.c) via, again, through ri_backpanel.

Does this help?

david_crandall
Offline
Joined: 2010-01-05

It certainly doesn't hurt! Much thanks!

I'll digest this and probably come up with more questions. I was just a little more lost than normal and slightly paranoid about unimplemented/semi-implemented mpe functions.

Message was edited by: david_crandall