diff --git a/sys/v4l2/gstv4l2bufferpool.c b/sys/v4l2/gstv4l2bufferpool.c
index 0bc88ca..db66d37 100644
--- a/sys/v4l2/gstv4l2bufferpool.c
+++ b/sys/v4l2/gstv4l2bufferpool.c
@@ -682,14 +682,15 @@ gst_v4l2_buffer_pool_qbuf (GstV4l2BufferPool * pool, GstBuffer * buf)
   meta->vbuffer.bytesused = gst_buffer_get_size (buf);
 
   GST_LOG_OBJECT (pool,
-      "enqueue buffer %p, index:%d, queued:%d, flags:%08x used:%d",
+      "enqueue buffer %p, index:%d, queued:%d, flags:%08x mem:%p used:%d",
       buf, index, pool->num_queued, meta->vbuffer.flags,
-      meta->vbuffer.bytesused);
+      meta->mem, meta->vbuffer.bytesused);
 
   if (pool->buffers[index] != NULL)
     goto already_queued;
 
   GST_LOG_OBJECT (pool, "doing QBUF");
+
   if (v4l2_ioctl (pool->video_fd, VIDIOC_QBUF, &meta->vbuffer) < 0)
     goto queue_failed;
 
@@ -720,6 +721,7 @@ gst_v4l2_buffer_pool_dqbuf (GstV4l2BufferPool * pool, GstBuffer ** buffer)
   struct v4l2_buffer vbuffer;
   GstV4l2Object *obj = pool->obj;
   GstClockTime timestamp;
+  GstV4l2Meta *meta;
 
   if ((res = gst_v4l2_object_poll (obj)) != GST_FLOW_OK)
     goto poll_error;
@@ -750,10 +752,13 @@ gst_v4l2_buffer_pool_dqbuf (GstV4l2BufferPool * pool, GstBuffer ** buffer)
 
   timestamp = GST_TIMEVAL_TO_TIME (vbuffer.timestamp);
 
+  meta = GST_V4L2_META_GET (outbuf);
+  g_assert (meta != NULL);
+
   GST_LOG_OBJECT (pool,
-      "dequeued buffer %p seq:%d (ix=%d), used %d, flags %08x, ts %"
+      "dequeued buffer %p seq:%d (ix=%d), mem %p used %d, flags %08x, ts %"
       GST_TIME_FORMAT ", pool-queued=%d, buffer=%p", outbuf, vbuffer.sequence,
-      vbuffer.index, vbuffer.bytesused, vbuffer.flags,
+      vbuffer.index, meta->mem, vbuffer.bytesused, vbuffer.flags,
       GST_TIME_ARGS (timestamp), pool->num_queued, outbuf);
 
   /* set top/bottom field first if v4l2_buffer has the information */
@@ -764,9 +769,20 @@ gst_v4l2_buffer_pool_dqbuf (GstV4l2BufferPool * pool, GstBuffer ** buffer)
     GST_BUFFER_FLAG_UNSET (outbuf, GST_VIDEO_BUFFER_FLAG_TFF);
   }
 
-  /* this can change at every frame, esp. with jpeg */
-  if (obj->type == V4L2_BUF_TYPE_VIDEO_CAPTURE)
-    gst_buffer_resize (outbuf, 0, vbuffer.bytesused);
+  /* this can change at every frame, esp. with jpeg        */
+  /* we cannot use gst_buffer_resize() here as it will     */
+  /* replace the dequeued memory object acquired from      */
+  /* the v4l2 driver to complete the resize operation,     */ 
+  /* effectively orphaning it.  Therefore, wrap the memory */
+  /* acquired from the v4l2 driver in a new memroy object  */
+  /* with vbuffer.bytesused as the size and replace the    */
+  /* existing memory object referenced by the GstBuffer    */
+  if (obj->type == V4L2_BUF_TYPE_VIDEO_CAPTURE) {
+        gst_buffer_replace_memory (outbuf, 0,
+        gst_memory_new_wrapped (GST_MEMORY_FLAG_NO_SHARE,
+            meta->mem, vbuffer.bytesused, 0, vbuffer.bytesused, NULL,
+            NULL));
+  }
 
   GST_BUFFER_TIMESTAMP (outbuf) = timestamp;
 
@@ -882,8 +898,8 @@ gst_v4l2_buffer_pool_acquire_buffer (GstBufferPool * bpool, GstBuffer ** buffer,
             }
 #endif
 
-            /* copy the memory */
-            copy = gst_buffer_copy (*buffer);
+            /* copy the buffer */
+            copy = gst_buffer_copy_region (*buffer, GST_BUFFER_COPY_ALL | GST_BUFFER_COPY_DEEP, 0, -1);
             GST_LOG_OBJECT (pool, "copy buffer %p->%p", *buffer, copy);
 
             /* and requeue so that we can continue capturing */
@@ -992,8 +1008,18 @@ gst_v4l2_buffer_pool_release_buffer (GstBufferPool * bpool, GstBuffer * buffer)
                 index);
 
             /* reset to the full length, in case it was changed */
-            gst_buffer_resize (buffer, 0, meta->vbuffer.length);
-
+            /* we cannot use gst_buffer_resize() here as it will     */
+            /* replace the dequeued memory object acquired from      */
+            /* the v4l2 driver to complete the resize operation,     */ 
+            /* effectively orphaning it.  Therefore, wrap the memory */
+            /* acquired from the v4l2 driver in a new memroy object  */
+            /* with vbuffer.bytesused as the size and replace the    */
+            /* existing memory object referenced by the GstBuffer    */
+            gst_buffer_replace_memory (buffer, 0,
+            gst_memory_new_wrapped (GST_MEMORY_FLAG_NO_SHARE,
+                meta->mem, meta->vbuffer.bytesused, 0, meta->vbuffer.bytesused, NULL,
+                NULL));           
+				
             /* playback, put the buffer back in the queue to refill later. */
             GST_BUFFER_POOL_CLASS (parent_class)->release_buffer (bpool,
                 buffer);
@@ -1040,6 +1066,7 @@ gst_v4l2_buffer_pool_finalize (GObject * object)
 static void
 gst_v4l2_buffer_pool_init (GstV4l2BufferPool * pool)
 {
+
 }
 
 static void
diff --git a/sys/v4l2/gstv4l2bufferpool.h b/sys/v4l2/gstv4l2bufferpool.h
index 90ccad4..3582bce 100644
--- a/sys/v4l2/gstv4l2bufferpool.h
+++ b/sys/v4l2/gstv4l2bufferpool.h
@@ -32,7 +32,6 @@ typedef struct _GstV4l2BufferPoolClass GstV4l2BufferPoolClass;
 typedef struct _GstV4l2Meta GstV4l2Meta;
 
 #include "gstv4l2object.h"
-//#include "v4l2_calls.h"
 
 GST_DEBUG_CATEGORY_EXTERN (v4l2buffer_debug);
 
