]> git.sesse.net Git - vlc/blobdiff - include/vlc_vout.h
jvlc: download a sample file to run tests, if needed
[vlc] / include / vlc_vout.h
index a016575ab5b21c59de6c03424c3dfb24d4f5e647..635434f08c7e87f4619300e62fb7dc622a7cfd0c 100644 (file)
@@ -115,6 +115,73 @@ struct picture_t
     struct picture_t *p_next;
 };
 
+/**
+ * This function will create a new picture.
+ * The picture created will implement a default release management compatible
+ * with picture_Yield and picture_Release. This default management will release
+ * picture_sys_t *p_sys field if non NULL.
+ */
+VLC_EXPORT( picture_t *, picture_New, ( vlc_fourcc_t i_chroma, int i_width, int i_height, int i_aspect ) );
+
+/**
+ * This function will force the destruction a picture.
+ * The value of the picture reference count should be 0 before entering this
+ * function.
+ * Unless used for reimplementing pf_release, you should not use this
+ * function but picture_Release.
+ */
+VLC_EXPORT( void, picture_Delete, ( picture_t * ) );
+
+/**
+ * This function will increase the picture reference count.
+ * It will not have any effect on picture obtained from vout
+ */
+static inline void picture_Yield( picture_t *p_picture )
+{
+    if( p_picture->pf_release )
+        p_picture->i_refcount++;
+}
+/**
+ * This function will release a picture.
+ * It will not have any effect on picture obtained from vout
+ */
+static inline void picture_Release( picture_t *p_picture )
+{
+    /* FIXME why do we let pf_release handle the i_refcount ? */
+    if( p_picture->pf_release )
+        p_picture->pf_release( p_picture );
+}
+
+/**
+ * This function will copy all picture dynamic properties.
+ */
+static inline void picture_CopyProperties( picture_t *p_dst, const picture_t *p_src )
+{
+    p_dst->date = p_src->date;
+    p_dst->b_force = p_src->b_force;
+
+    p_dst->b_progressive = p_src->b_progressive;
+    p_dst->i_nb_fields = p_src->i_nb_fields;
+    p_dst->b_top_field_first = p_src->b_top_field_first;
+}
+
+/**
+ * This function will copy the picture pixels.
+ */
+VLC_EXPORT( void, picture_CopyPixels, ( picture_t *p_dst, const picture_t *p_src ) );
+
+/**
+ * This function will copy both picture dynamic properties and pixels.
+ * You have to notice that sometime a simple picture_Yield may do what
+ * you want without the copy overhead.
+ * Provided for convenience.
+ */
+static inline void picture_Copy( picture_t *p_dst, const picture_t *p_src )
+{
+    picture_CopyPixels( p_dst, p_src );
+    picture_CopyProperties( p_dst, p_src );
+}
+
 /**
  * Video picture heap, either render (to store pictures used
  * by the decoder) or output (to store pictures displayed by the vout plugin)
@@ -552,7 +619,7 @@ VLC_EXPORT( vout_thread_t *, __vout_Request,    ( vlc_object_t *p_this, vout_thr
  * This function will create a suitable vout for a given p_fmt. It will never
  * reuse an already existing unused vout.
  *
- * You have to call either vout_Destroy or vout_Request on the returned value
+ * You have to call either vout_Close or vout_Request on the returned value
  * \param p_this a vlc object to which the returned vout will be attached
  * \param p_fmt the video format requested
  * \return a vout if the request is successfull, NULL otherwise