stream channels, sample_rate and frame_size.

This commit is contained in:
Alf
2020-09-29 21:36:03 -07:00
parent 0d3ba47d8b
commit fdc065b72e

View File

@@ -29,6 +29,9 @@ typedef struct Stream {
int level; int level;
int width; int width;
int height; int height;
int channels;
int sample_rate;
int frame_size;
} Stream; } Stream;
typedef struct FileInfoResponse { typedef struct FileInfoResponse {
@@ -105,6 +108,9 @@ FileInfoResponse get_file_info() {
.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,
.sample_rate = (int)pLocalCodecParameters->sample_rate,
.frame_size = (int)pLocalCodecParameters->frame_size,
}; };
r.streams.push_back(stream); r.streams.push_back(stream);
free(fourcc); free(fourcc);
@@ -130,6 +136,9 @@ EMSCRIPTEN_BINDINGS(FileInfoResponse_struct) {
.field("level", &Stream::level) .field("level", &Stream::level)
.field("width", &Stream::width) .field("width", &Stream::width)
.field("height", &Stream::height) .field("height", &Stream::height)
.field("channels", &Stream::channels)
.field("sample_rate", &Stream::sample_rate)
.field("frame_size", &Stream::frame_size)
; ;
register_vector<Stream>("Stream"); register_vector<Stream>("Stream");
emscripten::value_object<FileInfoResponse>("FileInfoResponse") emscripten::value_object<FileInfoResponse>("FileInfoResponse")