FreeRDP
tsmf_ffmpeg.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <winpr/crt.h>
#include <freerdp/channels/log.h>
#include <freerdp/client/tsmf.h>
#include <libavcodec/avcodec.h>
#include <libavutil/common.h>
#include "tsmf_constants.h"
#include "tsmf_decoder.h"

Macros

#define AVMEDIA_TYPE_VIDEO   0
 
#define AVMEDIA_TYPE_AUDIO   1
 
#define MAX_AUDIO_FRAME_SIZE   AVCODEC_MAX_AUDIO_FRAME_SIZE
 
#define AV_CODEC_ID_VC1   CODEC_ID_VC1
 
#define AV_CODEC_ID_WMAV2   CODEC_ID_WMAV2
 
#define AV_CODEC_ID_WMAPRO   CODEC_ID_WMAPRO
 
#define AV_CODEC_ID_MP3   CODEC_ID_MP3
 
#define AV_CODEC_ID_MP2   CODEC_ID_MP2
 
#define AV_CODEC_ID_MPEG2VIDEO   CODEC_ID_MPEG2VIDEO
 
#define AV_CODEC_ID_WMV3   CODEC_ID_WMV3
 
#define AV_CODEC_ID_AAC   CODEC_ID_AAC
 
#define AV_CODEC_ID_H264   CODEC_ID_H264
 
#define AV_CODEC_ID_AC3   CODEC_ID_AC3
 
#define AV_PIX_FMT_YUV420P   PIX_FMT_YUV420P
 
#define freerdp_tsmf_client_subsystem_entry   FREERDP_API freerdp_tsmf_client_decoder_subsystem_entry
 

Functions

static BOOL tsmf_ffmpeg_init_context (ITSMFDecoder *decoder)
 
static BOOL tsmf_ffmpeg_init_video_stream (ITSMFDecoder *decoder, const TS_AM_MEDIA_TYPE *media_type)
 
static BOOL tsmf_ffmpeg_init_audio_stream (ITSMFDecoder *decoder, const TS_AM_MEDIA_TYPE *media_type)
 
static BOOL tsmf_ffmpeg_init_stream (ITSMFDecoder *decoder, const TS_AM_MEDIA_TYPE *media_type)
 
static BOOL tsmf_ffmpeg_prepare (ITSMFDecoder *decoder)
 
static BOOL tsmf_ffmpeg_set_format (ITSMFDecoder *decoder, TS_AM_MEDIA_TYPE *media_type)
 
static BOOL tsmf_ffmpeg_decode_video (ITSMFDecoder *decoder, const BYTE *data, UINT32 data_size, UINT32 extensions)
 
static BOOL tsmf_ffmpeg_decode_audio (ITSMFDecoder *decoder, const BYTE *data, UINT32 data_size, UINT32 extensions)
 
static BOOL tsmf_ffmpeg_decode (ITSMFDecoder *decoder, const BYTE *data, UINT32 data_size, UINT32 extensions)
 
static BYTEtsmf_ffmpeg_get_decoded_data (ITSMFDecoder *decoder, UINT32 *size)
 
static UINT32 tsmf_ffmpeg_get_decoded_format (ITSMFDecoder *decoder)
 
static BOOL tsmf_ffmpeg_get_decoded_dimension (ITSMFDecoder *decoder, UINT32 *width, UINT32 *height)
 
static void tsmf_ffmpeg_free (ITSMFDecoder *decoder)
 
static BOOL CALLBACK InitializeAvCodecs (PINIT_ONCE once, PVOID param, PVOID *context)
 
ITSMFDecoder * freerdp_tsmf_client_subsystem_entry (void)
 

Variables

static INIT_ONCE g_Initialized = INIT_ONCE_STATIC_INIT
 

Macro Definition Documentation

#define AV_CODEC_ID_AAC   CODEC_ID_AAC
#define AV_CODEC_ID_AC3   CODEC_ID_AC3
#define AV_CODEC_ID_H264   CODEC_ID_H264
#define AV_CODEC_ID_MP2   CODEC_ID_MP2
#define AV_CODEC_ID_MP3   CODEC_ID_MP3
#define AV_CODEC_ID_MPEG2VIDEO   CODEC_ID_MPEG2VIDEO
#define AV_CODEC_ID_VC1   CODEC_ID_VC1
#define AV_CODEC_ID_WMAPRO   CODEC_ID_WMAPRO
#define AV_CODEC_ID_WMAV2   CODEC_ID_WMAV2
#define AV_CODEC_ID_WMV3   CODEC_ID_WMV3
#define AV_PIX_FMT_YUV420P   PIX_FMT_YUV420P
#define AVMEDIA_TYPE_AUDIO   1
#define AVMEDIA_TYPE_VIDEO   0

FreeRDP: A Remote Desktop Protocol Implementation Video Redirection Virtual Channel - FFmpeg Decoder

Copyright 2010-2011 Vic Lee

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 freerdp_tsmf_client_subsystem_entry   FREERDP_API freerdp_tsmf_client_decoder_subsystem_entry
#define MAX_AUDIO_FRAME_SIZE   AVCODEC_MAX_AUDIO_FRAME_SIZE

Function Documentation

ITSMFDecoder* freerdp_tsmf_client_subsystem_entry ( void  )

Here is the call graph for this function:

static BOOL CALLBACK InitializeAvCodecs ( PINIT_ONCE  once,
PVOID  param,
PVOID *  context 
)
static

Here is the caller graph for this function:

static BOOL tsmf_ffmpeg_decode ( ITSMFDecoder *  decoder,
const BYTE data,
UINT32  data_size,
UINT32  extensions 
)
static

Here is the call graph for this function:

Here is the caller graph for this function:

static BOOL tsmf_ffmpeg_decode_audio ( ITSMFDecoder *  decoder,
const BYTE data,
UINT32  data_size,
UINT32  extensions 
)
static

Here is the call graph for this function:

Here is the caller graph for this function:

static BOOL tsmf_ffmpeg_decode_video ( ITSMFDecoder *  decoder,
const BYTE data,
UINT32  data_size,
UINT32  extensions 
)
static

Here is the caller graph for this function:

static void tsmf_ffmpeg_free ( ITSMFDecoder *  decoder)
static

Here is the caller graph for this function:

static BYTE* tsmf_ffmpeg_get_decoded_data ( ITSMFDecoder *  decoder,
UINT32 size 
)
static

Here is the caller graph for this function:

static BOOL tsmf_ffmpeg_get_decoded_dimension ( ITSMFDecoder *  decoder,
UINT32 width,
UINT32 height 
)
static

Here is the caller graph for this function:

static UINT32 tsmf_ffmpeg_get_decoded_format ( ITSMFDecoder *  decoder)
static

Here is the caller graph for this function:

static BOOL tsmf_ffmpeg_init_audio_stream ( ITSMFDecoder *  decoder,
const TS_AM_MEDIA_TYPE media_type 
)
static

Here is the caller graph for this function:

static BOOL tsmf_ffmpeg_init_context ( ITSMFDecoder *  decoder)
static

Here is the caller graph for this function:

static BOOL tsmf_ffmpeg_init_stream ( ITSMFDecoder *  decoder,
const TS_AM_MEDIA_TYPE media_type 
)
static

Here is the call graph for this function:

Here is the caller graph for this function:

static BOOL tsmf_ffmpeg_init_video_stream ( ITSMFDecoder *  decoder,
const TS_AM_MEDIA_TYPE media_type 
)
static

Here is the caller graph for this function:

static BOOL tsmf_ffmpeg_prepare ( ITSMFDecoder *  decoder)
static

Here is the caller graph for this function:

static BOOL tsmf_ffmpeg_set_format ( ITSMFDecoder *  decoder,
TS_AM_MEDIA_TYPE media_type 
)
static

Here is the call graph for this function:

Here is the caller graph for this function:

Variable Documentation

INIT_ONCE g_Initialized = INIT_ONCE_STATIC_INIT
static