• LLuuuuuu
  • C/C++
  • 15.5MB
  • zip
  • 0
  • 10 积分
  • 1
  • 2020-02-21 17:51
/*********************************************************************** VruiXine - A VR video player based on Vrui and the xine multimedia engine. Copyright (c) 2015-2017 Oliver Kreylos This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ***********************************************************************/ #include <string.h> #include <xine.h> #include <xine/xineutils.h> #include <string> #include <stdexcept> #include <iostream> #include <Misc/ThrowStdErr.h> #include <Misc/FileNameExtensions.h> #include <Misc/MessageLogger.h> #include <Misc/StandardValueCoders.h> #include <Misc/ConfigurationFile.h> #include <Threads/TripleBuffer.h> #include <Geometry/Point.h> #include <Geometry/Vector.h> #include <Geometry/Rotation.h> #include <Geometry/OrthogonalTransformation.h> #include <Geometry/Plane.h> #include <Geometry/LinearUnit.h> #include <GL/gl.h> #include <GL/GLObject.h> #include <GL/GLContextData.h> #include <GL/Extensions/GLARBMultitexture.h> #include <GL/Extensions/GLARBTextureNonPowerOfTwo.h> #include <GL/Extensions/GLARBTextureRg.h> #include <GL/Extensions/GLARBVertexBufferObject.h> #include <GL/GLShader.h> #include <GL/GLVertexArrayParts.h> #include <GL/GLGeometryVertex.h> #include <GLMotif/StyleSheet.h> #include <GLMotif/WidgetManager.h> #include <GLMotif/PopupWindow.h> #include <GLMotif/Margin.h> #include <GLMotif/RowColumn.h> #include <GLMotif/RadioBox.h> #include <GLMotif/Blind.h> #include <GLMotif/Glyph.h> #include <GLMotif/Button.h> #include <GLMotif/NewButton.h> #include <GLMotif/ToggleButton.h> #include <GLMotif/TextField.h> #include <GLMotif/Slider.h> #include <GLMotif/TextFieldSlider.h> #include <GLMotif/FileSelectionHelper.h> #include <Vrui/Vrui.h> #include <Vrui/Application.h> #include <Vrui/InputDevice.h> #include <Vrui/Viewer.h> #include <Vrui/CoordinateManager.h> #include <Vrui/GenericAbstractToolFactory.h> #include <Vrui/DisplayState.h> #include <Vrui/OpenFile.h> class VruiXine:public Vrui::Application,public GLObject { /* Embedded classes: */ private: struct Frame // Structure representing a video frame { /* Elements: */ public: int format; // Format of video frame (YV12, YUY2, or RGB) int size[2]; // Size of video frame Vrui::Scalar aspectRatio; // Display aspect ratio of video frame unsigned char* planes[3]; // Pointers to up to three video frame planes /* Constructors and destructors: */ Frame(void) // Creates an empty frame :format(0), aspectRatio(0) { size[0]=size[1]=0; planes[0]=planes[1]=planes[2]=0; } ~Frame(void) // Destroys a frame { for(int i=0;i<3;++i) delete[] planes[i]; } }; struct OverlaySet // Structure representing a set of overlays { /* Elements: */ public: int numOverlays; // Number of active overlays raw_overlay_t overlays[XINE_VORAW_MAX_OVL]; /* Constructors and destructors: */ OverlaySet(void) // Creates an empty overlay set :numOverlays(0) { for(int i=0;i<XINE_VORAW_MAX_OVL;++i) overlays[i].ovl_rgba=0; } ~OverlaySet(void) // Destroys an overlay set { for(int i=0;i<XINE_VORAW_MAX_OVL;++i) delete[] overlays[i].ovl_rgba; } }; struct DataItem:public GLObject::DataItem { /* Elements: */ public: unsigned int numVertices[2]; // Number of vertices to render the video screen GLuint vertexBufferId; // Buffer for vertices to render the video screen GLuint indexBufferId; // Buffer for vertex indices to render the video screen unsigned int bufferDataVersion; // Version number of vertex data in vertex buffer GLuint frameTextureIds[3]; // IDs of three frame textures (Y plane or interleaved YUY2 or RGB, U plane, V plane) GLShader videoShaders[6]; // Shaders to render video textures in YV12, YUY2, and RGB formats, respectively, in color-only or combined color/depth format int videoShaderUniforms[6][5]; // Uniform variable locations of the three video rendering shaders unsigned int frameTextureVersion; // Version number of frame in frame texture(s) GLuint overlayTextureIds[XINE_VORAW_MAX_OVL]; // IDs of textures holding overlays unsigned int overlayTextureVersion; // Version number of overlay set in overlay textures /* Constructors and destructors: */ DataItem(void); virtual ~DataItem(void); }; typedef GLGeometry::Vertex<GLfloat,2,void,0,void,GLfloat,3> Vertex; // Type for vertices to render the video display screen /* Elements: */ xine_t* xine; // Handle to the main xine engine object xine_video_port_t* videoOutPort; // Handle to the video output port xine_audio_port_t* audioOutPort; // Handle to the audio output port xine_stream_t* stream; // Handle to the played multimedia stream xine_event_queue_t* eventQueue; // Handle to the event queue std::string videoFileName; // File name of the currently playing video GLMotif::FileSelectionHelper videoFileSelectionHelper; // Helper object to open video files Threads::TripleBuffer<Frame> videoFrames; // Triple buffer of video frames received from the video output plug-in unsigned int videoFrameVersion; // Version number of currently locked frame Threads::TripleBuffer<OverlaySet> overlaySets; // Triple buffer of overlay sets unsigned int overlaySetVersion; // Version number of currently locked overlay set GLMotif::PopupWindow* streamControlDialog; // Dialog window to control properties of the played video stream GLMotif::RadioBox* stereoModes; // Radio box to select stereo modes GLMotif::RadioBox* stereoLayouts; // Radio box to select stereo sub-frame layouts GLMotif::ToggleButton* stereoSquashedToggle; // Toggle to select squashed stereo GLMotif::ToggleButton* forceMonoToggle; // Toggle to force mono mode on stereo videos GLMotif::TextFieldSlider* stereoSeparationSlider; // Slider to adjust stereo separation in stereo videos GLMotif::TextFieldSlider* cropSliders[4]; // Sliders to adjust video cropping GLMotif::TextField* streamSizeTextFields[2]; // Text fields to display the effective stream size after cropping GLMotif::PopupWindow* dvdNavigationDialog; // Dialog window for DVD menu and chapter navigation GLMotif::Slider* volumeSlider; // Slider to adjust audio volume GLMotif::PopupWindow* playbackControlDialog; // Dialog window to control playback position GLMotif::TextField* playbackPositionText; // Text field showing the current playback position GLMotif::Slider* playbackSlider; // Slider to drag the current playback position bool playbackSliderDragging; // Flag whether the playback slider is currently being dragged GLMotif::TextField* streamLengthText; // Text field showing the length of the current stream double playbackPosCheckTime; // Next application time at which to check the playback position double streamLength; // Most recently reported stream length in seconds Vrui::Point screenCenter; // Center of video display screen in navigational coordinates Vrui::Scalar screenHeight; // Height of video display screen in navigational coordinate units Vrui::Scalar aspectRatio; // The aspect ratio of the currently locked video frame Vrui::Scalar screenCurvature; // Relative amount of screen curvature between 0 (flat) and 1 (sphere around display center) Vrui::Scalar fullSphereRadius; // Radius for full-sphere screens in navigational coordinate units double screenAzimuth,screenElevation; // Angles to rotate the screen int stereoMode; // Stream's stereo mode, 0: mono, 1: side-b
    • MMORPG_UI_Research.zip
    • VRTK3.2.1.zip
      VR Toolkit虚拟现实工具包 是统一管理各种VR设备SDK,提供一种方式开发VR程序的框架。 其中还包含了许多VR常用功能,如:控制器激光(贝塞尔)指针、虚拟空间运动、UI、虚拟物体交互等。
    • Unity3D平台AR与VR开发快速上手.rar
    • 3D机房.zip
      不多说,上干货 ! 风靡的3D机房具体实现,目前主要提供有以下管理功能:设备资产管理、机房空间统计、机房功耗统计、机房载重统计、场景可视化温度云、机房高级搜索、机房设备空间搜索、机房动环监控、机房链路管理。
    • 720度万能全景开发包flash+AS3+3d+源文件+源代码.rar
      flash全景开源代码,只要换下图片就是自己的作品!! flash全景开源代码,flash3D学习案例,pv3d很好的例子
    • Gait-Tracking-With-x-IMU-master.zip
      x-IMU matlab zupt惯性室内定位算法
    • 上汽软件大赛提交作品.rar
    • 倒车入库.rar
    • 雨流计数法.rar
      可通过matlab 实现雨滴计数法,可直接调用
    • AHRSupdate.rar