summaryrefslogtreecommitdiffstats
path: root/libmpcodecs/vd_zrmjpeg.c
diff options
context:
space:
mode:
Diffstat (limited to 'libmpcodecs/vd_zrmjpeg.c')
-rw-r--r--libmpcodecs/vd_zrmjpeg.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/libmpcodecs/vd_zrmjpeg.c b/libmpcodecs/vd_zrmjpeg.c
index 2d35ec1420..8dd460ab5b 100644
--- a/libmpcodecs/vd_zrmjpeg.c
+++ b/libmpcodecs/vd_zrmjpeg.c
@@ -59,7 +59,7 @@ static int query_format(sh_video_t *sh, unsigned int format) {
if (format == ctx->preferred_csp) return VFCAP_CSP_SUPPORTED;
return CONTROL_FALSE;
}
-
+
// to set/get/query special features/parameters
static int control(sh_video_t *sh, int cmd, void* arg, ...) {
switch (cmd) {
@@ -80,9 +80,9 @@ static int init(sh_video_t *sh) {
sh->context = ctx;
/* defer init of vo until the first frame is known */
- return 1;
+ return 1;
#if 0
- return mpcodecs_config_vo(sh, sh->disp_w, sh->disp_h, IMGFMT_ZRMJPEGIT);
+ return mpcodecs_config_vo(sh, sh->disp_w, sh->disp_h, IMGFMT_ZRMJPEGIT);
#endif
}
@@ -122,7 +122,7 @@ static unsigned int guess_mjpeg_type(unsigned char *data, unsigned int size,
ERROR("JPEG data must start with FFD8, but doesn't\n");
return 0;
}
-
+
p = 2; /* pointer within jpeg data */
while (p < size) {
@@ -131,7 +131,7 @@ static unsigned int guess_mjpeg_type(unsigned char *data, unsigned int size,
p++;
if (p >= size) return 0;
}
-
+
/* get marker code, skip duplicate FF's */
while(data[p] == 0xFF) {
p++;
@@ -142,7 +142,7 @@ static unsigned int guess_mjpeg_type(unsigned char *data, unsigned int size,
/* marker may have an associated length */
if (p <= size - 2) length = get_int2(data+p);
- else length = 0;
+ else length = 0;
switch (marker) {
case M_SOF0:
@@ -163,10 +163,10 @@ static unsigned int guess_mjpeg_type(unsigned char *data, unsigned int size,
/* these markers shouldn't have parameters,
* i.e. we don't need to skip anaything */
- if (marker == 0 || marker == 1 ||
+ if (marker == 0 || marker == 1 ||
(marker >= 0xd0 && marker < 0xd8))
- continue;
-
+ continue;
+
if (p + length <= size) p += length;
else {
ERROR("input JPEG too short, data missing\n");
@@ -223,9 +223,9 @@ static unsigned int guess_mjpeg_type(unsigned char *data, unsigned int size,
return IMGFMT_ZRMJPEGIT;
}
-
+
return 0;
-}
+}
// decode a frame
static mp_image_t* decode(sh_video_t *sh, void* data, int len, int flags) {
@@ -235,12 +235,12 @@ static mp_image_t* decode(sh_video_t *sh, void* data, int len, int flags) {
if (!ctx->vo_initialized) {
ctx->preferred_csp = guess_mjpeg_type(data, len, sh->disp_h);
if (ctx->preferred_csp == 0) return NULL;
- mpcodecs_config_vo(sh, sh->disp_w, sh->disp_h,
+ mpcodecs_config_vo(sh, sh->disp_w, sh->disp_h,
ctx->preferred_csp);
ctx->vo_initialized = 1;
}
- mpi = mpcodecs_get_image(sh, MP_IMGTYPE_EXPORT, 0,
+ mpi = mpcodecs_get_image(sh, MP_IMGTYPE_EXPORT, 0,
sh->disp_w, sh->disp_h);
/* abuse of mpi */
mpi->planes[0]=(uint8_t*)data;