FreeRDP
video_main.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <winpr/crt.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/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
 
#define DVCPluginEntry   FREERDP_API DVCPluginEntry
 

Functions

static const char * video_command_name (BYTE cmd)
 
static BOOL yuv_to_rgb (PresentationContext *presentation, BYTE *dest)
 
static void video_client_context_set_geometry (VideoClientContext *video, GeometryClientContext *geometry)
 
VideoClientContextPriv * VideoClientContextPriv_new (VideoClientContext *video)
 
static PresentationContext * PresentationContext_new (VideoClientContext *video, BYTE PresentationId, UINT32 x, UINT32 y, UINT32 width, UINT32 height)
 
static void PresentationContext_unref (PresentationContext *presentation)
 
static void VideoFrame_free (VideoFrame **pframe)
 
static void VideoClientContextPriv_free (VideoClientContextPriv *priv)
 
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, 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, TSMM_CLIENT_NOTIFICATION *notif)
 
static void video_timer (VideoClientContext *video, UINT64 now)
 
static UINT video_VideoData (VideoClientContext *context, 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)
 
UINT DVCPluginEntry (IDRDYNVC_ENTRY_POINTS *pEntryPoints)
 

Variables

static const BYTE MFVideoFormat_H264 []
 

Macro Definition Documentation

#define DVCPluginEntry   FREERDP_API DVCPluginEntry

Channel Client Interface

#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.

#define XF_VIDEO_UNLIMITED_RATE   31

Function Documentation

UINT DVCPluginEntry ( IDRDYNVC_ENTRY_POINTS *  pEntryPoints)

Function description

Returns
0 on success, otherwise a Win32 error code

Here is the call graph for this function:

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:

static void PresentationContext_unref ( PresentationContext *  presentation)
static

Here is the call graph for this function:

Here is the caller graph for this function:

static void video_client_context_set_geometry ( VideoClientContext *  video,
GeometryClientContext *  geometry 
)
static

Here is the caller graph for this function:

static const char* video_command_name ( BYTE  cmd)
static

Here is the caller graph for this function:

static UINT video_control_on_close ( IWTSVirtualChannelCallback *  pChannelCallback)
static

Function description

Returns
0 on success, otherwise a Win32 error code

Here is the caller graph for this function:

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:

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:

static UINT video_control_send_client_notification ( VideoClientContext *  context,
TSMM_CLIENT_NOTIFICATION *  notif 
)
static

Here is the call graph for this function:

Here is the caller graph for this function:

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:

static UINT video_data_on_close ( IWTSVirtualChannelCallback *  pChannelCallback)
static

Here is the caller graph for this function:

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:

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:

static BOOL video_onMappedGeometryClear ( MAPPED_GEOMETRY *  geometry)
static

Here is the call graph for this function:

Here is the caller graph for this function:

static BOOL video_onMappedGeometryUpdate ( MAPPED_GEOMETRY *  geometry)
static

Here is the caller graph for this function:

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:

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:

static UINT video_PresentationRequest ( VideoClientContext *  video,
TSMM_PRESENTATION_REQUEST *  req 
)
static

Here is the call graph for this function:

Here is the caller graph for this function:

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:

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:

static UINT video_VideoData ( VideoClientContext *  context,
TSMM_VIDEO_DATA *  data 
)
static

Here is the call graph for this function:

Here is the caller graph for this function:

static void VideoClientContextPriv_free ( VideoClientContextPriv *  priv)
static

Here is the call graph for this function:

Here is the caller graph for this function:

VideoClientContextPriv* VideoClientContextPriv_new ( VideoClientContext *  video)

Here is the call graph for this function:

Here is the caller graph for this function:

static void VideoFrame_free ( VideoFrame **  pframe)
static

Here is the call graph for this function:

Here is the caller graph for this function:

static BOOL yuv_to_rgb ( PresentationContext *  presentation,
BYTE dest 
)
static

Here is the call graph for this function:

Here is the caller graph for this function:

Variable Documentation

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