/* {"description" : "This data type describes a NAL frame of a H.264 video file. H.264 files are composed of a sequence of NAL frames."} */
data NALFrame {
/* {"@description" : "A possible value for 'type', meaning that this frame type is not known to this parser."} */
const byte T_UNKNOWN = 0
/* {"@description" : "A possible value for 'type', meaning that this frame is an SPS header."} */
const byte T_HEADER_SPS = 1
/* {"@description" : "A possible value for 'type', meaning that this frame is a PPS header."} */
const byte T_HEADER_PPS = 2
/* {"@description" : "A possible value for 'type', meaning that this frame is an SEI header."} */
const byte T_HEADER_SEI = 3
/* {"@description" : "A possible value for 'type', meaning that this frame is an I-frame."} */
const byte T_FRAME_I = 4
/* {"@description" : "A possible value for 'type', meaning that this frame is a P-frame."} */
const byte T_FRAME_P = 5
/* {"@description" : "A possible value for 'type', meaning that this frame is a B-frame."} */
const byte T_FRAME_B = 6
/* {"@description" : "The type of this NAL from, from one of the T_ constants."} */
byte type
/* {"@description" : "The number of bytes into the data content that this frame starts at."} */
int startOffset
/* {"@description" : "The number of bytes into the data content that this frame ends at."} */
int endOffset
}
/* {"description" : "This data type describes an SPS header of a H.264 video file, in cases where a NAL frame is of type SPS."} */
data SPSHeader {
/* {"@description" : "The width of video frames."} */
int width
/* {"@description" : "The height of video frames."} */
int height
/* {"@description" : "The H.264 profile that was used to create encoded video frames."} */
int profile
/* {"@description" : "The H.264 profile level that was used to create encoded video frames."} */
int level
/* {"@description" : "This value determines whether the decoded video frames should be cropped (if the video size is not representable as an exact pixel value in H.264)."} */
bool crop
/* {"@description" : "This number of pixels to crop from the left of a decoded frame."} */
int cropL
/* {"@description" : "This number of pixels to crop from the right of a decoded frame."} */
int cropR
/* {"@description" : "This number of pixels to crop from the top of a decoded frame."} */
int cropT
/* {"@description" : "This number of pixels to crop from the buttom of a decoded frame."} */
int cropB
}
/* {"description" : "This is an API to parse a H.264 video file as a stream of frames. This API assumes that your entire H.264 file (or self-contained segment) is in a byte array in memory."} */
interface H264Parser {
/* {"@description" : "This function gets the next frame from the input 'content' array, starting at the index denoted by 'offset'. It returns the type of frame this this is, with the start and end offset of its content."} */
NALFrame getNextFrame(byte content[], int offset)
/* {"@description" : "This function parses an SPS header from the input 'content' array, starting at the index denoted by 'offset'. SPS frames are generally at the start of a H.264 file / segment."} */
SPSHeader parseSPS(byte content[], int offset)
}To propose a new revision to this entity, use dana source put -ut your/new/version.dn -n media.video.H264Parser -m "reason for update" -u yourUsername
Version 2 (this version) by barry
Notes for this version: Updates to documentation strings.