MythTV
master
|
These functions are rewritten copies from FFmpeg's libavcodec, where find_start_code() is prefixed with avpriv_
.
More...
Functions | |
bool | start_code_is_valid (uint32_t start_code) |
Test whether a start code found by find_start_code() is valid. More... | |
const MTV_PUBLIC uint8_t * | find_start_code (const uint8_t *p, const uint8_t *end, uint32_t *start_code) |
Find the first start code in the buffer p . More... | |
const MTV_PUBLIC uint8_t * | find_start_code_truncated (const uint8_t *p, const uint8_t *end, uint32_t *start_code) |
By preserving the start_code value between subsequent calls, the caller can detect start codes across buffer boundaries. More... | |
These functions are rewritten copies from FFmpeg's libavcodec, where find_start_code() is prefixed with avpriv_
.
|
inline |
Test whether a start code found by find_start_code() is valid.
Use this to test the validity of a start code especially if a start code can be at the end of the buffer, where testing the return value of find_start_code() would incorrectly imply that the start code is invalid (since the returned value equals end
).
[in] | start_code | The start code to test. |
start_code
is valid Definition at line 54 of file bytereader.h.
Referenced by AVCParser::addBytes(), HEVCParser::addBytes(), find_start_code_truncated(), DTVRecorder::FindMPEG2Keyframes(), DTVRecorder::FindPSKeyFrames(), and PTSListener::ProcessTSPacket().
const uint8_t * ByteReader::find_start_code | ( | const uint8_t * | p, |
const uint8_t * | end, | ||
uint32_t * | start_code | ||
) |
Find the first start code in the buffer p
.
A start code is a sequence of 4 bytes with the hexadecimal value 00 00 01 XX
, where XX
represents any value and memory address increases left to right.
[in] | p | A pointer to the start of the memory buffer to scan. |
[in] | end | A pointer to the past-the-end memory address for the buffer given by p . p must be ≤ end . |
[out] | start_code | A pointer to a mutable uint32_t .Set to the found start code if it exists or an invalid start code (the 4 bytes prior to the returned value or ~0 if ). |
end
if no start code was found. Definition at line 26 of file bytereader.cpp.
Referenced by find_start_code_truncated().
const uint8_t * ByteReader::find_start_code_truncated | ( | const uint8_t * | p, |
const uint8_t * | end, | ||
uint32_t * | start_code | ||
) |
By preserving the start_code
value between subsequent calls, the caller can detect start codes across buffer boundaries.
[in,out] | start_code | A pointer to a mutable uint32_t .As input: For no history preset to ~0 , otherwise preset to the last returned start code to enable detecting start codes across buffer boundaries.On output: Set to the found start code if it exists or an invalid start code (the 4 bytes prior to the returned value, using the input history if ). |
Definition at line 74 of file bytereader.cpp.
Referenced by AVCParser::addBytes(), HEVCParser::addBytes(), DTVRecorder::FindMPEG2Keyframes(), DTVRecorder::FindPSKeyFrames(), AvFormatDecoder::MpegPreProcessPkt(), and PTSListener::ProcessTSPacket().