Skip to main content

Stereoscopic 3D

3 replies [Last post]
asx
Offline
Joined: 2010-10-05
Points: 0

Hi,
I try to use 3D API from org.blurayx.s3d.. And I have this exception:

java.lang.IllegalStateException: <strong>3D Planes should be prepared first!</strong>
at com.samsung.bluray.ui.s3d.DirectDrawS3DImpl.drawStereoscoptic(DirectDrawS3DImpl.java:183)
at org.blurayx.s3d.DirectDrawS3D.<strong>drawStereoscopic</strong>(DirectDrawS3D.java:177)
....................................

Can anybody halp me?
My code is about this:
private DVBBufferedImage imageL = new DVBBufferedImage(1920, 1080);
private DVBBufferedImage imageR = new DVBBufferedImage(1920, 1080);

private void render() {
    DVBGraphics gL = imageL.createGraphics();
    DVBGraphics gR = imageR.createGraphics();

    // Draw something in gL and gR

    DirectDrawS3D.getInstance().<strong>drawStereoscopic</strong>(imageL, 0, 0, null, imageR, 0, 0, null);  // <strong>This method throws exception</strong>
}

How can I prepare planes ??
Alex

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
billf
Offline
Joined: 2004-02-13
Points: 0

Hi Alex,
It's probably talking about putting the video subsystem in the right mode. There are HAVi APIs for that... See HGraphicsConfigTemplateS3D, and set S3DProperty.TWO_PLANES to REQUIRED. You have to do the standard HAVi dance: Get the default HGraphicsDevice (HScreen.getDefaultHGraphicsDevice), reserve it, and call getBestConfiguration and setGraphicsConfiguration.
You may have to set the SS_Content_exist_flag in index.bdmv -- I haven't looked at the precise rules in a while, but see part 3-1 s. 5.2.2.3. In the cookbook tools, the XML tag for that is "SSContentExistFlag". Here's the cookbook log from when that was added:
------------------------------------------------------------------------
r588 | billf | 2010-01-14 10:34:29 -0800 (Thu, 14 Jan 2010) | 7 lines
<no issue #>: Added new entries to index.bdmv generator
Added some new flags to index.bdmv to support 3D, as specified by part 3-1 5.2.2.3 (V2.4d5).
HTH,
Bill

asx
Offline
Joined: 2010-10-05
Points: 0

Hi Bill,
I try to set video configuration in initXlet() method ( is it correct ? ):

HGraphicsConfigTemplateS3D template = new HGraphicsConfigTemplateS3D();
<strong>template.setPreference</strong>(HGraphicsConfigTemplateS3D.S3D, S3DProperty.TWO_PLANES, HGraphicsConfigTemplateS3D.REQUIRED);

HScreen screen = HScreen.getDefaultHScreen();
HGraphicsDevice device = screen.getDefaultHGraphicsDevice();
HGraphicsConfiguration config = device.getBestConfiguration(new HGraphicsConfigTemplate[]{template});
device.setGraphicsConfiguration(config);

I set SSContentExistFlag to true and initialOutputModePreference to Mode3D in index.bdmv.
And I have exception:
<strong>SONY</strong>:
java.lang.IllegalArgumentException: HScreenConfigTemplate.setPreference: 4, false, 1
  at org/havi/ui/HScreenConfigTemplate.setPreference(ILjava/lang/Object;I)V(bytecode:303)
  at org/havi/ui/HGraphicsConfigTemplate.setPreference(ILjava/lang/Object;I)V(bytecode:38)
  at org/blurayx/s3d/ui/<strong>HGraphicsConfigTemplateS3D.setPreference</strong>(ILjava/lang/Object;I)V(bytecode:61)
  ................................................

<strong>SAMSUNG</strong>:
java.lang.IllegalArgumentException
  at org.havi.ui.HScreenConfigTemplate.setPreference(HScreenConfigTemplate.java:643)
  at org.havi.ui.HGraphicsConfigTemplate.setPreference(HGraphicsConfigTemplate.java:383)
  at org.blurayx.s3d.ui.<strong>HGraphicsConfigTemplateS3D.setPreference</strong>(HGraphicsConfigTemplateS3D.java.262)
  ................................................
billf
Offline
Joined: 2004-02-13
Points: 0

That looks right, except that you need to call HGraphicsDevice.reserveDevice. That is, assuming the code is in an instance method of a class that implements ResourceClient:

HGraphicsConfigTemplateS3D template = new HGraphicsConfigTemplateS3D();
<strong>template.setPreference</strong>(HGraphicsConfigTemplateS3D.S3D, S3DProperty.TWO_PLANES, HGraphicsConfigTemplateS3D.REQUIRED);

HScreen screen = HScreen.getDefaultHScreen();
HGraphicsDevice device = screen.getDefaultHGraphicsDevice();
<strong>device.reserveDevice(this);</strong>
HGraphicsConfiguration config = device.getBestConfiguration(new HGraphicsConfigTemplate[]{template});
device.setGraphicsConfiguration(config);
<strong>device.releaseDevice();</strong>
<br type="_moz" />

Also, I think it's OK to do this from initXlet, but I'm not totally certain. It might be better to do it from your animation thread, started from within startXlet().
Please let us know if you get this working! I'd love to see some 3D BD-J discs out in the world...
Cheers,
Bill