mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-05-16 05:07:06 +00:00
FS-7500: update yuv codec
This commit is contained in:
parent
ea2f00b3d9
commit
f3ad699526
@ -51,10 +51,8 @@ static switch_status_t switch_yuv_init(switch_codec_t *codec, switch_codec_flag_
|
|||||||
}
|
}
|
||||||
|
|
||||||
static switch_status_t switch_yuv_encode(switch_codec_t *codec,
|
static switch_status_t switch_yuv_encode(switch_codec_t *codec,
|
||||||
switch_codec_t *other_codec,
|
switch_image_t *img,
|
||||||
void *decoded_data,
|
void *encoded_data, uint32_t *encoded_data_len,
|
||||||
uint32_t decoded_data_len,
|
|
||||||
uint32_t decoded_rate, void *encoded_data, uint32_t *encoded_data_len, uint32_t *encoded_rate,
|
|
||||||
unsigned int *flag)
|
unsigned int *flag)
|
||||||
{
|
{
|
||||||
/* yuv encode is unclear, so return 0 for now */
|
/* yuv encode is unclear, so return 0 for now */
|
||||||
@ -64,18 +62,13 @@ static switch_status_t switch_yuv_encode(switch_codec_t *codec,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static switch_status_t switch_yuv_decode(switch_codec_t *codec,
|
static switch_status_t switch_yuv_decode(switch_codec_t *codec,
|
||||||
switch_codec_t *other_codec,
|
switch_frame_t *frame,
|
||||||
void *encoded_data,
|
switch_image_t **img,
|
||||||
uint32_t encoded_data_len,
|
|
||||||
uint32_t encoded_rate, void *decoded_data, uint32_t *decoded_data_len, uint32_t *decoded_rate,
|
|
||||||
unsigned int *flag)
|
unsigned int *flag)
|
||||||
{
|
{
|
||||||
if (*decoded_data_len < encoded_data_len) return SWITCH_STATUS_FALSE;
|
switch_assert(frame);
|
||||||
|
|
||||||
codec->dec_picture.width = codec->enc_picture.width;
|
*img = (switch_image_t *)frame->user_data;
|
||||||
codec->dec_picture.height = codec->enc_picture.height;
|
|
||||||
memcpy(decoded_data, encoded_data, encoded_data_len);
|
|
||||||
*decoded_data_len = encoded_data_len;
|
|
||||||
return SWITCH_STATUS_SUCCESS;
|
return SWITCH_STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user