Team Fortress 2 Source Code as on 22/4/2020
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

128 lines
4.3 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. //=============================================================================
  6. #ifndef QUICKTIME_VIDEO_H
  7. #define QUICKTIME_VIDEO_H
  8. #ifdef _WIN32
  9. #pragma once
  10. #endif
  11. //-----------------------------------------------------------------------------
  12. // Forward declarations
  13. //-----------------------------------------------------------------------------
  14. class IFileSystem;
  15. class IMaterialSystem;
  16. class CQuickTimeMaterial;
  17. //-----------------------------------------------------------------------------
  18. // Global interfaces - you already did the needed includes, right?
  19. //-----------------------------------------------------------------------------
  20. extern IFileSystem *g_pFileSystem;
  21. extern IMaterialSystem *materials;
  22. //-----------------------------------------------------------------------------
  23. // Quicktime includes - conditional compilation on #define QUICKTIME in VPC
  24. // The intent is to have a default functionality fallback if not defined
  25. // which provides a dynamically generated texture (moving line on background)
  26. //-----------------------------------------------------------------------------
  27. #if defined ( OSX )
  28. #include <quicktime/QTML.h>
  29. #include <quicktime/Movies.h>
  30. #elif defined ( WIN32 )
  31. #include <QTML.h>
  32. #include <Movies.h>
  33. #include <windows.h>
  34. #elif
  35. #error "Quicktime not supported on this target platform"
  36. #endif
  37. #include "video/ivideoservices.h"
  38. #include "videosubsystem.h"
  39. #include "utlvector.h"
  40. // -----------------------------------------------------------------------------
  41. // CQuickTimeVideoSubSystem - Implementation of IVideoSubSystem
  42. // -----------------------------------------------------------------------------
  43. class CQuickTimeVideoSubSystem : public CTier2AppSystem< IVideoSubSystem >
  44. {
  45. typedef CTier2AppSystem< IVideoSubSystem > BaseClass;
  46. public:
  47. CQuickTimeVideoSubSystem();
  48. ~CQuickTimeVideoSubSystem();
  49. // Inherited from IAppSystem
  50. virtual bool Connect( CreateInterfaceFn factory );
  51. virtual void Disconnect();
  52. virtual void *QueryInterface( const char *pInterfaceName );
  53. virtual InitReturnVal_t Init();
  54. virtual void Shutdown();
  55. // Inherited from IVideoSubSystem
  56. // SubSystem Identification functions
  57. virtual VideoSystem_t GetSystemID();
  58. virtual VideoSystemStatus_t GetSystemStatus();
  59. virtual VideoSystemFeature_t GetSupportedFeatures();
  60. virtual const char *GetVideoSystemName();
  61. // Setup & Shutdown Services
  62. virtual bool InitializeVideoSystem( IVideoCommonServices *pCommonServices );
  63. virtual bool ShutdownVideoSystem();
  64. virtual VideoResult_t VideoSoundDeviceCMD( VideoSoundDeviceOperation_t operation, void *pDevice = nullptr, void *pData = nullptr );
  65. // get list of file extensions and features we support
  66. virtual int GetSupportedFileExtensionCount();
  67. virtual const char *GetSupportedFileExtension( int num );
  68. virtual VideoSystemFeature_t GetSupportedFileExtensionFeatures( int num );
  69. // Video Playback and Recording Services
  70. virtual VideoResult_t PlayVideoFileFullScreen( const char *filename, void *mainWindow, int windowWidth, int windowHeight, int desktopWidth, int desktopHeight, bool windowed, float forcedMinTime, VideoPlaybackFlags_t playbackFlags );
  71. // Create/destroy a video material
  72. virtual IVideoMaterial *CreateVideoMaterial( const char *pMaterialName, const char *pVideoFileName, VideoPlaybackFlags_t flags );
  73. virtual VideoResult_t DestroyVideoMaterial( IVideoMaterial *pVideoMaterial );
  74. // Create/destroy a video encoder
  75. virtual IVideoRecorder *CreateVideoRecorder();
  76. virtual VideoResult_t DestroyVideoRecorder( IVideoRecorder *pRecorder );
  77. virtual VideoResult_t CheckCodecAvailability( VideoEncodeCodec_t codec );
  78. virtual VideoResult_t GetLastResult();
  79. private:
  80. bool SetupQuickTime();
  81. bool ShutdownQuickTime();
  82. VideoResult_t SetResult( VideoResult_t status );
  83. bool m_bQuickTimeInitialized;
  84. VideoResult_t m_LastResult;
  85. VideoSystemStatus_t m_CurrentStatus;
  86. VideoSystemFeature_t m_AvailableFeatures;
  87. IVideoCommonServices *m_pCommonServices;
  88. CUtlVector< IVideoMaterial* > m_MaterialList;
  89. CUtlVector< IVideoRecorder* > m_RecorderList;
  90. static const VideoSystemFeature_t DEFAULT_FEATURE_SET;
  91. };
  92. #endif // QUICKTIME_VIDEO_H