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.

97 lines
3.6 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // The copyright to the contents herein is the property of Valve, L.L.C.
  4. // The contents may be used and/or copied only with the written permission of
  5. // Valve, L.L.C., or in accordance with the terms and conditions stipulated in
  6. // the agreement/contract under which the contents have been supplied.
  7. //
  8. //=============================================================================
  9. #ifndef VIDEOSUBSYSTEM_H
  10. #define VIDEOSUBSYSTEM_H
  11. #if defined ( WIN32 )
  12. #pragma once
  13. #endif
  14. #include "tier2/tier2.h"
  15. #include "appframework/IAppSystem.h"
  16. //-----------------------------------------------------------------------------
  17. // Common structure used to store supported file types
  18. //-----------------------------------------------------------------------------
  19. struct VideoFileExtensionInfo_t
  20. {
  21. const char *m_FileExtension;
  22. VideoSystem_t m_VideoSubSystem;
  23. VideoSystemFeature_t m_VideoFeatures;
  24. };
  25. class IVideoCommonServices
  26. {
  27. public:
  28. virtual bool CalculateVideoDimensions( int videoWidth, int videoHeight, int displayWidth, int displayHeight, VideoPlaybackFlags_t playbackFlags,
  29. int *pOutputWidth, int *pOutputHeight, int *pXOffset, int *pYOffset ) = 0;
  30. virtual float GetSystemVolume() = 0;
  31. virtual VideoResult_t InitFullScreenPlaybackInputHandler( VideoPlaybackFlags_t playbackFlags, float forcedMinTime, bool windowed ) = 0;
  32. virtual bool ProcessFullScreenInput( bool &bAbortEvent, bool &bPauseEvent, bool &bQuitEvent ) = 0;
  33. virtual VideoResult_t TerminateFullScreenPlaybackInputHandler() = 0;
  34. };
  35. //-----------------------------------------------------------------------------
  36. // Main VIDEO_SERVICES interface
  37. //-----------------------------------------------------------------------------
  38. #define VIDEO_SUBSYSTEM_INTERFACE_VERSION "IVideoSubSystem002"
  39. class IVideoSubSystem : public IAppSystem
  40. {
  41. public:
  42. // SubSystem Identification functions
  43. virtual VideoSystem_t GetSystemID() = 0;
  44. virtual VideoSystemStatus_t GetSystemStatus() = 0;
  45. virtual VideoSystemFeature_t GetSupportedFeatures() = 0;
  46. virtual const char *GetVideoSystemName() = 0;
  47. // Setup & Shutdown Services
  48. virtual bool InitializeVideoSystem( IVideoCommonServices *pCommonServices ) = 0;
  49. virtual bool ShutdownVideoSystem() = 0;
  50. virtual VideoResult_t VideoSoundDeviceCMD( VideoSoundDeviceOperation_t operation, void *pDevice, void *pData = nullptr ) = 0;
  51. // get list of file extensions and features we support
  52. virtual int GetSupportedFileExtensionCount() = 0;
  53. virtual const char *GetSupportedFileExtension( int num ) = 0;
  54. virtual VideoSystemFeature_t GetSupportedFileExtensionFeatures( int num ) = 0;
  55. // Video Playback and Recording Services
  56. virtual VideoResult_t PlayVideoFileFullScreen( const char *filename, void *mainWindow, int windowWidth, int windowHeight, int desktopWidth, int desktopHeight, bool windowed, float forcedMinTime, VideoPlaybackFlags_t playbackFlags ) = 0;
  57. // Create/destroy a video material
  58. virtual IVideoMaterial *CreateVideoMaterial( const char *pMaterialName, const char *pVideoFileName, VideoPlaybackFlags_t flags ) = 0;
  59. virtual VideoResult_t DestroyVideoMaterial( IVideoMaterial* pVideoMaterial ) = 0;
  60. // Create/destroy a video encoder
  61. virtual IVideoRecorder *CreateVideoRecorder() = 0;
  62. virtual VideoResult_t DestroyVideoRecorder( IVideoRecorder *pRecorder ) = 0;
  63. virtual VideoResult_t CheckCodecAvailability( VideoEncodeCodec_t codec ) = 0;
  64. virtual VideoResult_t GetLastResult() = 0;
  65. };
  66. #endif