@pproenca/ffmpeg-darwin-arm64 0.1.7
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/include/aom/aom.h +127 -0
- package/include/aom/aom_codec.h +594 -0
- package/include/aom/aom_decoder.h +257 -0
- package/include/aom/aom_encoder.h +1154 -0
- package/include/aom/aom_external_partition.h +452 -0
- package/include/aom/aom_frame_buffer.h +84 -0
- package/include/aom/aom_image.h +462 -0
- package/include/aom/aom_integer.h +60 -0
- package/include/aom/aomcx.h +2288 -0
- package/include/aom/aomdx.h +607 -0
- package/include/dav1d/common.h +94 -0
- package/include/dav1d/data.h +117 -0
- package/include/dav1d/dav1d.h +329 -0
- package/include/dav1d/headers.h +444 -0
- package/include/dav1d/picture.h +157 -0
- package/include/dav1d/version.h +50 -0
- package/include/index.js +1 -0
- package/include/libavcodec/ac3_parser.h +36 -0
- package/include/libavcodec/adts_parser.h +37 -0
- package/include/libavcodec/avcodec.h +3128 -0
- package/include/libavcodec/avdct.h +88 -0
- package/include/libavcodec/avfft.h +149 -0
- package/include/libavcodec/bsf.h +332 -0
- package/include/libavcodec/codec.h +382 -0
- package/include/libavcodec/codec_desc.h +134 -0
- package/include/libavcodec/codec_id.h +669 -0
- package/include/libavcodec/codec_par.h +248 -0
- package/include/libavcodec/d3d11va.h +109 -0
- package/include/libavcodec/defs.h +337 -0
- package/include/libavcodec/dirac.h +135 -0
- package/include/libavcodec/dv_profile.h +82 -0
- package/include/libavcodec/dxva2.h +90 -0
- package/include/libavcodec/jni.h +67 -0
- package/include/libavcodec/mediacodec.h +103 -0
- package/include/libavcodec/packet.h +887 -0
- package/include/libavcodec/qsv.h +109 -0
- package/include/libavcodec/vdpau.h +171 -0
- package/include/libavcodec/version.h +45 -0
- package/include/libavcodec/version_major.h +52 -0
- package/include/libavcodec/videotoolbox.h +85 -0
- package/include/libavcodec/vorbis_parser.h +74 -0
- package/include/libavdevice/avdevice.h +397 -0
- package/include/libavdevice/version.h +45 -0
- package/include/libavdevice/version_major.h +43 -0
- package/include/libavfilter/avfilter.h +1379 -0
- package/include/libavfilter/buffersink.h +173 -0
- package/include/libavfilter/buffersrc.h +215 -0
- package/include/libavfilter/version.h +48 -0
- package/include/libavfilter/version_major.h +40 -0
- package/include/libavformat/avformat.h +3107 -0
- package/include/libavformat/avio.h +831 -0
- package/include/libavformat/version.h +47 -0
- package/include/libavformat/version_major.h +54 -0
- package/include/libavutil/adler32.h +63 -0
- package/include/libavutil/aes.h +69 -0
- package/include/libavutil/aes_ctr.h +99 -0
- package/include/libavutil/ambient_viewing_environment.h +72 -0
- package/include/libavutil/attributes.h +173 -0
- package/include/libavutil/audio_fifo.h +187 -0
- package/include/libavutil/avassert.h +78 -0
- package/include/libavutil/avconfig.h +6 -0
- package/include/libavutil/avstring.h +428 -0
- package/include/libavutil/avutil.h +362 -0
- package/include/libavutil/base64.h +72 -0
- package/include/libavutil/blowfish.h +82 -0
- package/include/libavutil/bprint.h +254 -0
- package/include/libavutil/bswap.h +105 -0
- package/include/libavutil/buffer.h +322 -0
- package/include/libavutil/camellia.h +70 -0
- package/include/libavutil/cast5.h +80 -0
- package/include/libavutil/channel_layout.h +751 -0
- package/include/libavutil/common.h +589 -0
- package/include/libavutil/cpu.h +145 -0
- package/include/libavutil/crc.h +102 -0
- package/include/libavutil/csp.h +150 -0
- package/include/libavutil/des.h +81 -0
- package/include/libavutil/detection_bbox.h +108 -0
- package/include/libavutil/dict.h +241 -0
- package/include/libavutil/display.h +109 -0
- package/include/libavutil/dovi_meta.h +396 -0
- package/include/libavutil/downmix_info.h +115 -0
- package/include/libavutil/encryption_info.h +205 -0
- package/include/libavutil/error.h +129 -0
- package/include/libavutil/eval.h +140 -0
- package/include/libavutil/executor.h +67 -0
- package/include/libavutil/ffversion.h +5 -0
- package/include/libavutil/fifo.h +242 -0
- package/include/libavutil/file.h +62 -0
- package/include/libavutil/film_grain_params.h +322 -0
- package/include/libavutil/frame.h +1175 -0
- package/include/libavutil/hash.h +264 -0
- package/include/libavutil/hdr_dynamic_metadata.h +376 -0
- package/include/libavutil/hdr_dynamic_vivid_metadata.h +346 -0
- package/include/libavutil/hmac.h +99 -0
- package/include/libavutil/hwcontext.h +598 -0
- package/include/libavutil/hwcontext_cuda.h +74 -0
- package/include/libavutil/hwcontext_d3d11va.h +178 -0
- package/include/libavutil/hwcontext_d3d12va.h +142 -0
- package/include/libavutil/hwcontext_drm.h +169 -0
- package/include/libavutil/hwcontext_dxva2.h +75 -0
- package/include/libavutil/hwcontext_mediacodec.h +61 -0
- package/include/libavutil/hwcontext_opencl.h +100 -0
- package/include/libavutil/hwcontext_qsv.h +87 -0
- package/include/libavutil/hwcontext_vaapi.h +117 -0
- package/include/libavutil/hwcontext_vdpau.h +44 -0
- package/include/libavutil/hwcontext_videotoolbox.h +106 -0
- package/include/libavutil/hwcontext_vulkan.h +382 -0
- package/include/libavutil/iamf.h +690 -0
- package/include/libavutil/imgutils.h +377 -0
- package/include/libavutil/intfloat.h +77 -0
- package/include/libavutil/intreadwrite.h +677 -0
- package/include/libavutil/lfg.h +81 -0
- package/include/libavutil/log.h +387 -0
- package/include/libavutil/lzo.h +66 -0
- package/include/libavutil/macros.h +80 -0
- package/include/libavutil/mastering_display_metadata.h +137 -0
- package/include/libavutil/mathematics.h +300 -0
- package/include/libavutil/md5.h +89 -0
- package/include/libavutil/mem.h +607 -0
- package/include/libavutil/motion_vector.h +57 -0
- package/include/libavutil/murmur3.h +115 -0
- package/include/libavutil/opt.h +1187 -0
- package/include/libavutil/parseutils.h +197 -0
- package/include/libavutil/pixdesc.h +440 -0
- package/include/libavutil/pixelutils.h +51 -0
- package/include/libavutil/pixfmt.h +716 -0
- package/include/libavutil/random_seed.h +57 -0
- package/include/libavutil/rational.h +225 -0
- package/include/libavutil/rc4.h +69 -0
- package/include/libavutil/replaygain.h +50 -0
- package/include/libavutil/ripemd.h +83 -0
- package/include/libavutil/samplefmt.h +269 -0
- package/include/libavutil/sha.h +90 -0
- package/include/libavutil/sha512.h +92 -0
- package/include/libavutil/spherical.h +243 -0
- package/include/libavutil/stereo3d.h +325 -0
- package/include/libavutil/tea.h +71 -0
- package/include/libavutil/threadmessage.h +115 -0
- package/include/libavutil/time.h +56 -0
- package/include/libavutil/timecode.h +199 -0
- package/include/libavutil/timestamp.h +85 -0
- package/include/libavutil/tree.h +137 -0
- package/include/libavutil/twofish.h +70 -0
- package/include/libavutil/tx.h +210 -0
- package/include/libavutil/uuid.h +146 -0
- package/include/libavutil/version.h +124 -0
- package/include/libavutil/video_enc_params.h +171 -0
- package/include/libavutil/video_hint.h +107 -0
- package/include/libavutil/xtea.h +94 -0
- package/include/libswresample/swresample.h +587 -0
- package/include/libswresample/version.h +46 -0
- package/include/libswresample/version_major.h +31 -0
- package/include/libswscale/swscale.h +460 -0
- package/include/libswscale/version.h +44 -0
- package/include/libswscale/version_major.h +35 -0
- package/include/ogg/config_types.h +26 -0
- package/include/ogg/ogg.h +209 -0
- package/include/ogg/os_types.h +158 -0
- package/include/opus/opus.h +1099 -0
- package/include/opus/opus_defines.h +830 -0
- package/include/opus/opus_multistream.h +660 -0
- package/include/opus/opus_projection.h +568 -0
- package/include/opus/opus_types.h +166 -0
- package/include/svt-av1/EbDebugMacros.h +88 -0
- package/include/svt-av1/EbSvtAv1.h +462 -0
- package/include/svt-av1/EbSvtAv1Enc.h +1112 -0
- package/include/svt-av1/EbSvtAv1ErrorCodes.h +67 -0
- package/include/svt-av1/EbSvtAv1ExtFrameBuf.h +64 -0
- package/include/svt-av1/EbSvtAv1Formats.h +126 -0
- package/include/svt-av1/EbSvtAv1Metadata.h +156 -0
- package/include/vorbis/codec.h +242 -0
- package/include/vorbis/vorbisenc.h +435 -0
- package/include/vorbis/vorbisfile.h +205 -0
- package/include/vpx/vp8.h +136 -0
- package/include/vpx/vp8cx.h +1118 -0
- package/include/vpx/vp8dx.h +228 -0
- package/include/vpx/vpx_codec.h +475 -0
- package/include/vpx/vpx_decoder.h +367 -0
- package/include/vpx/vpx_encoder.h +1150 -0
- package/include/vpx/vpx_ext_ratectrl.h +590 -0
- package/include/vpx/vpx_frame_buffer.h +83 -0
- package/include/vpx/vpx_image.h +221 -0
- package/include/vpx/vpx_integer.h +40 -0
- package/include/vpx/vpx_tpl.h +68 -0
- package/lib/index.js +1 -0
- package/lib/libSvtAv1Enc.a +0 -0
- package/lib/libaom.a +0 -0
- package/lib/libavcodec.a +0 -0
- package/lib/libavdevice.a +0 -0
- package/lib/libavfilter.a +0 -0
- package/lib/libavformat.a +0 -0
- package/lib/libavutil.a +0 -0
- package/lib/libdav1d.a +0 -0
- package/lib/libogg.a +0 -0
- package/lib/libopus.a +0 -0
- package/lib/libswresample.a +0 -0
- package/lib/libswscale.a +0 -0
- package/lib/libvorbis.a +0 -0
- package/lib/libvorbisenc.a +0 -0
- package/lib/libvorbisfile.a +0 -0
- package/lib/libvpx.a +0 -0
- package/package.json +35 -0
- package/versions.json +1 -0
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (C) 2007 Marco Gerards <marco@gnu.org>
|
|
3
|
+
* Copyright (C) 2009 David Conrad
|
|
4
|
+
* Copyright (C) 2011 Jordi Ortiz
|
|
5
|
+
*
|
|
6
|
+
* This file is part of FFmpeg.
|
|
7
|
+
*
|
|
8
|
+
* FFmpeg is free software; you can redistribute it and/or
|
|
9
|
+
* modify it under the terms of the GNU Lesser General Public
|
|
10
|
+
* License as published by the Free Software Foundation; either
|
|
11
|
+
* version 2.1 of the License, or (at your option) any later version.
|
|
12
|
+
*
|
|
13
|
+
* FFmpeg is distributed in the hope that it will be useful,
|
|
14
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
15
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
16
|
+
* Lesser General Public License for more details.
|
|
17
|
+
*
|
|
18
|
+
* You should have received a copy of the GNU Lesser General Public
|
|
19
|
+
* License along with FFmpeg; if not, write to the Free Software
|
|
20
|
+
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
|
21
|
+
*/
|
|
22
|
+
|
|
23
|
+
#ifndef AVCODEC_DIRAC_H
|
|
24
|
+
#define AVCODEC_DIRAC_H
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* @file
|
|
28
|
+
* Interface to Dirac Decoder/Encoder
|
|
29
|
+
* @author Marco Gerards <marco@gnu.org>
|
|
30
|
+
* @author David Conrad
|
|
31
|
+
* @author Jordi Ortiz
|
|
32
|
+
*/
|
|
33
|
+
|
|
34
|
+
#include <stddef.h>
|
|
35
|
+
#include <stdint.h>
|
|
36
|
+
|
|
37
|
+
#include "libavutil/pixfmt.h"
|
|
38
|
+
#include "libavutil/rational.h"
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* The spec limits the number of wavelet decompositions to 4 for both
|
|
42
|
+
* level 1 (VC-2) and 128 (long-gop default).
|
|
43
|
+
* 5 decompositions is the maximum before >16-bit buffers are needed.
|
|
44
|
+
* Schroedinger allows this for DD 9,7 and 13,7 wavelets only, limiting
|
|
45
|
+
* the others to 4 decompositions (or 3 for the fidelity filter).
|
|
46
|
+
*
|
|
47
|
+
* We use this instead of MAX_DECOMPOSITIONS to save some memory.
|
|
48
|
+
*/
|
|
49
|
+
#define MAX_DWT_LEVELS 5
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Parse code values:
|
|
53
|
+
*
|
|
54
|
+
* Dirac Specification ->
|
|
55
|
+
* 9.6.1 Table 9.1
|
|
56
|
+
*
|
|
57
|
+
* VC-2 Specification ->
|
|
58
|
+
* 10.4.1 Table 10.1
|
|
59
|
+
*/
|
|
60
|
+
|
|
61
|
+
enum DiracParseCodes {
|
|
62
|
+
DIRAC_PCODE_SEQ_HEADER = 0x00,
|
|
63
|
+
DIRAC_PCODE_END_SEQ = 0x10,
|
|
64
|
+
DIRAC_PCODE_AUX = 0x20,
|
|
65
|
+
DIRAC_PCODE_PAD = 0x30,
|
|
66
|
+
DIRAC_PCODE_PICTURE_CODED = 0x08,
|
|
67
|
+
DIRAC_PCODE_PICTURE_RAW = 0x48,
|
|
68
|
+
DIRAC_PCODE_PICTURE_LOW_DEL = 0xC8,
|
|
69
|
+
DIRAC_PCODE_PICTURE_HQ = 0xE8,
|
|
70
|
+
DIRAC_PCODE_INTER_NOREF_CO1 = 0x0A,
|
|
71
|
+
DIRAC_PCODE_INTER_NOREF_CO2 = 0x09,
|
|
72
|
+
DIRAC_PCODE_INTER_REF_CO1 = 0x0D,
|
|
73
|
+
DIRAC_PCODE_INTER_REF_CO2 = 0x0E,
|
|
74
|
+
DIRAC_PCODE_INTRA_REF_CO = 0x0C,
|
|
75
|
+
DIRAC_PCODE_INTRA_REF_RAW = 0x4C,
|
|
76
|
+
DIRAC_PCODE_INTRA_REF_PICT = 0xCC,
|
|
77
|
+
DIRAC_PCODE_MAGIC = 0x42424344,
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
typedef struct DiracVersionInfo {
|
|
81
|
+
int major;
|
|
82
|
+
int minor;
|
|
83
|
+
} DiracVersionInfo;
|
|
84
|
+
|
|
85
|
+
typedef struct AVDiracSeqHeader {
|
|
86
|
+
unsigned width;
|
|
87
|
+
unsigned height;
|
|
88
|
+
uint8_t chroma_format; ///< 0: 444 1: 422 2: 420
|
|
89
|
+
|
|
90
|
+
uint8_t interlaced;
|
|
91
|
+
uint8_t top_field_first;
|
|
92
|
+
|
|
93
|
+
uint8_t frame_rate_index; ///< index into dirac_frame_rate[]
|
|
94
|
+
uint8_t aspect_ratio_index; ///< index into dirac_aspect_ratio[]
|
|
95
|
+
|
|
96
|
+
uint16_t clean_width;
|
|
97
|
+
uint16_t clean_height;
|
|
98
|
+
uint16_t clean_left_offset;
|
|
99
|
+
uint16_t clean_right_offset;
|
|
100
|
+
|
|
101
|
+
uint8_t pixel_range_index; ///< index into dirac_pixel_range_presets[]
|
|
102
|
+
uint8_t color_spec_index; ///< index into dirac_color_spec_presets[]
|
|
103
|
+
|
|
104
|
+
int profile;
|
|
105
|
+
int level;
|
|
106
|
+
|
|
107
|
+
AVRational framerate;
|
|
108
|
+
AVRational sample_aspect_ratio;
|
|
109
|
+
|
|
110
|
+
enum AVPixelFormat pix_fmt;
|
|
111
|
+
enum AVColorRange color_range;
|
|
112
|
+
enum AVColorPrimaries color_primaries;
|
|
113
|
+
enum AVColorTransferCharacteristic color_trc;
|
|
114
|
+
enum AVColorSpace colorspace;
|
|
115
|
+
|
|
116
|
+
DiracVersionInfo version;
|
|
117
|
+
int bit_depth;
|
|
118
|
+
} AVDiracSeqHeader;
|
|
119
|
+
|
|
120
|
+
/**
|
|
121
|
+
* Parse a Dirac sequence header.
|
|
122
|
+
*
|
|
123
|
+
* @param dsh this function will allocate and fill an AVDiracSeqHeader struct
|
|
124
|
+
* and write it into this pointer. The caller must free it with
|
|
125
|
+
* av_free().
|
|
126
|
+
* @param buf the data buffer
|
|
127
|
+
* @param buf_size the size of the data buffer in bytes
|
|
128
|
+
* @param log_ctx if non-NULL, this function will log errors here
|
|
129
|
+
* @return 0 on success, a negative AVERROR code on failure
|
|
130
|
+
*/
|
|
131
|
+
int av_dirac_parse_sequence_header(AVDiracSeqHeader **dsh,
|
|
132
|
+
const uint8_t *buf, size_t buf_size,
|
|
133
|
+
void *log_ctx);
|
|
134
|
+
|
|
135
|
+
#endif /* AVCODEC_DIRAC_H */
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* This file is part of FFmpeg.
|
|
3
|
+
*
|
|
4
|
+
* FFmpeg is free software; you can redistribute it and/or
|
|
5
|
+
* modify it under the terms of the GNU Lesser General Public
|
|
6
|
+
* License as published by the Free Software Foundation; either
|
|
7
|
+
* version 2.1 of the License, or (at your option) any later version.
|
|
8
|
+
*
|
|
9
|
+
* FFmpeg is distributed in the hope that it will be useful,
|
|
10
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
11
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
12
|
+
* Lesser General Public License for more details.
|
|
13
|
+
*
|
|
14
|
+
* You should have received a copy of the GNU Lesser General Public
|
|
15
|
+
* License along with FFmpeg; if not, write to the Free Software
|
|
16
|
+
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
#ifndef AVCODEC_DV_PROFILE_H
|
|
20
|
+
#define AVCODEC_DV_PROFILE_H
|
|
21
|
+
|
|
22
|
+
#include <stdint.h>
|
|
23
|
+
|
|
24
|
+
#include "libavutil/pixfmt.h"
|
|
25
|
+
#include "libavutil/rational.h"
|
|
26
|
+
|
|
27
|
+
/* minimum number of bytes to read from a DV stream in order to
|
|
28
|
+
* determine the profile */
|
|
29
|
+
#define DV_PROFILE_BYTES (6 * 80) /* 6 DIF blocks */
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
/*
|
|
33
|
+
* AVDVProfile is used to express the differences between various
|
|
34
|
+
* DV flavors. For now it's primarily used for differentiating
|
|
35
|
+
* 525/60 and 625/50, but the plans are to use it for various
|
|
36
|
+
* DV specs as well (e.g. SMPTE314M vs. IEC 61834).
|
|
37
|
+
*/
|
|
38
|
+
typedef struct AVDVProfile {
|
|
39
|
+
int dsf; /* value of the dsf in the DV header */
|
|
40
|
+
int video_stype; /* stype for VAUX source pack */
|
|
41
|
+
int frame_size; /* total size of one frame in bytes */
|
|
42
|
+
int difseg_size; /* number of DIF segments per DIF channel */
|
|
43
|
+
int n_difchan; /* number of DIF channels per frame */
|
|
44
|
+
AVRational time_base; /* 1/framerate */
|
|
45
|
+
int ltc_divisor; /* FPS from the LTS standpoint */
|
|
46
|
+
int height; /* picture height in pixels */
|
|
47
|
+
int width; /* picture width in pixels */
|
|
48
|
+
AVRational sar[2]; /* sample aspect ratios for 4:3 and 16:9 */
|
|
49
|
+
enum AVPixelFormat pix_fmt; /* picture pixel format */
|
|
50
|
+
int bpm; /* blocks per macroblock */
|
|
51
|
+
const uint8_t *block_sizes; /* AC block sizes, in bits */
|
|
52
|
+
int audio_stride; /* size of audio_shuffle table */
|
|
53
|
+
int audio_min_samples[3]; /* min amount of audio samples */
|
|
54
|
+
/* for 48kHz, 44.1kHz and 32kHz */
|
|
55
|
+
int audio_samples_dist[5]; /* how many samples are supposed to be */
|
|
56
|
+
/* in each frame in a 5 frames window */
|
|
57
|
+
const uint8_t (*audio_shuffle)[9]; /* PCM shuffling table */
|
|
58
|
+
} AVDVProfile;
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Get a DV profile for the provided compressed frame.
|
|
62
|
+
*
|
|
63
|
+
* @param sys the profile used for the previous frame, may be NULL
|
|
64
|
+
* @param frame the compressed data buffer
|
|
65
|
+
* @param buf_size size of the buffer in bytes
|
|
66
|
+
* @return the DV profile for the supplied data or NULL on failure
|
|
67
|
+
*/
|
|
68
|
+
const AVDVProfile *av_dv_frame_profile(const AVDVProfile *sys,
|
|
69
|
+
const uint8_t *frame, unsigned buf_size);
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* Get a DV profile for the provided stream parameters.
|
|
73
|
+
*/
|
|
74
|
+
const AVDVProfile *av_dv_codec_profile(int width, int height, enum AVPixelFormat pix_fmt);
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* Get a DV profile for the provided stream parameters.
|
|
78
|
+
* The frame rate is used as a best-effort parameter.
|
|
79
|
+
*/
|
|
80
|
+
const AVDVProfile *av_dv_codec_profile2(int width, int height, enum AVPixelFormat pix_fmt, AVRational frame_rate);
|
|
81
|
+
|
|
82
|
+
#endif /* AVCODEC_DV_PROFILE_H */
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* DXVA2 HW acceleration
|
|
3
|
+
*
|
|
4
|
+
* copyright (c) 2009 Laurent Aimar
|
|
5
|
+
*
|
|
6
|
+
* This file is part of FFmpeg.
|
|
7
|
+
*
|
|
8
|
+
* FFmpeg is free software; you can redistribute it and/or
|
|
9
|
+
* modify it under the terms of the GNU Lesser General Public
|
|
10
|
+
* License as published by the Free Software Foundation; either
|
|
11
|
+
* version 2.1 of the License, or (at your option) any later version.
|
|
12
|
+
*
|
|
13
|
+
* FFmpeg is distributed in the hope that it will be useful,
|
|
14
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
15
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
16
|
+
* Lesser General Public License for more details.
|
|
17
|
+
*
|
|
18
|
+
* You should have received a copy of the GNU Lesser General Public
|
|
19
|
+
* License along with FFmpeg; if not, write to the Free Software
|
|
20
|
+
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
|
21
|
+
*/
|
|
22
|
+
|
|
23
|
+
#ifndef AVCODEC_DXVA2_H
|
|
24
|
+
#define AVCODEC_DXVA2_H
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* @file
|
|
28
|
+
* @ingroup lavc_codec_hwaccel_dxva2
|
|
29
|
+
* Public libavcodec DXVA2 header.
|
|
30
|
+
*/
|
|
31
|
+
|
|
32
|
+
#if !defined(_WIN32_WINNT) || _WIN32_WINNT < 0x0602
|
|
33
|
+
#undef _WIN32_WINNT
|
|
34
|
+
#define _WIN32_WINNT 0x0602
|
|
35
|
+
#endif
|
|
36
|
+
|
|
37
|
+
#include <stdint.h>
|
|
38
|
+
#include <d3d9.h>
|
|
39
|
+
#include <dxva2api.h>
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* @defgroup lavc_codec_hwaccel_dxva2 DXVA2
|
|
43
|
+
* @ingroup lavc_codec_hwaccel
|
|
44
|
+
*
|
|
45
|
+
* @{
|
|
46
|
+
*/
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* This structure is used to provides the necessary configurations and data
|
|
50
|
+
* to the DXVA2 FFmpeg HWAccel implementation.
|
|
51
|
+
*
|
|
52
|
+
* The application must make it available as AVCodecContext.hwaccel_context.
|
|
53
|
+
*/
|
|
54
|
+
struct dxva_context {
|
|
55
|
+
/**
|
|
56
|
+
* DXVA2 decoder object
|
|
57
|
+
*/
|
|
58
|
+
IDirectXVideoDecoder *decoder;
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* DXVA2 configuration used to create the decoder
|
|
62
|
+
*/
|
|
63
|
+
const DXVA2_ConfigPictureDecode *cfg;
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* The number of surface in the surface array
|
|
67
|
+
*/
|
|
68
|
+
unsigned surface_count;
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* The array of Direct3D surfaces used to create the decoder
|
|
72
|
+
*/
|
|
73
|
+
LPDIRECT3DSURFACE9 *surface;
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* A bit field configuring the workarounds needed for using the decoder
|
|
77
|
+
*/
|
|
78
|
+
uint64_t workaround;
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* Private to the FFmpeg AVHWAccel implementation
|
|
82
|
+
*/
|
|
83
|
+
unsigned report_id;
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* @}
|
|
88
|
+
*/
|
|
89
|
+
|
|
90
|
+
#endif /* AVCODEC_DXVA2_H */
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* JNI public API functions
|
|
3
|
+
*
|
|
4
|
+
* Copyright (c) 2015-2016 Matthieu Bouron <matthieu.bouron stupeflix.com>
|
|
5
|
+
*
|
|
6
|
+
* This file is part of FFmpeg.
|
|
7
|
+
*
|
|
8
|
+
* FFmpeg is free software; you can redistribute it and/or
|
|
9
|
+
* modify it under the terms of the GNU Lesser General Public
|
|
10
|
+
* License as published by the Free Software Foundation; either
|
|
11
|
+
* version 2.1 of the License, or (at your option) any later version.
|
|
12
|
+
*
|
|
13
|
+
* FFmpeg is distributed in the hope that it will be useful,
|
|
14
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
15
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
16
|
+
* Lesser General Public License for more details.
|
|
17
|
+
*
|
|
18
|
+
* You should have received a copy of the GNU Lesser General Public
|
|
19
|
+
* License along with FFmpeg; if not, write to the Free Software
|
|
20
|
+
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
|
21
|
+
*/
|
|
22
|
+
|
|
23
|
+
#ifndef AVCODEC_JNI_H
|
|
24
|
+
#define AVCODEC_JNI_H
|
|
25
|
+
|
|
26
|
+
/*
|
|
27
|
+
* Manually set a Java virtual machine which will be used to retrieve the JNI
|
|
28
|
+
* environment. Once a Java VM is set it cannot be changed afterwards, meaning
|
|
29
|
+
* you can call multiple times av_jni_set_java_vm with the same Java VM pointer
|
|
30
|
+
* however it will error out if you try to set a different Java VM.
|
|
31
|
+
*
|
|
32
|
+
* @param vm Java virtual machine
|
|
33
|
+
* @param log_ctx context used for logging, can be NULL
|
|
34
|
+
* @return 0 on success, < 0 otherwise
|
|
35
|
+
*/
|
|
36
|
+
int av_jni_set_java_vm(void *vm, void *log_ctx);
|
|
37
|
+
|
|
38
|
+
/*
|
|
39
|
+
* Get the Java virtual machine which has been set with av_jni_set_java_vm.
|
|
40
|
+
*
|
|
41
|
+
* @param vm Java virtual machine
|
|
42
|
+
* @return a pointer to the Java virtual machine
|
|
43
|
+
*/
|
|
44
|
+
void *av_jni_get_java_vm(void *log_ctx);
|
|
45
|
+
|
|
46
|
+
/*
|
|
47
|
+
* Set the Android application context which will be used to retrieve the Android
|
|
48
|
+
* content resolver to handle content uris.
|
|
49
|
+
*
|
|
50
|
+
* This function is only available on Android.
|
|
51
|
+
*
|
|
52
|
+
* @param app_ctx global JNI reference to the Android application context
|
|
53
|
+
* @return 0 on success, < 0 otherwise
|
|
54
|
+
*/
|
|
55
|
+
int av_jni_set_android_app_ctx(void *app_ctx, void *log_ctx);
|
|
56
|
+
|
|
57
|
+
/*
|
|
58
|
+
* Get the Android application context that has been set with
|
|
59
|
+
* av_jni_set_android_app_ctx.
|
|
60
|
+
*
|
|
61
|
+
* This function is only available on Android.
|
|
62
|
+
*
|
|
63
|
+
* @return a pointer the the Android application context
|
|
64
|
+
*/
|
|
65
|
+
void *av_jni_get_android_app_ctx(void);
|
|
66
|
+
|
|
67
|
+
#endif /* AVCODEC_JNI_H */
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Android MediaCodec public API
|
|
3
|
+
*
|
|
4
|
+
* Copyright (c) 2016 Matthieu Bouron <matthieu.bouron stupeflix.com>
|
|
5
|
+
*
|
|
6
|
+
* This file is part of FFmpeg.
|
|
7
|
+
*
|
|
8
|
+
* FFmpeg is free software; you can redistribute it and/or
|
|
9
|
+
* modify it under the terms of the GNU Lesser General Public
|
|
10
|
+
* License as published by the Free Software Foundation; either
|
|
11
|
+
* version 2.1 of the License, or (at your option) any later version.
|
|
12
|
+
*
|
|
13
|
+
* FFmpeg is distributed in the hope that it will be useful,
|
|
14
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
15
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
16
|
+
* Lesser General Public License for more details.
|
|
17
|
+
*
|
|
18
|
+
* You should have received a copy of the GNU Lesser General Public
|
|
19
|
+
* License along with FFmpeg; if not, write to the Free Software
|
|
20
|
+
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
|
21
|
+
*/
|
|
22
|
+
|
|
23
|
+
#ifndef AVCODEC_MEDIACODEC_H
|
|
24
|
+
#define AVCODEC_MEDIACODEC_H
|
|
25
|
+
|
|
26
|
+
#include "libavcodec/avcodec.h"
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* This structure holds a reference to a android/view/Surface object that will
|
|
30
|
+
* be used as output by the decoder.
|
|
31
|
+
*
|
|
32
|
+
*/
|
|
33
|
+
typedef struct AVMediaCodecContext {
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* android/view/Surface object reference.
|
|
37
|
+
*/
|
|
38
|
+
void *surface;
|
|
39
|
+
|
|
40
|
+
} AVMediaCodecContext;
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Allocate and initialize a MediaCodec context.
|
|
44
|
+
*
|
|
45
|
+
* When decoding with MediaCodec is finished, the caller must free the
|
|
46
|
+
* MediaCodec context with av_mediacodec_default_free.
|
|
47
|
+
*
|
|
48
|
+
* @return a pointer to a newly allocated AVMediaCodecContext on success, NULL otherwise
|
|
49
|
+
*/
|
|
50
|
+
AVMediaCodecContext *av_mediacodec_alloc_context(void);
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Convenience function that sets up the MediaCodec context.
|
|
54
|
+
*
|
|
55
|
+
* @param avctx codec context
|
|
56
|
+
* @param ctx MediaCodec context to initialize
|
|
57
|
+
* @param surface reference to an android/view/Surface
|
|
58
|
+
* @return 0 on success, < 0 otherwise
|
|
59
|
+
*/
|
|
60
|
+
int av_mediacodec_default_init(AVCodecContext *avctx, AVMediaCodecContext *ctx, void *surface);
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* This function must be called to free the MediaCodec context initialized with
|
|
64
|
+
* av_mediacodec_default_init().
|
|
65
|
+
*
|
|
66
|
+
* @param avctx codec context
|
|
67
|
+
*/
|
|
68
|
+
void av_mediacodec_default_free(AVCodecContext *avctx);
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* Opaque structure representing a MediaCodec buffer to render.
|
|
72
|
+
*/
|
|
73
|
+
typedef struct MediaCodecBuffer AVMediaCodecBuffer;
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* Release a MediaCodec buffer and render it to the surface that is associated
|
|
77
|
+
* with the decoder. This function should only be called once on a given
|
|
78
|
+
* buffer, once released the underlying buffer returns to the codec, thus
|
|
79
|
+
* subsequent calls to this function will have no effect.
|
|
80
|
+
*
|
|
81
|
+
* @param buffer the buffer to render
|
|
82
|
+
* @param render 1 to release and render the buffer to the surface or 0 to
|
|
83
|
+
* discard the buffer
|
|
84
|
+
* @return 0 on success, < 0 otherwise
|
|
85
|
+
*/
|
|
86
|
+
int av_mediacodec_release_buffer(AVMediaCodecBuffer *buffer, int render);
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* Release a MediaCodec buffer and render it at the given time to the surface
|
|
90
|
+
* that is associated with the decoder. The timestamp must be within one second
|
|
91
|
+
* of the current `java/lang/System#nanoTime()` (which is implemented using
|
|
92
|
+
* `CLOCK_MONOTONIC` on Android). See the Android MediaCodec documentation
|
|
93
|
+
* of [`android/media/MediaCodec#releaseOutputBuffer(int,long)`][0] for more details.
|
|
94
|
+
*
|
|
95
|
+
* @param buffer the buffer to render
|
|
96
|
+
* @param time timestamp in nanoseconds of when to render the buffer
|
|
97
|
+
* @return 0 on success, < 0 otherwise
|
|
98
|
+
*
|
|
99
|
+
* [0]: https://developer.android.com/reference/android/media/MediaCodec#releaseOutputBuffer(int,%20long)
|
|
100
|
+
*/
|
|
101
|
+
int av_mediacodec_render_buffer_at_time(AVMediaCodecBuffer *buffer, int64_t time);
|
|
102
|
+
|
|
103
|
+
#endif /* AVCODEC_MEDIACODEC_H */
|