FreeRDP
h264_mediacodec.c File Reference
#include <winpr/wlog.h>
#include <winpr/assert.h>
#include <winpr/library.h>
#include <freerdp/log.h>
#include <freerdp/codec/h264.h>
#include <media/NdkMediaCodec.h>
#include <media/NdkMediaFormat.h>
#include "h264.h"

Functions

static AMediaFormat * mediacodec_format_new (wLog *log, int width, int height)
 
static void set_mediacodec_format (H264_CONTEXT *h264, AMediaFormat **formatVariable, AMediaFormat *newFormat)
 
static int update_mediacodec_inputformat (H264_CONTEXT *h264)
 
static int update_mediacodec_outputformat (H264_CONTEXT *h264)
 
static void release_current_outputbuffer (H264_CONTEXT *h264)
 
static int mediacodec_compress (H264_CONTEXT *h264, const BYTE **pSrcYuv, const UINT32 *pStride, BYTE **ppDstData, UINT32 *pDstSize)
 
static int mediacodec_decompress (H264_CONTEXT *h264, const BYTE *pSrcData, UINT32 SrcSize)
 
static void mediacodec_uninit (H264_CONTEXT *h264)
 
static BOOL mediacodec_init (H264_CONTEXT *h264)
 

Variables

static const char * CODEC_NAME = "video/avc"
 
static const int COLOR_FormatYUV420Planar = 19
 
static const int COLOR_FormatYUV420Flexible = 0x7f420888
 
static const int MEDIACODEC_MINIMUM_WIDTH = 320
 
static const int MEDIACODEC_MINIMUM_HEIGHT = 240
 
const H264_CONTEXT_SUBSYSTEM g_Subsystem_mediacodec
 

Function Documentation

◆ mediacodec_compress()

static int mediacodec_compress ( H264_CONTEXT *  h264,
const BYTE **  pSrcYuv,
const UINT32 *  pStride,
BYTE **  ppDstData,
UINT32 *  pDstSize 
)
static

◆ mediacodec_decompress()

static int mediacodec_decompress ( H264_CONTEXT *  h264,
const BYTE pSrcData,
UINT32  SrcSize 
)
static
Here is the call graph for this function:

◆ mediacodec_format_new()

static AMediaFormat* mediacodec_format_new ( wLog *  log,
int  width,
int  height 
)
static
Here is the caller graph for this function:

◆ mediacodec_init()

static BOOL mediacodec_init ( H264_CONTEXT *  h264)
static
Here is the call graph for this function:

◆ mediacodec_uninit()

static void mediacodec_uninit ( H264_CONTEXT *  h264)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ release_current_outputbuffer()

static void release_current_outputbuffer ( H264_CONTEXT *  h264)
static
Here is the caller graph for this function:

◆ set_mediacodec_format()

static void set_mediacodec_format ( H264_CONTEXT *  h264,
AMediaFormat **  formatVariable,
AMediaFormat *  newFormat 
)
static
Here is the caller graph for this function:

◆ update_mediacodec_inputformat()

static int update_mediacodec_inputformat ( H264_CONTEXT *  h264)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ update_mediacodec_outputformat()

static int update_mediacodec_outputformat ( H264_CONTEXT *  h264)
static
Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ CODEC_NAME

const char* CODEC_NAME = "video/avc"
static

FreeRDP: A Remote Desktop Protocol Implementation H.264 Bitmap Compression

Copyright 2022 Ely Ronnen elyro.nosp@m.nnen.nosp@m.@gmai.nosp@m.l.co.nosp@m.m

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.

◆ COLOR_FormatYUV420Flexible

const int COLOR_FormatYUV420Flexible = 0x7f420888
static

◆ COLOR_FormatYUV420Planar

const int COLOR_FormatYUV420Planar = 19
static

◆ g_Subsystem_mediacodec

const H264_CONTEXT_SUBSYSTEM g_Subsystem_mediacodec
Initial value:
= { "MediaCodec", mediacodec_init,
static int mediacodec_decompress(H264_CONTEXT *h264, const BYTE *pSrcData, UINT32 SrcSize)
Definition: h264_mediacodec.c:227
static BOOL mediacodec_init(H264_CONTEXT *h264)
Definition: h264_mediacodec.c:440
static int mediacodec_compress(H264_CONTEXT *h264, const BYTE **pSrcYuv, const UINT32 *pStride, BYTE **ppDstData, UINT32 *pDstSize)
Definition: h264_mediacodec.c:214
static void mediacodec_uninit(H264_CONTEXT *h264)
Definition: h264_mediacodec.c:401

◆ MEDIACODEC_MINIMUM_HEIGHT

const int MEDIACODEC_MINIMUM_HEIGHT = 240
static

◆ MEDIACODEC_MINIMUM_WIDTH

const int MEDIACODEC_MINIMUM_WIDTH = 320
static