Pass the actual amount of bytes we have copied into the bitstream buffer. Also unmap the memory before queuing.