Please find below a patch that increases the functionality of VideoProviders
Again.
There are 2 major changes. 
1.) Allow selection of AudioUnits: This is necessary on embedded hw when you
have a digital and a separate analogue audio output and you want to turn
them off or on.
2.) Stream Attributes: This allows you to set the attributes of a stream for
example an MPEG2 Transport stream might contain H264 video data.  You could
now use the SameVideo Provider but SetStreamAttributes (encoding) to H264
and thus make sure the video provider was set up correctly.

I would appreciate feedback on this patch if it is not suitable for
acceptance
--------------------------------------------------------
 include/directfb.h                 |   75
++++++++++++++++++++++++++++++++++++-
 src/media/idirectfbvideoprovider.c |   23 +++++++++++
 2 files changed, 96 insertions(+), 2 deletions(-)
--------------------------------------------------------
diff -urN DirectFB.orig/include/directfb.h DirectFB/include/directfb.h
--- DirectFB.orig/include/directfb.h    2007-07-04 13:53:37.000000000 +0100
+++ DirectFB/include/directfb.h 2007-07-04 14:19:11.000000000 +0100
@@ -1383,6 +1383,9 @@
      DVCAPS_SATURATION  = 0x00000080,  /* supports Saturation adjustment  
*/
      DVCAPS_INTERACTIVE = 0x00000100,  /* supports SendEvent              
*/
      DVCAPS_VOLUME      = 0x00000200,  /* supports Volume adjustment      
*/
+     DVCAPS_EVENT       = 0x00000400,  /* supports the sending of events as
video/audio data changes.*/
+     DVCAPS_ATTRIBUTES  = 0x00000800,  /* supports dynamic changing of
atrributes.*/
+     DVCAPS_AUDIO_SEL   = 0x00001000,  /* Supportes chosing audio
outputs.*/
 } DFBVideoProviderCapabilities;
 
 /*
@@ -1408,6 +1411,18 @@
                                          is reached (gapless).     */
 } DFBVideoProviderPlaybackFlags;
 
+/*
+ * Flags to allow Audio Unit selection.
+ */
+typedef enum {
+     DVAUDIOUNIT_NONE   = 0x00000000, /* No Audio Unit            */
+     DVAUDIOUNIT_ONE    = 0x00000001, /* Audio Unit One           */
+     DVAUDIOUNIT_TWO    = 0x00000002, /* Audio Unit Two           */
+     DVAUDIOUNIT_THREE  = 0x00000004, /* Audio Unit Three         */
+     DVAUDIOUNIT_FOUR   = 0x00000008, /* Audio Unit Four          */
+     DVAUDIOUNIT_ALL    = 0x0000000F, /* Audio Unit One           */
+} DFBVideoProviderAudioUnits;
+
 
 /*
  * Flags defining which fields of a DFBColorAdjustment are valid.
@@ -5342,7 +5357,10 @@
           double            framerate;    /* number of frames per second       
*/
           double            aspect;       /* frame aspect ratio                
*/
           int               bitrate;      /* amount of bits per second         
*/
-     }
+         int               afd;          /* Active Format Descriptor           
  
*/
+         int               width;        /* Width as reported by Sequence
Header  */
+         int               height;       /* Height as reported by Sequence
Header */
+     } 
       video;
 
      struct {
@@ -5363,6 +5381,32 @@
 } DFBStreamDescription;
 
 /*
+ * Type of an audio stream.
+ */
+typedef enum {
+     DSF_ES         = 0x00000000, /* ES.  */
+     DSF_PES        = 0x00000001, /* PES. */
+} DFBStreamFormat;
+
+/*
+ * Stream attributes for a audio/video stream.
+ */
+typedef struct {
+     struct {
+          char            encoding[DFB_STREAM_DESC_ENCODING_LENGTH]; /*
+                                             encoding (e.g. "MPEG4")           
*/
+          DFBStreamFormat format;   /* format of the video stream      */
+          
+     } video;
+     
+     struct {
+          char            encoding[DFB_STREAM_DESC_ENCODING_LENGTH]; /*
+                                             encoding (e.g. "AAC")             
*/
+          DFBStreamFormat format;   /* format of the audio stream      */
+     } audio;
+} DFBStreamAttributes;
+
+/*
  * Called for each written frame.
  */
 typedef void (*DVFrameCallback)(void *ctx);
@@ -5405,7 +5449,6 @@
           DFBStreamDescription     *ret_dsc
      );
 
-
    /** Playback **/
 
      /*
@@ -5554,6 +5597,34 @@
           float                    *ret_level
      );
 
+     /*
+      * Set the stream attributes.
+      * May have a wrapper with different media types types encapsulated.
+      * Can use this method to indicate the content type.
+      */
+     DFBResult (*SetStreamAttributes) (
+          IDirectFBVideoProvider   *thiz,
+          DFBStreamDescription      attr
+     );
+
+     /*
+      * Set the audio units that are being used for output.
+      * May have multiple audio outputs and need to configure them on/off
+      * dynamically. 
+      */
+     DFBResult (*SetAudioOutputs) (
+          IDirectFBVideoProvider         *thiz,
+          DFBVideoProviderAudioUnits*    audioUnits
+     );
+
+     /*
+      * Get the audio units that are being used for output.
+      */
+     DFBResult (*GetAudioOutputs) (
+          IDirectFBVideoProvider         *thiz,
+          DFBVideoProviderAudioUnits*    audioUnits
+     );
+
      /** Event buffers **/
      /*
       * Create an event buffer for this video provider and attach it.
diff -urN DirectFB.orig/src/media/idirectfbvideoprovider.c
DirectFB/src/media/idirectfbvideoprovider.c
--- DirectFB.orig/src/media/idirectfbvideoprovider.c    2007-07-04
13:53:37.000000000 +0100
+++ DirectFB/src/media/idirectfbvideoprovider.c 2007-07-04
14:18:22.000000000 +0100
@@ -203,6 +203,26 @@
      return DFB_UNIMPLEMENTED;
 }
 
+static DFBResult
+IDirectFBVideoProvider_SetStreamAttributes(IDirectFBVideoProvider   *thiz,
+                                           DFBStreamDescription      attr)
+{
+     return DFB_UNIMPLEMENTED;
+}
+
+static DFBResult
+IDirectFBVideoProvider_SetAudioOutputs(IDirectFBVideoProvider        
*thiz,
+                                       DFBVideoProviderAudioUnits*   
audioUnits)
+{
+     return DFB_UNIMPLEMENTED;
+}
+
+static DFBResult
+IDirectFBVideoProvider_GetAudioOutputs(IDirectFBVideoProvider        
*thiz,
+                                       DFBVideoProviderAudioUnits*   
audioUnits)
+{
+     return DFB_UNIMPLEMENTED;
+}
 
 static DFBResult
 IDirectFBVideoProvider_CreateEventBuffer( IDirectFBVideoProvider  *thiz,
@@ -261,6 +281,9 @@
      thiz->GetSpeed              = IDirectFBVideoProvider_GetSpeed;
      thiz->SetVolume             = IDirectFBVideoProvider_SetVolume;
      thiz->GetVolume             = IDirectFBVideoProvider_GetVolume;
+     thiz->SetStreamAttributes   =
IDirectFBVideoProvider_SetStreamAttributes;
+     thiz->SetAudioOutputs       = IDirectFBVideoProvider_SetAudioOutputs;
+     thiz->GetAudioOutputs       = IDirectFBVideoProvider_GetAudioOutputs;
      thiz->CreateEventBuffer     =
IDirectFBVideoProvider_CreateEventBuffer;
      thiz->AttachEventBuffer     =
IDirectFBVideoProvider_AttachEventBuffer;
      thiz->EnableEvents          = IDirectFBVideoProvider_EnableEvents;

Cheers
Dan

http://www.nabble.com/file/p11430984/increased_video_provider_caps.patch
increased_video_provider_caps.patch 
-- 
View this message in context: 
http://www.nabble.com/Increasing-Video-Provider-Capabilities-tf4024446.html#a11430984
Sent from the DirectFB Dev mailing list archive at Nabble.com.


_______________________________________________
directfb-dev mailing list
[email protected]
http://mail.directfb.org/cgi-bin/mailman/listinfo/directfb-dev

Reply via email to