[Spice-devel] [PATCH 6/9] mjpeg_encoder: add mjpeg_encoder_get_bytes_per_pixel

Christophe Fergeau cfergeau at redhat.com
Tue Jun 28 04:18:07 PDT 2011


Returns the number of bytes per pixel corresponding to the input
data format.
---
 server/mjpeg_encoder.c |    5 +++++
 server/mjpeg_encoder.h |    1 +
 2 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/server/mjpeg_encoder.c b/server/mjpeg_encoder.c
index 8e74e0a..bfe8ca7 100644
--- a/server/mjpeg_encoder.c
+++ b/server/mjpeg_encoder.c
@@ -81,6 +81,11 @@ size_t mjpeg_encoder_get_frame_stride(MJpegEncoder *encoder)
     return encoder->stride;
 }
 
+uint8_t mjpeg_encoder_get_bytes_per_pixel(MJpegEncoder *encoder)
+{
+    return encoder->bytes_per_pixel;
+}
+
 
 /* Pixel conversion routines */
 static void pixel_rgb24bpp_to_24(uint8_t *src, uint8_t *dest)
diff --git a/server/mjpeg_encoder.h b/server/mjpeg_encoder.h
index 03b25cc..0773a14 100644
--- a/server/mjpeg_encoder.h
+++ b/server/mjpeg_encoder.h
@@ -28,6 +28,7 @@ void mjpeg_encoder_destroy(MJpegEncoder *encoder);
 
 uint8_t *mjpeg_encoder_get_frame(MJpegEncoder *encoder);
 size_t mjpeg_encoder_get_frame_stride(MJpegEncoder *encoder);
+uint8_t mjpeg_encoder_get_bytes_per_pixel(MJpegEncoder *encoder);
 int mjpeg_encoder_encode_frame(MJpegEncoder *encoder,
                                uint8_t **buffer, size_t *buffer_len);
 int mjpeg_encoder_start_frame(MJpegEncoder *encoder, SpiceBitmapFmt format,
-- 
1.7.5.4



More information about the Spice-devel mailing list