Commit b93e5794 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

v4l2: inline ProcessVideoFrame(), no functional changes

parent 3432a593
...@@ -438,8 +438,6 @@ vlc_module_end () ...@@ -438,8 +438,6 @@ vlc_module_end ()
* Access: local prototypes * 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. * Parses a V4L2 MRL into VLC object variables.
*/ */
...@@ -1008,10 +1006,11 @@ block_t* GrabVideo (vlc_object_t *demux, demux_sys_t *sys) ...@@ -1008,10 +1006,11 @@ block_t* GrabVideo (vlc_object_t *demux, demux_sys_t *sys)
return NULL; return NULL;
} }
block_t *block = ProcessVideoFrame(demux, sys->p_buffers[buf.index].start, /* Copy frame */
buf.bytesused); block_t *block = block_Alloc (buf.bytesused);
if (block == NULL) if (unlikely(block == NULL))
return NULL; return NULL;
memcpy (block->p_buffer, sys->p_buffers[buf.index].start, buf.bytesused);
/* Unlock */ /* Unlock */
if (v4l2_ioctl (sys->i_fd, VIDIOC_QBUF, &buf) < 0) if (v4l2_ioctl (sys->i_fd, VIDIOC_QBUF, &buf) < 0)
...@@ -1023,29 +1022,6 @@ block_t* GrabVideo (vlc_object_t *demux, demux_sys_t *sys) ...@@ -1023,29 +1022,6 @@ block_t* GrabVideo (vlc_object_t *demux, demux_sys_t *sys)
return block; return block;
} }
/*****************************************************************************
* 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 * Helper function to initalise video IO using the mmap method
*****************************************************************************/ *****************************************************************************/
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment