libobs: Add Y800 color format support

(Note: Also modified the obs-ffmpeg plugin module)

Allows the ability for frame data to pass 8-bit grayscale images (Y800
color format).

Closes jp9000/obs-studio#515
This commit is contained in:
jpk
2016-02-24 23:02:11 -05:00
committed by jp9000
parent 07ecdaf8d3
commit c3629eacb5
7 changed files with 22 additions and 0 deletions

View File

@@ -66,6 +66,13 @@ void video_frame_init(struct video_frame *frame, enum video_format format,
frame->linesize[1] = width;
break;
case VIDEO_FORMAT_Y800:
size = width * height;
ALIGN_SIZE(size, alignment);
frame->data[0] = bmalloc(size);
frame->linesize[0] = width;
break;
case VIDEO_FORMAT_YVYU:
case VIDEO_FORMAT_YUY2:
case VIDEO_FORMAT_UYVY:
@@ -115,6 +122,7 @@ void video_frame_copy(struct video_frame *dst, const struct video_frame *src,
memcpy(dst->data[1], src->data[1], src->linesize[1] * cy / 2);
break;
case VIDEO_FORMAT_Y800:
case VIDEO_FORMAT_YVYU:
case VIDEO_FORMAT_YUY2:
case VIDEO_FORMAT_UYVY: