From 49265541974282f3346c9dc7de2365858f9fcb4d Mon Sep 17 00:00:00 2001 From: deva Date: Sat, 12 Aug 2006 15:00:40 +0000 Subject: Added timecode and fixed the sending and receiving of frames through the network. --- lib/libdv_wrapper.cc | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) (limited to 'lib/libdv_wrapper.cc') 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; +} -- cgit v1.2.3