0

I want to understand the working principles of the HTC Evo 3D's 3D Display; however, the code and HTCDev's tutorial do not help on this. It is said that the SEI FPA bit in the header overrides the choice which is given by hand such as:

public void surfaceChanged(SurfaceHolder surfaceholder, int i, int j, int k) {
    holder = surfaceholder;
    enableS3D(true, holder.getSurface()); // note SEI FPA flag in content
                                          // overrides this
}

The play video code:

private void playVideo() {
    release();
    fileName = "HTCDemo.mp4";
    try {
        mediaPlayer = new MediaPlayer();
        final AssetFileDescriptor afd = getAssets().openFd(fileName);
        mediaPlayer.setDataSource(afd.getFileDescriptor(), afd.getStartOffset(),
                afd.getLength());
        mediaPlayer.setDisplay(holder);
        mediaPlayer.prepare();
        mediaPlayer.setOnPreparedListener(this);
        mediaPlayer.setOnVideoSizeChangedListener(this);
        mediaPlayer.setAudioStreamType(AudioManager.STREAM_MUSIC);
    } catch (Exception e) {
        Log.e(TAG, Log.getStackTraceString(e));
    }
}

At this point, I could not track where it looks to the SEI FPA bit in the header. I need a help for showing the necessary code part. Thanks in advance.

EJoshuaS - Reinstate Monica
  • 10,460
  • 46
  • 38
  • 64
peagasus
  • 70
  • 12

1 Answers1

1

Do you need to parse SEI FPA bit in the header itself? That's out of scope of this API. As noted, the codec parses this to enable (and override) S3D setting.

In the overview, it's mentioned how you can use 3rd party tools like x264 to add this bit to existing content.

I'd recommend looking at the code for x264 for help in parsing the file header if that's what you need to do at runtime.

dljava
  • 1,700
  • 16
  • 13
  • I want the display not to be overridden by the SEI FPA flag. In other words, I want to enable or disable S3D setting without looking the FPA. I assume the SEI FPA flag is parsed in the codec part of the MediaPlayer codec, from your first paragraph. And, I know how to add this bit to the video but I want to work with live streams which makes SEI FPA flag setting impossible. – peagasus Jul 31 '12 at 20:26