⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 qtvid.h

📁 使用VOIP技术.能够无连接接通远程用户
💻 H
字号:
////  The contents of this file are subject to the Mozilla Public License//  Version 1.0 (the "License"); you may not use this file except in//  compliance with the License. You may obtain a copy of the License at//  http://www.mozilla.org/MPL/// //  Software distributed under the License is distributed on an "AS IS"//  basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See//  the License for the specific language governing rights and limitations//  under the License.// //  The Original Code is CPhone, a cross platform voip gui.////  The Initial Developer of the Original Code is Derek Smithies.////  Copyright (C) 2002 Indranet Technologies Ltd, //                                  http://www.indranet-technologies.com//  All Rights Reserved.////  Contributor(s): _______________/* * *  $Log: qtvid.h,v $ *  Revision 1.2  2003/04/04 04:37:49  dereksmithies *  Major upgrade. *  Ixj & microtelco support added. Fix threading issues. * *  Revision 1.1.1.1  2002/05/12 22:55:01  dereksmithies *  Initial release. * * * * */#ifndef _CPhone_Qt_H#define _CPhone_Qt_H#include <ptlib.h>#include <qimage.h>#include "vdisplay.h"/**Display data to the Qt screen.  */class QtVideoDevice : public PVideoOutputDevice{  PCLASSINFO(QtVideoDevice, PVideoOutputDevice); public:  /**Constructor. Does not make a window. Initializes all variables;   */  QtVideoDevice(BOOL _isEncoding, VideoDisplay *_displayWidget, BOOL vertFlip);  /**Destructor.  Closes window if necessary, (which initializes all variables)   */  ~QtVideoDevice();  /**Open the device given the device name.   */  virtual BOOL Open(		    const PString & deviceName,   /// Device name to open		    BOOL startImmediate = TRUE    /// Immediately start device		    )    { return TRUE; }  /**Synonymous with the destructor.   */  BOOL Close();    /**Global test function to determine if this video rendering     class is open.*/  BOOL IsOpen();    /**Take a YUV420P format image, render it on the existing window.      If the window is not present, there is no rendering.  */   BOOL Redraw (const void *videoFrame);   virtual PString GetDeviceName() const     { return "QtVideo"; }  /**Get a list of all of the drivers available.      */   virtual PStringList GetDeviceNames() const;      /**Get the maximum frame size in bytes.         Note a particular device may be able to provide variable length   frames (eg motion JPEG) so will be the maximum size of all frames.   */   virtual PINDEX GetMaxFrameBytes()     { return 352 * 288 * 3 * 2; }      /**Set size of the window. Closes existing window, opens new window.    */   BOOL SetFrameSize (unsigned _width ,unsigned _height);   /**Get the video conversion vertical flip state    */   BOOL GetVFlipState();      /**Set the video conversion vertical flip state    */   BOOL SetVFlipState(BOOL newVFlipState);      /**Toggle the video conversion vertical flip state    */   BOOL ToggleVFlipState();    void RemoveVideoImage();   unsigned GetFrameWidth() const { return width; }      unsigned GetFrameHeight() const { return height; }   BOOL SetFrameData(		     unsigned x,		     unsigned y,		     unsigned width,		     unsigned height,		     const BYTE * data,		     BOOL endFrame = TRUE    ) ;      /**Indicate frame may be displayed.    */   BOOL EndFrame();  protected:   BOOL WriteLineSegment(int x, int y, unsigned len, const BYTE * data);              BOOL         isEncoding;    BOOL         doVerticalFlip; private:    VideoDisplay *displayWidget;    unsigned    width;    unsigned    height;};/** Generate a text message on a YUV420P image plane.  */class PTextVideoInputDevice : public PFakeVideoInputDevice{  PCLASSINFO(PTextVideoInputDevice, PFakeVideoInputDevice);   public:  /**create a new video input device for generating text image on a qt system.   */  PTextVideoInputDevice();  PTextVideoInputDevice(PString message);  ~PTextVideoInputDevice();  /*Get the names of the devices.   */  PStringList GetInputDeviceNames();  /**find how many channels are available for use   */  int GetNumChannels();  /** Set the size of the output frame, and alter colour      converter size.  */  BOOL SetFrameSize(unsigned width, unsigned height);  /** Fill the destination frame with the required data.   */  BOOL GetFrameDataNoDelay(BYTE *destFrame, PINDEX * /*bytesReturned*/);  void SetDisplayText(PString newText);  /**Set the colour format to be used.          Default behaviour sets the value of the colourFormat variable and then     returns the IsOpen() status.  */  virtual BOOL SetColourFormat(const PString & colourFormat);               // New colour format for device. protected:  PString    text;  Rgb32Image *rgbImage;  PMutex      bufferMutex;};    #endif// End of File ///////////////////////////////////////////////////////////////

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -