[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Public WebGL] Interest in promoting to draft, and implementing, WEBGL_dynamic_texture

On 13/06/06 11:35, Benoit Jacob wrote:

Thanks Mark for the reply. I look forward to the advancement of WEBGL_dynamic_texture. Indeed, there is fairly strong interest from Mozilla in this functionality. In the interest of full disclosure: the interest comes from Firefox OS, where _javascript_ is the only application development language and WebGL the only GL-like API, and therefore something like WEBGL_dynamic_texture appears to be particularly important to enable advanced graphics involving video textures
Hi Benoit, all,

I am working on what has turned into an almost total rewrite of the WEBGL_dynamic_texture. Below is the IDL I have converged on. To speed up the process I'm posting it now while I continue to work on the spec. text. I'd appreciate any comments from anyone but especially the IDL experts out there. Between the token names and comments I think you can get a pretty good idea of how it will work. The big change from before is that the stream has become an explicit object.

At the moment it specifies the function setDBPresentationTime which is called to specify the presentation time for the subsequent present of the drawing buffer. If we move to having an explicit drawing buffer object, the function should be moved to that object. If we move to an explicit present model, presentation time can be a parameter of the present call. The presentation time comes from the acquired frame.

module webgl {
  interface WEBGL_dynamic_texture {
    // Type for nanosecond time stamps as returned by the system monotonic timer.
    // Precision will be unchanged up to 2**53 nanoseconds =~ 41 days. Could
    // wrap after that or just keep counting, in which case precision will be halved
    // and the next precision change will occur after a further 82 days.
    // Certainly good enough for browser up time and for system up time
    // which is what the monotonic clock usually is.
     typedef double WEBGLTimeStampNS;

    interface WDTFrame {
      // Time of the frame relative to the start of the media.
      // Equivalent to currrentTime in an HTMLMediaElement
      readonly attribute double frameTime;
      // The time the frame should be presented in order to sync with
      // other tracks in the element's mediagroup, particularly audio.
      // Question: what are the base and units of the renderbuffer-present time on iOS?
      readonly attribute WEBGLTimeStampNS presentTime;
    }; // interface WDTFrame
    interface WDTStream {
      const GLenum STREAM_CONNECTING = 0;
      const GLenum STREAM_EMPTY = 1;
      const GLenum STREAM_NEW_FRAME_AVAILABLE = 2;
      const GLenum STREAM_OLD_FRAME_AVAILABLE = 3;
      const GLenum STREAM_DISCONNECTED = 4;

      // Affects size of buffer allocated for holding video frames and how many video
      // frames need to be produced before starting audio playback. Therefore needs
      // to be set before video starts playing. Would be convenient if it could be
      // changed during pause. Need implementation experience to know if that is
      // possible. 
      attribute unsigned long maxConsumerLatency(int usecs);
      // Can vary between 0 and maxConsumerLatency set above.
      attribute unsigned long consumerLatencyUSec;

      readonly attribute WDTFrame consumerFrame;
      readonly attribute WDTFrame producerFrame;

      void connectSource(HTMLCanvasElement);
      void connectSource(HTMLImageElement);
      void connectSource(HTMLVideoElement);
      void disconnect();

      WDTFrame acquireImage();
      void releaseImage();
    }; // interface WDTStream

    interface WDTSyncValues {
      readonly attribute WEBGLTimeStampNS ust;
      readonly attribute unsigned long msc;
    }; // interface WDTSyncValues

    const GLenum TEXTURE_EXTERNAL_OES = 0x8D65;
    const GLenum SAMPLER_EXTERNAL_OES = 0x8D66;

    // Creates a stream whose consumer is the texture currently bound to TEXTURE_EXTERNAL_OES.
    WDTStream createStream();
    // Returns UST and MSC (screen refresh count) of last drawing buffer present
    WDTSyncValues getSyncValues();
    // Returns current UST (unadjusted system time), the system monotonic clock.
    WEBGLTimeStampNS ustnow();
    // Sets presentation time for drawing buffer at composite following the script returning
    // to the browser. If time already passed, present as soon as possible.
    void setDBPresentationTime(WEBGLTimeStampNS pt);   
  }; // interface WEBGL_dynamic_texture
}; // module webgl



注意:この電子メールには、株式会社エイチアイの機密情報が含まれている場合が有ります。正式なメール受信者では無い場合はメール複製、 再配信または情報の使用を固く禁じております。エラー、手違いでこのメールを受け取られましたら削除を行い配信者にご連絡をお願いいたし ます.

NOTE: This electronic mail message may contain confidential and privileged information from HI Corporation. If you are not the intended recipient, any disclosure, photocopying, distribution or use of the contents of the received information is prohibited. If you have received this e-mail in error, please notify the sender immediately and permanently delete this message and all related copies.