Skip to main content

Video in Background

8 replies [Last post]
mmckenna
Offline
Joined: 2008-07-31

Hello,

Is there a way to edit the RI's config files to play a video in the background?

Thank you!

Matt

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
greg80303
Offline
Joined: 2008-07-03

Are you running the RI by itself (standalone, using the runRI.sh script) or within the tru2way Workbench SDK?

Regardless of the method, you will definitely need to write an OCAP application that performs a service selection. If you are running the RI standalone with all the default configuration files, you can select the services ocap://0x45a or ocap://0x45b and you should see video. If you are using the SDK you can use the GUI tools to generate your own channel map and provide your own MPEG files.

Greg

mmckenna
Offline
Joined: 2008-07-31

Hello Greg,

Thanks for the info. Initially, I wanted to use the RI standalone because I wasn't able to get the Eclipse plug-in to work correctly. However, I have since been able to get the plug-in functioning.

Unfortunately, I have been unable to get and MPEG2 transport to play in the background.

Here is what I tried:
* Create a "HelloWorld" project using the wizard
* Updated default_channel_map_configuration to use my MPEG2 + PID as the default background video
* Packaged the service
* Ran the RI using the run configuration

When following these steps, I just get a black background. Any ideas on what I might be missing?

Thank you!

Matt

greg80303
Offline
Joined: 2008-07-03

I am not too familiar with the HelloWorld application, but I'm pretty sure that it does not do service selection. The RI itself will not just automatically display video. You have to write OCAP application code that selects a particular service.

mmckenna
Offline
Joined: 2008-07-31

Thanks, Greg. Do you know if there is example code out there that details service selection? I tried two different methods: (1) using the service locator you suggested and (2) selecting channel 1. I wasn't able to get either working.

For (1) the ocap://0x45b locator, I received an error doing a getService(loc) from the SIManager:

ERROR RI.Stack - 10641 [pool-6] ERROR service.SICacheImpl - Lookup failed due to SIDatabaseException. Locator=ocap://0x45b
ERROR RI.Stack - org.cablelabs.impl.service.SIRequestInvalidException:
at org.cablelabs.impl.manager.service.SIDatabaseImpl.nativeGetServiceBySourceID(Native Method)
at org.cablelabs.impl.manager.service.SIDatabaseImpl.getServiceBySourceID(SIDatabaseImpl.java:554)
at org.cablelabs.impl.manager.service.SICacheImpl.getService(SICacheImpl.java:1330)
at org.cablelabs.impl.manager.service.SIManagerImpl.getService(SIManagerImpl.java:256)
at org.cablelabs.impl.manager.service.DVRSIManagerImpl.getService(DVRSIManagerImpl.java:74)
at org.cablelabs.impl.manager.service.HNSIManagerImpl.getService(HNSIManagerImpl.java:34)
at org.ocapproject.xlet.HelloWorld.startXlet(HelloWorld.java:141)
at org.cablelabs.impl.manager.application.JavaTVXlet.startXlet(Xlet.java:120)
at org.cablelabs.impl.manager.application.XletApp$7.doRun(XletApp.java:819)
at org.cablelabs.impl.manager.application.XletApp$Returnable.run(XletApp.java:689)
at org.cablelabs.impl.manager.application.AbstractCallerContext$2.run(AbstractCallerConINFO RI.Stack - (JVM stdout) javax.tv.locator.InvalidLocatorException: Lookup failed due to org.cablelabs.impl.service.SIRequestInvalidException:

For (2) selecting channel 1, I get an error about NOT_PRESENTING:

INFO RI.Stack - 10266 [pool-4] INFO application.Application$State - appid=0 NOT_LOADED->~AUTO_PARTIALLY_LOADED success
INFO RI.Stack - 10297 [pool-4] INFO application.Application$State - appid=0 ~AUTO_PARTIALLY_LOADED->LOADED success
INFO RI.Stack - (JVM stdout) Local Service 1
INFO RI.Stack - (JVM stdout) CH1
INFO RI.Stack - 10344 [pool-4] INFO application.Application$State - appid=0 LOADED->~INITED success
INFO RI.Stack - 10344 [pool-4] INFO selection.ServiceContextImpl - ServiceContext instance created: (id 947cdc20, no delegate)
INFO RI.Stack - 10360 [pool-4] INFO selection.ServiceContextImpl - select service - new service: AbstractService[0x2beef]: (id 947cdc20, no delegate)
INFO RI.Stack - 10360 [System-1] INFO selection.ServiceContextImpl - select called in NOT PRESENTING: (id 947cdc20, no delegate)
INFO RI.Stack - 10360 [System-1] INFO selection.ServiceContextImpl - setting state to PRESENTING_PENDING: (id 947cdc20, no delegate)
INFO RI.Stack - 10375 [System-1] INFO selection.ServiceContextImpl - calling delegate.present: (id 947cdc20, no delegate)
INFO RI.Stack - 10375 [System-1] INFO selection.AbstractServiceContextDelegate - present - service: AbstractService[0x2beef], locators: null
INFO RI.Stack - 10375 [System-1] INFO selection.ServiceContextImpl - delegate callback - notPresenting - javax.tv.service.selection.SelectionFailedEvent, reason: 6: (id 947cdc20, delegate: AbstractServiceContextDelegate - service: null)
INFO RI.Stack - 10407 [System-1] INFO selection.ServiceContextImpl - received notPresenting in PRESENTING_PENDING: (id 947cdc20, delegate: AbstractServiceContextDelegate - service: null)
INFO RI.Stack - 10422 [System-1] INFO selection.ServiceContextImpl - reason was not USER_STOP: (id 947cdc20, delegate: AbstractServiceContextDelegate - service: null)
INFO RI.Stack - 10438 [System-1] INFO selection.ServiceContextImpl - posting event type: javax.tv.service.selection.SelectionFailedEvent, reason 6: (id 947cdc20, delegate: AbstractServiceContextDelegate - service: null)
INFO RI.Stack - 10438 [System-1] INFO selection.ServiceContextImpl - setting state to NOT_PRESENTING: (id 947cdc20, delegate: AbstractServiceContextDelegate - service: null)
INFO RI.Stack - 10453 [System-1] INFO selection.ServiceContextImpl - reselecting last presented service: (id 947cdc20, delegate: AbstractServiceContextDelegate - service: null)
INFO RI.Stack - 10469 [System-1] INFO selection.ServiceContextImpl - setting state to NOT_PRESENTING: (id 947cdc20, delegate: AbstractServiceContextDelegate - service: null)
INFO RI.Stack - 10469 [pool-4] INFO application.Application$State - appid=0 LOADED->STARTED success
INFO RI.Stack - 10485 [System-1] INFO selection.AbstractServiceContextDelegate - unable to add service to database: AbstractService[0x2beef]
INFO RI.Stack - - Found descriptor tag: 0x93 (length 3)

Any thoughts on this? Thank you!

Matt

mmckenna
Offline
Joined: 2008-07-31

Hello again Greg,

You mentioned I should be using the 0x43a or 0x43b locator, but doing a javax.tv.locator.LocatorFactory.getInstance().createLocator("ocap://0x45a") does not return a Locator. Am I doing that correctly?

Secondly, I've been trying to simply select Channel 1 that was associated with a video file via the Eclipse plugin. I had success selecting channel #1, but no success in playing back video. Here is the relevant part of the OCAP RI log:

INFO RI.Stack - (JVM stdout) SERVICE NAME: CH 1
INFO RI.Stack - 11875 [pool-3] INFO selection.ServiceContextImpl - ServiceContext instance created: (id 7021d9e7, no delegate)
INFO RI.Stack - 11890 [pool-3] INFO selection.ServiceContextImpl - select service - new service: org.cablelabs.impl.service.javatv.service.ServiceImpl@8b679e0a[uniqueID=ServiceImpl467905440, locator=ocap://0x1, handle=org.cablelabs.impl.manager.service.SIDatabaseImpl$ServiceHandleImpl@1be3aba0[handle=1be3aba0], name=CH 1, serviceType=UNKNOWN, serviceNumber=1, minorNumber=-1, lsData[language=null], locData=null]: (id 7021d9e7, no delegate)
INFO RI.Stack - 11937 [System-1] INFO selection.ServiceContextImpl - select called in NOT PRESENTING: (id 7021d9e7, no delegate)
INFO RI.Stack - 11968 [System-1] INFO selection.ServiceContextImpl - setting state to PRESENTING_PENDING: (id 7021d9e7, no delegate)
INFO RI.Stack - 11968 [pool-3] INFO application.Application$State - appid=0 LOADED->~INITED success
INFO RI.Stack - 11984 [System-1] INFO selection.ServiceContextImpl - calling delegate.present: (id 7021d9e7, no delegate)
INFO RI.Stack - 12015 [pool-3] INFO application.Application$State - appid=0 LOADED->STARTED success

This is how I am selecting the service:

public void initXlet(javax.tv.xlet.XletContext ctx)
throws javax.tv.xlet.XletStateChangeException {

SIManager siManager = SIManager.createInstance();

this.xletContext = ctx;

setLayout(null);
setSize(640,480);

scene = HSceneFactory.getInstance().getDefaultHScene();
scene.setSize(600,440);
scene.setLocation(40, 40);
scene.add(this);
scene.setVisible(true);
setForeground(Color.white);
setBackground(Color.lightGray);

ServiceList services = SIManager.createInstance().filterServices(null);
Service service = services.getService(1);
System.out.println("SERVICE NAME: " + service.getName());

try {
sc = ServiceContextFactory.getInstance().createServiceContext();
sc.select(service);
} catch (SecurityException e) {
e.printStackTrace();
} catch (ServiceContextException e) {
e.printStackTrace();
}

}

Do you have any thoughts on this issue?

Thank you!

Matt

Message was edited by: mmckenna

greg80303
Offline
Joined: 2008-07-03

Don't worry about creating locators for right now. Your test Xlet seems just fine the way it is.

The key points are to:

1) Create your channel map by using the Eclipse plugin (there is a button on the main Eclipse tool bar that allows you to manage custom channel maps). You must define channels using that tool that map to MPEG2 transport stream files that you have on your local system. The frequency, modulation, and sourceID values can be specified as anything -- but the program number MUST correspond to a program number within the associated MPEG file that contains at least a video elementary stream.

2) When you create a run configuration for your xlet, you MUST also choose the channel map you created. If you do not choose your channel map, it will not be present when your xlet runs.

G

mmckenna
Offline
Joined: 2008-07-31

Thanks for the help, Greg.

I think I'm getting closer. However, the log gives me an error about my stream not having a PCR (it does).

INFO RI.Stack - 10266 [System-1] INFO selection.ServiceContextImpl - received presenting in PRESENTING_PENDING: (id 23566b6e, delegate: AbstractServiceContextDelegate - service: AbstractService[0x2beef])
INFO RI.Stack - 10281 [pool-4] INFO application.Application$State - appid=0 NOT_LOADED->~AUTO_PARTIALLY_LOADED success
INFO RI.Stack - 10281 [System-1] INFO selection.ServiceContextImpl - setting state to PRESENTING: (id 23566b6e, delegate: AbstractServiceContextDelegate - service: AbstractService[0x2beef])
INFO RI.Stack - 10297 [System-1] INFO selection.ServiceContextImpl - posting NormalContentEvent: (id 23566b6e, delegate: AbstractServiceContextDelegate - service: AbstractService[0x2beef])
INFO RI.Stack - 10328 [pool-4] INFO application.Application$State - appid=0 ~AUTO_PARTIALLY_LOADED->LOADED success
INFO RI.Stack - (JVM stdout) SERVICE NAME: CH 1
INFO RI.Stack - 10375 [pool-4] INFO selection.ServiceContextImpl - ServiceContext instance created: (id e2b1cfaf, no delegate)
INFO RI.Stack - 10375 [pool-4] INFO selection.ServiceContextImpl - select service - new service: org.cablelabs.impl.service.javatv.service.ServiceImpl@53b69fa9[uniqueID=ServiceImpl469983536, locator=ocap://0x1, handle=org.cablelabs.impl.manager.service.SIDatabaseImpl$ServiceHandleImpl@1c036130[handle=1c036130], name=CH 1, serviceType=UNKNOWN, serviceNumber=1, minorNumber=-1, lsData[language=null], locData=null]: (id e2b1cfaf, no delegate)
INFO RI.Stack - 10391 [pool-4] INFO application.Application$State - appid=0 LOADED->~INITED success
INFO RI.Stack - 10406 [System-1] INFO selection.ServiceContextImpl - select called in NOT PRESENTING: (id e2b1cfaf, no delegate)
INFO RI.Stack - 10422 [System-1] INFO selection.ServiceContextImpl - setting state to PRESENTING_PENDING: (id e2b1cfaf, no delegate)
INFO RI.Stack - 10422 [System-1] INFO selection.ServiceContextImpl - calling delegate.present: (id e2b1cfaf, no delegate)
INFO RI.Stack - 10437 [System-1] INFO selection.DVRBroadcastServiceContextDelegate - present - new service: org.cablelabs.impl.service.javatv.service.ServiceImpl@53b69fa9[uniqueID=ServiceImpl469983536, locator=ocap://0x1, handle=org.cablelabs.impl.manager.service.SIDatabaseImpl$ServiceHandleImpl@1c036130[handle=1c036130], name=CH 1, serviceType=UNKNOWN, serviceNumber=1, minorNumber=-1, lsData[language=null], locData=null], locators: null
INFO RI.Stack - 10437 [pool-4] INFO application.Application$State - appid=0 LOADED->STARTED success
INFO RI.Stack - 10469 [System-1] INFO timeshift.TimeShiftWindow - TSW 0x26321148: setStateNoNotify(): Changed from state NOT_TUNED to TUNE_PENDING
INFO RI.Stack - 10484 [System-1] INFO selection.DVRBroadcastServiceContextDelegate - setting currentState to PRESENTING_PENDING
INFO RI.Stack - 10516 [pool-8] INFO service.SICacheImpl - org.cablelabs.impl.manager.service.SICacheImpl@c613bbf8 Failed to add object to service details cache due to PCR not being available: org.cablelabs.impl.service.javatv.navigation.ServiceDetailsImpl@42762f7b[uniqueID=ServiceDetailsImpl469983536, locator=ocap://0x1, handle=org.cablelabs.impl.manager.service.SIDatabaseImpl$ServiceDetailsHandleImpl@1c036130[handle=1c036130], sourceID=1, programNumber=258, appID=-1, longName=, deliverySystemType=CABLE, serviceInformationType=SCTE_SI, updateTime=Tue Mar 23 21:08:55 GMT 2010, caSystemIDs=[ ], isFree=true, pcrPID=-1, lsData=null]
INFO RI.Stack - Tune request returned success! Freq=63000000, Mode=8, ProgNum=258. Tune started!
INFO RI.Stack - tunerEventCallback -- Successful tune! Transition from NOSYNC to SYNC state!
INFO RI.Stack - 13609 [System-1] INFO timeshift.TimeShiftWindow - TSW 0x26321148: setStateAndNotify(): Changed from state TUNE_PENDING to TUNED_SYNCED
INFO RI.Stack - 13625 [pool-12] INFO selection.DVRBroadcastServiceContextDelegate - TSWCL - got new state TUNED_SYNCED (4) from TUNE_PENDING (3) for TSWC 0x5f0c974d:[nlist 1,ru org.cablelabs.impl.service.ServiceContextResourceUsageImpl@1672235534[id=0,prio=0,org.davic.net.tuning.NetworkInterfaceController,org.havi.ui.HVideoDevice,],tsw TSW 0x26321148:[INFO RI.Stack - 13641 [pool-12] INFO selection.DVRBroadcastServiceContextDelegate - TSWCL - TUNED_SYNCED from TUNE_PENDING - setting live and calling sourceReady
INFO RI.Stack - 13656 [pool-12] INFO selection.DVRBroadcastServiceContextDelegate - setLive - Enabling liveplayback
INFO RI.Stack - 13656 [pool-12] INFO selection.DVRBroadcastServiceContextDelegate - sourceReady
INFO RI.Stack - 13656 [pool-12] INFO selection.DVRBroadcastServiceContextDelegate - creating serviceMediaHandler
INFO RI.Stack - 13672 [pool-13] INFO service.SICacheImpl - org.cablelabs.impl.manager.service.SICacheImpl@c613bbf8 Failed to add object to service details cache due to PCR not being available: org.cablelabs.impl.service.javatv.navigation.ServiceDetailsImpl@a60a779f[uniqueID=ServiceDetailsImpl469983536, locator=ocap://0x1, handle=org.cablelabs.impl.manager.service.SIDatabaseImpl$ServiceDetailsHandleImpl@1c036130[handle=1c036130], sourceID=1, programNumber=258, appID=-1, longName=, deliverySystemType=CABLE, serviceInformationType=SCTE_SI, updateTime=Tue Mar 23 21:08:55 GMT 2010, caSystemIDs=[ ], isFree=true, pcrPID=-1, lsData=null]
INFO RI.Stack - 13703 [pool-12] INFO selection.ServiceMediaHandlerCreationDelegate - createServiceMediaHandler - details: org.cablelabs.impl.service.javatv.navigation.ServiceDetailsImpl@a60a779f[uniqueID=ServiceDetailsImpl469983536, locator=ocap://0x1, handle=org.cablelabs.impl.manager.service.SIDatabaseImpl$ServiceDetailsHandleImpl@1c036130[handle=1c036130], sourceID=1, programNumber=258, appID=-1, longName=, deliverySystemType=CABLE, serviceInformationType=SCTE_SI, updateTime=Tue Mar 23 21:08:55 GMT 2010, caSystemIDs=[ ], isFree=true, pcrPID=-1, lsData=null], locators: null
INFO RI.Stack - 13797 [pool-12] INFO player.AbstractServicePlayer - addPresentationModeListener: org.cablelabs.impl.service.javatv.selection.DVRBroadcastServiceContextDelegate$PresentationModeListenerImpl@12a4ca04
INFO RI.Stack - 13812 [pool-12] INFO selection.DVRBroadcastServiceContextDelegate - starting serviceMediaHandler: TSBServiceMediaHandler@94b9d268
INFO RI.Stack - 13812 [pool-12] INFO player.AbstractPlayer - start() [Unrealized]
INFO RI.Stack - 13859 [pool-15] INFO presentation.AbstractServicePresentation - doStart - AbstractServicePresentation: 28deb8ef
INFO RI.Stack - 13875 [pool-15] INFO presentation.AbstractServicePresentation - startSessionChange - trigger: NEW_SELECTED_SERVICE - AbstractServicePresentation: 28deb8ef
INFO RI.Stack - 13875 [pool-15] INFO presentation.AbstractServicePresentation - stopCurrentSession - AbstractServicePresentation: 28deb8ef
INFO RI.Stack - IB_PAT event, ts_handle: 0x1c035fb0
INFO RI.Stack - 16656 [pool-15] INFO presentation.AbstractDVRServicePresentation - doStartSession: Selection { trigger=NEW_SELECTED_SERVICE, svcDetails=org.cablelabs.impl.service.javatv.navigation.ServiceDetailsImpl@a60a779f[uniqueID=ServiceDetailsImpl469983536, locator=ocap://0x1, handle=org.cablelabs.impl.manager.service.SIDatabaseImpl$ServiceDetailsHandleImpl@1c036130[handle=1c036130], sourceID=1, programNumber=258, appID=-1, longName=, deliverySystemType=CABLE, serviceInformationType=SCTE_SI, updateTime=Tue Mar 23 21:08:55 GMT 2010, caSystemIDs=[ ], isFree=true, pcrPID=-1, lsData=null], locators=null, isDefault=true }, live: true
INFO RI.Stack - 16687 [pool-15] INFO presentation.AbstractDVRServicePresentation - initial components not presentable - selection: Selection { trigger=NEW_SELECTED_SERVICE, svcDetails=org.cablelabs.impl.service.javatv.navigation.ServiceDetailsImpl@a60a779f[uniqueID=ServiceDetailsImpl469983536, locator=ocap://0x1, handle=org.cablelabs.impl.manager.service.SIDatabaseImpl$ServiceDetailsHandleImpl@1c036130[handle=1c036130], sourceID=1, programNumber=258, appID=-1, longName=, deliverySystemType=CABLE, serviceInformationType=SCTE_SI, updateTime=Tue Mar 23 21:08:55 GMT 2010, caSystemIDs=[ ], isFree=true, pcrPID=-1, lsData=null], locators=null, isDefault=true }

Have you run into this issue before?

Thanks!

Matt

mmckenna
Offline
Joined: 2008-07-31

Following up:

I tried again using the streams that live in the OCAP RI file system. The video plays back. I'm assuming this means there is something wrong with my MPEG transport streams.

If anyone has had success transcoding video into compliant transport streams, any tips are appreciated!

Thank you!

Matt