Class: WebRTC::I420Buffer
- Inherits:
-
Object
- Object
- WebRTC::I420Buffer
- Defined in:
- lib/webrtc/video_frame.rb
Instance Attribute Summary collapse
-
#data_u ⇒ Object
Returns the value of attribute data_u.
-
#data_v ⇒ Object
Returns the value of attribute data_v.
-
#data_y ⇒ Object
Returns the value of attribute data_y.
-
#height ⇒ Object
readonly
Returns the value of attribute height.
-
#stride_u ⇒ Object
readonly
Returns the value of attribute stride_u.
-
#stride_v ⇒ Object
readonly
Returns the value of attribute stride_v.
-
#stride_y ⇒ Object
readonly
Returns the value of attribute stride_y.
-
#width ⇒ Object
readonly
Returns the value of attribute width.
Instance Method Summary collapse
-
#initialize(width:, height:, data_y: nil, data_u: nil, data_v: nil, stride_y: nil, stride_u: nil, stride_v: nil) ⇒ I420Buffer
constructor
A new instance of I420Buffer.
Constructor Details
#initialize(width:, height:, data_y: nil, data_u: nil, data_v: nil, stride_y: nil, stride_u: nil, stride_v: nil) ⇒ I420Buffer
Returns a new instance of I420Buffer.
8 9 10 11 12 13 14 15 16 17 |
# File 'lib/webrtc/video_frame.rb', line 8 def initialize(width:, height:, data_y: nil, data_u: nil, data_v: nil, stride_y: nil, stride_u: nil, stride_v: nil) @width = width @height = height @stride_y = stride_y || width @stride_u = stride_u || (width / 2) @stride_v = stride_v || (width / 2) @data_y = data_y || "\x00".b * (@stride_y * @height) @data_u = data_u || "\x80".b * (@stride_u * (@height / 2)) @data_v = data_v || "\x80".b * (@stride_v * (@height / 2)) end |
Instance Attribute Details
#data_u ⇒ Object
Returns the value of attribute data_u.
6 7 8 |
# File 'lib/webrtc/video_frame.rb', line 6 def data_u @data_u end |
#data_v ⇒ Object
Returns the value of attribute data_v.
6 7 8 |
# File 'lib/webrtc/video_frame.rb', line 6 def data_v @data_v end |
#data_y ⇒ Object
Returns the value of attribute data_y.
6 7 8 |
# File 'lib/webrtc/video_frame.rb', line 6 def data_y @data_y end |
#height ⇒ Object (readonly)
Returns the value of attribute height.
5 6 7 |
# File 'lib/webrtc/video_frame.rb', line 5 def height @height end |
#stride_u ⇒ Object (readonly)
Returns the value of attribute stride_u.
5 6 7 |
# File 'lib/webrtc/video_frame.rb', line 5 def stride_u @stride_u end |
#stride_v ⇒ Object (readonly)
Returns the value of attribute stride_v.
5 6 7 |
# File 'lib/webrtc/video_frame.rb', line 5 def stride_v @stride_v end |
#stride_y ⇒ Object (readonly)
Returns the value of attribute stride_y.
5 6 7 |
# File 'lib/webrtc/video_frame.rb', line 5 def stride_y @stride_y end |
#width ⇒ Object (readonly)
Returns the value of attribute width.
5 6 7 |
# File 'lib/webrtc/video_frame.rb', line 5 def width @width end |