summaryrefslogtreecommitdiff
path: root/lib/libdv_wrapper.cc
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libdv_wrapper.cc')
-rw-r--r--lib/libdv_wrapper.cc21
1 files changed, 19 insertions, 2 deletions
diff --git a/lib/libdv_wrapper.cc b/lib/libdv_wrapper.cc
index 563c709..5a385b1 100644
--- a/lib/libdv_wrapper.cc
+++ b/lib/libdv_wrapper.cc
@@ -67,8 +67,11 @@ void LibDVWrapper::setSampling(DV::Sampling sampling)
decoder->sampling = (dv_sample_t)sampling;
}
-void LibDVWrapper::setOutputBuffer(char *output)
+void LibDVWrapper::setOutputBuffer(char *output, DV::ColorSpace c)
{
+ colorspace = c;
+ switch(colorspace) {
+ case DV::YUV:
#ifdef COLORSPACE_YV12
yuv[0] = (unsigned char*)output;
yuv[1] = (unsigned char*)yuv[0] + (width * height);
@@ -80,6 +83,20 @@ void LibDVWrapper::setOutputBuffer(char *output)
yuv[0] = (unsigned char*)output;
pitches[0] = width * 2;
#endif
+ break;
+
+ case DV::RGB:
+ yuv[0] = (unsigned char*)output;
+ yuv[1] = yuv[2] = NULL;
+ pitches[0] = width * 3;
+ break;
+
+ case DV::BGR0:
+ yuv[0] = (unsigned char*)output;
+ yuv[1] = yuv[2] = NULL;
+ pitches[0] = width * 4;
+ break;
+ }
}
void LibDVWrapper::decode(char *input)
@@ -96,7 +113,7 @@ void LibDVWrapper::decode(char *input)
dv_decode_full_frame(decoder,
(const uint8_t*)input,
- e_dv_color_yuv,
+ (dv_color_space_t)colorspace,
yuv,
pitches);
}