summaryrefslogtreecommitdiff
path: root/src/decoder.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/decoder.cc')
-rw-r--r--src/decoder.cc59
1 files changed, 58 insertions, 1 deletions
diff --git a/src/decoder.cc b/src/decoder.cc
index 2ab3b6b..4707c90 100644
--- a/src/decoder.cc
+++ b/src/decoder.cc
@@ -25,6 +25,9 @@
*/
/*
* $Log$
+ * Revision 1.22 2005/05/02 09:50:22 deva
+ * Rewrote freeze, shoot and record flags, from encoder to frame.
+ *
* Revision 1.21 2005/05/01 09:56:26 deva
* Added Id and Log tags to all files
*
@@ -60,6 +63,7 @@ Decoder::Decoder(Error* err,
player_queue = gplayer_queue;
mutex = gmutex;
running = grunning;
+ b_record = false; // Initially no recording is done.
}
Decoder::~Decoder()
@@ -68,6 +72,10 @@ Decoder::~Decoder()
void Decoder::decode()
{
+ bool local_shoot;
+ bool local_freeze;
+ bool local_record;
+
dv1394 dv_stream = dv1394(errobj); // Use default port and channel.
while(*running) {
@@ -78,10 +86,25 @@ void Decoder::decode()
// Read a dvframe
ptr = dv_stream.readFrame();
if(!ptr) return; // No frame read. (Due to firewire error)
+
+ local_shoot = b_shoot;
+ b_shoot = false;
+ local_freeze = b_freeze;
+ b_freeze = false;
+ local_record = b_record;
+
Frame *eframe = new Frame(ptr, DVPACKAGE_SIZE);
+ eframe->shoot = local_shoot;
+ eframe->freeze = local_freeze;
+ eframe->record = local_record;
+
Frame *pframe = new Frame(ptr, DVPACKAGE_SIZE);
- free(ptr);
+ pframe->shoot = local_shoot;
+ pframe->freeze = local_freeze;
+ pframe->record = local_record;
+ free(ptr);
+
encode_queue->push(eframe);
player_queue->push(pframe);
@@ -104,4 +127,38 @@ void Decoder::run() {
fprintf(stderr, "Decoder thread stopped.\n"); fflush(stderr);
}
+/*
+ * Set freeze bit on current frame.
+ */
+void Decoder::freeze()
+{
+ b_freeze = true;
+}
+
+
+/*
+ * Set shoot bit on current frame.
+ */
+void Decoder::shoot(unsigned char *rgb)
+{
+ b_shoot = true;
+}
+
+/*
+ * Set the record bit to true in all following frames.
+ */
+void Decoder::start()
+{
+ b_record = true;
+}
+
+/*
+ * Set the record bit to false in all following frames.
+ */
+void Decoder::stop(n_savestate save)
+{
+ b_record = false;
+}
+
+
#endif /*USE_GUI*/