libcvd-members
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[libcvd-members] libcvd cvd/OSX/qtbuffer.h cvd_src/OSX/qtbuffer.cpp


From: Georg Klein
Subject: [libcvd-members] libcvd cvd/OSX/qtbuffer.h cvd_src/OSX/qtbuffer.cpp
Date: Fri, 07 Dec 2007 15:02:08 +0000

CVSROOT:        /cvsroot/libcvd
Module name:    libcvd
Changes by:     Georg Klein <georgklein>        07/12/07 15:02:08

Modified files:
        cvd/OSX        : qtbuffer.h 
        cvd_src/OSX    : qtbuffer.cpp 

Log message:
        QTBuffer lets you query the image format string. (Some camera return 
yuv422
        instead of vuy422..)

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/libcvd/cvd/OSX/qtbuffer.h?cvsroot=libcvd&r1=1.1&r2=1.2
http://cvs.savannah.gnu.org/viewcvs/libcvd/cvd_src/OSX/qtbuffer.cpp?cvsroot=libcvd&r1=1.1&r2=1.2

Patches:
Index: cvd/OSX/qtbuffer.h
===================================================================
RCS file: /cvsroot/libcvd/libcvd/cvd/OSX/qtbuffer.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -b -r1.1 -r1.2
--- cvd/OSX/qtbuffer.h  27 Dec 2005 10:23:13 -0000      1.1
+++ cvd/OSX/qtbuffer.h  7 Dec 2007 15:02:08 -0000       1.2
@@ -32,6 +32,8 @@
 #include <cvd/timer.h>
 #include <cvd/colourspaces.h>
 
+#include <string>
+
 namespace CVD {
        namespace Exceptions {
                /// Exceptions specific to QTBUFFER
@@ -107,9 +109,12 @@
         double frame_rate();
                /// Is there a new frame ready?
                bool frame_pending();
+       /// Get the video format string
+       std::string get_frame_format_string();
         
        private:
                RawQTPimpl * pimpl;
+                std::string frame_format_string;
     };
 };
 

Index: cvd_src/OSX/qtbuffer.cpp
===================================================================
RCS file: /cvsroot/libcvd/libcvd/cvd_src/OSX/qtbuffer.cpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -b -r1.1 -r1.2
--- cvd_src/OSX/qtbuffer.cpp    27 Dec 2005 10:23:13 -0000      1.1
+++ cvd_src/OSX/qtbuffer.cpp    7 Dec 2007 15:02:08 -0000       1.2
@@ -150,6 +150,19 @@
                err = SGPrepare(pimpl->seqGrab, false, true);   
                // ...action
                err = SGStartRecord(pimpl->seqGrab);
+               
+               // What format are the images?
+               ImageDescriptionHandle imageDesc = 
(ImageDescriptionHandle)NewHandle(0);
+               err = SGGetChannelSampleDescription(pimpl->chanVideo, 
(Handle)imageDesc);
+               if(err != noErr){
+                 throw 
Exceptions::QTBUFFER::DeviceOpen("SGGetChannelSampleDescription returned 
error");
+               }
+               // Convert pascal string to stl string..
+               for(char i=1; i<=(**imageDesc).name[0]; i++)
+                       frame_format_string = frame_format_string + (char) 
(**imageDesc).name[i];
+
+
+               
        }
        catch(Exceptions::QTBUFFER::DeviceOpen){
                // clean up on failure
@@ -159,6 +172,11 @@
        }
 }
 
+string RawQT::get_frame_format_string()
+{
+       return frame_format_string;
+}
+
 RawQT::~RawQT(){
        if(pimpl){
                if (pimpl->seqGrab)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]