Code
·
29 lines
·
786 bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29using System;
namespace Matroska.Models;
/// <summary>
/// http://matroska.sourceforge.net/technical/specs/index.html#simpleblock_structure
/// </summary>
public sealed class SimpleBlock : Block
{
private const byte KeyFrameBit = 0b10000000;
private const byte DiscardableBit = 0b00000001;
/// <summary>
/// Keyframe, set when the Block contains only keyframes
/// </summary>
public bool IsKeyFrame { get; private set; }
/// <summary>
/// Discardable, the frames of the Block can be discarded during playing if needed
/// </summary>
public bool IsDiscardable { get; private set; }
public override void Parse(Span<byte> span)
{
base.Parse(span);
IsKeyFrame = (Flags & KeyFrameBit) == KeyFrameBit;
IsDiscardable = (Flags & DiscardableBit) == DiscardableBit;
}
}