[vlc-commits] commit: Added video_format_CopyCrop helper. (Laurent Aimar )

git at videolan.org git at videolan.org
Sun Nov 7 16:45:26 CET 2010


vlc | branch: master | Laurent Aimar <fenrir at videolan.org> | Sat Nov  6 21:58:47 2010 +0100| [523bba18671c692ad53dd841ed88484b269e6c12] | committer: Laurent Aimar 

Added video_format_CopyCrop helper.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=523bba18671c692ad53dd841ed88484b269e6c12
---

 include/vlc_es.h     |    5 +++++
 src/libvlccore.sym   |    1 +
 src/misc/es_format.c |    9 +++++++++
 3 files changed, 15 insertions(+), 0 deletions(-)

diff --git a/include/vlc_es.h b/include/vlc_es.h
index 556b414..3c80d57 100644
--- a/include/vlc_es.h
+++ b/include/vlc_es.h
@@ -173,6 +173,11 @@ static inline void video_format_Clean( video_format_t *p_src )
 VLC_EXPORT( void, video_format_Setup, ( video_format_t *, vlc_fourcc_t i_chroma, int i_width, int i_height, int i_sar_num, int i_sar_den ) );
 
 /**
+ * It will copy the crop properties from a video_format_t to another.
+ */
+VLC_EXPORT( void, video_format_CopyCrop, ( video_format_t *, const video_format_t * ) );
+
+/**
  * This function will check if the first video format is similar
  * to the second one.
  */
diff --git a/src/libvlccore.sym b/src/libvlccore.sym
index 7ec9e4e..aec8a36 100644
--- a/src/libvlccore.sym
+++ b/src/libvlccore.sym
@@ -485,6 +485,7 @@ var_TriggerCallback
 var_Type
 var_Inherit
 var_InheritURational
+video_format_CopyCrop
 video_format_FixRgb
 video_format_IsSimilar
 video_format_Setup
diff --git a/src/misc/es_format.c b/src/misc/es_format.c
index 9864a0f..e55ee2b 100644
--- a/src/misc/es_format.c
+++ b/src/misc/es_format.c
@@ -206,6 +206,15 @@ void video_format_Setup( video_format_t *p_fmt, vlc_fourcc_t i_chroma,
         break;
     }
 }
+
+void video_format_CopyCrop( video_format_t *p_dst, const video_format_t *p_src )
+{
+    p_dst->i_x_offset       = p_src->i_x_offset;
+    p_dst->i_y_offset       = p_src->i_y_offset;
+    p_dst->i_visible_width  = p_src->i_visible_width;
+    p_dst->i_visible_height = p_src->i_visible_height;
+}
+
 bool video_format_IsSimilar( const video_format_t *p_fmt1, const video_format_t *p_fmt2 )
 {
     video_format_t v1 = *p_fmt1;



More information about the vlc-commits mailing list