FreeRDP
video_main.c File Reference
#include <freerdp/config.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <winpr/crt.h>
#include <winpr/assert.h>
#include <winpr/synch.h>
#include <winpr/print.h>
#include <winpr/stream.h>
#include <winpr/cmdline.h>
#include <winpr/collections.h>
#include <winpr/interlocked.h>
#include <winpr/sysinfo.h>
#include <freerdp/addin.h>
#include <freerdp/primitives.h>
#include <freerdp/client/channels.h>
#include <freerdp/client/geometry.h>
#include <freerdp/client/video.h>
#include <freerdp/channels/log.h>
#include <freerdp/codec/h264.h>
#include <freerdp/codec/yuv.h>
#include "video_main.h"

Macros

#define TAG   CHANNELS_TAG("video")
 
#define XF_VIDEO_UNLIMITED_RATE   31
 

Functions

static void PresentationContext_unref (PresentationContext **presentation)
 
static void VideoClientContextPriv_free (VideoClientContextPriv *priv)
 
static const char * video_command_name (BYTE cmd)
 
static void video_client_context_set_geometry (VideoClientContext *video, GeometryClientContext *geometry)
 
static VideoClientContextPriv * VideoClientContextPriv_new (VideoClientContext *video)
 
static BOOL PresentationContext_ref (PresentationContext *presentation)
 
static PresentationContext * PresentationContext_new (VideoClientContext *video, BYTE PresentationId, UINT32 x, UINT32 y, UINT32 width, UINT32 height)
 
static void VideoFrame_free (VideoFrame **pframe)
 
static VideoFrame * VideoFrame_new (VideoClientContextPriv *priv, PresentationContext *presentation, MAPPED_GEOMETRY *geom)
 
static UINT video_control_send_presentation_response (VideoClientContext *context, TSMM_PRESENTATION_RESPONSE *resp)
 
static BOOL video_onMappedGeometryUpdate (MAPPED_GEOMETRY *geometry)
 
static BOOL video_onMappedGeometryClear (MAPPED_GEOMETRY *geometry)
 
static UINT video_PresentationRequest (VideoClientContext *video, const TSMM_PRESENTATION_REQUEST *req)
 
static UINT video_read_tsmm_presentation_req (VideoClientContext *context, wStream *s)
 
static UINT video_control_on_data_received (IWTSVirtualChannelCallback *pChannelCallback, wStream *s)
 
static UINT video_control_send_client_notification (VideoClientContext *context, const TSMM_CLIENT_NOTIFICATION *notif)
 
static void video_timer (VideoClientContext *video, UINT64 now)
 
static UINT video_VideoData (VideoClientContext *context, const TSMM_VIDEO_DATA *data)
 
static UINT video_data_on_data_received (IWTSVirtualChannelCallback *pChannelCallback, wStream *s)
 
static UINT video_control_on_close (IWTSVirtualChannelCallback *pChannelCallback)
 
static UINT video_data_on_close (IWTSVirtualChannelCallback *pChannelCallback)
 
static UINT video_control_on_new_channel_connection (IWTSListenerCallback *listenerCallback, IWTSVirtualChannel *channel, BYTE *Data, BOOL *pbAccept, IWTSVirtualChannelCallback **ppCallback)
 
static UINT video_data_on_new_channel_connection (IWTSListenerCallback *pListenerCallback, IWTSVirtualChannel *pChannel, BYTE *Data, BOOL *pbAccept, IWTSVirtualChannelCallback **ppCallback)
 
static UINT video_plugin_initialize (IWTSPlugin *plugin, IWTSVirtualChannelManager *channelMgr)
 
static UINT video_plugin_terminated (IWTSPlugin *pPlugin)
 
 if (!videoPlugin)
 

Variables

static const BYTE MFVideoFormat_H264 []
 
VIDEO_PLUGIN * videoPlugin = NULL
 
VideoClientContext * videoContext = NULL
 
VideoClientContextPriv * priv = NULL
 
 else
 
return CHANNEL_RC_BAD_CHANNEL
 
return error
 

Macro Definition Documentation

◆ TAG

#define TAG   CHANNELS_TAG("video")

FreeRDP: A Remote Desktop Protocol Implementation Video Optimized Remoting Virtual Channel Extension

Copyright 2017 David Fort conta.nosp@m.ct@h.nosp@m.arden.nosp@m.ing-.nosp@m.consu.nosp@m.ltin.nosp@m.g.com

Licensed under the Apache License, Version 2.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.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

◆ XF_VIDEO_UNLIMITED_RATE

#define XF_VIDEO_UNLIMITED_RATE   31

Function Documentation

◆ if()

if ( videoPlugin)
Here is the call graph for this function:

◆ PresentationContext_new()

static PresentationContext* PresentationContext_new ( VideoClientContext *  video,
BYTE  PresentationId,
UINT32  x,
UINT32  y,
UINT32  width,
UINT32  height 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ PresentationContext_ref()

static BOOL PresentationContext_ref ( PresentationContext *  presentation)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ PresentationContext_unref()

static void PresentationContext_unref ( PresentationContext **  presentation)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ video_client_context_set_geometry()

static void video_client_context_set_geometry ( VideoClientContext *  video,
GeometryClientContext *  geometry 
)
static
Here is the caller graph for this function:

◆ video_command_name()

static const char* video_command_name ( BYTE  cmd)
static
Here is the caller graph for this function:

◆ video_control_on_close()

static UINT video_control_on_close ( IWTSVirtualChannelCallback *  pChannelCallback)
static

Function description

Returns
0 on success, otherwise a Win32 error code
Here is the call graph for this function:
Here is the caller graph for this function:

◆ video_control_on_data_received()

static UINT video_control_on_data_received ( IWTSVirtualChannelCallback *  pChannelCallback,
wStream s 
)
static

Function description

Returns
0 on success, otherwise a Win32 error code
Here is the call graph for this function:
Here is the caller graph for this function:

◆ video_control_on_new_channel_connection()

static UINT video_control_on_new_channel_connection ( IWTSListenerCallback *  listenerCallback,
IWTSVirtualChannel *  channel,
BYTE Data,
BOOL *  pbAccept,
IWTSVirtualChannelCallback **  ppCallback 
)
static

Function description

Returns
0 on success, otherwise a Win32 error code
Here is the call graph for this function:
Here is the caller graph for this function:

◆ video_control_send_client_notification()

static UINT video_control_send_client_notification ( VideoClientContext *  context,
const TSMM_CLIENT_NOTIFICATION notif 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ video_control_send_presentation_response()

static UINT video_control_send_presentation_response ( VideoClientContext *  context,
TSMM_PRESENTATION_RESPONSE resp 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ video_data_on_close()

static UINT video_data_on_close ( IWTSVirtualChannelCallback *  pChannelCallback)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ video_data_on_data_received()

static UINT video_data_on_data_received ( IWTSVirtualChannelCallback *  pChannelCallback,
wStream s 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ video_data_on_new_channel_connection()

static UINT video_data_on_new_channel_connection ( IWTSListenerCallback *  pListenerCallback,
IWTSVirtualChannel *  pChannel,
BYTE Data,
BOOL *  pbAccept,
IWTSVirtualChannelCallback **  ppCallback 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ video_onMappedGeometryClear()

static BOOL video_onMappedGeometryClear ( MAPPED_GEOMETRY *  geometry)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ video_onMappedGeometryUpdate()

static BOOL video_onMappedGeometryUpdate ( MAPPED_GEOMETRY *  geometry)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ video_plugin_initialize()

static UINT video_plugin_initialize ( IWTSPlugin *  plugin,
IWTSVirtualChannelManager *  channelMgr 
)
static

Function description

Returns
0 on success, otherwise a Win32 error code
Here is the call graph for this function:
Here is the caller graph for this function:

◆ video_plugin_terminated()

static UINT video_plugin_terminated ( IWTSPlugin *  pPlugin)
static

Function description

Returns
0 on success, otherwise a Win32 error code
Here is the call graph for this function:
Here is the caller graph for this function:

◆ video_PresentationRequest()

static UINT video_PresentationRequest ( VideoClientContext *  video,
const TSMM_PRESENTATION_REQUEST req 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ video_read_tsmm_presentation_req()

static UINT video_read_tsmm_presentation_req ( VideoClientContext *  context,
wStream s 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ video_timer()

static void video_timer ( VideoClientContext *  video,
UINT64  now 
)
static

some dropped frames, looks like we're asking too many frames per seconds, try lowering rate. We go directly from unlimited rate to 24 frames/seconds otherwise we lower rate by 2 frames by seconds

we treat all frames ok, so either ask the server to send more, or stay unlimited

Here is the call graph for this function:
Here is the caller graph for this function:

◆ video_VideoData()

static UINT video_VideoData ( VideoClientContext *  context,
const TSMM_VIDEO_DATA data 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ VideoClientContextPriv_free()

void VideoClientContextPriv_free ( VideoClientContextPriv *  priv)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ VideoClientContextPriv_new()

static VideoClientContextPriv* VideoClientContextPriv_new ( VideoClientContext *  video)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ VideoFrame_free()

static void VideoFrame_free ( VideoFrame **  pframe)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ VideoFrame_new()

static VideoFrame* VideoFrame_new ( VideoClientContextPriv *  priv,
PresentationContext *  presentation,
MAPPED_GEOMETRY *  geom 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ CHANNEL_RC_BAD_CHANNEL

return CHANNEL_RC_BAD_CHANNEL

◆ else

else
Initial value:
{
WLog_ERR(TAG, "could not get video Plugin.")
#define WLog_ERR(tag,...)
Definition: include/winpr/wlog.h:206
#define TAG
Definition: video_main.c:45

◆ error

return error

◆ MFVideoFormat_H264

const BYTE MFVideoFormat_H264[]
static
Initial value:
= { 'H', '2', '6', '4', 0x00, 0x00, 0x10, 0x00,
0x80, 0x00, 0x00, 0xAA, 0x00, 0x38, 0x9B, 0x71 }

◆ priv

VideoClientContextPriv* priv = NULL

◆ videoContext

VideoClientContext* videoContext = NULL

◆ videoPlugin

videoPlugin = NULL

Channel Client Interface Function description

Returns
0 on success, otherwise a Win32 error code