1 Star 0 Fork 0

linshl/jessibuca

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
libde265.h 1.05 KB
一键复制 编辑 原始数据 按行查看 历史
langhuihui 提交于 2019-09-22 22:21 . 增加可以反复重置解码头
#pragma once
#include "libde265/de265.h"
#include "libde265/image.h"
class Libde265 : public VideoDecoder
{
public:
de265_PTS pts;
de265_decoder_context *h265DecContext;
Libde265()
{
h265DecContext = de265_new_decoder();
emscripten_log(0, "H265 init");
}
~Libde265()
{
de265_free_decoder(h265DecContext);
}
void _decode(IOBuffer data) override
{
de265_push_NAL(h265DecContext, (const unsigned char *)data, data.length, 0, nullptr);
int more = 1;
while (more)
{
more = 0;
auto err = de265_decode(h265DecContext, &more);
if (err != DE265_OK)
{
if (err != DE265_ERROR_WAITING_FOR_INPUT_DATA)
emscripten_log(0, "de265_decode:%d", err);
break;
}
const de265_image *img = de265_get_next_picture(h265DecContext);
if (img)
{
//emscripten_log(0, "%d", img);
int out_stride;
for (int i = 0; i < 3; i++)
p_yuv[i] = (u32)de265_get_image_plane(img, i, &out_stride);
if (videoWidth == 0)
decodeVideoSize(de265_get_image_width(img, 0), de265_get_image_height(img, 0));
decodeYUV420();
}
}
}
};
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/linshl/jessibuca.git
git@gitee.com:linshl/jessibuca.git
linshl
jessibuca
jessibuca
worker

搜索帮助

23e8dbc6 1850385 7e0993f3 1850385