bare-ffmpeg 1.0.0-10 → 1.0.0-11

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.
@@ -1,5 +1,6 @@
1
1
  const binding = require('../binding')
2
2
  const Rational = require('./rational')
3
+ const ChannelLayout = require('./channel-layout')
3
4
 
4
5
  module.exports = class FFmpegCodecContext {
5
6
  constructor(codec) {
@@ -45,6 +46,14 @@ module.exports = class FFmpegCodecContext {
45
46
  return binding.setCodecContextSampleFormat(this._handle, value)
46
47
  }
47
48
 
49
+ get sampleRate() {
50
+ return binding.getCodecContextSampleRate(this._handle)
51
+ }
52
+
53
+ set sampleRate(value) {
54
+ binding.setCodecContextSampleRate(this._handle, value)
55
+ }
56
+
48
57
  get timeBase() {
49
58
  const view = new Int32Array(binding.getCodecContextTimeBase(this._handle))
50
59
  return new Rational(view[0], view[1])
@@ -58,6 +67,16 @@ module.exports = class FFmpegCodecContext {
58
67
  )
59
68
  }
60
69
 
70
+ get channelLayout() {
71
+ return new ChannelLayout(binding.getCodecContextChannelLayout(this._handle))
72
+ }
73
+
74
+ set channelLayout(value) {
75
+ using copy = ChannelLayout.from(value)
76
+
77
+ binding.setCodecContextChannelLayout(this._handle, copy._handle)
78
+ }
79
+
61
80
  open(options) {
62
81
  if (this._opened) return
63
82
  this._opened = true
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bare-ffmpeg",
3
- "version": "1.0.0-10",
3
+ "version": "1.0.0-11",
4
4
  "description": "Low-level FFmpeg bindings for Bare",
5
5
  "exports": {
6
6
  ".": "./index.js",