video.h (3211B)
1/** 2 * FreeRDP: A Remote Desktop Protocol Implementation 3 * Video Optimized Remoting Virtual Channel Extension 4 * 5 * Copyright 2018 David Fort <contact@hardening-consulting.com> 6 * 7 * Licensed under the Apache License, Version 2.0 (the "License"); 8 * you may not use this file except in compliance with the License. 9 * You may obtain a copy of the License at 10 * 11 * http://www.apache.org/licenses/LICENSE-2.0 12 * 13 * Unless required by applicable law or agreed to in writing, software 14 * distributed under the License is distributed on an "AS IS" BASIS, 15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 * See the License for the specific language governing permissions and 17 * limitations under the License. 18 */ 19 20#ifndef FREERDP_CHANNEL_VIDEO_H 21#define FREERDP_CHANNEL_VIDEO_H 22 23#include <winpr/wtypes.h> 24#include <freerdp/types.h> 25 26#define VIDEO_CONTROL_DVC_CHANNEL_NAME "Microsoft::Windows::RDS::Video::Control::v08.01" 27#define VIDEO_DATA_DVC_CHANNEL_NAME "Microsoft::Windows::RDS::Video::Data::v08.01" 28 29/** @brief TSNM packet type */ 30enum 31{ 32 TSMM_PACKET_TYPE_PRESENTATION_REQUEST = 1, 33 TSMM_PACKET_TYPE_PRESENTATION_RESPONSE = 2, 34 TSMM_PACKET_TYPE_CLIENT_NOTIFICATION = 3, 35 TSMM_PACKET_TYPE_VIDEO_DATA = 4 36}; 37 38/** @brief TSMM_PRESENTATION_REQUEST commands */ 39enum 40{ 41 TSMM_START_PRESENTATION = 1, 42 TSMM_STOP_PRESENTATION = 2 43}; 44 45/** @brief presentation request struct */ 46struct _TSMM_PRESENTATION_REQUEST 47{ 48 BYTE PresentationId; 49 BYTE Version; 50 BYTE Command; 51 BYTE FrameRate; 52 UINT32 SourceWidth, SourceHeight; 53 UINT32 ScaledWidth, ScaledHeight; 54 UINT64 hnsTimestampOffset; 55 UINT64 GeometryMappingId; 56 BYTE VideoSubtypeId[16]; 57 UINT32 cbExtra; 58 BYTE* pExtraData; 59}; 60typedef struct _TSMM_PRESENTATION_REQUEST TSMM_PRESENTATION_REQUEST; 61 62/** @brief response to a TSMM_PRESENTATION_REQUEST */ 63struct _TSMM_PRESENTATION_RESPONSE 64{ 65 BYTE PresentationId; 66}; 67typedef struct _TSMM_PRESENTATION_RESPONSE TSMM_PRESENTATION_RESPONSE; 68 69/** @brief TSMM_VIDEO_DATA flags */ 70enum 71{ 72 TSMM_VIDEO_DATA_FLAG_HAS_TIMESTAMPS = 0x01, 73 TSMM_VIDEO_DATA_FLAG_KEYFRAME = 0x02, 74 TSMM_VIDEO_DATA_FLAG_NEW_FRAMERATE = 0x04 75}; 76 77/** @brief a video data packet */ 78struct _TSMM_VIDEO_DATA 79{ 80 BYTE PresentationId; 81 BYTE Version; 82 BYTE Flags; 83 UINT64 hnsTimestamp; 84 UINT64 hnsDuration; 85 UINT16 CurrentPacketIndex; 86 UINT16 PacketsInSample; 87 UINT32 SampleNumber; 88 UINT32 cbSample; 89 BYTE* pSample; 90}; 91typedef struct _TSMM_VIDEO_DATA TSMM_VIDEO_DATA; 92 93/** @brief values for NotificationType in TSMM_CLIENT_NOTIFICATION */ 94enum 95{ 96 TSMM_CLIENT_NOTIFICATION_TYPE_NETWORK_ERROR = 1, 97 TSMM_CLIENT_NOTIFICATION_TYPE_FRAMERATE_OVERRIDE = 2 98}; 99 100/** @brief struct used when NotificationType is FRAMERATE_OVERRIDE */ 101struct _TSMM_CLIENT_NOTIFICATION_FRAMERATE_OVERRIDE 102{ 103 UINT32 Flags; 104 UINT32 DesiredFrameRate; 105}; 106typedef struct _TSMM_CLIENT_NOTIFICATION_FRAMERATE_OVERRIDE 107 TSMM_CLIENT_NOTIFICATION_FRAMERATE_OVERRIDE; 108 109/** @brief a client to server notification struct */ 110struct _TSMM_CLIENT_NOTIFICATION 111{ 112 BYTE PresentationId; 113 BYTE NotificationType; 114 TSMM_CLIENT_NOTIFICATION_FRAMERATE_OVERRIDE FramerateOverride; 115}; 116typedef struct _TSMM_CLIENT_NOTIFICATION TSMM_CLIENT_NOTIFICATION; 117 118#endif /* FREERDP_CHANNEL_VIDEO_H */