forked from forks/ffprobe-wasm
fix: likely update all deprecated fucntion calls
Signed-off-by: Alix von Schirp <github@avonschirp.bootmedia.de>
This commit is contained in:
@@ -149,7 +149,7 @@ FileInfoResponse get_file_info(std::string filename) {
|
|||||||
.level = (int)pLocalCodecParameters->level,
|
.level = (int)pLocalCodecParameters->level,
|
||||||
.width = (int)pLocalCodecParameters->width,
|
.width = (int)pLocalCodecParameters->width,
|
||||||
.height = (int)pLocalCodecParameters->height,
|
.height = (int)pLocalCodecParameters->height,
|
||||||
.channels = (int)pLocalCodecParameters->channels,
|
.channels = (int)pLocalCodecParameters->ch_layout.nb_channels,
|
||||||
.sample_rate = (int)pLocalCodecParameters->sample_rate,
|
.sample_rate = (int)pLocalCodecParameters->sample_rate,
|
||||||
.frame_size = (int)pLocalCodecParameters->frame_size,
|
.frame_size = (int)pLocalCodecParameters->frame_size,
|
||||||
};
|
};
|
||||||
@@ -165,7 +165,6 @@ FileInfoResponse get_file_info(std::string filename) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
r.streams.push_back(stream);
|
r.streams.push_back(stream);
|
||||||
free(fourcc);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Loop through the chapters (if any).
|
// Loop through the chapters (if any).
|
||||||
@@ -227,7 +226,7 @@ FramesResponse get_frames(std::string filename, int timestamp) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Get streams data.
|
// Get streams data.
|
||||||
AVCodec *pCodec = NULL;
|
const AVCodec *pCodec = NULL;
|
||||||
AVCodecParameters *pCodecParameters = NULL;
|
AVCodecParameters *pCodecParameters = NULL;
|
||||||
int video_stream_index = -1;
|
int video_stream_index = -1;
|
||||||
int nb_frames = 0;
|
int nb_frames = 0;
|
||||||
@@ -238,7 +237,7 @@ FramesResponse get_frames(std::string filename, int timestamp) {
|
|||||||
pLocalCodecParameters = pFormatContext->streams[i]->codecpar;
|
pLocalCodecParameters = pFormatContext->streams[i]->codecpar;
|
||||||
|
|
||||||
// Print out the decoded frame info.
|
// Print out the decoded frame info.
|
||||||
AVCodec *pLocalCodec = avcodec_find_decoder(pLocalCodecParameters->codec_id);
|
const AVCodec *pLocalCodec = avcodec_find_decoder(pLocalCodecParameters->codec_id);
|
||||||
if (pLocalCodecParameters->codec_type == AVMEDIA_TYPE_VIDEO) {
|
if (pLocalCodecParameters->codec_type == AVMEDIA_TYPE_VIDEO) {
|
||||||
if (video_stream_index == -1) {
|
if (video_stream_index == -1) {
|
||||||
video_stream_index = i;
|
video_stream_index = i;
|
||||||
@@ -296,7 +295,7 @@ FramesResponse get_frames(std::string filename, int timestamp) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Track keyframes so we paginate by each GOP.
|
// Track keyframes so we paginate by each GOP.
|
||||||
if (pFrame->key_frame == 1) key_frames++;
|
if (pFrame->flags & AV_FRAME_FLAG_KEY) key_frames++;
|
||||||
|
|
||||||
// Break at the next keyframe found.
|
// Break at the next keyframe found.
|
||||||
if (key_frames > 1) break;
|
if (key_frames > 1) break;
|
||||||
@@ -307,7 +306,7 @@ FramesResponse get_frames(std::string filename, int timestamp) {
|
|||||||
.pts = (int) pPacket->pts,
|
.pts = (int) pPacket->pts,
|
||||||
.dts = (int) pPacket->dts,
|
.dts = (int) pPacket->dts,
|
||||||
.pos = (int) pPacket->pos,
|
.pos = (int) pPacket->pos,
|
||||||
.pkt_size = pFrame->pkt_size,
|
.pkt_size = pPacket->size,
|
||||||
};
|
};
|
||||||
r.frames.push_back(f);
|
r.frames.push_back(f);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user