Skip to main content

Giving error when enabling the closed caption

2 replies [Last post]
sdyavarashetti
Offline
Joined: 2010-07-27
Points: 0

In order to enable cc, we need to implement the ServiceContextListener and need to wait for the NormalContentEvent and we need to get the instance of Player and then using player instance we can get the cc instance.I have got the cc instance and i got the cc status as TURN_OFF (default value 1) and i set the value to TURN_ON i.e. 0, however it is throwing some exception.

Please find the following implemented code to enable the cc:

mScf = ServiceContextFactory.getInstance();
try {

mSc = mScf.createServiceContext();

} catch (InsufficientResourcesException e) {

fail("testSetUp" + e.getMessage());

}

Service service = null;

mSc.addListener(this);

SIManager sManager = SIManager.createInstance();

try {

service = sManager.getService(new org.ocap.net.OcapLocator(11678)); -- here passed the source id which is having cc text.

System.out.println("testSetUp():service----->>>>>>>>>>>"+service);

}

catch(Exception e){

}

mPlayer = null;

mSc.select(service);

waitServiceContextEvent();

System.out.println("testSetUp():mPlayer----->>>>>>>>>>>"+mPlayer); -- testSetUp():mPlayer----->>>>>>>>>>>TSBServiceMediaHandler@3c1d233a

mCcControl = (ClosedCaptioningControl) mPlayer.getControl("org.ocap.media.ClosedCaptioningControl");

System.out.println("testSetUp():mCcControl----->>>>>>>>>>>"+mCcControl); -- testSetUp():mCcControl----->>>>>>>>>>>org.cablelabs.impl.media.player.AbstractServicePlayer$ClosedCaptioningControlImpl@741226da

final int mState = mCcControl.getClosedCaptioningState();

System.out.println("testSetUp():mState----->>>>>>>>>>>"+mState); -- testSetUp():mState----->>>>>>>>>>>0

if (mState == ClosedCaptioningControl.CC_TURN_OFF) {

mCcControl.setClosedCaptioningState(ClosedCaptioningControl.CC_TURN_ON); -- here it is throwing exception as -- RI.Stack- ERROR in jniSetCCState: mpe_ccSetClosedCaptioning() = 102

}

System.out.println("testSetUp():after Change----->>>>>>>>>>>"+ mCcControl.getClosedCaptioningState());

mSc.stop();

waitServiceContextEvent();

mSc.removeListener(this);

mSc.destroy();

private void waitServiceContextEvent() {

synchronized (lockServiceContext) {

try {

lockServiceContext.wait(WAIT_TIME);

} catch (InterruptedException e) {

}

}

}

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
csweeney
Offline
Joined: 2009-04-11
Points: 0

A quick scan of the codebase indicates that the underlying implementation (in mpeos_caption.c) for mpe_ccSetClosedCaptioning is not implemented - that is why the stack is throwing the exception you are seeing.

I believe that the RI does not currently provide support for closed captioning - the basic framework is in place, but not (yet) fleshed out.

greg80303
Offline
Joined: 2008-07-03
Points: 0

A slight clarification -- the "RI PC Platform" does not support closed captioning at this time. The platform-independent pieces of the RI stack should have most if not all CC functionality implemented. However, if you want to test an application's control over CC, you would only be able to do so on a real set-top or other platform that has implemented the MPEOS API described above.

G