[vlc-commits] v4l2: inline ProcessVideoFrame(), no functional changes

Rémi Denis-Courmont git at videolan.org
Tue Apr 10 22:15:09 CEST 2012


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Tue Apr 10 22:44:04 2012 +0300| [b93e5794077f1a0e362f143de63749b1ce27532e] | committer: Rémi Denis-Courmont

v4l2: inline ProcessVideoFrame(), no functional changes

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

 modules/access/v4l2/video.c |   32 ++++----------------------------
 1 files changed, 4 insertions(+), 28 deletions(-)

diff --git a/modules/access/v4l2/video.c b/modules/access/v4l2/video.c
index 6bd4595..9d8afab 100644
--- a/modules/access/v4l2/video.c
+++ b/modules/access/v4l2/video.c
@@ -438,8 +438,6 @@ vlc_module_end ()
  * Access: local prototypes
  *****************************************************************************/
 
-static block_t* ProcessVideoFrame( vlc_object_t *p_demux, uint8_t *p_frame, size_t );
-
 /**
  * Parses a V4L2 MRL into VLC object variables.
  */
@@ -1008,10 +1006,11 @@ block_t* GrabVideo (vlc_object_t *demux, demux_sys_t *sys)
         return NULL;
     }
 
-    block_t *block = ProcessVideoFrame(demux, sys->p_buffers[buf.index].start,
-                                       buf.bytesused);
-    if (block == NULL)
+    /* Copy frame */
+    block_t *block = block_Alloc (buf.bytesused);
+    if (unlikely(block == NULL))
         return NULL;
+    memcpy (block->p_buffer, sys->p_buffers[buf.index].start, buf.bytesused);
 
     /* Unlock */
     if (v4l2_ioctl (sys->i_fd, VIDIOC_QBUF, &buf) < 0)
@@ -1024,29 +1023,6 @@ block_t* GrabVideo (vlc_object_t *demux, demux_sys_t *sys)
 }
 
 /*****************************************************************************
- * ProcessVideoFrame: Helper function to take a buffer and copy it into
- * a new block
- *****************************************************************************/
-static block_t* ProcessVideoFrame( vlc_object_t *p_demux, uint8_t *p_frame, size_t i_size )
-{
-    block_t *p_block;
-
-    if( !p_frame ) return NULL;
-
-    /* New block */
-    if( !( p_block = block_New( p_demux, i_size ) ) )
-    {
-        msg_Warn( p_demux, "Cannot get new block" );
-        return NULL;
-    }
-
-    /* Copy frame */
-    memcpy( p_block->p_buffer, p_frame, i_size );
-
-    return p_block;
-}
-
-/*****************************************************************************
  * Helper function to initalise video IO using the mmap method
  *****************************************************************************/
 int InitMmap( vlc_object_t *p_demux, demux_sys_t *p_sys, int i_fd )



More information about the vlc-commits mailing list