Horus Doc || C++ Reference || Class Overview   Pixels   Images   Detector   Geometry   Registry || Doxygen's quick Index  

VideoWriter.h

00001 
00002 /*
00003  *  Copyright (c) 2000, University of Amsterdam, The Netherlands.
00004  *  All rights reserved.
00005  *
00006  *  Author(s):
00007  *  Marc Navarro            (mnavarro@wins.uva.nl)
00008  */
00009 
00010 #include <streams.h>
00011 #include "atlbase.h"
00012 
00013 #include "IPutFrame.h"
00014 
00015 class VideoWriter : public IPutFrameController
00016 {
00017 public:
00018                                 VideoWriter(const char* name, int w, int h);
00019     virtual                     ~VideoWriter();
00020     int                         isNull();
00021 
00022     void                        putFrame(BYTE* data);
00023 
00024     //IPutFrameController:
00025     STDMETHODIMP                FillNextData(BYTE* data);
00026     STDMETHODIMP                GetDataSizes(int* width, int* height);
00027 
00028     //IUnknown:
00029     STDMETHODIMP                QueryInterface(const IID& riid, void** ppv);
00030     STDMETHODIMP_(ULONG)        AddRef();
00031     STDMETHODIMP_(ULONG)        Release();
00032 
00033 private:
00034 
00035     HRESULT                     buildGraph(const char* filename);
00036     HRESULT                     showError(const char* msg, HRESULT hr);
00037     HRESULT                     init(const char* filename, int w, int h);
00038 
00039     void                        stopWriting();
00040     HRESULT                     emptyData(BYTE* data);
00041 
00042     void                        trace(const char* msg);
00043 
00044     BYTE*                       _data;
00045     int                         _width;
00046     int                         _height;
00047 
00048     // Synchronize access to _data:
00049     // "Graph" thread can not access _data till some data is available
00050     // and "CORBA" thread can not put new data till _data has been processed
00051     // by "Graph thread".
00052     //
00053     // "Graph" thread waits on _newDataEvent and notifies _dataUsedEvent
00054     // "CORBA" thread waits on _dataUsedEvent and notifies _newDataEvent
00055     CAMEvent                    _newDataEvent;
00056     CAMEvent                    _dataUsedEvent;
00057 
00058     CComPtr<IGraphBuilder>      _iBuilder;
00059     CComPtr<IMediaControl>      _imCtrl;
00060     CComPtr<IMediaEvent>        _imEvent;
00061     CComPtr<IMediaEventSink>    _imEvSink;
00062 
00063     int                         _stopping;
00064 };
00065 
00066 

Generated on Tue Feb 3 14:18:44 2004 for C++Reference by doxygen1.2.12 written by Dimitri van Heesch, © 1997-2001