@lumen5/beamcoder 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.circleci/config.yml +41 -0
- package/.circleci/images/testbeam10-4.1/Dockerfile +12 -0
- package/.circleci/test_image/Dockerfile +14 -0
- package/.circleci/test_image/build.md +13 -0
- package/.eslintrc.js +27 -0
- package/.github/workflows/publish-npm.yml +33 -0
- package/LICENSE +674 -0
- package/README.md +1221 -0
- package/beamstreams.js +692 -0
- package/binding.gyp +103 -0
- package/examples/encode_h264.js +92 -0
- package/examples/jpeg_app.js +55 -0
- package/examples/jpeg_filter_app.js +101 -0
- package/examples/make_mp4.js +123 -0
- package/images/beamcoder_small.jpg +0 -0
- package/index.d.ts +83 -0
- package/index.js +44 -0
- package/install_ffmpeg.js +240 -0
- package/package.json +45 -0
- package/scratch/decode_aac.js +38 -0
- package/scratch/decode_avci.js +50 -0
- package/scratch/decode_hevc.js +38 -0
- package/scratch/decode_pcm.js +39 -0
- package/scratch/make_a_mux.js +68 -0
- package/scratch/muxer.js +74 -0
- package/scratch/read_wav.js +35 -0
- package/scratch/simple_mux.js +39 -0
- package/scratch/stream_avci.js +127 -0
- package/scratch/stream_mp4.js +78 -0
- package/scratch/stream_mux.js +47 -0
- package/scratch/stream_pcm.js +82 -0
- package/scratch/stream_wav.js +62 -0
- package/scripts/install_beamcoder_dependencies.sh +25 -0
- package/src/adaptor.h +202 -0
- package/src/beamcoder.cc +937 -0
- package/src/beamcoder_util.cc +1129 -0
- package/src/beamcoder_util.h +206 -0
- package/src/codec.cc +7386 -0
- package/src/codec.h +44 -0
- package/src/codec_par.cc +1818 -0
- package/src/codec_par.h +40 -0
- package/src/decode.cc +569 -0
- package/src/decode.h +75 -0
- package/src/demux.cc +584 -0
- package/src/demux.h +88 -0
- package/src/encode.cc +496 -0
- package/src/encode.h +72 -0
- package/src/filter.cc +1888 -0
- package/src/filter.h +30 -0
- package/src/format.cc +5287 -0
- package/src/format.h +77 -0
- package/src/frame.cc +2681 -0
- package/src/frame.h +52 -0
- package/src/governor.cc +286 -0
- package/src/governor.h +30 -0
- package/src/hwcontext.cc +378 -0
- package/src/hwcontext.h +35 -0
- package/src/log.cc +186 -0
- package/src/log.h +20 -0
- package/src/mux.cc +834 -0
- package/src/mux.h +106 -0
- package/src/packet.cc +762 -0
- package/src/packet.h +49 -0
- package/test/codecParamsSpec.js +148 -0
- package/test/decoderSpec.js +56 -0
- package/test/demuxerSpec.js +41 -0
- package/test/encoderSpec.js +69 -0
- package/test/filtererSpec.js +47 -0
- package/test/formatSpec.js +343 -0
- package/test/frameSpec.js +145 -0
- package/test/introspectionSpec.js +73 -0
- package/test/muxerSpec.js +34 -0
- package/test/packetSpec.js +122 -0
- package/types/Beamstreams.d.ts +98 -0
- package/types/Codec.d.ts +123 -0
- package/types/CodecContext.d.ts +555 -0
- package/types/CodecPar.d.ts +108 -0
- package/types/Decoder.d.ts +137 -0
- package/types/Demuxer.d.ts +113 -0
- package/types/Encoder.d.ts +94 -0
- package/types/Filter.d.ts +324 -0
- package/types/FormatContext.d.ts +380 -0
- package/types/Frame.d.ts +295 -0
- package/types/HWContext.d.ts +62 -0
- package/types/Muxer.d.ts +121 -0
- package/types/Packet.d.ts +82 -0
- package/types/PrivClass.d.ts +25 -0
- package/types/Stream.d.ts +165 -0
package/src/format.h
ADDED
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Aerostat Beam Coder - Node.js native bindings for FFmpeg.
|
|
3
|
+
Copyright (C) 2019 Streampunk Media Ltd.
|
|
4
|
+
|
|
5
|
+
This program is free software: you can redistribute it and/or modify
|
|
6
|
+
it under the terms of the GNU General Public License as published by
|
|
7
|
+
the Free Software Foundation, either version 3 of the License, or
|
|
8
|
+
(at your option) any later version.
|
|
9
|
+
|
|
10
|
+
This program is distributed in the hope that it will be useful,
|
|
11
|
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
12
|
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
13
|
+
GNU General Public License for more details.
|
|
14
|
+
|
|
15
|
+
You should have received a copy of the GNU General Public License
|
|
16
|
+
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
17
|
+
|
|
18
|
+
https://www.streampunk.media/ mailto:furnace@streampunk.media
|
|
19
|
+
14 Ormiscaig, Aultbea, Achnasheen, IV22 2JJ U.K.
|
|
20
|
+
*/
|
|
21
|
+
|
|
22
|
+
#ifndef FORMAT_H
|
|
23
|
+
#define FORMAT_H
|
|
24
|
+
|
|
25
|
+
#include "node_api.h"
|
|
26
|
+
#include "beamcoder_util.h"
|
|
27
|
+
#include "codec_par.h"
|
|
28
|
+
#include "packet.h"
|
|
29
|
+
#include "adaptor.h"
|
|
30
|
+
|
|
31
|
+
extern "C" {
|
|
32
|
+
#include <libavformat/avformat.h>
|
|
33
|
+
#include <libavutil/avstring.h>
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
// Indirection required to avoid double delete after demuxer forceClose
|
|
37
|
+
struct fmtCtxRef {
|
|
38
|
+
AVFormatContext* fmtCtx = nullptr;
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
napi_value muxers(napi_env env, napi_callback_info info);
|
|
42
|
+
napi_value demuxers(napi_env env, napi_callback_info info);
|
|
43
|
+
napi_value guessFormat(napi_env env, napi_callback_info info);
|
|
44
|
+
napi_value newStream(napi_env env, napi_callback_info info);
|
|
45
|
+
|
|
46
|
+
napi_status fromAVInputFormat(napi_env env,
|
|
47
|
+
const AVInputFormat* iformat, napi_value* result);
|
|
48
|
+
napi_status fromAVOutputFormat(napi_env env,
|
|
49
|
+
const AVOutputFormat* iformat, napi_value* result);
|
|
50
|
+
napi_status fromAVFormatContext(napi_env env,
|
|
51
|
+
AVFormatContext* fmtCtx, Adaptor *adaptor, napi_value* result);
|
|
52
|
+
napi_status fromAVStream(napi_env env, AVStream* stream, napi_value* result);
|
|
53
|
+
|
|
54
|
+
void formatContextFinalizer(napi_env env, void* data, void* hint);
|
|
55
|
+
|
|
56
|
+
napi_value makeFormat(napi_env env, napi_callback_info info);
|
|
57
|
+
napi_value streamToJSON(napi_env env, napi_callback_info info);
|
|
58
|
+
napi_value formatToJSON(napi_env env, napi_callback_info info);
|
|
59
|
+
|
|
60
|
+
/* Notes
|
|
61
|
+
|
|
62
|
+
AVInputFormat and AVOutputFormats
|
|
63
|
+
- iterate over to produce lists of available
|
|
64
|
+
- JS objects that reflect the internal values only - lazy
|
|
65
|
+
- Ability to "guess" an output formats
|
|
66
|
+
|
|
67
|
+
AVFormatContext
|
|
68
|
+
- full getters and setters pattern
|
|
69
|
+
- demuxer to offer add new streams
|
|
70
|
+
- uses setters and getters
|
|
71
|
+
|
|
72
|
+
AVStream
|
|
73
|
+
- only public constructor is muxer.newStream()
|
|
74
|
+
- uses setters and getters
|
|
75
|
+
*/
|
|
76
|
+
|
|
77
|
+
#endif // FORMAT_H
|