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.cc24
1 files changed, 23 insertions, 1 deletions
diff --git a/lib/libdv_wrapper.cc b/lib/libdv_wrapper.cc
index a056419..e178ee3 100644
--- a/lib/libdv_wrapper.cc
+++ b/lib/libdv_wrapper.cc
@@ -142,7 +142,6 @@ Frame *LibDVWrapper::decode(Frame *input, DV::ColorSpace c)
break;
}
-
dv_decode_full_frame(decoder,
(const uint8_t*)input->vframe,
(dv_color_space_t)colorspace,
@@ -150,6 +149,29 @@ Frame *LibDVWrapper::decode(Frame *input, DV::ColorSpace c)
pitches);
Frame *frame = new Frame(buf, size, type, NULL, 0, AF_NONE);
+
+ frame->timecode = getTimeCode();
+
return frame;
}
+TimeCode LibDVWrapper::getTimeCode()
+{
+ TimeCode timecode;
+ int timestamp[4];
+
+ dv_get_timestamp_int(decoder, timestamp);
+
+ timecode.hour = timestamp[0];
+ timecode.min = timestamp[1];
+ timecode.sec = timestamp[2];
+ timecode.frame = timestamp[3];
+ /*
+ fprintf(stderr, "%d %d %d %d\n",
+ timecode.hour,
+ timecode.min,
+ timecode.sec,
+ timecode.frame);
+ */
+ return timecode;
+}