Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
b644421c
提交
b644421c
authored
1月 17, 2019
作者:
Anthony Minessale
提交者:
Andrey Volk
7月 25, 2019
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
core side of vpx update
上级
f49279b4
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
250 行增加
和
255 行删除
+250
-255
Makefile.am
Makefile.am
+49
-43
switch_image.h
src/include/switch_image.h
+193
-204
switch_core_video.c
src/switch_core_video.c
+8
-8
没有找到文件。
Makefile.am
浏览文件 @
b644421c
...
@@ -195,49 +195,55 @@ CORE_LIBS+=libfreeswitch_spandsp.la
...
@@ -195,49 +195,55 @@ CORE_LIBS+=libfreeswitch_spandsp.la
if
ENABLE_LIBYUV
if
ENABLE_LIBYUV
libfreeswitch_libyuv_la_SOURCES
=
\
libfreeswitch_libyuv_la_SOURCES
=
\
libs/libyuv/source/compare.cc
\
libs/libyuv/source/compare.cc
\
libs/libyuv/source/compare_common.cc
\
libs/libyuv/source/compare_common.cc
\
libs/libyuv/source/compare_gcc.cc
\
libs/libyuv/source/compare_gcc.cc
\
libs/libyuv/source/convert.cc
\
libs/libyuv/source/compare_mmi.cc
\
libs/libyuv/source/convert_argb.cc
\
libs/libyuv/source/compare_msa.cc
\
libs/libyuv/source/convert_from.cc
\
libs/libyuv/source/compare_neon64.cc
\
libs/libyuv/source/convert_from_argb.cc
\
libs/libyuv/source/compare_neon.cc
\
libs/libyuv/source/convert_to_argb.cc
\
libs/libyuv/source/compare_win.cc
\
libs/libyuv/source/convert_to_i420.cc
\
libs/libyuv/source/convert_argb.cc
\
libs/libyuv/source/cpu_id.cc
\
libs/libyuv/source/convert.cc
\
libs/libyuv/source/planar_functions.cc
\
libs/libyuv/source/convert_from_argb.cc
\
libs/libyuv/source/rotate.cc
\
libs/libyuv/source/convert_from.cc
\
libs/libyuv/source/rotate_any.cc
\
libs/libyuv/source/convert_jpeg.cc
\
libs/libyuv/source/rotate_argb.cc
\
libs/libyuv/source/convert_to_argb.cc
\
libs/libyuv/source/rotate_common.cc
\
libs/libyuv/source/convert_to_i420.cc
\
libs/libyuv/source/rotate_gcc.cc
\
libs/libyuv/source/cpu_id.cc
\
libs/libyuv/source/rotate_mips.cc
\
libs/libyuv/source/mjpeg_decoder.cc
\
libs/libyuv/source/row_any.cc
\
libs/libyuv/source/mjpeg_validate.cc
\
libs/libyuv/source/row_common.cc
\
libs/libyuv/source/planar_functions.cc
\
libs/libyuv/source/row_mips.cc
\
libs/libyuv/source/rotate_any.cc
\
libs/libyuv/source/row_gcc.cc
\
libs/libyuv/source/rotate_argb.cc
\
libs/libyuv/source/scale.cc
\
libs/libyuv/source/rotate.cc
\
libs/libyuv/source/scale_any.cc
\
libs/libyuv/source/rotate_common.cc
\
libs/libyuv/source/scale_argb.cc
\
libs/libyuv/source/rotate_gcc.cc
\
libs/libyuv/source/scale_common.cc
\
libs/libyuv/source/rotate_mmi.cc
\
libs/libyuv/source/scale_gcc.cc
\
libs/libyuv/source/rotate_msa.cc
\
libs/libyuv/source/scale_mips.cc
\
libs/libyuv/source/rotate_neon64.cc
\
libs/libyuv/source/video_common.cc
\
libs/libyuv/source/rotate_neon.cc
\
libs/libyuv/source/compare_neon64.cc
\
libs/libyuv/source/rotate_win.cc
\
libs/libyuv/source/compare_neon.cc
\
libs/libyuv/source/row_any.cc
\
libs/libyuv/source/compare_win.cc
\
libs/libyuv/source/row_common.cc
\
libs/libyuv/source/convert_jpeg.cc
\
libs/libyuv/source/row_gcc.cc
\
libs/libyuv/source/mjpeg_decoder.cc
\
libs/libyuv/source/row_mmi.cc
\
libs/libyuv/source/mjpeg_validate.cc
\
libs/libyuv/source/row_msa.cc
\
libs/libyuv/source/rotate_neon64.cc
\
libs/libyuv/source/row_neon64.cc
\
libs/libyuv/source/rotate_neon.cc
\
libs/libyuv/source/row_neon.cc
\
libs/libyuv/source/rotate_win.cc
\
libs/libyuv/source/row_win.cc
\
libs/libyuv/source/row_neon64.cc
\
libs/libyuv/source/scale_any.cc
\
libs/libyuv/source/row_neon.cc
\
libs/libyuv/source/scale_argb.cc
\
libs/libyuv/source/row_win.cc
\
libs/libyuv/source/scale.cc
\
libs/libyuv/source/scale_neon64.cc
\
libs/libyuv/source/scale_common.cc
\
libs/libyuv/source/scale_neon.cc
\
libs/libyuv/source/scale_gcc.cc
\
libs/libyuv/source/scale_win.cc
libs/libyuv/source/scale_mmi.cc
\
libs/libyuv/source/scale_msa.cc
\
libs/libyuv/source/scale_neon64.cc
\
libs/libyuv/source/scale_neon.cc
\
libs/libyuv/source/scale_win.cc
\
libs/libyuv/source/video_common.cc
libfreeswitch_libyuv_la_CPPFLAGS
=
-O2
-fomit-frame-pointer
-Ilibs
/libyuv/include
libfreeswitch_libyuv_la_CPPFLAGS
=
-O2
-fomit-frame-pointer
-Ilibs
/libyuv/include
CORE_LIBS
+=
libfreeswitch_libyuv.la
CORE_LIBS
+=
libfreeswitch_libyuv.la
...
...
src/include/switch_image.h
浏览文件 @
b644421c
...
@@ -8,7 +8,6 @@
...
@@ -8,7 +8,6 @@
* be found in the AUTHORS file in the root of the source tree.
* be found in the AUTHORS file in the root of the source tree.
*/
*/
/*!\file
/*!\file
* \brief Describes the vpx image descriptor and associated operations
* \brief Describes the vpx image descriptor and associated operations
*
*
...
@@ -20,213 +19,203 @@
...
@@ -20,213 +19,203 @@
extern
"C"
{
extern
"C"
{
#endif
#endif
/*!\brief Current ABI version number
/*!\brief Current ABI version number
*
*
* \internal
* \internal
* If this file is altered in any way that changes the ABI, this value
* If this file is altered in any way that changes the ABI, this value
* must be bumped. Examples include, but are not limited to, changing
* must be bumped. Examples include, but are not limited to, changing
* types, removing or reassigning enums, adding/removing/rearranging
* types, removing or reassigning enums, adding/removing/rearranging
* fields to structures
* fields to structures
*/
*/
#define VPX_IMAGE_ABI_VERSION (4)
/**<\hideinitializer*/
#define VPX_IMAGE_ABI_VERSION (4)
/**<\hideinitializer*/
#define VPX_IMG_FMT_PLANAR 0x100
/**< Image is a planar format. */
#define VPX_IMG_FMT_PLANAR 0x100
/**< Image is a planar format. */
#define VPX_IMG_FMT_UV_FLIP 0x200
/**< V plane precedes U in memory. */
#define VPX_IMG_FMT_UV_FLIP 0x200
/**< V plane precedes U in memory. */
#define VPX_IMG_FMT_HAS_ALPHA 0x400
/**< Image has an alpha channel. */
#define VPX_IMG_FMT_HAS_ALPHA 0x400
/**< Image has an alpha channel. */
#define VPX_IMG_FMT_HIGHBITDEPTH 0x800
/**< Image uses 16bit framebuffer. */
#define VPX_IMG_FMT_HIGHBITDEPTH 0x800
/**< Image uses 16bit framebuffer. */
/*!\brief List of supported image formats */
/*!\brief List of supported image formats */
typedef
enum
vpx_img_fmt
{
typedef
enum
vpx_img_fmt
{
VPX_IMG_FMT_NONE
,
VPX_IMG_FMT_NONE
,
VPX_IMG_FMT_RGB24
,
/**< 24 bit per pixel packed RGB */
VPX_IMG_FMT_RGB24
,
/**< 24 bit per pixel packed RGB */
VPX_IMG_FMT_RGB32
,
/**< 32 bit per pixel packed 0RGB */
VPX_IMG_FMT_RGB32
,
/**< 32 bit per pixel packed 0RGB */
VPX_IMG_FMT_RGB565
,
/**< 16 bit per pixel, 565 */
VPX_IMG_FMT_RGB565
,
/**< 16 bit per pixel, 565 */
VPX_IMG_FMT_RGB555
,
/**< 16 bit per pixel, 555 */
VPX_IMG_FMT_RGB555
,
/**< 16 bit per pixel, 555 */
VPX_IMG_FMT_UYVY
,
/**< UYVY packed YUV */
VPX_IMG_FMT_UYVY
,
/**< UYVY packed YUV */
VPX_IMG_FMT_YUY2
,
/**< YUYV packed YUV */
VPX_IMG_FMT_YUY2
,
/**< YUYV packed YUV */
VPX_IMG_FMT_YVYU
,
/**< YVYU packed YUV */
VPX_IMG_FMT_YVYU
,
/**< YVYU packed YUV */
VPX_IMG_FMT_BGR24
,
/**< 24 bit per pixel packed BGR */
VPX_IMG_FMT_BGR24
,
/**< 24 bit per pixel packed BGR */
VPX_IMG_FMT_RGB32_LE
,
/**< 32 bit packed BGR0 */
VPX_IMG_FMT_RGB32_LE
,
/**< 32 bit packed BGR0 */
VPX_IMG_FMT_ARGB
,
/**< 32 bit packed ARGB, alpha=255 */
VPX_IMG_FMT_ARGB
,
/**< 32 bit packed ARGB, alpha=255 */
VPX_IMG_FMT_ARGB_LE
,
/**< 32 bit packed BGRA, alpha=255 */
VPX_IMG_FMT_ARGB_LE
,
/**< 32 bit packed BGRA, alpha=255 */
VPX_IMG_FMT_RGB565_LE
,
/**< 16 bit per pixel, gggbbbbb rrrrrggg */
VPX_IMG_FMT_RGB565_LE
,
/**< 16 bit per pixel, gggbbbbb rrrrrggg */
VPX_IMG_FMT_RGB555_LE
,
/**< 16 bit per pixel, gggbbbbb 0rrrrrgg */
VPX_IMG_FMT_RGB555_LE
,
/**< 16 bit per pixel, gggbbbbb 0rrrrrgg */
VPX_IMG_FMT_YV12
=
VPX_IMG_FMT_YV12
=
VPX_IMG_FMT_PLANAR
|
VPX_IMG_FMT_UV_FLIP
|
1
,
/**< planar YVU */
VPX_IMG_FMT_PLANAR
|
VPX_IMG_FMT_UV_FLIP
|
1
,
/**< planar YVU */
VPX_IMG_FMT_I420
=
VPX_IMG_FMT_PLANAR
|
2
,
VPX_IMG_FMT_I420
=
VPX_IMG_FMT_PLANAR
|
2
,
VPX_IMG_FMT_VPXYV12
=
VPX_IMG_FMT_PLANAR
|
VPX_IMG_FMT_UV_FLIP
|
3
,
/** < planar 4:2:0 format with vpx color space */
VPX_IMG_FMT_VPXYV12
=
VPX_IMG_FMT_PLANAR
|
VPX_IMG_FMT_UV_FLIP
|
VPX_IMG_FMT_VPXI420
=
VPX_IMG_FMT_PLANAR
|
4
,
3
,
/** < planar 4:2:0 format with vpx color space */
VPX_IMG_FMT_I422
=
VPX_IMG_FMT_PLANAR
|
5
,
VPX_IMG_FMT_VPXI420
=
VPX_IMG_FMT_PLANAR
|
4
,
VPX_IMG_FMT_I444
=
VPX_IMG_FMT_PLANAR
|
6
,
VPX_IMG_FMT_I422
=
VPX_IMG_FMT_PLANAR
|
5
,
VPX_IMG_FMT_I440
=
VPX_IMG_FMT_PLANAR
|
7
,
VPX_IMG_FMT_I444
=
VPX_IMG_FMT_PLANAR
|
6
,
VPX_IMG_FMT_444A
=
VPX_IMG_FMT_PLANAR
|
VPX_IMG_FMT_HAS_ALPHA
|
6
,
VPX_IMG_FMT_I440
=
VPX_IMG_FMT_PLANAR
|
7
,
VPX_IMG_FMT_I42016
=
VPX_IMG_FMT_I420
|
VPX_IMG_FMT_HIGHBITDEPTH
,
VPX_IMG_FMT_444A
=
VPX_IMG_FMT_PLANAR
|
VPX_IMG_FMT_HAS_ALPHA
|
6
,
VPX_IMG_FMT_I42216
=
VPX_IMG_FMT_I422
|
VPX_IMG_FMT_HIGHBITDEPTH
,
VPX_IMG_FMT_I42016
=
VPX_IMG_FMT_I420
|
VPX_IMG_FMT_HIGHBITDEPTH
,
VPX_IMG_FMT_I44416
=
VPX_IMG_FMT_I444
|
VPX_IMG_FMT_HIGHBITDEPTH
,
VPX_IMG_FMT_I42216
=
VPX_IMG_FMT_I422
|
VPX_IMG_FMT_HIGHBITDEPTH
,
VPX_IMG_FMT_I44016
=
VPX_IMG_FMT_I440
|
VPX_IMG_FMT_HIGHBITDEPTH
VPX_IMG_FMT_I44416
=
VPX_IMG_FMT_I444
|
VPX_IMG_FMT_HIGHBITDEPTH
,
}
vpx_img_fmt_t
;
/**< alias for enum vpx_img_fmt */
VPX_IMG_FMT_I44016
=
VPX_IMG_FMT_I440
|
VPX_IMG_FMT_HIGHBITDEPTH
}
vpx_img_fmt_t
;
/**< alias for enum vpx_img_fmt */
/*!\brief List of supported color spaces */
typedef
enum
vpx_color_space
{
/*!\brief List of supported color spaces */
VPX_CS_UNKNOWN
=
0
,
/**< Unknown */
typedef
enum
vpx_color_space
{
VPX_CS_BT_601
=
1
,
/**< BT.601 */
VPX_CS_UNKNOWN
=
0
,
/**< Unknown */
VPX_CS_BT_709
=
2
,
/**< BT.709 */
VPX_CS_BT_601
=
1
,
/**< BT.601 */
VPX_CS_SMPTE_170
=
3
,
/**< SMPTE.170 */
VPX_CS_BT_709
=
2
,
/**< BT.709 */
VPX_CS_SMPTE_240
=
4
,
/**< SMPTE.240 */
VPX_CS_SMPTE_170
=
3
,
/**< SMPTE.170 */
VPX_CS_BT_2020
=
5
,
/**< BT.2020 */
VPX_CS_SMPTE_240
=
4
,
/**< SMPTE.240 */
VPX_CS_RESERVED
=
6
,
/**< Reserved */
VPX_CS_BT_2020
=
5
,
/**< BT.2020 */
VPX_CS_SRGB
=
7
/**< sRGB */
VPX_CS_RESERVED
=
6
,
/**< Reserved */
}
vpx_color_space_t
;
/**< alias for enum vpx_color_space */
VPX_CS_SRGB
=
7
/**< sRGB */
}
vpx_color_space_t
;
/**< alias for enum vpx_color_space */
/*!\brief List of supported color range */
typedef
enum
vpx_color_range
{
/*!\brief List of supported color range */
VPX_CR_STUDIO_RANGE
=
0
,
/**< Y [16..235], UV [16..240] */
typedef
enum
vpx_color_range
{
VPX_CR_FULL_RANGE
=
1
/**< YUV/RGB [0..255] */
VPX_CR_STUDIO_RANGE
=
0
,
/**< Y [16..235], UV [16..240] */
}
vpx_color_range_t
;
/**< alias for enum vpx_color_range */
VPX_CR_FULL_RANGE
=
1
/**< YUV/RGB [0..255] */
}
vpx_color_range_t
;
/**< alias for enum vpx_color_range */
/**\brief Image Descriptor */
typedef
struct
vpx_image
{
/**\brief Image Descriptor */
vpx_img_fmt_t
fmt
;
/**< Image Format */
typedef
struct
vpx_image
{
vpx_color_space_t
cs
;
/**< Color Space */
vpx_img_fmt_t
fmt
;
/**< Image Format */
vpx_color_range_t
range
;
/**< Color Range */
vpx_color_space_t
cs
;
/**< Color Space */
vpx_color_range_t
range
;
/**< Color Range */
/* Image storage dimensions */
unsigned
int
w
;
/**< Stored image width */
/* Image storage dimensions */
unsigned
int
h
;
/**< Stored image height */
unsigned
int
w
;
/**< Stored image width */
unsigned
int
bit_depth
;
/**< Stored image bit-depth */
unsigned
int
h
;
/**< Stored image height */
unsigned
int
bit_depth
;
/**< Stored image bit-depth */
/* Image display dimensions */
unsigned
int
d_w
;
/**< Displayed image width */
/* Image display dimensions */
unsigned
int
d_h
;
/**< Displayed image height */
unsigned
int
d_w
;
/**< Displayed image width */
unsigned
int
d_h
;
/**< Displayed image height */
/* Image intended rendering dimensions */
unsigned
int
r_w
;
/**< Intended rendering image width */
/* Image intended rendering dimensions */
unsigned
int
r_h
;
/**< Intended rendering image height */
unsigned
int
r_w
;
/**< Intended rendering image width */
unsigned
int
r_h
;
/**< Intended rendering image height */
/* Chroma subsampling info */
unsigned
int
x_chroma_shift
;
/**< subsampling order, X */
/* Chroma subsampling info */
unsigned
int
y_chroma_shift
;
/**< subsampling order, Y */
unsigned
int
x_chroma_shift
;
/**< subsampling order, X */
unsigned
int
y_chroma_shift
;
/**< subsampling order, Y */
/* Image data pointers. */
#define VPX_PLANE_PACKED 0
/**< To be used for all packed formats */
/* Image data pointers. */
#define VPX_PLANE_Y 0
/**< Y (Luminance) plane */
#define VPX_PLANE_PACKED 0
/**< To be used for all packed formats */
#define VPX_PLANE_U 1
/**< U (Chroma) plane */
#define VPX_PLANE_Y 0
/**< Y (Luminance) plane */
#define VPX_PLANE_V 2
/**< V (Chroma) plane */
#define VPX_PLANE_U 1
/**< U (Chroma) plane */
#define VPX_PLANE_ALPHA 3
/**< A (Transparency) plane */
#define VPX_PLANE_V 2
/**< V (Chroma) plane */
unsigned
char
*
planes
[
4
];
/**< pointer to the top left pixel for each plane */
#define VPX_PLANE_ALPHA 3
/**< A (Transparency) plane */
int
stride
[
4
];
/**< stride between rows for each plane */
unsigned
char
*
planes
[
4
];
/**< pointer to the top left pixel for each plane */
int
stride
[
4
];
/**< stride between rows for each plane */
int
bps
;
/**< bits per sample (for packed formats) */
int
bps
;
/**< bits per sample (for packed formats) */
/* The following member may be set by the application to associate data
* with this image.
/*!\brief The following member may be set by the application to associate
*/
* data with this image.
void
*
user_priv
;
/**< may be set by the application to associate data
* with this image. */
/* The following members should be treated as private. */
unsigned
char
*
img_data
;
/**< private */
int
img_data_owner
;
/**< private */
int
self_allocd
;
/**< private */
void
*
fb_priv
;
/**< Frame buffer data associated with the image. */
}
vpx_image_t
;
/**< alias for struct vpx_image */
/**\brief Representation of a rectangle on a surface */
typedef
struct
vpx_image_rect
{
unsigned
int
x
;
/**< leftmost column */
unsigned
int
y
;
/**< topmost row */
unsigned
int
w
;
/**< width */
unsigned
int
h
;
/**< height */
}
vpx_image_rect_t
;
/**< alias for struct vpx_image_rect */
/*!\brief Open a descriptor, allocating storage for the underlying image
*
* Returns a descriptor for storing an image of the given format. The
* storage for the descriptor is allocated on the heap.
*
* \param[in] img Pointer to storage for descriptor. If this parameter
* is NULL, the storage for the descriptor will be
* allocated on the heap.
* \param[in] fmt Format for the image
* \param[in] d_w Width of the image
* \param[in] d_h Height of the image
* \param[in] align Alignment, in bytes, of the image buffer and
* each row in the image(stride).
*
* \return Returns a pointer to the initialized image descriptor. If the img
* parameter is non-null, the value of the img parameter will be
* returned.
*/
*/
vpx_image_t
*
vpx_img_alloc
(
vpx_image_t
*
img
,
void
*
user_priv
;
vpx_img_fmt_t
fmt
,
unsigned
int
d_w
,
unsigned
int
d_h
,
unsigned
int
align
);
/*!\brief Open a descriptor, using existing storage for the underlying image
*
* Returns a descriptor for storing an image of the given format. The
* storage for descriptor has been allocated elsewhere, and a descriptor is
* desired to "wrap" that storage.
*
* \param[in] img Pointer to storage for descriptor. If this parameter
* is NULL, the storage for the descriptor will be
* allocated on the heap.
* \param[in] fmt Format for the image
* \param[in] d_w Width of the image
* \param[in] d_h Height of the image
* \param[in] align Alignment, in bytes, of each row in the image.
* \param[in] img_data Storage to use for the image
*
* \return Returns a pointer to the initialized image descriptor. If the img
* parameter is non-null, the value of the img parameter will be
* returned.
*/
vpx_image_t
*
vpx_img_wrap
(
vpx_image_t
*
img
,
vpx_img_fmt_t
fmt
,
unsigned
int
d_w
,
unsigned
int
d_h
,
unsigned
int
align
,
unsigned
char
*
img_data
);
/*!\brief Set the rectangle identifying the displayed portion of the image
*
* Updates the displayed rectangle (aka viewport) on the image surface to
* match the specified coordinates and size.
*
* \param[in] img Image descriptor
* \param[in] x leftmost column
* \param[in] y topmost row
* \param[in] w width
* \param[in] h height
*
* \return 0 if the requested rectangle is valid, nonzero otherwise.
*/
int
vpx_img_set_rect
(
vpx_image_t
*
img
,
unsigned
int
x
,
unsigned
int
y
,
unsigned
int
w
,
unsigned
int
h
);
/*!\brief Flip the image vertically (top for bottom)
*
* Adjusts the image descriptor's pointers and strides to make the image
* be referenced upside-down.
*
* \param[in] img Image descriptor
*/
void
vpx_img_flip
(
vpx_image_t
*
img
);
/*!\brief Close an image descriptor
/* The following members should be treated as private. */
*
unsigned
char
*
img_data
;
/**< private */
* Frees all allocated storage associated with an image descriptor.
int
img_data_owner
;
/**< private */
*
int
self_allocd
;
/**< private */
* \param[in] img Image descriptor
*/
void
*
fb_priv
;
/**< Frame buffer data associated with the image. */
void
vpx_img_free
(
vpx_image_t
*
img
);
}
vpx_image_t
;
/**< alias for struct vpx_image */
/**\brief Representation of a rectangle on a surface */
typedef
struct
vpx_image_rect
{
unsigned
int
x
;
/**< leftmost column */
unsigned
int
y
;
/**< topmost row */
unsigned
int
w
;
/**< width */
unsigned
int
h
;
/**< height */
}
vpx_image_rect_t
;
/**< alias for struct vpx_image_rect */
/*!\brief Open a descriptor, allocating storage for the underlying image
*
* Returns a descriptor for storing an image of the given format. The
* storage for the descriptor is allocated on the heap.
*
* \param[in] img Pointer to storage for descriptor. If this parameter
* is NULL, the storage for the descriptor will be
* allocated on the heap.
* \param[in] fmt Format for the image
* \param[in] d_w Width of the image
* \param[in] d_h Height of the image
* \param[in] align Alignment, in bytes, of the image buffer and
* each row in the image(stride).
*
* \return Returns a pointer to the initialized image descriptor. If the img
* parameter is non-null, the value of the img parameter will be
* returned.
*/
vpx_image_t
*
vpx_img_alloc
(
vpx_image_t
*
img
,
vpx_img_fmt_t
fmt
,
unsigned
int
d_w
,
unsigned
int
d_h
,
unsigned
int
align
);
/*!\brief Open a descriptor, using existing storage for the underlying image
*
* Returns a descriptor for storing an image of the given format. The
* storage for descriptor has been allocated elsewhere, and a descriptor is
* desired to "wrap" that storage.
*
* \param[in] img Pointer to storage for descriptor. If this parameter
* is NULL, the storage for the descriptor will be
* allocated on the heap.
* \param[in] fmt Format for the image
* \param[in] d_w Width of the image
* \param[in] d_h Height of the image
* \param[in] align Alignment, in bytes, of each row in the image.
* \param[in] img_data Storage to use for the image
*
* \return Returns a pointer to the initialized image descriptor. If the img
* parameter is non-null, the value of the img parameter will be
* returned.
*/
vpx_image_t
*
vpx_img_wrap
(
vpx_image_t
*
img
,
vpx_img_fmt_t
fmt
,
unsigned
int
d_w
,
unsigned
int
d_h
,
unsigned
int
align
,
unsigned
char
*
img_data
);
/*!\brief Set the rectangle identifying the displayed portion of the image
*
* Updates the displayed rectangle (aka viewport) on the image surface to
* match the specified coordinates and size.
*
* \param[in] img Image descriptor
* \param[in] x leftmost column
* \param[in] y topmost row
* \param[in] w width
* \param[in] h height
*
* \return 0 if the requested rectangle is valid, nonzero otherwise.
*/
int
vpx_img_set_rect
(
vpx_image_t
*
img
,
unsigned
int
x
,
unsigned
int
y
,
unsigned
int
w
,
unsigned
int
h
);
/*!\brief Flip the image vertically (top for bottom)
*
* Adjusts the image descriptor's pointers and strides to make the image
* be referenced upside-down.
*
* \param[in] img Image descriptor
*/
void
vpx_img_flip
(
vpx_image_t
*
img
);
/*!\brief Close an image descriptor
*
* Frees all allocated storage associated with an image descriptor.
*
* \param[in] img Image descriptor
*/
void
vpx_img_free
(
vpx_image_t
*
img
);
#ifdef __cplusplus
#ifdef __cplusplus
}
// extern "C"
}
// extern "C"
...
...
src/switch_core_video.c
浏览文件 @
b644421c
...
@@ -384,15 +384,15 @@ SWITCH_DECLARE(void) switch_img_patch_rgb(switch_image_t *IMG, switch_image_t *i
...
@@ -384,15 +384,15 @@ SWITCH_DECLARE(void) switch_img_patch_rgb(switch_image_t *IMG, switch_image_t *i
}
}
if
(
img
->
fmt
==
SWITCH_IMG_FMT_ARGB
&&
IMG
->
fmt
==
SWITCH_IMG_FMT_ARGB
)
{
if
(
img
->
fmt
==
SWITCH_IMG_FMT_ARGB
&&
IMG
->
fmt
==
SWITCH_IMG_FMT_ARGB
)
{
uint8
*
src_argb0
=
img
->
planes
[
SWITCH_PLANE_PACKED
];
uint8
_t
*
src_argb0
=
img
->
planes
[
SWITCH_PLANE_PACKED
];
int
src_stride_argb0
=
img
->
stride
[
SWITCH_PLANE_PACKED
];
int
src_stride_argb0
=
img
->
stride
[
SWITCH_PLANE_PACKED
];
uint8
*
src_argb1
=
IMG
->
planes
[
SWITCH_PLANE_PACKED
];
uint8
_t
*
src_argb1
=
IMG
->
planes
[
SWITCH_PLANE_PACKED
];
int
src_stride_argb1
=
IMG
->
stride
[
SWITCH_PLANE_PACKED
];
int
src_stride_argb1
=
IMG
->
stride
[
SWITCH_PLANE_PACKED
];
uint8
*
dst_argb
=
IMG
->
planes
[
SWITCH_PLANE_PACKED
];
uint8
_t
*
dst_argb
=
IMG
->
planes
[
SWITCH_PLANE_PACKED
];
int
dst_stride_argb
=
IMG
->
stride
[
SWITCH_PLANE_PACKED
];
int
dst_stride_argb
=
IMG
->
stride
[
SWITCH_PLANE_PACKED
];
int
width
=
MIN
(
img
->
d_w
,
IMG
->
d_w
-
abs
(
x
));
int
width
=
MIN
(
img
->
d_w
,
IMG
->
d_w
-
abs
(
x
));
int
height
=
MIN
(
img
->
d_h
,
IMG
->
d_h
-
abs
(
y
));
int
height
=
MIN
(
img
->
d_h
,
IMG
->
d_h
-
abs
(
y
));
void
(
*
ARGBBlendRow
)(
const
uint8
*
src_argb
,
const
uint8
*
src_argb1
,
uint8
*
dst_argb
,
int
width
)
=
GetARGBBlend
();
void
(
*
ARGBBlendRow
)(
const
uint8
_t
*
src_argb
,
const
uint8_t
*
src_argb1
,
uint8_t
*
dst_argb
,
int
width
)
=
GetARGBBlend
();
switch_img_attenuate
(
img
);
switch_img_attenuate
(
img
);
...
@@ -3277,10 +3277,10 @@ SWITCH_DECLARE(switch_status_t) switch_img_from_raw(switch_image_t *dest, void *
...
@@ -3277,10 +3277,10 @@ SWITCH_DECLARE(switch_status_t) switch_img_from_raw(switch_image_t *dest, void *
}
}
/*
/*
int ConvertToI420(const uint8* src_frame, size_t src_size,
int ConvertToI420(const uint8
_t
* src_frame, size_t src_size,
uint8* dst_y, int dst_stride_y,
uint8
_t
* dst_y, int dst_stride_y,
uint8* dst_u, int dst_stride_u,
uint8
_t
* dst_u, int dst_stride_u,
uint8* dst_v, int dst_stride_v,
uint8
_t
* dst_v, int dst_stride_v,
int crop_x, int crop_y,
int crop_x, int crop_y,
int src_width, int src_height,
int src_width, int src_height,
int crop_width, int crop_height,
int crop_width, int crop_height,
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论