The declarations of functions creating payloads from RIFF files.
More...
#include <stdint.h>
#include "cdi_os_api.h"
#include "test_control.h"
Go to the source code of this file.
|
bool | GetNextRiffChunkSize (const StreamSettings *stream_settings_ptr, CdiFileID read_file_handle, int *ret_chunk_size_ptr) |
| Get the size of the next chunk from a RIFF file. The RIFF file specifies chunk size in the file. Once the chunk size has been read the size can be used in GetNextPayload() to read the next chunk.
|
|
bool | StartRiffPayloadFile (const StreamSettings *stream_settings_ptr, CdiFileID read_file_handle) |
| Reads the initial header information from the RIFF file and verifies that the file header indicates a valid file. After this is performed the file is ready to read the next payload size using GetNextRiffPayloadSize().
|
|
bool | ReportRiffFileContents (const char *file_path_str, int max_line_length, int mode) |
| Prints information about the contents of a RIFF file.
|
|
bool | RiffFileContainsAncillaryData (const char *file_path_str) |
|
The declarations of functions creating payloads from RIFF files.
◆ RiffDumpMode
Symbols referring two different kinds of RIFF data to show.
Enumerator |
---|
kRiffDumpNone | Don't dump anything.
|
kRiffDumpRaw | Dump RIFF chunks.
|
kRiffDumpDid | When a CID file, show DID and SDID of ancillary payloads.
|
kRiffDumpClosedCaptions | When a CID file, show closed caption data, if any.
|
◆ GetNextRiffChunkSize()
bool GetNextRiffChunkSize |
( |
const StreamSettings * | stream_settings_ptr, |
|
|
CdiFileID | read_file_handle, |
|
|
int * | ret_chunk_size_ptr ) |
Get the size of the next chunk from a RIFF file. The RIFF file specifies chunk size in the file. Once the chunk size has been read the size can be used in GetNextPayload() to read the next chunk.
- Parameters
-
stream_settings_ptr | Pointer to stream settings. |
read_file_handle | The file handle to read RIFF chunk header from. |
ret_chunk_size_ptr | Returns the size of the next chunk to be read from the RIFF file. |
- Returns
- If successful return true, otherwise returns false.
- See also
- StartRiffPayloadFile()
◆ ReportRiffFileContents()
bool ReportRiffFileContents |
( |
const char * | file_path_str, |
|
|
int | max_line_length, |
|
|
int | mode ) |
Prints information about the contents of a RIFF file.
- Parameters
-
file_path_str | Pointer to the file path string. |
max_line_length | Maximum number of characters of description to print per chunk. |
mode | Dump mode selecting the kind of data to show. |
- Returns
- True when file was processed successfully, false when an error occurred.
◆ RiffFileContainsAncillaryData()
bool RiffFileContainsAncillaryData |
( |
const char * | file_path_str | ) |
|
Check if RIFF file data is decodable ancillary data. A run of cdi_test with –riff includes payload decoding as one of the checks. A RIFF file that does contain actual ancillary data is therefore unsuitable as test input, as it will cause payload errors by failing the decoding check. This function tells whether a RIFF file is suitable for testing.
- Parameters
-
file_path_str | Pointer to the file path string. |
- Returns
- True if and only if the file contains decodable ancillary data.
◆ StartRiffPayloadFile()
Reads the initial header information from the RIFF file and verifies that the file header indicates a valid file. After this is performed the file is ready to read the next payload size using GetNextRiffPayloadSize().
RIFF format
bytes
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
'R' 'I' 'F' 'F' / size 4 Bytes \/form = 'CDI '\/Chunk = 'ANC '\
/ chunk size 4B\/payload data is chunk_size in bytes in size...
...............................................................
...............................\/Chunk2='ANC '\/chunk2 size 4B\
/payload number 2 is chunk2 size in bytes .....................
***************************************************************
/Chunk-n='ANC '\/Chunk-n size \/Chunk N data of chunk-n size \
...............................................................
For additional RIFF file information please see https://johnloomis.org/cpe102/asgn/asgn1/riff.html.
- Parameters
-
stream_settings_ptr | Pointer to stream settings. |
read_file_handle | The file handle to read RIFF file header from. |
- Returns
- If successful return true, otherwise returns false.