]> git.sesse.net Git - vlc/blobdiff - include/vlc_picture.h
mediacodec: skip prerolled frames
[vlc] / include / vlc_picture.h
index ee553499e0ae12d230e704aac1ed7a593065da5f..d3e3b99c1f8f5ad6c6b4ca63a1c80ba8357889d0 100644 (file)
@@ -32,6 +32,7 @@
  */
 
 #include <vlc_es.h>
+#include <vlc_atomic.h>
 
 /** Description of a planar graphic field */
 typedef struct plane_t
@@ -56,10 +57,11 @@ typedef struct plane_t
  */
 #define PICTURE_PLANE_MAX (VOUT_MAX_PLANES)
 
+
 /**
  * A private definition to help overloading picture release
  */
-typedef struct picture_release_sys_t picture_release_sys_t;
+typedef struct picture_gc_sys_t picture_gc_sys_t;
 
 /**
  * Video picture
@@ -71,7 +73,6 @@ struct picture_t
      */
     video_frame_format_t format;
 
-    void           *p_data_orig;                /**< pointer before memalign */
     plane_t         p[PICTURE_PLANE_MAX];     /**< description of the planes */
     int             i_planes;                /**< number of allocated planes */
 
@@ -79,7 +80,6 @@ struct picture_t
      * These properties can be modified using the video output thread API,
      * but should never be written directly */
     /**@{*/
-    unsigned        i_refcount;                  /**< link reference counter */
     mtime_t         date;                                  /**< display date */
     bool            b_force;
     /**@}*/
@@ -91,9 +91,8 @@ struct picture_t
     bool            b_progressive;          /**< is it a progressive frame ? */
     bool            b_top_field_first;             /**< which field is first */
     unsigned int    i_nb_fields;                  /**< # of displayed fields */
-    int8_t         *p_q;                           /**< quantification table */
-    int             i_qstride;                    /**< quantification stride */
-    int             i_qtype;                       /**< quantification style */
+    void          * context;          /**< video format-specific data pointer,
+             * must point to a (void (*)(void*)) pointer to free the context */
     /**@}*/
 
     /** Private data - the video output plugin might want to put stuff here to
@@ -101,8 +100,12 @@ struct picture_t
     picture_sys_t * p_sys;
 
     /** This way the picture_Release can be overloaded */
-    void (*pf_release)( picture_t * );
-    picture_release_sys_t *p_release_sys;
+    struct
+    {
+        atomic_uintptr_t refcount;
+        void (*pf_destroy)( picture_t * );
+        picture_gc_sys_t *p_sys;
+    } gc;
 
     /** Next picture in a FIFO a pictures */
     struct picture_t *p_next;
@@ -112,7 +115,7 @@ struct picture_t
  * This function will create a new picture.
  * The picture created will implement a default release management compatible
  * with picture_Hold and picture_Release. This default management will release
- * p_sys, p_q, p_data_orig fields if non NULL.
+ * p_sys, gc.p_sys fields if non NULL.
  */
 VLC_API picture_t * picture_New( vlc_fourcc_t i_chroma, int i_width, int i_height, int i_sar_num, int i_sar_den ) VLC_USED;
 
@@ -130,6 +133,7 @@ VLC_API picture_t * picture_NewFromFormat( const video_format_t *p_fmt ) VLC_USE
 typedef struct
 {
     picture_sys_t *p_sys;
+    void (*pf_destroy)(picture_t *);
 
     /* Plane resources
      * XXX all fields MUST be set to the right value.
@@ -231,7 +235,7 @@ VLC_API int picture_Export( vlc_object_t *p_obj, block_t **pp_image, video_forma
  *
  * It can be useful to get the properties of planes.
  */
-VLC_API int picture_Setup( picture_t *, vlc_fourcc_t i_chroma, int i_width, int i_height, int i_sar_num, int i_sar_den );
+VLC_API int picture_Setup( picture_t *, const video_format_t * );
 
 
 /**
@@ -242,24 +246,11 @@ VLC_API int picture_Setup( picture_t *, vlc_fourcc_t i_chroma, int i_width, int
  *  - not be ephemere.
  *  - not have the fade flag.
  *  - contains only picture (no text rendering).
+ * \return the number of region(s) succesfully blent
  */
-VLC_API void picture_BlendSubpicture( picture_t *, filter_t *p_blend, subpicture_t * );
+VLC_API unsigned picture_BlendSubpicture( picture_t *, filter_t *p_blend, subpicture_t * );
 
 
-/*****************************************************************************
- * Flags used to describe the status of a picture
- *****************************************************************************/
-
-/* Quantification type */
-enum
-{
-    QTYPE_NONE,
-
-    QTYPE_MPEG1,
-    QTYPE_MPEG2,
-    QTYPE_H264,
-};
-
 /*****************************************************************************
  * Shortcuts to access image components
  *****************************************************************************/