Skip to main content

Giving error when enabling the closed caption

2 replies [Last post]
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;


SIManager sManager = SIManager.createInstance();

try {

service = sManager.getService(new; -- here passed the source id which is having cc text.



catch(Exception e){


mPlayer = null;;


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

mCcControl = (ClosedCaptioningControl) mPlayer.getControl("");

System.out.println("testSetUp():mCcControl----->>>>>>>>>>>"+mCcControl); -- testSetUp():mCcControl----->>>>>>>>>>>$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());





private void waitServiceContextEvent() {

synchronized (lockServiceContext) {

try {


} catch (InterruptedException e) {




Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
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.

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.