<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://jogamp.org/bugzilla/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.2"
          urlbase="https://jogamp.org/bugzilla/"
          
          maintainer="sgothel@jausoft.com"
>

    <bug>
          <bug_id>1494</bug_id>
          
          <creation_ts>2024-01-31 11:01:10 +0100</creation_ts>
          <short_desc>GLMediaPlayer/GraphUI: Support Displaying Bitmap&apos;ed Subtitles (PGS ..)</short_desc>
          <delta_ts>2024-02-03 03:27:46 +0100</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>3</classification_id>
          <classification>JogAmp</classification>
          <product>Jogl</product>
          <component>graph</component>
          <version>2.6.0</version>
          <rep_platform>All</rep_platform>
          <op_sys>all</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P4</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          <dependson>1492</dependson>
          <blocked>805</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="Sven Gothel">sgothel</reporter>
          <assigned_to name="Sven Gothel">sgothel</assigned_to>
          <cc>sgothel</cc>
          
          <cf_type>FEATURE</cf_type>
          <cf_scm_refs>a19f810c9618e2fa6829f1c157d2e1a88ca178de
670286747af423781aa4f54062aa34345d32a397
72065d9e2a9d6480c34afc9920071d5ed577d37a
b8b692e9cf3120d788ae912514f54948ddccacf5
9fe460aecf8509c8305416bb9d77aadf6165c677
23cf5279472d3ae1b2d8d1904e6b1f1e7fd8f012
1639bf159810895eb24791c8128a7b2c02d15a56</cf_scm_refs>
          <cf_workaround>---</cf_workaround>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>7081</commentid>
    <comment_count>0</comment_count>
    <who name="Sven Gothel">sgothel</who>
    <bug_when>2024-01-31 11:01:10 +0100</bug_when>
    <thetext>Bitmap Subtitles shall be made available via FFMPEGMediaPlayer implementation and utilized via GraphUI MediaButton as well as via the full feature widget MediaPlayer.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>7083</commentid>
    <comment_count>1</comment_count>
    <who name="Sven Gothel">sgothel</who>
    <bug_when>2024-01-31 11:02:43 +0100</bug_when>
    <thetext>commit a19f810c9618e2fa6829f1c157d2e1a88ca178de

    FFMPEGPlayer: Prep for bitmap&apos;ed subtitles: Use glEnable()/glBindTexture() func-ptr in native; readNextPacket0() passes video+subtitle texTarget and texID
    
    For bitmap subtitles we need to push the bitmap into its own texture.
    Hence readNextPacket0() must switch to used texture using glEnable() on !core and glBindTexture().

+++

commit 670286747af423781aa4f54062aa34345d32a397

    GLMediaPlayer: Add getSubtitleCodec()


+++</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>7093</commentid>
    <comment_count>2</comment_count>
    <who name="Sven Gothel">sgothel</who>
    <bug_when>2024-02-02 07:32:42 +0100</bug_when>
    <thetext>commit 72065d9e2a9d6480c34afc9920071d5ed577d37a

    Bug 1494: Add SubTextureEvent &amp; SubEmptyEvent; Add SubtitleEvent.release() provided by owner to take back borrowed resources (texture of bitmap subtitle)

+++

commit b8b692e9cf3120d788ae912514f54948ddccacf5

    GLMediaPlayer: Split GLMediaFrameListener (rarely used) from GLMediaEventListener, easing listener callbacks; Prepare SubtitleEventListener generalization (Bug 1494)
    
    Moves pushSound(), pushSubtitle*() from FFMPEGMediaPlayer to GLMediaPlayerImpl,
    as it is handled in a generic way - even though currently only called by native FFMPEGMediaPlayer implementation.
    
    Note: This patch is incomplete, i.e. not even compile clean.
    But choses as-is to semantically split the work to ease review.

+++

commit 9fe460aecf8509c8305416bb9d77aadf6165c677

    Bug 1494: Clarify SubtitleEvent class, adding general FFmpeg analog CodecID and hence also promoting VideoPixelFormat</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>7094</commentid>
    <comment_count>3</comment_count>
    <who name="Sven Gothel">sgothel</who>
    <bug_when>2024-02-02 08:52:25 +0100</bug_when>
    <thetext>commit 23cf5279472d3ae1b2d8d1904e6b1f1e7fd8f012

Bug 1494 - GLMediaPlayer/GraphUI: Support Displaying Bitmap&apos;ed Subtitles (PGS ..) via FFMPEGFMediaPlayer/FFmpeg
    
FFMPEGFMediaPlayer related changes:
- Add libswscale (6th FFmpeg lib used) for sws_getCachedContext(), sws_scale() and sws_freeContext(),
  used natively to convert the palette&apos;ed bitmap into RGBA colorspace -&gt; GL texture
    
- Handling AVSubtitleRect.type SUBTITLE_BITMAP
-- only handled if libswscale is available
-- config/adjust texture object
-- sws_scale palette&apos;ed bitmap to texture
-- intermediate memory is cached, may be resized and free&apos;ed at destroy
-- texture objects are managed and passed from GLMediaPlayerImpl,
   as they are also forwarded to player client via SubBitmapEvent
    
- Passing the AVCodecID to GLMediaPlayerImpl, converted to our CodecID enum.
    
- Unifying creation and opening of AVCodecContext with &apos;createOpenedAVCodecContext(..)&apos;
    
+++ 
    
SubtitleEvent*
- SubTextEvent now also handles ASS.Dialogue (FFmpeg 4)
  besides ASS.Event (FFmpeg 5, 6, ..).
    
+++ 
    
GLMediaPlayerImpl
- Added ringbuffer subTexFree, managing Texture for bitmap&apos;ed subtitles
-- Uses 1 bitmap-subtitle Texture per used textureCount in cache,
   as one bitmap-subtile can be displayed per frame.
   Could be potentially reduced to just 2 .. but resources used are 
   relatively low here.
    
- Validating subTexFree + videoFramesFree usage,
  use blocking get/put ringbuffer due to utilization from different threads.
    
- Receives subtitle content from native getNextPacket0() via callback,
  creates SubtitleEvent instance and passes it to a SubtitleEventListener - if exists.
  (See MediaButton example)
    
-- SubBitmapEvent also gets its special SubBitmapEvent.TextureOwner to handle client releasing
   the event and allowing us to put back the Texture resource to &apos;subTexFree&apos;.
   This passing through of the Texture object is probably a weakness of this lifecycle
   and requires the client to ensure SubtitleEvent.release() gets called.
   See MediaButton example!
  
- Exposing CodecID, allowing clients like MediaButton to handle SubtitleEvent content according to codec</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>7096</commentid>
    <comment_count>4</comment_count>
    <who name="Sven Gothel">sgothel</who>
    <bug_when>2024-02-02 08:53:49 +0100</bug_when>
    <thetext>commit 1639bf159810895eb24791c8128a7b2c02d15a56 (HEAD -&gt; jausoft_01)

    GLMediaPlayerImpl: Disable subDEBUG flag</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>